QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#567296#7723. Hash ServerCrysflyAC ✓422ms4224kbC++146.9kb2024-09-16 10:56:212024-09-16 10:56:21

Judging History

你现在查看的是最新测评结果

  • [2024-09-16 10:56:21]
  • 评测
  • 测评结果:AC
  • 用时:422ms
  • 内存:4224kb
  • [2024-09-16 10:56:21]
  • 提交

answer

/*
first run:能用若干次询问确定 ai,ki
second run 会得到 这些询问排序后的结果,只需要把这些询问的结果是怎样的排列传给 second run 即可
选一个 hash%mod=sum 使得之前那些有效询问都 !=sum
随机若干个串的 hash 结果,使得 hash%mod=sum,second run 就可以区分两种信息
从这些串的 hash 结果串中选出一个上升序列,来传输这个排列 p. 
每次找下一个 hash2(s)=i 的串传输即可。
no time to write code TAT
*/
#include <stdio.h>
#include <functional>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <map>

using namespace std;

const int PART1_QUERIES = 41;

long long mod = 141167095653376LL;
long long X;
int P[10];

long long hash0[11];
long long a[11];
long long b[11];
long long b2[11];

long long add(long long a, long long b) {
	return (a + b) % mod;
}

long long sub(long long a, long long b) {
	return ((a - b) % mod + mod) % mod;
}

long long add(long long a, long long b, long long c) {
	return add(add(a, b), c);
}

long long mult(long long a, long long b) {
	if (a < 0) a += mod;
	if (b < 10) {
		return (a * b) % mod;
	}
	if (b % 2 == 0) {
		return (mult(a, b / 2) * 2) % mod;
	} else {
		return (mult(a, b - 1) + a) % mod;
	}
}

long long power(long long a, long long b) {
	long long res = 1;
	while (b) {
		if (b & 1) res = mult(res, a);
		a = mult(a, a);
		b >>= 1;
	}
	return res;
}

long long diff[10];

string print_hash(long long value) {
	string res;
	for (int i = 0; i < 10; i++) {
		res = ((char)(value % 26 + 'a')) + res;
		value /= 26;
	}
	return res;
}

map<string, long long> cache;

vector<pair<string, int>> queries;

long long query(string s, bool rec = true) {
	if (cache.find(s) != cache.end()) return cache[s];
	printf("%s\n", s.c_str());
	fflush(stdout);
	char res[11];
	scanf("%s", res);

	long long value = 0;
	for (int i = 0; i < 10; i++) {
		value = value * 26 + (res[i] - 'a');
	}

	if (rec) queries.push_back({res, (int) queries.size()});
	return cache[s] = value;
}

string get_hash(const string s) {
	int first = 0;
	for (int k = 0; k < 10; k++) {
		for (int j = 0; j < 10; j++) {
			if (s[j] == first + 'a') {
				first++;
			}
		}
	}

	long long cur = hash0[first];

	for (int j = 0; j < 10; j++) {
		for (int k = first; k < s[j] - 'a'; k++) {
			cur = add(cur, diff[j]);
			cur = add(cur, mult(b2[j], k + 1));
		}
		for (int k = first; k > s[j] - 'a'; k--) {
			cur = sub(cur, diff[j]);
			cur = sub(cur, mult(b2[j], k));
		}
	}

	cur = 0;

	for (int j = 0; j < 10; j++) {
		cur = add(cur, add(mult(a[j], s[j] - 'a' + 1), mult(b[j], power(s[j] - 'a' + 1, 2))));
	}

	return print_hash(cur);
}

long long get_info(string s, int sum, int mod) {
	int val = 0;
	for (size_t i = 0; i < s.size(); i++) {
		val = (val + s[i]) % (PART1_QUERIES + 1);
	}
	if (val != sum) return -1;

	int res = 0;
	for (size_t i = 0; i < s.size(); i += 2) {
		res = (res + s[i]) % mod;
	}
	return res;
}

string generate_random_string() {
	string res;
	for (int i = 0; i < 10; i++) {
		res += 'a' + rand() % 26;
	}
	return res;
}

void determine_hash_calc(function<long long (string)> query) {
	string s0 = "aaaaaaaaaa";
	hash0[0] = query(s0);
	for (int i = 0; i < 10; i++) {
		string s = s0;
		s[i] = 'b';
		long long res = query(s);
		long long hash = sub(res, hash0[0]);

		diff[i] = hash;

	}

	for (int i = 0; i < 10; i++) {
		string s;
		s = "bbbbbbbbbb";
		long long hash0 = query(s);
		s[i] = 'a';
		long long hash1 = sub(hash0, query(s));
		s = "cccccccccc";
		hash0 = query(s);
		s[i] = 'b';
		long long hash2 = sub(hash0, query(s));
		b2[i] = sub(hash2, hash1);
		b[i] = b2[i] / 2;
		a[i] = sub(hash1, mult(3, b[i]));
		diff[i] = sub(diff[i], b2[i]);
	}

	for (int i = 1; i <= 10; i++) {
		string s;
		for (int j = 0; j < 10; j++) {
			s += 'a' + i;
		}
		hash0[i] = query(s);
	}


}

void part1() {
	determine_hash_calc([](string s){return query(s);});

	set<int> used;

	for (auto [s, _]: queries) {
		int val = 0;
		for (size_t i = 0; i < s.size(); i++) {
			val = (val + s[i]) % (queries.size() + 1);
		}
		used.insert(val);
	}

	int sum = -1;

	for (size_t i = 0; i < queries.size() + 1; i++) {
		if (used.find(i) == used.end()) {
			sum = i;
			break;
		}
	}

	vector<pair<string, string>> aux;

	while (aux.size() < 5000) {
		string s = generate_random_string();
		string hash = get_hash(s);
		if (get_info(hash, sum, cache.size()) != -1) {
			aux.push_back({hash, s});
		}
	}

	sort(queries.begin(), queries.end());
	sort(aux.begin(), aux.end());

	size_t cur = 0;

	size_t rem = queries.size();

	for (size_t i = 0; i < aux.size() && cur < queries.size(); i++) {
		int info = get_info(aux[i].first, sum, rem);
		if (info == queries[cur].second) {
			query(aux[i].second, false);
			rem--;
			for (size_t j = cur + 1; j < queries.size(); j++) {
				if (queries[j].second > queries[cur].second) queries[j].second--;
			}
			cur++;
		}
	}

	printf("done\n");
	fflush(stdout);
}

void part2() {
	int m;
	scanf("%d", &m);

	vector<string> responses;

	for (int i = 0; i < m; i++) {
		char tmp[11];
		scanf("%s", tmp);
		responses.push_back(tmp);
	}
	sort(responses.begin(), responses.end());
	map<int, int> cnt;
	for (size_t i = 0; i < responses.size(); i++) {
		int val = 0;
		for (size_t j = 0; j < responses[i].size(); j++) {
			val = (val + responses[i][j]) % (PART1_QUERIES + 1);
		}
		cnt[val]++;
	}

	int sum = -1;
	int cnt_max = 0;

	for (auto e: cnt) {
		if (e.second > cnt_max) {
			sum = e.first;
			cnt_max = e.second;
		}
	}

	vector<int> p(PART1_QUERIES, -1);

	vector<string> queries;

	int rem = PART1_QUERIES;
	int cur = 0;

	for (size_t i = 0; i < responses.size(); i++) {
		int info = get_info(responses[i], sum, rem);
		if (info != -1) {
			int c = info;
			for (size_t j = 0; j < p.size(); j++) {
				if (p[j] == -1) {
					if (c == 0) {
						p[j] = cur;
						break;
					}
					c--;
				}
			}
			rem--;
			cur++;
		} else {
			queries.push_back(responses[i]);
		}
	}

	vector<pair<int, string>> outputs;

	for (size_t i = 0; i < p.size(); i++) {
		outputs.push_back({i, queries[p[i]]});
	}

	sort(outputs.begin(), outputs.end());

	determine_hash_calc([&outputs](string s) {
		if (cache.find(s) != cache.end()) return cache[s];
		string res = outputs[0].second;

		outputs.erase(outputs.begin(), outputs.begin() + 1);

		long long value = 0;
		for (int i = 0; i < 10; i++) {
			value = value * 26 + (res[i] - 'a');
		}
		return cache[s] = value;
	});

	for (int i = 0; i < 100; i++) {
		char s[11];
		scanf("%s", s);

		printf("%s\n", get_hash(s).c_str());
		fflush(stdout);
	}
}

int main() {

	int run;

	scanf("%d", &run);

	if (run == 1) {
		part1();
	}

	if (run == 2) {
		part2();
	}
                           
	return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 410ms
memory: 4000kb

input:

1
wilyevxwyy
mhalfeorgs
rfobsokzqk
wpafrzgojg
iixhdvthna
irrjsssbee
halelbpluo
lxyxdchnpu
wixhlzxuym
wilygdzfsq
wilyewiezq
gcfffvmuie
qdqsfmwaak
dhfvcyssbs
mxmaanatsi
lfdbsczrqs
cplbdsiexw
fvqxssecxw
cfiytmiyna
ubtwgvrjuc
vxofzuskoa
tsztrysqcy
xxrvgfucow
vkfyzpvfmo
eqpzaqtdrs
qmsghpddri
jpxymsbwem
g...

output:

aaaaaaaaaa
baaaaaaaaa
abaaaaaaaa
aabaaaaaaa
aaabaaaaaa
aaaabaaaaa
aaaaabaaaa
aaaaaabaaa
aaaaaaabaa
aaaaaaaaba
aaaaaaaaab
bbbbbbbbbb
abbbbbbbbb
cccccccccc
bccccccccc
babbbbbbbb
cbcccccccc
bbabbbbbbb
ccbccccccc
bbbabbbbbb
cccbcccccc
bbbbabbbbb
ccccbccccc
bbbbbabbbb
cccccbcccc
bbbbbbabbb
ccccccbccc
bbb...

input:

2
82
vxofzuskoa
mhalfeorgs
xxrvgfucow
dtnuqterfg
dfmqfozzlg
dzmpydalxg
wixhlzxuym
ccgslbcppi
ubtwgvrjuc
dopxjvtici
bonizbwtng
gcffenllom
mxmaanatsi
copilkwucs
eiigxmzuoc
iohqiqvmxk
jpxymsbwem
rfobsokzqk
dcefkztaam
xlzrxeinse
dmmwvclivk
axxhcefagk
cljofptpqq
dxxukdvejg
lzdblqdots
vuhqetqnlc
halelbplu...

output:

wilyevxwyy
gcfffvmuie
dhfvcyssbs
nxntwfpqfo
lzdblqdots
xlzrxeinse
wkdrewenay
itozirrmua
iohqiqvmxk
vuhqetqnlc
wloyxacojc
kodqlkfprk
mbzqvxzrka
bbdacpktmy
dlnsfkmwae
thftejfyxs
wofczlqcfo
nglvqrrfxs
rjzxebjkae
iyvhnosomy
nyyatfstka
gkicvajyrk
mgznsysejc
foyhnarklc
miekdghqxk
gmrvppoxua
wilyevxwyy
gcf...

result:

ok 100 lines

Test #2:

score: 100
Accepted
time: 411ms
memory: 4028kb

input:

1
mmqyaxqkrv
msojcnbwxb
skpcypdkkn
kyravjawdf
fmeapxqins
zexuxydykv
alcauktpnp
moqjrthypt
bvyksogxef
ckybmayihx
vkixijxnmj
yzxubfmzgs
yuaizqbnbm
lnuoaxprsr
kmpbvfghox
tbzpdnzzoa
zfwsocpsbl
anxrgucnvi
nfukzfwkit
gakrmfnbkv
aompqiafdq
mhqxeezlns
dwddkdbcyf
lbmrhsjuky
otpukzeadt
yxyikjvliu
lltsgctlwf
j...

output:

aaaaaaaaaa
baaaaaaaaa
abaaaaaaaa
aabaaaaaaa
aaabaaaaaa
aaaabaaaaa
aaaaabaaaa
aaaaaabaaa
aaaaaaabaa
aaaaaaaaba
aaaaaaaaab
bbbbbbbbbb
abbbbbbbbb
cccccccccc
bccccccccc
babbbbbbbb
cbcccccccc
bbabbbbbbb
ccbccccccc
bbbabbbbbb
cccbcccccc
bbbbabbbbb
ccccbccccc
bbbbbabbbb
cccccbcccc
bbbbbbabbb
ccccccbccc
bbb...

input:

2
82
epxqxtwpcz
qcfuttfwme
kyravjawdf
krjvymnohv
nfukzfwkit
alcauktpnp
bvyksogxef
aompqiafdq
ervjydhwdm
eskkognayx
eedabknqls
qznxqyowrh
zexuxydykv
wojfqhrmiq
ychfzzyobs
mhqxeezlns
lbmrhsjuky
lltsgctlwf
cpqggokzey
errjpmnizc
esikhgovou
dbkunvsril
mmqyaxqkrv
yzxubfmzgs
azpqchndsx
jxkvtqkalh
eiuzflkjk...

output:

jmbofxzrbe
nujgisbzwd
xtmlblrkrj
ltomppcyts
cfxbkoufrf
aoilrvwyei
yqedatllin
hjrimolkog
cjgczxjeat
tkysttetjy
zbusszevpq
cnnhdwnbat
tylgxmebld
rgtatequfy
uavxkvdwyt
yighoklain
asqggwlaed
olasnaaqlk
onzxebwutp
ordapmpoxl
ppxnjaclus
zcyepvbshv
dbvukzichf
zxbcahmtlq
itfekgedcw
xyzjkaiuiw
xyrqvmaiyo
ogk...

result:

ok 100 lines

Test #3:

score: 100
Accepted
time: 405ms
memory: 3988kb

input:

1
kgxyeekvyk
gaquqmvwie
ptkveajlbk
swnrclptiw
dcvxxhkeeo
yasdyooqos
nzeecilcvg
wkagwfklua
gkdjvdhlta
rrjemnsnbc
wyuvvvyovm
gthujhuiey
kzoxwzjhve
pldopkcktq
qoplfamcxi
bguxjlvtby
pmbhgjagpu
ydsblapkum
rohgupauyq
nxjuqeuzyu
yjtbxzwtyy
sznooxqnoq
dfdopfequu
dbboldubic
xtjfgqojpi
uqflrgusji
aswlxapcrm
k...

output:

aaaaaaaaaa
baaaaaaaaa
abaaaaaaaa
aabaaaaaaa
aaabaaaaaa
aaaabaaaaa
aaaaabaaaa
aaaaaabaaa
aaaaaaabaa
aaaaaaaaba
aaaaaaaaab
bbbbbbbbbb
abbbbbbbbb
cccccccccc
bccccccccc
babbbbbbbb
cbcccccccc
bbabbbbbbb
ccbccccccc
bbbabbbbbb
cccbcccccc
bbbbabbbbb
ccccbccccc
bbbbbabbbb
cccccbcccc
bbbbbbabbb
ccccccbccc
bbb...

input:

2
82
dqopabapgk
ctipdxhcvw
dnadeavbxm
kqcisixski
rrjemnsnbc
bguxjlvtby
btgddybqde
gthujhuiey
dnykwcemos
kzoxwzjhve
bywbjzrtyw
kilgwljdqm
avlwqiylja
aleicebddc
emjbuqruos
lyuqubweta
anzltalfoy
rohgupauyq
ccvxgwurmu
dryrazzxyg
blqxdphkwo
bekadwsjdk
rlexelomvm
dtfujgwzlc
doyoltdqsa
yasdyooqos
kgxyeekvy...

output:

gtrvtpfone
fibjanxlme
emzsrfjsok
fpqwhigztq
vymzmyygzm
cszseiwzje
awxofyfdkm
rlqipfazle
nhlmpzpudg
nacnkdfvsg
tqhnvfoidq
spzhlltzfm
mdpesxyxls
doqfwnptzi
vdjyswjbxg
qjaqevctws
fjqzjoasgw
avtmtzalby
sprypzcoug
wzucrwstqe
yeipcueeji
gbktsscnno
jzzjlokcdo
ilvgsnvvzu
qwjeiccblo
rtxmteiwma
ampmzvctbi
fyz...

result:

ok 100 lines

Test #4:

score: 100
Accepted
time: 407ms
memory: 4004kb

input:

1
rqahjffwjm
empolfwklg
agvgktdebc
aoiiwlciqw
rqaqwfcuyo
bgzlhzrywk
bsnwkyfhbc
nnioqmvdna
styzuhovae
rqahjnocae
ysowmgkwna
tzbgjgkbsi
hclzhftnqo
hbcxadmqao
qxgxqonemw
lighhsmuas
tyanxsmxfa
latewanpky
aggviadpfg
tzawwgnddg
hbcnlaghjo
kiccklxzfk
pyjrpmtpts
jwnrhnkras
fimpilxsva
ybszbyuuou
bnqhjrpojc
s...

output:

aaaaaaaaaa
baaaaaaaaa
abaaaaaaaa
aabaaaaaaa
aaabaaaaaa
aaaabaaaaa
aaaaabaaaa
aaaaaabaaa
aaaaaaabaa
aaaaaaaaba
aaaaaaaaab
bbbbbbbbbb
abbbbbbbbb
cccccccccc
bccccccccc
babbbbbbbb
cbcccccccc
bbabbbbbbb
ccbccccccc
bbbabbbbbb
cccbcccccc
bbbbabbbbb
ccccbccccc
bbbbbabbbb
cccccbcccc
bbbbbbabbb
ccccccbccc
bbb...

input:

2
82
tyanxsmxfa
cbqthizxnc
jwnrhnkras
dpqfkqnzjk
dmgcgcsopc
ceftuyuhva
agfmtvaibi
dkuqncxdiy
zkvgzgaogm
dpkedyzmwe
bsnwkyfhbc
bnqhjrpojc
dpvgitrqlg
dorvmsijcs
yxaznetela
bhnnsseqwk
cmqhtwrlme
akeiuzhugw
styzuhovae
mwmrgffbou
aspikwhmsm
pyjrpmtpts
kiccklxzfk
ybszbyuuou
danthffmii
dherjzwens
boxsicieu...

output:

dahgltboke
afyyfmxfje
zlafkmuqii
yszzfglozy
gwhrzxftqs
lehcgaxani
afezctvuny
nkvwaatjre
apefpoxqxg
jfqbmjrfjg
jmnufzylzg
kfjioyijas
bjrdutyqtc
kjujdzpzns
eqnbpdpwtw
cxagcxwudm
gfalhrbxsm
lagizznnxo
jkrngotvjq
fkbnhtddoi
emhiwzzxye
ywmniqsyvo
rypgczjohe
skribswvhc
qmjlhpjyly
metnrfanzu
iqwpsvehbu
kiw...

result:

ok 100 lines

Test #5:

score: 100
Accepted
time: 411ms
memory: 4164kb

input:

1
qidjkbthsm
qedwmmkopu
tjkyrstkxw
vbnwthzrgc
nasfdasoga
iqcwyxemho
miasprqjqg
yhrpktmxoi
jfccgovqsa
kydwlqkuxa
bqhydgzgvs
ptzsisrzmi
pxzfgiaspa
yjpavywbho
ynpldybalk
mssdbbrwgy
tmenfqucta
lapezmlpys
gznctcndum
tbkwptssyu
agcnnevfte
xmaetxguxg
efkifzgnfy
tucjdcuxoo
uaeeiflmei
hulmiayjqm
mtqegfgsoo
w...

output:

aaaaaaaaaa
baaaaaaaaa
abaaaaaaaa
aabaaaaaaa
aaabaaaaaa
aaaabaaaaa
aaaaabaaaa
aaaaaabaaa
aaaaaaabaa
aaaaaaaaba
aaaaaaaaab
bbbbbbbbbb
abbbbbbbbb
cccccccccc
bccccccccc
babbbbbbbb
cbcccccccc
bbabbbbbbb
ccbccccccc
bbbabbbbbb
cccbcccccc
bbbbabbbbb
ccccbccccc
bbbbbabbbb
cccccbcccc
bbbbbbabbb
ccccccbccc
bbb...

input:

2
82
akhibbqlfy
cpdwcztjmy
elvrojbyiq
fkccotnsuw
mssdbbrwgy
yhrpktmxoi
exaejbgtdo
qidjkbthsm
basxteopbo
kydwlqkuxa
vbnwthzrgc
elyprljumc
flnbtyrmdu
excgescuea
epqplavepy
qzyqoeujce
cshcioggsc
fbbcextdhs
ynpldybalk
hulmiayjqm
devmilnujy
flakhredsi
fdwzthzzmy
wjmesawume
cgxbhpettu
fiimtwpume
qcxixufne...

output:

gocztenybg
wvzoptyqhk
aididxdtvc
vmyjcqkchw
hlinlwonwy
byhvncfems
itwhxttnpm
dqdniepwze
iqubagevpo
keyjivuyxm
cqqjwzdgvs
tsjzondgtu
tscmzkgyog
hzokzrnrpm
qzrtmftlrc
nffrslkrdc
ttivddqdts
pcrzbotmoc
tfifvawnce
lzgallmadu
dchpptuabg
yuqqgqzafs
impgvuvbgk
nodrsfrnam
tuusuzfjue
zdqvawzvsw
bcklsezfyo
vnx...

result:

ok 100 lines

Test #6:

score: 100
Accepted
time: 422ms
memory: 3988kb

input:

1
zqowuaxdsa
guwmtijjua
loeslpylkg
qrczaepioo
ztndpocapu
dzcibervra
kwhxewnuqs
htfbgkwtrq
jubrwbzamy
rnvwqndgmw
ezdlnrldlq
owdrjborng
hrwbjucllg
tqsjtcapls
skznazxgyc
cynvrmnjva
btebmmptpw
xvppcxwmqs
qzuzgvgklo
otfknojupm
mrqwelqsgi
knqgbxtzog
olrdmqekai
dqkqyfyaoo
epraxcuink
gtnmwrpbnq
smylihgfbs
e...

output:

aaaaaaaaaa
baaaaaaaaa
abaaaaaaaa
aabaaaaaaa
aaabaaaaaa
aaaabaaaaa
aaaaabaaaa
aaaaaabaaa
aaaaaaabaa
aaaaaaaaba
aaaaaaaaab
bbbbbbbbbb
abbbbbbbbb
cccccccccc
bccccccccc
babbbbbbbb
cbcccccccc
bbabbbbbbb
ccbccccccc
bbbabbbbbb
cccbcccccc
bbbbabbbbb
ccccbccccc
bbbbbabbbb
cccccbcccc
bbbbbbabbb
ccccccbccc
bbb...

input:

2
82
eaqsnbetfg
dqobukqtrm
viozazeynk
draucfhocq
btebmmptpw
smylihgfbs
dmwziemuqg
xyvnychpsi
ebtluqleys
cynvrmnjva
kwhxewnuqs
epraxcuink
gtnmwrpbnq
jubrwbzamy
cndvshyzbo
aikwjgtdbi
otfknojupm
amwbjhdgew
ebwozteufo
mrqwelqsgi
cpprlwhojq
utczwxxzls
zqowuaxdsa
guwmtijjua
barziejhtg
chjgrqkbeo
dalwinxbf...

output:

avgsvlkjys
msodtxtozw
ukulkodunw
xyjyssafek
ntfofpbciw
srryerkphy
rmwbpsewxi
oopvuwoqss
vhdtudmkoa
gpwhsujwak
rjtyafwfdq
mbdifpgwlg
ckzestqdkm
vofgefldlw
vukfdqzbrk
mdnhzabdby
utqpuohxki
yhomapifoe
egetcabblg
vracypmvxc
tficdxfgju
dirsrswxps
tvssaxpmok
fwktfnlkfq
wwozrfpbdm
xhoxcbdqmy
voqeaicjgy
urt...

result:

ok 100 lines

Test #7:

score: 100
Accepted
time: 405ms
memory: 4068kb

input:

1
hksjtoukww
gijdeuabfm
zxlwigznjm
dbiixhpzqk
evdfcwwlpc
mzwnkwrwoq
ufztybgnlo
xfkmtucojq
nehyfjyhws
yunmdmgrys
ftoxsgnfva
vnofwxdjwy
wpxmlrxtoi
qinojzaxag
kshqtnhchg
dautieyhki
rgihsuuzea
zwygtehvdk
odqufmrmdc
yddknpbjes
icptwqlqmk
pykcfpfyfe
pjyeqfsskw
isgvskrhig
dzftzybeve
fswcwrvgke
gmebznyyzc
p...

output:

aaaaaaaaaa
baaaaaaaaa
abaaaaaaaa
aabaaaaaaa
aaabaaaaaa
aaaabaaaaa
aaaaabaaaa
aaaaaabaaa
aaaaaaabaa
aaaaaaaaba
aaaaaaaaab
bbbbbbbbbb
abbbbbbbbb
cccccccccc
bccccccccc
babbbbbbbb
cbcccccccc
bbabbbbbbb
ccbccccccc
bbbabbbbbb
cccbcccccc
bbbbabbbbb
ccccbccccc
bbbbbabbbb
cccccbcccc
bbbbbbabbb
ccccccbccc
bbb...

input:

2
82
dautieyhki
dsxibsahzu
eqwqwrblcm
vvenhffijy
cvjcmliiee
dwnlipftjs
dbiixhpzqk
eoxhopqdno
mdafqhmucm
nehyfjyhws
ewyrbqtikc
ptyrlbzmxc
hxdhxqkmna
icptwqlqmk
ejklxsnoho
xerryfkoyu
kntqdugitu
edtdmzrcvc
dbgdkrkroa
bniiqcofcm
zwygtehvdk
acgfjjpqli
ambxkkrwyu
pykcfpfyfe
ftoxsgnfva
kshqtnhchg
bwzpdtirs...

output:

hyryohwwuq
yehfkkieqo
lkhdxdpupy
lepcyozgfa
kbxtdwbiaw
scwosljueu
eltdfrbtjw
dzzuxttfwu
ykqarwgspw
xbxviikinq
bynfyvztfe
sdxhnldpcg
kojuydvgrs
ligdgcalme
fpdvczzpra
lwxirbycis
fjrhrbcvju
fvhtlwodve
vhgikfzmbi
kcjyvwueia
ulpkumkgnm
levfgirmkm
ohhcgirase
ragdsjudvu
nlpmtkqmho
oqwfqqkqbq
rhqjcskzdy
qzj...

result:

ok 100 lines

Test #8:

score: 100
Accepted
time: 420ms
memory: 4224kb

input:

1
rkcjcrfilo
mdsnrmhvua
ksfoplfgsa
fgjvkidakq
ehumzfiwcq
uowdisoavo
xdcivoggnu
tpzxscqlma
acfkpveodm
igcahvdcdc
rtpchwmlaq
rhcduihvbw
wnlzfnfhtk
zqzkazhlwy
wwvvufeggk
xyyyhohwvk
cnjxkbdvuk
dkurmrkdcu
ofxpyhadpu
ejjzxuehku
etzpjltwnu
ocijogzcrw
qklilwxwow
loceblgwzq
ebztyaxpaq
pbepewwsbk
okxaroiesk
i...

output:

aaaaaaaaaa
baaaaaaaaa
abaaaaaaaa
aabaaaaaaa
aaabaaaaaa
aaaabaaaaa
aaaaabaaaa
aaaaaabaaa
aaaaaaabaa
aaaaaaaaba
aaaaaaaaab
bbbbbbbbbb
abbbbbbbbb
cccccccccc
bccccccccc
babbbbbbbb
cbcccccccc
bbabbbbbbb
ccbccccccc
bbbabbbbbb
cccbcccccc
bbbbabbbbb
ccccbccccc
bbbbbabbbb
cccccbcccc
bbbbbbabbb
ccccccbccc
bbb...

input:

2
82
ebztyaxpaq
efvddukkae
bdnxpjniru
dmovwliite
wwvvufeggk
alcmpekbki
mzzgzepcrw
bsljcbsaog
yfqmqzksqy
zqzkazhlwy
etzpjltwnu
awuhxjcqjo
ksfoplfgsa
acqylvpfoo
arqimwzbjm
ckoxlfzhnm
egnyatmqgw
acfkpveodm
ehizkauswi
uowdisoavo
afyppndmvo
qxpkpdasmu
ofxpyhadpu
wnlzfnfhtk
iopiwbgkzg
cjrxoeplzc
efeulrmyr...

output:

lukecwtkzy
pssgzmiwes
iezdfllena
jkpgupcnia
nnzjuutfks
lrkvbpdsoa
pglkqswmeq
uvcvmfezae
vilpenfxjy
xuimbyeiyk
qkrwsajpik
cscxlygdoy
gcnvrvdnck
gdxvbuqgga
ztgzrnawry
dfirtyssdg
ltzkgycguy
osnxztxvce
pjdqlyjvoy
kwxkewumfg
atsvhjflas
ywqgdpnfci
uzbxevxjje
bxqxtzwbtk
rqzmfdehvm
orhgwysinm
cvbknjrrrg
oxm...

result:

ok 100 lines

Test #9:

score: 100
Accepted
time: 404ms
memory: 4160kb

input:

1
wqubbiivzy
qyqkllygqo
dcunortuys
xeinxfwcta
blujyelsjy
fnprjgaejm
lbbmfyjvwm
uxmrgmecxe
oaxpcxrtkw
kuigscoozm
grczwkgdra
nvccwryvxg
tnftmojlgq
zmyfmcvzry
trwvcjayto
hjbqjinwym
ycdrdueefw
nhnqaulpee
wqdieoewnc
jabtzvvzng
mwogjequaq
eygmouhnns
wbabzesccq
zkursbxwas
vbykmzznic
pojmrodpaa
ujvuiievcy
w...

output:

aaaaaaaaaa
baaaaaaaaa
abaaaaaaaa
aabaaaaaaa
aaabaaaaaa
aaaabaaaaa
aaaaabaaaa
aaaaaabaaa
aaaaaaabaa
aaaaaaaaba
aaaaaaaaab
bbbbbbbbbb
abbbbbbbbb
cccccccccc
bccccccccc
babbbbbbbb
cbcccccccc
bbabbbbbbb
ccbccccccc
bbbabbbbbb
cccbcccccc
bbbbabbbbb
ccccbccccc
bbbbbabbbb
cccccbcccc
bbbbbbabbb
ccccccbccc
bbb...

input:

2
82
cpdljzipzo
zgdooqizyq
dbzkfuguzm
hjbqjinwym
pojmrodpaa
nhnqaulpee
avxcclagmi
daogoamimq
ycdrdueefw
cnrvllfitu
bthdzykzee
brczkuybhu
xgxqntqths
grczwkgdra
gojlfqzaje
ccsxxoibqu
wqdieoewnc
ztebzfwoli
czvsxyezno
mwogjequaq
cturgnltgo
ddhukqzjmw
vbykmzznic
avfdgubjmi
avhbijmcby
apvujuavfq
caxocgebl...

output:

tdvmlpdtjs
vjhpkjczia
upywmgpydq
ttzaybciqq
apbykrynws
ppzqipjhoc
sruqgfqgqc
jrgaildjpg
yxskarphpm
cskqrajxnm
ejlzdrqevc
xcdwtugdgi
myreqqtylo
ohfrdxioxu
uqjblbofdi
umiwhtyade
zklkagnmsc
khfzgxctmq
spsuhsavik
oqflwgfnzi
afazbrivle
rmucasodje
cjqgwlgrtc
vcbbaacntw
dtmbpyesuy
ciadgwewxg
penkjaoiba
fod...

result:

ok 100 lines

Test #10:

score: 100
Accepted
time: 410ms
memory: 4040kb

input:

1
vqsjowbzom
iceqchwwkg
ztsvkwakrs
kfckrwoonw
eofhtmoeug
pbrjkdxaem
yrnwaqbihy
zrtxurrvuo
kqixfibqso
jnchyhomsa
zfcwnbnlta
qojaqzbxui
ecwudnhayo
ksxzgizuro
metqbinpqi
mliouzdmrc
shpduqudju
bzyznypiuy
ktgrvoclzi
hqwcmipsoo
fbrquommrg
xdkavrgxei
uetzqtpeza
nnnoffcpaw
wsjgbicoqq
mnhmldmbog
ybbszxqaga
b...

output:

aaaaaaaaaa
baaaaaaaaa
abaaaaaaaa
aabaaaaaaa
aaabaaaaaa
aaaabaaaaa
aaaaabaaaa
aaaaaabaaa
aaaaaaabaa
aaaaaaaaba
aaaaaaaaab
bbbbbbbbbb
abbbbbbbbb
cccccccccc
bccccccccc
babbbbbbbb
cbcccccccc
bbabbbbbbb
ccbccccccc
bbbabbbbbb
cccbcccccc
bbbbabbbbb
ccccbccccc
bbbbbabbbb
cccccbcccc
bbbbbbabbb
ccccccbccc
bbb...

input:

2
82
mzynstqlpu
bosnancgqg
wsjgbicoqq
ktgrvoclzi
crzchnpkqu
pbrjkdxaem
fmjdhfipem
axmiftlusg
eorbfednjk
xdkavrgxei
fllxofhugu
nnnoffcpaw
mnhmldmbog
bzyznypiuy
shpduqudju
fndyoehuwk
irynxtmzbm
hqwcmipsoo
wwwsyxpkme
zfcwnbnlta
metqbinpqi
buqujykkma
eofhtmoeug
bguvpaohyo
mjzsnfwaca
azllnjshui
fjfgywcwr...

output:

jaxqouilio
wogksgbabu
gzlyvwjctw
azwndzkuwy
ogsdmegicm
dbhymdubac
aesqtoessi
glnzlozddu
etsqkkzwjg
zlgjnsfuru
iigpzklqei
ukujumpfha
acyblfjshi
ppudlcasjs
waczfjdvwe
vwufrbqhha
btmmvlibyu
qevpklhnoe
dmxxecfnno
jfljdixrco
zhzhlawxuc
ihursafybo
mhunxkuncu
ngushtyeoa
cxhnhmkofm
pevendvgww
ycnyonejum
ivv...

result:

ok 100 lines

Test #11:

score: 100
Accepted
time: 413ms
memory: 4068kb

input:

1
emdcislbvo
ctlwuhcqps
dgzaskhftu
uusvntksuc
bpifxdnzdo
zkkiqmitlg
yuliugjozg
rzeoexjtug
saevkwjryy
oedyccjfkq
jpooyqrddi
udhryjzamu
vvyxmvhlsq
uznuvapvzs
rnvyeyspry
viltoscwoo
uffktgrbpw
durytizjog
hnnxxyktro
xacojywdeu
gkgiegdopi
zfalqqbixc
yoqpcenwgk
zuzlmwanjc
vxzdvaqrmk
gqggcfaioc
yhrytsyqrk
g...

output:

aaaaaaaaaa
baaaaaaaaa
abaaaaaaaa
aabaaaaaaa
aaabaaaaaa
aaaabaaaaa
aaaaabaaaa
aaaaaabaaa
aaaaaaabaa
aaaaaaaaba
aaaaaaaaab
bbbbbbbbbb
abbbbbbbbb
cccccccccc
bccccccccc
babbbbbbbb
cbcccccccc
bbabbbbbbb
ccbccccccc
bbbabbbbbb
cccbcccccc
bbbbabbbbb
ccccbccccc
bbbbbabbbb
cccccbcccc
bbbbbbabbb
ccccccbccc
bbb...

input:

2
82
diicattmig
xuohkwisla
lepaesndzs
zkkiqmitlg
axgggugdpa
cqspabuana
dmggkwywio
cnwvtoxzwi
ozwfilszfa
ckuwkogfvo
ctlwuhcqps
gkgiegdopi
zfalqqbixc
andopmztqk
gjbizghyii
bpifxdnzdo
aahinphlsg
dowrwnaqsc
zuzlmwanjc
dfzifnxits
bkvvxoztxm
clxrmwsgii
havkyqjoii
dfhwqwkyki
vxzdvaqrmk
mewxorigvy
uznuvapvz...

output:

blohpsamtw
qncpslhlqa
oroycundii
rgnzizkfbu
ebktsufinu
krdhowsuim
iogzxdinro
vfounqkake
fwmfbytwvm
ngzuilpxju
gnhseavvvq
ohkvastjpw
pejqdfvyca
ewwqdxttkq
dwgssbqzgs
rghybymyeo
sbpmbdhqow
mhjssnldba
uizmiqnszs
tjmzggthtk
fsgdozagwe
hvvtxqgapg
qtdudkzswc
aplifinkzw
smigbqxvcy
nkilmwdaxe
yfcofsknwk
gcv...

result:

ok 100 lines

Test #12:

score: 100
Accepted
time: 421ms
memory: 3996kb

input:

1
bfkpieupwa
spuhwqricy
cwrzqwrfea
jtwobfrcmo
azipsuehjk
zzcjjyvqnk
mwvzfcxrvc
suyrpqdhvk
fidwyebnne
gjzwursuzu
qcpjytbnzm
cuqhicsxdc
lkgotqwewe
etrbztuvvg
oenlyyqbkc
bdiwzkwhvc
lbggnldyco
ugeipbwkmo
kzwaxspikm
dasgxnjfps
ocmszjpcje
eayngirwls
nyobyyvvze
rdexlepvea
yebikpjdlm
lfcfarkfds
zyiggerapq
y...

output:

aaaaaaaaaa
baaaaaaaaa
abaaaaaaaa
aabaaaaaaa
aaabaaaaaa
aaaabaaaaa
aaaaabaaaa
aaaaaabaaa
aaaaaaabaa
aaaaaaaaba
aaaaaaaaab
bbbbbbbbbb
abbbbbbbbb
cccccccccc
bccccccccc
babbbbbbbb
cbcccccccc
bbabbbbbbb
ccbccccccc
bbbabbbbbb
cccbcccccc
bbbbabbbbb
ccccbccccc
bbbbbabbbb
cccccbcccc
bbbbbbabbb
ccccccbccc
bbb...

input:

2
82
ddrroamhde
dasgxnjfps
jtwobfrcmo
evdtcencam
ibddznmotg
akoztkuoic
kzwaxspikm
afklowsukm
bdiwzkwhvc
ariflyygno
evlmthdwxa
dedbhwafnw
axmsbdrdda
chyyumlgco
spuhwqricy
qcpjytbnzm
duaorlqolq
ecqvlboivy
yrwzsdlzly
ylxakefpyu
aycaezwrks
zyiggerapq
erdinbukwy
gjzwursuzu
suyrpqdhvk
cltaaeisas
nyobyyvvz...

output:

pfwgophdbs
jikowwjihm
vubhgrltje
hnsrndvsac
hehldvdmoe
irfmucmhwo
gvzkcbloxc
qgabuhbulk
gfwcjgvqsg
gfuiunttaw
flitcuunwo
ttgwqplsok
xolamrlusk
uvbjmrxeko
oieaguihem
vuigxfihcu
qloinlbmhk
auqyzktzoc
yuwujmwkxg
njfoevnpus
bbxrhaaaga
mwleaejege
eprkmydlom
nosjglevzm
wfkepxcdoi
gxxdjkomla
ayvpgzimgw
miw...

result:

ok 100 lines

Test #13:

score: 100
Accepted
time: 410ms
memory: 3964kb

input:

1
pocsutunzm
xkkhszsmyg
gxdjduwgsw
ghestzcyks
qpcdmigale
jtdhcvwmey
cchiovzyyi
kfgxfgqerc
aomxseiibi
dchlrqoves
cpcplwvfac
tnklqvzuse
lrcwsqbvtk
lxxeogpuec
ehzbctitsy
cejvhuybyu
oxewbnxugi
cuilrqrkgy
bqtcrqumvg
smlazhoigm
efansbdhma
zijxitxwms
acgsunsxfa
gzfvwtujti
euvrdqhwlq
ywghgjeeao
giuddzfsac
i...

output:

aaaaaaaaaa
baaaaaaaaa
abaaaaaaaa
aabaaaaaaa
aaabaaaaaa
aaaabaaaaa
aaaaabaaaa
aaaaaabaaa
aaaaaaabaa
aaaaaaaaba
aaaaaaaaab
bbbbbbbbbb
abbbbbbbbb
cccccccccc
bccccccccc
babbbbbbbb
cbcccccccc
bbabbbbbbb
ccbccccccc
bbbabbbbbb
cccbcccccc
bbbbabbbbb
ccccbccccc
bbbbbabbbb
cccccbcccc
bbbbbbabbb
ccccccbccc
bbb...

input:

2
82
anwvjteose
gzfvwtujti
acegsxccfu
dfdjuivhyy
xkkhszsmyg
acgsunsxfa
bvapxwwjjc
gxdjduwgsw
oxewbnxugi
cudzsdgzes
ddsbzrqfss
dqschpflxy
cchiovzyyi
bfhttojgca
bqtcrqumvg
xrwvgafjyq
crrafyunug
dvoizuukbc
bdiabjgvxk
owzifjdwzg
bkunleyxqc
buteleqvwg
tnklqvzuse
ehzbctitsy
dueylqvgbs
dirojapvxo
fzfstzfnm...

output:

tqmhdlhabw
lwbxenarhk
xjlxyrtkkk
yvbavnfpdi
ksxuyrdkdu
vyjklirekc
qitkldmiuo
sjdzsqlqca
usdlxtknts
jyweehlolc
aobsgnyoci
bdbptnktka
rkrpyjwkoa
yrsvpdrgte
esxgiylbry
zlylrzjsxs
dxxmotwfey
umprqtskdw
pizaygjnny
dhznumccbm
ttpkytcfwq
hawkfyjaow
htxdbovyba
jmueofzfku
jbkltgkqjg
uefkczhkco
enlawlfnyq
xpp...

result:

ok 100 lines

Test #14:

score: 100
Accepted
time: 416ms
memory: 4104kb

input:

1
pyjapiokkh
uransxlzad
dodopnpclt
mjckmvqpjo
ssprcpyisp
wbrykmvdrj
awawomhlhd
riethlyooh
yslkzxewmr
bpiedhjpkh
pwsvxamyuh
ugcxwnsydm
pnlksyvjnq
mxhrvpnpfp
grxajstrjz
gqijwisgca
uygllqnssj
xvjnzaqtef
xdbjehpsra
rlwhjgizve
hczlunrhlz
ocuabjmewk
kwknmmdcvf
jilbxjzxgq
fxnfmltghl
swhfekitzm
xgrmaeefuh
l...

output:

aaaaaaaaaa
baaaaaaaaa
abaaaaaaaa
aabaaaaaaa
aaabaaaaaa
aaaabaaaaa
aaaaabaaaa
aaaaaabaaa
aaaaaaabaa
aaaaaaaaba
aaaaaaaaab
bbbbbbbbbb
abbbbbbbbb
cccccccccc
bccccccccc
babbbbbbbb
cbcccccccc
bbabbbbbbb
ccbccccccc
bbbabbbbbb
cccbcccccc
bbbbabbbbb
ccccbccccc
bbbbbabbbb
cccccbcccc
bbbbbbabbb
ccccccbccc
bbb...

input:

2
82
dwwhtlkkrb
cycrbumhyn
dfvghmfmft
xefmooxmzh
xgrmaeefuh
dxocbrclha
pqcgicdknl
sbhadqgnch
grxajstrjz
apcldtfmlc
jqmpyzuuua
dvryebiazt
bcnmybcmmb
pyjapiokkh
rlwhjgizve
bcwmwoydbv
uransxlzad
yslkzxewmr
ssprcpyisp
awawomhlhd
bpiedhjpkh
dyyaxmsztq
bhqbzdxwqi
bputatsauk
pnlksyvjnq
cyuwvwpiiw
kwknmmdcv...

output:

mvicojohql
hvytkxaqhi
qysiaearqo
dwvudvutgm
dkkewcfbos
etihltbtii
hmbdmqsmob
kadupbkqhx
yqdvcbjlkf
lkfuguogah
bbnrmrklcn
zvccsornut
fomeshcjwh
ypinlgqfcg
vmmtswampn
vswkezkxba
qzzrwtwjxi
jmpahyiias
tuhuqczocq
ewbbncmavd
bkmwgksfrf
ezehpekeff
wlbttvdkxw
rsqhezbdir
hsvfjaawov
lznxighbyc
uysrjmyedj
kyk...

result:

ok 100 lines

Test #15:

score: 100
Accepted
time: 402ms
memory: 4028kb

input:

1
bojjscjjge
xrtoeidska
ugvjjarlvo
jygjiuhkrg
nhwbpfufye
dnxejbatok
aygbyiujqu
sdkjmurxii
dsfeuajsic
edguxmhaoe
kuadsxkucy
qkksjcfdee
uhanwwkuai
sodzyznhua
spvemackti
xryssdxaou
fbsdozbrlu
iansskhbtc
vqmvfqpnzm
eqyalyugme
niikcabwcw
okwxsdnsvy
cizzcopxya
raoacvucto
ivafneavig
zvjsojwpca
ubdiwnyuxa
o...

output:

aaaaaaaaaa
baaaaaaaaa
abaaaaaaaa
aabaaaaaaa
aaabaaaaaa
aaaabaaaaa
aaaaabaaaa
aaaaaabaaa
aaaaaaabaa
aaaaaaaaba
aaaaaaaaab
bbbbbbbbbb
abbbbbbbbb
cccccccccc
bccccccccc
babbbbbbbb
cbcccccccc
bbabbbbbbb
ccbccccccc
bbbabbbbbb
cccbcccccc
bbbbabbbbb
ccccbccccc
bbbbbabbbb
cccccbcccc
bbbbbbabbb
ccccccbccc
bbb...

input:

2
82
okwxsdnsvy
vqmvfqpnzm
xrtoeidska
dtuonoifqo
ufnporqfuo
aqlwduurdo
zvjsojwpca
dtmhpyyagq
kssmbmoxbg
ugvjjarlvo
edguxmhaoe
dvnoyoipek
dinrlkvjou
aowjaoxiwo
akunlwfuza
kuadsxkucy
sdkjmurxii
dtwxndowbg
ckutyulcmg
czunytgyxm
bojjscjjge
drabkmhkok
sodzyznhua
drfoxuzqzu
dfvkhkwusk
dvkwseipri
hzpgnuhxb...

output:

fjtwpkampa
vgvvpashty
jurinqqtgw
jynfugbkns
jkcciyqlvu
vrvppwikiq
xlbnvbabgy
vwgvurwbty
zrxvugouyy
bkkbaajenc
dtkhzzheuc
wxrzrtvhew
qcbsemmviy
rqqlemakks
gphrkuorxk
dcmkjqpxfs
oigqmacfxy
yypzhkvjcw
ngqqsqgtje
vpphboswsc
swccvdgcoq
ksgpjmwsyk
gurrzrzktq
nycokqqpta
vxjvjawcdi
nnnxxlbeuy
mwfgaudixk
ppc...

result:

ok 100 lines

Test #16:

score: 100
Accepted
time: 417ms
memory: 4204kb

input:

1
axglcybafm
amiqzhatoy
dubyqwralq
vaozhuyxsg
dhxqfazoqi
aibaibasow
esldobsaxq
nfmkpcseww
jzvmwegvaa
hchyhmeacg
iidkxvkdpi
mdwtpinbmu
mounsznidi
htwzlfkdvy
vhhxquckrq
jhbgbjxbgq
ozqvhboeki
saofklpeaa
hjgatrdicq
jtfonfonby
rggjipafyg
mtcekfnjdk
xscduecjvc
iisbeewauq
wzhyfentia
zvquddvwvk
fdceynugea
d...

output:

aaaaaaaaaa
baaaaaaaaa
abaaaaaaaa
aabaaaaaaa
aaabaaaaaa
aaaabaaaaa
aaaaabaaaa
aaaaaabaaa
aaaaaaabaa
aaaaaaaaba
aaaaaaaaab
bbbbbbbbbb
abbbbbbbbb
cccccccccc
bccccccccc
babbbbbbbb
cbcccccccc
bbabbbbbbb
ccbccccccc
bbbabbbbbb
cccbcccccc
bbbbabbbbb
ccccbccccc
bbbbbabbbb
cccccbcccc
bbbbbbabbb
ccccccbccc
bbb...

input:

2
82
czthittafs
saofklpeaa
celmeuhakk
dsiiwfedbi
arcbctkcti
mdwtpinbmu
dqqkcgyszc
boehchtyuy
cfobfcyebw
bgdqbauzia
agaqbodcsu
btwnjtavik
iidkxvkdpi
dquolcepzm
deouzcusoc
dsjdroiisy
cpyhzkquxw
dpjhcecosg
dqkdwwukii
lgqpcuffrk
chwrxwouts
crhwtgncqs
jtfonfonby
aehxaqwcyy
pvswlnexza
nthcqoshgy
dezyhwlcc...

output:

yrfkerjvie
ahvoxabfuy
urjntvolkw
mtzbrevkem
btrbyavdgw
brgpuqufee
fhqfyvmvdy
ttpinnxrse
rmskrkmsku
aztpswxyio
efdvvhgyyi
dddzkxnqmi
epnderrizy
vrbybuybpc
grsfscvjyo
vrzcxbufxg
bjvkrvalew
rfdjfqmwuq
tkqigwjtis
widhpwcvnq
lxirfsfugc
lkoqisfskg
oxmuprcdqm
arfwjnqbyy
kxfrozowzy
hjstdrjoek
hngwtoxwos
fpa...

result:

ok 100 lines

Test #17:

score: 100
Accepted
time: 417ms
memory: 4164kb

input:

1
cldnxrzntv
ctxgqosodh
spvpzmujut
bcxbhmbowd
ywywcubgpr
kixioyrgxx
igikaogdgp
zlntnfijtq
vocfkwrjpv
xztckycbnl
uazwuxolsb
fcxpomhqgw
eudwvpopxk
ibieyiyhnd
ftxtymyivt
oyfnmrmufy
ioxheovcwh
glecesfpeo
mynvdnsqgx
irchjkfxla
sbvdlxujlj
xfduxfpxcu
ehuhtgudxd
zhstlqbauc
vhozicfjsl
icnjyyyuhb
mfzchvlxnk
l...

output:

aaaaaaaaaa
baaaaaaaaa
abaaaaaaaa
aabaaaaaaa
aaabaaaaaa
aaaabaaaaa
aaaaabaaaa
aaaaaabaaa
aaaaaaabaa
aaaaaaaaba
aaaaaaaaab
bbbbbbbbbb
abbbbbbbbb
cccccccccc
bccccccccc
babbbbbbbb
cbcccccccc
bbabbbbbbb
ccbccccccc
bbbabbbbbb
cccbcccccc
bbbbabbbbb
ccccbccccc
bbbbbabbbb
cccccbcccc
bbbbbbabbb
ccccccbccc
bbb...

input:

2
82
cjrutgiqth
sbvdlxujlj
mfzchvlxnk
beuwvvlcpg
ecddqmzxpu
apgjkbehnq
efqskyyeki
efypjewvfo
cqxfckuhvr
ecbtutnolu
cygfikkvox
bcxbhmbowd
spvpzmujut
fbcvqlsemp
dsixitjdrp
djdypetjpw
jtzddyquxm
bhqtsewqqe
eudwvpopxk
djjqlxvyzy
ibieyiyhnd
zlntnfijtq
irchjkfxla
ehuhtgudxd
uazwuxolsb
egfrmozxij
aajjovngi...

output:

eombtumazs
ioxunwbnli
egbxgujrvp
pjdoyjlorh
chmvhpchrj
zvucrepwmx
enzogxotxu
eakniqniew
rgprnimzhf
zeginzjdmg
vetgvxawpf
lazclpwkri
leushgrqnx
omaeaenvez
iqmivskefl
lijucepphm
grlpisevoi
arjgvxvqvm
jqfqvzkcau
spancwaaqk
ubpbkquvvu
pospexcrly
ychjnlmwzq
fvykfqqhbj
eevgvjxbah
hvauiuxlyq
tphwrxleta
eoc...

result:

ok 100 lines

Test #18:

score: 100
Accepted
time: 413ms
memory: 4076kb

input:

1
tuilecsjvx
ztaeptxmcx
txlddmmgcl
kpgeklyopp
xgnfqsydur
rgwmtjndvp
hyrwefwmss
hxdjjydmsv
tgugjwgwtd
kuxtceeqtd
jmlpkyfexd
acccnzavra
udkjchvtka
sxhadozjlj
eqfeftmyml
zyzkopgzkm
flzgvuxdkx
jhejhpuqxi
bavkvpsixt
wpxibivbsg
gnmgyxotkr
cpoaysgbri
pocldzzklt
lxsrnvwsuf
zbopyfjfkq
lzheidpsuc
mpdlprzzwn
a...

output:

aaaaaaaaaa
baaaaaaaaa
abaaaaaaaa
aabaaaaaaa
aaabaaaaaa
aaaabaaaaa
aaaaabaaaa
aaaaaabaaa
aaaaaaabaa
aaaaaaaaba
aaaaaaaaab
bbbbbbbbbb
abbbbbbbbb
cccccccccc
bccccccccc
babbbbbbbb
cbcccccccc
bbabbbbbbb
ccbccccccc
bbbabbbbbb
cccbcccccc
bbbbabbbbb
ccccbccccc
bbbbbabbbb
cccccbcccc
bbbbbbabbb
ccccccbccc
bbb...

input:

2
82
txlddmmgcl
cnepihbcdz
cbthiciomh
ajunpfskzh
bavkvpsixt
blstdnlyio
udkjchvtka
zyzkopgzkm
ebecsyqacj
wpxibivbsg
cwzofgfomr
jbmupxootu
ztaeptxmcx
dlwswgxnea
cglegyfqzx
hxdjjydmsv
ecrzlzioii
cpoaysgbri
cdzhjpseut
ectpaqhsry
eciulumqwh
mhjvfblsif
ackvqmkvxh
bylaoeddtb
bnqwuwntyo
xgnfqsydur
ykuvsgibw...

output:

erjjnmprgn
qtaxkchgjp
ztapctjtcr
qofpocsmve
qnpakahvbw
xgyuiwjigh
bjuvioezlq
mbskhbpotb
szfwqjusle
lyqxfaoksx
qipzafrvox
npmvzzrbtt
afaafqnmjf
lcqzncqcol
xvtuogydyh
yfkmyeelir
cyjtscpync
zohnarwjpj
vqnkfogchn
fpzyygubco
xshxxlhkiy
ymvijyvxxm
lrflgwzltl
vykdutlgso
jymhgpirfq
rukirweokt
uinpfpnkou
wkn...

result:

ok 100 lines

Test #19:

score: 100
Accepted
time: 409ms
memory: 4000kb

input:

1
vbpeyklgnv
nzimmmazxp
cirbslycgp
iicpkyutwj
svdtvefdep
idlnbaabnp
pbzelzgdgq
vfmlnwjmer
wcdtuaondl
zazkgytfdj
adissftlol
xoietlsnew
eqoxfkctvc
hmezldvtzd
rhrimapwzl
qhghzkfrmc
wzwgmcvdwl
khuugxizwi
jpfakhekkr
zutpwryqoc
ncusyuiqml
kmlwqwdsfc
qbbfzakrzl
dnyffwxqmb
agluxjcyok
xkkydzuhoa
tbafpekxuj
w...

output:

aaaaaaaaaa
baaaaaaaaa
abaaaaaaaa
aabaaaaaaa
aaabaaaaaa
aaaabaaaaa
aaaaabaaaa
aaaaaabaaa
aaaaaaabaa
aaaaaaaaba
aaaaaaaaab
bbbbbbbbbb
abbbbbbbbb
cccccccccc
bccccccccc
babbbbbbbb
cbcccccccc
bbabbbbbbb
ccbccccccc
bbbabbbbbb
cccbcccccc
bbbbabbbbb
ccccbccccc
bbbbbabbbb
cccccbcccc
bbbbbbabbb
ccccccbccc
bbb...

input:

2
82
dusesdhpbi
fbiqvvaqlx
nzimmmazxp
svdtvefdep
dmzvahrqav
fhgabekhqy
vfmlnwjmer
rleewkuwin
yxlapeksxm
fgvldygqgy
delvmpijsv
cpzjsgnldp
fbstxsqeqc
smoqzqkieg
dzqswrzmnn
iazulrwyzr
beurwmevva
adissftlol
mmtzxjedsy
bupsnjlmkn
appeblgbcz
fgysbhegfe
khuugxizwi
xpjzkmqhxj
ncusyuiqml
exjnudusei
cirbslycg...

output:

bljzpslsaw
rdawlrrxfg
tmtleuzicr
ghvrogqsly
etdwhbpcth
tnttfyxsjo
vehovdshhl
qdsklsfgnv
izchixytdo
alyjhfcapf
vspbskfvsf
siukpxmpwo
gqtwxrzqkt
xlgetzchfj
lttjlmuyqt
thzyjdukff
wutzztypkt
fwgrtqdwwj
rhuzypcide
uddqxyvsrg
hehkrfszah
odnqbpytdm
isdzaupblk
enabunvdmd
dsrbrusllm
xoopwjzohx
dtcjkdlarj
xim...

result:

ok 100 lines

Test #20:

score: 100
Accepted
time: 406ms
memory: 4004kb

input:

1
oophoqfppy
wknpidkmza
bprfteldks
vtwwmgfqam
hbgxtzzdvy
tpkczzgrhq
sovrqisxiw
rdeiyvjigs
cwzlemkgxi
fwsalvmtag
rkkualfife
dfnilunesq
vjpashihjo
ryucrmwtic
meezfkvvjk
qelkhghqxw
wpdvgznehs
waftoeneic
tlsyydvoty
ksvsgktqmq
jajynzctsm
yesnalmday
sehbwvbxsm
zfgykbzwzs
almxwbuujo
aqyhbpjmbw
csbixabogy
o...

output:

aaaaaaaaaa
baaaaaaaaa
abaaaaaaaa
aabaaaaaaa
aaabaaaaaa
aaaabaaaaa
aaaaabaaaa
aaaaaabaaa
aaaaaaabaa
aaaaaaaaba
aaaaaaaaab
bbbbbbbbbb
abbbbbbbbb
cccccccccc
bccccccccc
babbbbbbbb
cbcccccccc
bbabbbbbbb
ccbccccccc
bbbabbbbbb
cccbcccccc
bbbbabbbbb
ccccbccccc
bbbbbabbbb
cccccbcccc
bbbbbbabbb
ccccccbccc
bbb...

input:

2
82
hbgxtzzdvy
bbkmdzdbcy
cvjjxtrrde
dazuhpoukk
lxkpopgbii
vshxcnvuzi
gujqftihki
trajkppdfw
cuthvpqsga
cnbdbgupre
meezfkvvjk
ehkjxcrsfa
cwzlemkgxi
czuffkupqg
ksvsgktqmq
almxwbuujo
acbgfryjik
daltbspanc
aeihbybuji
ryucrmwtic
aqyhbpjmbw
czhovfnctq
clrfshwwog
aguqzxvafi
czqtmdfxbs
bixbmrpfsy
aghsksuto...

output:

twcbsejywo
ohdotbbuzg
jnnsmaqpeu
fbazjeynyg
bzvlaprefc
ywvsjlphau
fjjijeffqe
ydftuinmty
bzzjjctali
csjulppoug
fqedphzpwo
cgormybnpy
xodfiwwezs
atttcdirwk
ldukiixhem
dcflkljjuy
igvsmonogw
tgaamugkrg
svuvkcxxiy
rqxfgvqwjg
wmllzmvovk
edidrhruws
dhyquhuivs
bieixwiffu
gxnasnxeii
hvoslzrosy
pvniumsyty
ujq...

result:

ok 100 lines

Test #21:

score: 100
Accepted
time: 416ms
memory: 4100kb

input:

1
mqlnnlhmoy
bmgdfixxsi
boksbsnreo
vedtcafkxw
bypupxwkcw
nsmacjnnxa
wcxxhwkhhk
zrurwbcppm
gwykhdyuui
fmvcbzhhns
bnfrpkofdo
nvokmwssyq
yztuuzchvg
dpiqyihtdc
iljqvewcyk
yxpfypmoja
suxukgkbue
fhweyhuups
qlaporzook
ynkdkkdvks
sbivjtjwxk
mtnxxymrqo
cdzivtiisi
ejcaslpyge
fybfychvvi
aufgegxpyc
rcyjkxlzsu
t...

output:

aaaaaaaaaa
baaaaaaaaa
abaaaaaaaa
aabaaaaaaa
aaabaaaaaa
aaaabaaaaa
aaaaabaaaa
aaaaaabaaa
aaaaaaabaa
aaaaaaaaba
aaaaaaaaab
bbbbbbbbbb
abbbbbbbbb
cccccccccc
bccccccccc
babbbbbbbb
cbcccccccc
bbabbbbbbb
ccbccccccc
bbbabbbbbb
cccbcccccc
bbbbabbbbb
ccccbccccc
bbbbbabbbb
cccccbcccc
bbbbbbabbb
ccccccbccc
bbb...

input:

2
82
tpbntebktg
crroapsdvq
owgjbqjeyy
fmafsrqtyo
dfafwanshi
fybfychvvi
iljqvewcyk
cdzivtiisi
clhifbmapu
dtaflozmmw
cvociajvcc
boksbsnreo
fhweyhuups
caidmcphyi
igrparxilc
wnyoyuuvck
ayheiqqrzg
ejcaslpyge
nsmacjnnxa
cikhekvfcm
suxukgkbue
edtjqmcoac
byvsqrpezy
dljwmivtik
bwalyrubno
ehdhiebjuq
doidjiqhh...

output:

tpcacnbkpq
gleoyyrgec
cqbjgftvga
xisxnadfhk
nedwtueaqk
jyijubwjbq
gudlokwlyy
fxtyuqpcie
cnyopmrgyo
izjjosuyfi
zfsvugrtsg
zqgrjtjmbo
fzdalorynu
fuewmgwsca
lmureeilrs
hqttgitohm
imlgzgxqlu
fnifsfaxso
jufyjbzkfy
zcxkcjggzo
idajaigkns
klbtczthqa
tqsoxlmsxw
ydilwzwmmi
amwtqbbshk
dsergbdhty
ckpjwxlymc
ibr...

result:

ok 100 lines

Test #22:

score: 100
Accepted
time: 408ms
memory: 4080kb

input:

1
pktzmuyuts
uzxsnhkkve
eiuteakycu
irnlngupso
cnqkjjhcem
qpzzbbttow
gjihvgrpqg
oasuvxrziu
jbjsfuqzpw
glglfaucjc
qcbaijibxw
sjqroceiki
mumynpssiw
iwqcdvqoxw
nqhtqrjrsq
dlpxwwsfbg
pvytdqfula
zcxfnqinlm
rsgfneyrrs
fgugrnwazo
orueyorzru
rekrzvjjpe
qwsotaklvk
blcjfqlnnu
zcmtzeuupo
ttrwezldvg
mqxtceymta
y...

output:

aaaaaaaaaa
baaaaaaaaa
abaaaaaaaa
aabaaaaaaa
aaabaaaaaa
aaaabaaaaa
aaaaabaaaa
aaaaaabaaa
aaaaaaabaa
aaaaaaaaba
aaaaaaaaab
bbbbbbbbbb
abbbbbbbbb
cccccccccc
bccccccccc
babbbbbbbb
cbcccccccc
bbabbbbbbb
ccbccccccc
bbbabbbbbb
cccbcccccc
bbbbabbbbb
ccccbccccc
bbbbbabbbb
cccccbcccc
bbbbbbabbb
ccccccbccc
bbb...

input:

2
82
emxbatjgps
glglfaucjc
mumynpssiw
fgugrnwazo
fbnsgzoxra
dwpavhgqso
qcbaijibxw
gjihvgrpqg
clmsyrsffk
ytayvcmdoe
dbiivbdmxa
fbntsvuwxw
dqucjetxcy
edghbtxaji
bmxoplcnro
sjqroceiki
fhlremaecs
pktzmuyuts
nqhtqrjrsq
emuksonkbu
dptdgkdgjg
pvytdqfula
iwqcdvqoxw
qpzzbbttow
zcxfnqinlm
etundnqgsk
cdhecjjjr...

output:

belfdsozaw
pvojybmppq
ltawvqvhok
gdveqmoupg
hydrqsrgca
lddubphvpu
lppmsczdmu
inffvylple
ysrozquqpm
ktqanmivxs
gjvgryofnk
ghumepiape
inczgjryyk
efqqxwyocg
dcjcixiixm
buwxxleyzi
xfkwvqiigc
iwejlorivi
errwjmomwa
jksenotqcw
qqmoegfsui
fcgrablrzc
dnervfrhte
dwnmpugbwe
ewcxebwntm
nnkbbajjyu
sbaguybhty
ldb...

result:

ok 100 lines

Test #23:

score: 100
Accepted
time: 409ms
memory: 4092kb

input:

1
vqyilnsvma
stcasiqvbc
gaawuesfou
beelgfzizu
oeyhtimjaq
bfvyegspes
hbkbzphjls
rohozqwgtk
cnfrqlfzvw
zhjvzbhzmi
ewlzmpbsyi
hsjurwtfcm
kqgclbvfnk
keiktbbcxk
fntbdrccas
xjhgjftuzs
pudzbvybna
cfdrxemros
kogckbbhrg
pejvkbzrnw
iabhvtzfqk
cdmezdtlju
mfzrgwelxc
whybdvercu
uemtxvfvqc
lvaodtptvc
kyaxjznoik
a...

output:

aaaaaaaaaa
baaaaaaaaa
abaaaaaaaa
aabaaaaaaa
aaabaaaaaa
aaaabaaaaa
aaaaabaaaa
aaaaaabaaa
aaaaaaabaa
aaaaaaaaba
aaaaaaaaab
bbbbbbbbbb
abbbbbbbbb
cccccccccc
bccccccccc
babbbbbbbb
cbcccccccc
bbabbbbbbb
ccbccccccc
bbbabbbbbb
cccbcccccc
bbbbabbbbb
ccccbccccc
bbbbbabbbb
cccccbcccc
bbbbbbabbb
ccccccbccc
bbb...

input:

2
82
nxopvfnqdm
stcasiqvbc
kqgclbvfnk
awclmzgasq
dnloxtgoho
wkcpxvybnk
ctuprnsdji
xjhgjftuzs
asmhknlytk
eklrvqcfwq
pejvkbzrnw
yyekihyppm
cwkcwxlcgy
cfryeivqfw
iabhvtzfqk
elaxcbvcsa
bqrwgggywe
lvaodtptvc
btqkxwwstq
gaawuesfou
dnuiviuoji
cbaaxozbco
dxikyirpgk
vqyilnsvma
dewudtsmve
pudzbvybna
mhtcfvnpa...

output:

jeehlwuedg
zgykencdte
hqhjglyxls
zahyuxplba
wpariihnic
gzfssivpmo
hpipkwdovc
iwpwvfirnu
mwmauermay
rkkzpcxtiy
rmengudqea
fhzaygayfy
piqyjmydbc
wfbkbkwxus
kayrkjzkre
obcpojxcpc
zhovuczotg
xezwoyzrji
jldohfevuq
aijlovbuek
nxhkoovgck
vtbwasjaqi
kctgnzigzq
wyyhkckzcq
myetaooams
mwsbagpruq
dmneatxfeo
und...

result:

ok 100 lines

Test #24:

score: 100
Accepted
time: 415ms
memory: 4076kb

input:

1
nbyapwdhnq
xwcvnktqfa
pzgdoslaui
klxvwiwfua
kkwytapzxo
dcnsedloyk
iqyfpahjxe
natdgyvdda
mdtrawkyte
cbtwtjsyqq
vtxrieevuq
duluhikcbg
tagzjtttjw
ydphakujow
humncxiwfc
axdrimciuo
cjzhdbeuao
gklzavrduw
tsgnsalhaw
glmwedxjri
mzisudgymo
ntwctbbuqm
ieivzbwpls
iflpiefzrs
ugyjogwumy
dvqrqfsglw
xgcvgmylhc
e...

output:

aaaaaaaaaa
baaaaaaaaa
abaaaaaaaa
aabaaaaaaa
aaabaaaaaa
aaaabaaaaa
aaaaabaaaa
aaaaaabaaa
aaaaaaabaa
aaaaaaaaba
aaaaaaaaab
bbbbbbbbbb
abbbbbbbbb
cccccccccc
bccccccccc
babbbbbbbb
cbcccccccc
bbabbbbbbb
ccbccccccc
bbbabbbbbb
cccbcccccc
bbbbabbbbb
ccccbccccc
bbbbbabbbb
cccccbcccc
bbbbbbabbb
ccccccbccc
bbb...

input:

2
82
iflpiefzrs
ecmsojyoyc
ebrconeekm
dwpguxrhka
kkwytapzxo
dagknkzeak
daczmvbbqa
ehvheobwty
efoefyeqdc
ehguclvvhy
cdhiqsngia
cacuyfiuys
dyxhcpwita
cjbdadnaia
cvvunvhrxu
nbyapwdhnq
ebtiytpota
pzgdoslaui
vcmdpainug
xwcvnktqfa
dwypgpkuia
ymisqeuiey
ydphakujow
bsbvbuleyw
dsahnrsadc
dduhjtryva
ebdbmevmb...

output:

qydsfskftk
bjsmbhdkda
vaoihhihuc
vujkylocgq
hptaiieeia
yngvxjhcxa
xkmniiqope
jimfkymagq
xsfzektxus
kgpnxecdyu
zsoyxaywwe
blfhqmqmsm
qlnzwxueug
rphtsdfhns
sipnntchti
lhazlrhybo
jvijjixiom
cwhhgwqxzy
uayztpjuvy
prejnmxbzi
buaoeetuxs
edgemviajo
jdpelbnoys
grupnxlzqw
qshnhyyzme
xxsujldfne
cnkknrqate
ecp...

result:

ok 100 lines

Test #25:

score: 100
Accepted
time: 416ms
memory: 4040kb

input:

1
zugnlrnrhs
jhycbymnra
zpceedsyqy
nmtakhukdc
jouvpvmuns
hukzxndmww
ndwzxvlsfi
alubgwpdgm
juxlhmkfvg
czficrvdwm
hwniytlslq
xyzoqgpbtk
olhzzzqfkc
uofdntefjc
jtfkpvgtqm
yedxxujuke
ifwbnzaiio
kgnbrqiiya
rujsiygkty
oelgmcpynk
hzysoixbnu
pyvcekzgeg
qfaxxrzycq
kpjcecravu
mpckuajlce
xhmavbnpuq
rhpqaxkuja
n...

output:

aaaaaaaaaa
baaaaaaaaa
abaaaaaaaa
aabaaaaaaa
aaabaaaaaa
aaaabaaaaa
aaaaabaaaa
aaaaaabaaa
aaaaaaabaa
aaaaaaaaba
aaaaaaaaab
bbbbbbbbbb
abbbbbbbbb
cccccccccc
bccccccccc
babbbbbbbb
cbcccccccc
bbabbbbbbb
ccbccccccc
bbbabbbbbb
cccbcccccc
bbbbabbbbb
ccccbccccc
bbbbbabbbb
cccccbcccc
bbbbbbabbb
ccccccbccc
bbb...

input:

2
82
uuatzghpeq
jouvpvmuns
hwniytlslq
dlljdzsvva
pyvcekzgeg
nyiqulsnfw
dyeyfmauwy
cmisejpyku
aigknpzkly
dzeqwrrddm
jvajhfljpw
kpjcecravu
aznkpmiubs
dntbwanxui
kgnbrqiiya
buzbihbcra
jtfkpvgtqm
qfaxxrzycq
eqebglsyus
fddnkkybbk
jhycbymnra
astapqcbce
ifwbnzaiio
fczkmqpkno
dzewbvbcxu
daaulbvyaa
fcxszrmuw...

output:

zxmbfauvji
ftzyssogww
glhoktdlhs
ahyetespve
sngaidlqhu
jwchpcyoic
fdkzmvhbxm
khtwhnwlhq
swadavnqoy
glhimqmtva
pqioblhocg
jxgjarmewe
xfnkgmnrju
bwhnbppoda
pfhhhjtymi
oexpskwltu
ygoshvgtoe
snunlxsere
xgfqtdpecs
fbldjzkjss
pkkcauxxiq
ochnljvziw
wivwdlpsmk
pxohykjtnq
giopuyffbc
nykkonoztm
vnfzgubtci
ukc...

result:

ok 100 lines

Test #26:

score: 100
Accepted
time: 415ms
memory: 4084kb

input:

1
fxtntwofuc
xmgmfbxdro
jeeflzinfu
uyaswfbgzk
osckphlgbe
djkyokcdro
hjqpdlkrai
miauwzbwac
yknydmsgrc
qboyadfaek
acmbxekcli
aqlhvhqdxw
jbyjkchgak
kebiehfuli
mdzhozcgfq
xkaqdevwme
xjfhnsycgy
lqecszdcso
tkmrvxxcdu
rwckzwtdqu
oicralgfka
detxaucgak
kmliqdozre
zeoglstsrq
eggjkmdeek
ugeasfcnrw
iozplviivc
i...

output:

aaaaaaaaaa
baaaaaaaaa
abaaaaaaaa
aabaaaaaaa
aaabaaaaaa
aaaabaaaaa
aaaaabaaaa
aaaaaabaaa
aaaaaaabaa
aaaaaaaaba
aaaaaaaaab
bbbbbbbbbb
abbbbbbbbb
cccccccccc
bccccccccc
babbbbbbbb
cbcccccccc
bbabbbbbbb
ccbccccccc
bbbabbbbbb
cccbcccccc
bbbbabbbbb
ccccbccccc
bbbbbabbbb
cccccbcccc
bbbbbbabbb
ccccccbccc
bbb...

input:

2
82
qmpxpazjno
edvkckapaq
kmliqdozre
dasydzxgjm
djvktyeuje
eoehtesxsm
enlqansthw
ebddlgkezo
emajwntoiw
ecswvutfck
idqxlrmdaw
iozplviivc
ofimixxljq
cnzyoefvbo
eqwvktprvu
tkmrvxxcdu
xjmesvfamy
dwenwucmtg
enmsiuivrc
eoupkvffrm
bhwgpghcbo
yknydmsgrc
avovmfhute
efpyunfdsq
esncgkkntw
viodkhahzy
eqjzscanm...

output:

okmkfbajsc
ztjxervana
zdyuqlcpjg
tnbkmwdbku
pdvmdkinzq
akwwcokmgi
secvqxyydo
lfyjzlgdco
pdyvbmgbxg
fbgsmymbnk
qsqyhxreoo
gfmqvqjmoo
yknlnruztg
mwczbgiwta
zsftecmjrw
qcackpeqsu
hnrrhvfjyi
uifdqihqgy
jiehpokwza
ndduqujhxs
ebomotkncm
lthcfgeflc
xlqvwccimw
jvewaqzrqc
ypzwllybms
emkrbrkbnu
gzpjrzzckw
ibl...

result:

ok 100 lines

Test #27:

score: 100
Accepted
time: 413ms
memory: 4068kb

input:

1
fktzkzgnxg
dycswxggag
igboawocec
zvmibxhqku
xgsbtrhghu
xkhyncpoui
mkuifigxuq
iuzayerfwe
iviymfbryo
upavletxcs
jvonciosve
sjkkoxakdg
twbrczasag
mvxhlthosa
amgqmspgmy
pocvyzsvwk
wrfjgskfhc
xysbxyzhps
vjfwejtock
anmigezrss
dfnhspycvk
ajwlmtrjge
faogazkgiw
ljkbuoaafw
girgelivmo
ozfjbrpsei
cdihkcpira
o...

output:

aaaaaaaaaa
baaaaaaaaa
abaaaaaaaa
aabaaaaaaa
aaabaaaaaa
aaaabaaaaa
aaaaabaaaa
aaaaaabaaa
aaaaaaabaa
aaaaaaaaba
aaaaaaaaab
bbbbbbbbbb
abbbbbbbbb
cccccccccc
bccccccccc
babbbbbbbb
cbcccccccc
bbabbbbbbb
ccbccccccc
bbbabbbbbb
cccbcccccc
bbbbabbbbb
ccccbccccc
bbbbbabbbb
cccccbcccc
bbbbbbabbb
ccccccbccc
bbb...

input:

2
82
bcgmfefway
dfnhspycvk
elrsfhilsy
oqanhmrokq
mvxhlthosa
hyabarsjeu
auogqfyoqi
igboawocec
ddfdxfepau
dddrczohfc
cpkrlysyyu
eijgvxhnso
amgqmspgmy
ddvllbrtru
amvqhtnpim
egxktpxclk
enkrqtfvgm
anmigezrss
fktzkzgnxg
owgqbocbpo
sjkkoxakdg
fwyosnynjw
douthxmobk
twbrczasag
dhbyiasvry
emjibysvyc
awjumxzvn...

output:

qcaseiobym
pglkdrenus
xaabawfxuy
coucnkfbvk
jkkakdvddq
zzybawpbeu
lopcltyigs
fvywccvfqe
wlkhqptjem
utxxmvvzba
jkijjuepme
esofqsdgjq
pkdjqakkbm
okiczepncm
ucfgejilys
apzxazmqjy
gycfjmahtc
tpzoxvgjcw
jomtqfmlgq
hbcxnculvs
xqxkezlldc
fvbeooftdq
nqhvtjboss
meugttxhtw
odbwbbwbzc
aoiqscmbkq
tejyhktyhi
nym...

result:

ok 100 lines

Test #28:

score: 100
Accepted
time: 404ms
memory: 4040kb

input:

1
shhntcarwk
ndanjimomq
obyleufkck
yplwghdlkm
hyaojtpmdw
zthbumlguk
qnoyzhrowm
djmygjvpvq
wwjcdgjqxq
pfvrukugyu
spkhmcxhnu
xmtpyjeigm
craqicslqg
pqkgpvkxeg
nhaaaglmte
bscsmqzqam
vnzhrgnxxc
rephlebosk
ihyrdodydq
hwaphrpnza
duxztkzmpq
qaubwyttim
dppqxsiytk
zgmesdnlgk
vkbttilyus
mkoflbjkhg
hzvxouhpwe
s...

output:

aaaaaaaaaa
baaaaaaaaa
abaaaaaaaa
aabaaaaaaa
aaabaaaaaa
aaaabaaaaa
aaaaabaaaa
aaaaaabaaa
aaaaaaabaa
aaaaaaaaba
aaaaaaaaab
bbbbbbbbbb
abbbbbbbbb
cccccccccc
bccccccccc
babbbbbbbb
cbcccccccc
bbabbbbbbb
ccbccccccc
bbbabbbbbb
cccbcccccc
bbbbabbbbb
ccccbccccc
bbbbbabbbb
cccccbcccc
bbbbbbabbb
ccccccbccc
bbb...

input:

2
82
datfztsyka
craqicslqg
dsmjnpkryc
vkbttilyus
yplwghdlkm
qnoyzhrowm
cbqyzwxcia
dstervmsla
bdxnmdztra
bxpssswvvi
obyleufkck
jmsjzroqcg
dvenrcvpno
cullakzhts
bltwdezqoi
xmtpyjeigm
ihyrdodydq
eehoykpmto
cyxnortxku
usfltmukps
eclpvhizku
msffjjgwow
eeakisspae
nhaaaglmte
zgmesdnlgk
dzausirfzc
duxztkzmp...

output:

vufqbhvmxi
znszcufvii
snvztzcrqy
xtnkxbbuqc
cljkaqemng
qnzjyldecm
ftaxmfobxy
oaezvzgqhq
tmqziwdtma
wdaoqshkkq
eoscmjrwmw
ryosqpprue
npwxefukea
pwmcukysbc
ynkralvbws
svbwdwfhgq
djnkfexceu
enaccpvxym
rxvrctfims
gfffqqlvvw
zwfqlbfadc
quxmiindzo
mepepnxfay
hrrdrvlguy
dzrsqeicso
moezmlqupm
zjiakvispc
tpz...

result:

ok 100 lines

Test #29:

score: 100
Accepted
time: 412ms
memory: 4000kb

input:

1
cumlwxulty
sowdyqbyfa
dwtgrsyvwk
nibosntlyy
zisronefui
dcyzsrtlie
mycezcgqmk
unfywlgvue
zxxrevnkyu
fglvxugjjq
vrjraoeguc
vkbvqnbiom
fpsdoutwdk
duudgtuqjq
dvngfardhs
uhvavrwyma
dutqkrsxts
kwmsuxcijm
qlftqqghje
yvvpyxrooc
gfauzztcic
vbphutcjag
przfpbhzjy
lgmcoipdwa
utzkkyjrai
driiqzoyog
xroaalpcuo
y...

output:

aaaaaaaaaa
baaaaaaaaa
abaaaaaaaa
aabaaaaaaa
aaabaaaaaa
aaaabaaaaa
aaaaabaaaa
aaaaaabaaa
aaaaaaabaa
aaaaaaaaba
aaaaaaaaab
bbbbbbbbbb
abbbbbbbbb
cccccccccc
bccccccccc
babbbbbbbb
cbcccccccc
bbabbbbbbb
ccbccccccc
bbbabbbbbb
cccbcccccc
bbbbabbbbb
ccccbccccc
bbbbbabbbb
cccccbcccc
bbbbbbabbb
ccccccbccc
bbb...

input:

2
82
xazjmdrmuq
dkjlkbufam
ejijynrjgy
ygqqipijjq
bijtevrdzq
cneqmwrnoi
fglvxugjjq
dlgplnyiwk
xroaalpcuo
egndkendri
lgmcoipdwa
driiqzoyog
dkethhbfdw
unfywlgvue
vbphutcjag
enhtuigpvk
dxvkjhmrfq
qilnrayhta
emspoolrki
lkvxbkjpsy
nosmmnobwk
syclpqpkyu
boqvwdzvwu
zxxrevnkyu
bricqyvgye
xprlxqpjrc
dzzdlbxes...

output:

egxgnxuuki
zgrnfnlery
icdcuodzas
wbrzphbtjc
nxplyatdww
zbhcntllwc
udmewnakdg
rgmjmsfzyy
orphvmycgu
pjuyzrnyim
awkodlvvam
uuvpmqtivu
gbegpdvxxi
ghehiaasri
svbjbopanm
cdktrqsllw
qquzfdtrzu
ypcwdvfaze
mjjsfvjoey
hycevymwmc
pqgyladewo
oolwrmzrqa
cbxxghexea
qbavwepjzm
kmertlajxw
ptsfphjnay
wxedmdnwbs
yso...

result:

ok 100 lines

Test #30:

score: 100
Accepted
time: 398ms
memory: 4208kb

input:

1
fonugixevk
tgjkcauyhs
kcxotbxyby
qkvijbqqlg
mwynzxuyyk
uyfgezyfpa
wenkcwzxbg
hvwdlqcppe
qvmjuauaoi
namraugavo
hhgoxbrwxs
ssbekjwkvs
fafooryrjk
nkoemcxsay
myjzwemnre
odrjxqvrpe
cvghxzrtxg
hvtqhrczfw
vwcnrvmbko
ljqkquyqss
iltnejualc
dijslsvkcc
owucooufuu
ccbonvtspw
purekpceqg
qksvfcraby
gkigniyzts
h...

output:

aaaaaaaaaa
baaaaaaaaa
abaaaaaaaa
aabaaaaaaa
aaabaaaaaa
aaaabaaaaa
aaaaabaaaa
aaaaaabaaa
aaaaaaabaa
aaaaaaaaba
aaaaaaaaab
bbbbbbbbbb
abbbbbbbbb
cccccccccc
bccccccccc
babbbbbbbb
cbcccccccc
bbabbbbbbb
ccbccccccc
bbbabbbbbb
cccbcccccc
bbbbabbbbb
ccccbccccc
bbbbbabbbb
cccccbcccc
bbbbbbabbb
ccccccbccc
bbb...

input:

2
82
dajptsmwgs
bmxqcxlxla
colroqdoxi
toljfcfrlq
bijcqzydsq
hhgoxbrwxs
dmzostesfe
gkigniyzts
dmajxjvyre
qzijtrbstk
ssbekjwkvs
hvwdlqcppe
lgchpynovo
cophrrqmmk
namraugavo
cjykzuiuwy
bwpiwywtvk
wenkcwzxbg
cbpebddxks
iltnejualc
nkoemcxsay
qzywdmnuue
badwkrpxjw
buiivoysai
dijslsvkcc
blcddjvrna
dbwnaquez...

output:

cygmkqowpa
mleavvpkso
yxgsduhncy
qbribvhvxw
artcncswfy
gsjkhbgfjo
oiuodrfdpq
thenrsblbc
zpntmiqvlu
gncjpfqhto
cfwecyotzy
rujicscsbc
hoscevjegk
bjahistfne
fczavqxwqm
msjkafldqm
vztvleqmos
kvocdmfyoc
paxxkxjwns
mnkujgoima
dqtnwvknoi
ekriwqxafo
xvkaaljxko
rzjbuovmuk
kupinqnrem
kgjitqeofm
kfelriuwsu
qxe...

result:

ok 100 lines

Test #31:

score: 100
Accepted
time: 415ms
memory: 4088kb

input:

1
wrwlxxcaga
ijczeodywu
fzeamoxpxm
frmdgpgdqo
bfxrshhlzu
zstksvuare
ufahtcdcpk
tkevpgbnts
vtutmtnvcu
fbxzenbegs
lhjajgbnio
ylwykqmgau
muqldzkhka
fiblmgerki
xirvjajspm
pepjvyqqji
vbxyjtyqiu
pmhhbyicqg
zhpcvldihs
txvsqgguha
qktgtbpikm
vkzzprufpq
nyqdvgpzlc
aytcplldrk
bawfqtliww
btoothmsnc
tkxxswznko
z...

output:

aaaaaaaaaa
baaaaaaaaa
abaaaaaaaa
aabaaaaaaa
aaabaaaaaa
aaaabaaaaa
aaaaabaaaa
aaaaaabaaa
aaaaaaabaa
aaaaaaaaba
aaaaaaaaab
bbbbbbbbbb
abbbbbbbbb
cccccccccc
bccccccccc
babbbbbbbb
cbcccccccc
bbabbbbbbb
ccbccccccc
bbbabbbbbb
cccbcccccc
bbbbabbbbb
ccccbccccc
bbbbbabbbb
cccccbcccc
bbbbbbabbb
ccccccbccc
bbb...

input:

2
82
igwniaoevs
edwhxyajiw
ebgfffoaws
btoorcersq
frmdgpgdqo
dxtagnrpmo
dmtexogtgq
ejnccffgxo
ctxgonxicm
ckrdkqdpyw
dayvlsvpdg
tkevpgbnts
zjyqvualea
zhpcvldihs
dsvlrkqqci
xwecartrro
xeixvxbuns
ufahtcdcpk
anmowehqqs
ylwykqmgau
dgvkqkzvic
fzeamoxpxm
fbxzenbegs
bzpfntvihi
eczobolvms
cdkjpmoruu
zstksvuar...

output:

yuwzktjdrc
yfihtbkrey
wbithmkurg
ewtotbhhaq
jtenxqxtma
zkjmlwrrqy
mpywkevsts
ztefkvfbqa
cgkpwdvefq
eznppnixle
cuqxrozrju
tiuocdhkum
ohvjovncai
uonhzyvysk
euzyrfhamw
bskwtuxsew
ybvuoxuyng
czbnrrpeui
wzloieejvi
scslcbvzcs
hzqfkiwwts
mvjeokyqnm
vlwucapqua
yownhgmhcm
wonxbbzsiw
mvkghagscc
karutbwkjw
ilh...

result:

ok 100 lines