QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#192372#7518. GCD of Pattern Matchingucup-team1004#AC ✓189ms3844kbC++141.2kb2023-09-30 14:23:082023-09-30 14:23:09

Judging History

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

  • [2023-09-30 14:23:09]
  • 评测
  • 测评结果:AC
  • 用时:189ms
  • 内存:3844kb
  • [2023-09-30 14:23:08]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
template<typename T>
ostream& operator << (ostream &out,const vector<T>&x){
	if(x.empty())return out<<"[]";
	out<<'['<<x[0];
	for(int len=x.size(),i=1;i<len;i++)out<<','<<x[i];
	return out<<']';
}
template<typename T>
vector<T> ary(const T *a,int l,int r){
	return vector<T>{a+l,a+1+r};
}
template<typename T>
void debug(T x){
	cerr<<x<<'\n';
}
template<typename T,typename ...S>
void debug(T x,S ...y){
	cerr<<x<<' ',debug(y...);
}
using ull=unsigned long long;
const int N=18;
int T,m,n,k;
ull v[N],vis[128];
char a[N];
void get(){
	scanf("%d%s",&m,a+1),n=strlen(a+1);
	ull now=1;
	for(int i=n;i>=1;i--,now*=m){
		vis[a[i]]+=now;
	}
	k=0;
	for(int i=1;i<=n;i++)if(vis[a[i]]){
		v[++k]=vis[a[i]],vis[a[i]]=0;
	}
	if(k==1){
		printf("%llu\n",v[1]);
		return;
	}
	if(k<m){
		ull ans=0;
		for(int i=1;i<=k;i++)ans=__gcd(ans,v[i]);
		printf("%llu\n",ans);
		return;
	}
	if(m==2){
		printf("%llu\n",v[1]);
		return;
	}
	ull ans=0;
	for(int i=1;i<=k;i++){
		ans+=v[i]*(i%k);
	}
	for(int i=2;i<=k;i++){
		ans=__gcd(ans,max(v[1],v[i])-min(v[1],v[i]));
	}
	printf("%llu\n",ans);
}
int main(){
	for(scanf("%d",&T);T--;)get();
	return 0;
}

这程序好像有点Bug,我给组数据试试?

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 3596kb

input:

5
10 ccpcccpc
10 cpcpcp
10 cpc
4 cpccpc
4 dhcp

output:

10001
10101
1
65
3

result:

ok 5 number(s): "10001 10101 1 65 3"

Test #2:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

30
2 ab
3 abc
4 abcd
5 abcde
6 abcdef
7 abcdefg
8 abcdefgh
9 abcdefghi
10 abcdefghij
11 abcdefghijk
12 abcdefghijkl
13 abcdefghijklm
14 abcdefghijklmn
15 abcdefghijklmno
16 abcdefghijklmnop
16 a
16 ab
16 abc
16 abcd
16 abcde
16 abcdef
16 abcdefg
16 abcdefgh
16 abcdefghi
16 abcdefghij
16 abcdefghijk
...

output:

2
1
3
2
5
3
7
4
9
5
11
6
13
7
15
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

result:

ok 30 numbers

Test #3:

score: 0
Accepted
time: 0ms
memory: 3784kb

input:

12
10 abccbaabc
10 abcdeedcba
10 abccbaabccba
3 abccbaabccba
4 abcddcba
4 abcddcbaabcddcba
5 online
5 onlie
6 online
3 ccc
10 ccc
16 aaaaaaaaaaaaaaaa

output:

3
11
11000011
2920
15
983055
1
2
1
13
111
1229782938247303441

result:

ok 12 numbers

Test #4:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

21
13 abcccbbaccca
11 abcdcdeebdcdca
15 abcdcdeebdcdca
11 abcdcdeebdcacd
15 abcdcdeebdcacd
12 abcdcdeebbae
14 abcbadcbabcd
14 abcbaccbacbb
14 aaaaaabaabbab
10 aaaaabaababbb
9 aaaaabaababb
14 aaaaabaabbaba
10 aaaaabbaabaab
11 aaaaabbabbaabb
14 aaaababbbbbaba
12 aaaabbababbb
12 aaabaabbabab
13 aabaaab...

output:

183
4
4
4
4
1
38221
183
1
1
820
1
1
12
24326193
145
133
157
1064
1
145

result:

ok 21 numbers

Test #5:

score: 0
Accepted
time: 0ms
memory: 3604kb

input:

21
13 acccabbcccba
11 acdcdbeedcdcba
15 acdcdbeedcdcba
11 dcacdbeedcdcba
15 dcacdbeedcdcba
12 eabbeedcdcba
14 dcbabcdabcba
14 bbcabccabcba
14 babbaabaaaaaa
10 bbbabaabaaaaa
9 bbabaabaaaaa
14 ababbaabaaaaa
10 baabaabbaaaaa
11 bbaabbabbaaaaa
14 ababbbbbabaaaa
12 bbbababbaaaa
12 bababbaabaaa
13 bbababa...

output:

915
4
4
4
4
5
38221
183
157
79
5740
157
79
516
24326193
1015
665
785
1064
11
1015

result:

ok 21 numbers

Test #6:

score: 0
Accepted
time: 0ms
memory: 3532kb

input:

96
15 abbbcaacccba
16 cabacaabbccba
16 bcbbaaccabcba
16 bbccaacbabcba
16 bcbabbccaacba
16 abcacbcaccbba
16 accabcbabcbba
15 ccaaabccbbba
15 bbaaabbbbbba
16 abababbbbba
11 abbaabaabbbbba
16 ababbaaabbbbba
16 abbbaaaabbbbba
11 bababaababbbba
11 bababaabbbba
12 aababaabbbba
15 bbaaabbbba
16 aaaabbaaabb...

output:

416
157
157
157
157
157
157
416
416
89
516
1921
731
86
117
1015
176
731
187
665
2011170
516
785
2989355
40543655
63
67
731
731
86
1921
176
1357265
416
1015
416
416
176
785
731
1357265
516
86
63
1015
117
86
516
731
67
665
187
1921
86
516
516
86
665
63
785
187
2011170
1921
89
117
665
2989355
40543655
...

result:

ok 96 numbers

Test #7:

score: 0
Accepted
time: 0ms
memory: 3688kb

input:

96
15 abcccaacbbba
16 abccbbaacabac
16 abcbaccaabbcb
16 abcbabcaaccbb
16 abcaaccbbabcb
16 abbccacbcacba
16 abbcbabcbacca
15 abbbccbaaacc
15 abbbbbbaaabb
16 abbbbbababa
11 abbbbbaabaabba
16 abbbbbaaabbaba
16 abbbbbaaaabbba
11 abbbbabaababab
11 abbbbaababab
12 abbbbaababaa
15 abbbbaaabb
16 abbbbaaabba...

output:

32
1
1
1
1
1
1
32
32
1
12
17
17
2
3
145
16
17
17
133
402234
12
157
2989355
40543655
3
1
17
17
2
17
16
271453
32
145
32
32
16
157
17
271453
12
2
3
145
3
2
12
17
1
133
17
17
2
12
12
2
133
3
157
17
402234
17
1
3
133
2989355
40543655
1
3
145
1
3
157
1
17
3
133
1
2989355
40543655
157
1
3
3
1
157
145
1
3
...

result:

ok 96 numbers

Test #8:

score: 0
Accepted
time: 24ms
memory: 3672kb

input:

100000
15 abbbcaacccba
16 cabacaabbccba
16 bcbbaaccabcba
16 bbccaacbabcba
16 bcbabbccaacba
16 abcacbcaccbba
16 accabcbabcbba
15 ccaaabccbbba
15 bbaaabbbbbba
16 abababbbbba
11 abbaabaabbbbba
16 ababbaaabbbbba
16 abbbaaaabbbbba
11 bababaababbbba
11 bababaabbbba
12 aababaabbbba
15 bbaaabbbba
16 aaaabba...

output:

416
157
157
157
157
157
157
416
416
89
516
1921
731
86
117
1015
176
731
187
665
2011170
516
785
2989355
40543655
63
67
731
731
86
1921
176
1357265
416
1015
416
416
176
785
731
1357265
516
86
63
1015
117
86
516
731
67
665
187
1921
86
516
516
86
665
63
785
187
2011170
1921
89
117
665
2989355
40543655
...

result:

ok 100000 numbers

Test #9:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

22
15 dacbcbdddaddcba
15 bacdcdddbaddcba
15 bdedacaebecdcba
15 bdddacadbdcdcba
15 baaadcaabdcdcba
15 bdcdacacbccdcba
16 acccacddbbcdcba
16 acaccaddbbcdcba
15 bdbdacabbbcdcba
15 badddcddbacdcba
15 bdadacaabacdcba
15 abcddadddbcbcad
15 abcddabdddcdcab
15 abcdcebeacadedb
15 abcdcdbdacadddb
15 abcdcdbaa...

output:

2651
2651
2651
2651
2651
2651
3003
77
2651
2651
2651
241
241
241
241
241
241
273
1
241
241
241

result:

ok 22 numbers

Test #10:

score: 0
Accepted
time: 0ms
memory: 3676kb

input:

237
12 aaaaaaaa
12 aaaaaaaaa
4 aaaaaaaaaa
13 aaaaaaaaaaa
16 aaaaaaaaaaaa
6 aaaaaaaaaaaaa
6 aaaaaaaaaaaaaa
14 aaaababbbbbaba
14 aaaabbabba
8 aaabaabbbaa
4 aaabaabbbaabba
11 aaabababaaaa
7 aaabababbabbaa
16 aaabbabaabbbaa
3 aaabbbaaba
7 aaabbbaabaaa
11 aaabbbbabbaa
5 aaabbbbbbaaa
8 aabaabbababa
7 aaba...

output:

39089245
469070941
349525
149346699503
18764998447377
2612138803
15672832819
24326193
75
89
145
14763
58
1921
44
208
156
3906
285
312
13
30583
70
16
29
468799645
58593
55
113
65
13
29
43
203
665
46873
1460
232
21
2343
65
516
73015558161
2380
51
32
1555
187245
53
35
116
1015
52
2121
285212689
78
4156...

result:

ok 237 numbers

Test #11:

score: 0
Accepted
time: 10ms
memory: 3680kb

input:

30580
14 aaababbbbbaa
14 bccaaccccbaa
6 ccaacbabbbbbbcba
11 bedadacba
8 dgfceaedabcbaa
13 ebdeeabcdcba
15 aabacacaacccccba
3 aababaaaaababaaa
16 acbbabbbbccba
16 accbacbcccba
15 feddcbafeddcba
13 baaaacacabcbaa
9 dcbaaaaadcbdcba
7 bbbbabbbba
15 acdddbbaccba
5 cacbaabcaaabacba
16 dabadcbcdcba
7 babab...

output:

197
45
9079
1
1
5
17
65620
53
3
170859376
29
31
16808
241
204
65793
2
117650
2651
1
7568149
248833
1
513
3
1285
3003
19136585
11
1
1
17
1
77
2
3
2
58
1111
82
22049
62
328
13
20
32045
244
33
1
65
1
1000001
1
3003
1
3003
290730444229
1
1
1885
1
7
823544
50401
93
1
116
14065
532171
1475827473
183
78
1
...

result:

ok 30580 numbers

Test #12:

score: 0
Accepted
time: 6ms
memory: 3788kb

input:

19914
9 abaccacbbcba
5 abcdebadcbed
12 hgfedcba
14 abacdbefgfhgib
13 abcdefdabcdefd
9 abbaabba
11 abcddbbcacad
5 aaaaaaabaaba
6 badcfefedcba
13 faedabcfcedcba
12 eabbecdccaaba
7 abcdefdefabc
5 abcdcdddddab
7 abcccdbddcbadb
9 cbbabcbaccba
16 abaaabababbbab
16 abcacccabcbbba
11 abcaddeddebc
6 aaaaaaaa...

output:

5740
601
1
1
62748518
65620
133
126
185
29
1
344
26
8
73
17895697
1
1332
15672832819
273
1
4161
11111
1
69810262081
1085
4
2
1
31
257
8
1
1
3
121
65793
1
1
1
2
1
1
273
10
10
2
7529537
105413505
452
1
37
1
730
164
85
252
1
1
8
11
1
1001
1
156
1
3
2
11390626
3
4
89
1
17
10
67
2
3
3
8
17
30941
13
49155...

result:

ok 19914 numbers

Test #13:

score: 0
Accepted
time: 20ms
memory: 3836kb

input:

100000
7 mkjpmkjppkjm
13 ybyzybyzzbbz
14 ifvnvifvnv
6 gpgggkkkkppkgk
10 werrrrrerewe
4 ssbsbbssbsbb
8 oinyydinnodn
14 qtttqqtttqqq
5 mpmmpmpmpppmpm
16 cymwll
9 cwmwmfwfwycy
13 tqqttqqt
7 qqrrzqqrrqzr
4 utuugtyutyygtu
6 gkbzkb
6 ifypccpyfill
11 bhyhsssshbyshs
9 mxmxmxmxmxmx
4 eexemmmxxxem
4 ejeedjddj...

output:

57
20
537825
29
101
12291
9
3165
3
1
82
399868
2353
29
1
35
2
3530369206
85
1
1
1
5
364
105
241
2
1001
665
1
43053283
28
1
366
157
4097
806
1333
16
2380
4
1
730
54466
170859376
1
5
20593
7
65
597871
9901
28393
4
14
13
197
268435457
26
1
197
1
1
182
3
2
391251
1885
1000001
1
3
17
3
1
1
49
16
1
32
274...

result:

ok 100000 numbers

Test #14:

score: 0
Accepted
time: 30ms
memory: 3548kb

input:

100000
11 fnffffxxxfnnnxff
4 tvo
5 zuuy
8 dzazddzdddzddzaz
9 xxsxxssxssxs
9 oiuooiuo
9 cycycc
11 eueuueeseususues
13 gtjvwuyvwuyvgtjv
9 sqssqqaqqaasaas
11 rrrrrr
13 vlvlvvvlvvll
10 tsttpptwwsspttw
14 ninmnininimimmni
10 hyoyqhoiobzywqh
9 sxjgibgeojixl
5 lylwlwlw
7 yyrsvsatvaasvyrt
14 wqqqqwqwwqqwwww...

output:

1464
1
1
4097
730
6562
2
16
28562
7381
177156
785
3
591
1
1
1
1
697
16
257
73
6481
77
1
14521
1
15
1
1
145
785
1
1
15
2
257
1
137858863143
164025000064
1
183
2
11
1
1
1
1
13
1
1
24888
1
6
3003
288240100
45
3
391251
16
128
1
91
1
64
4369
15
2
3
113
3
7
16
1
1
1
13
1
16385
40
1
65537
820
1
8
14
1
17
1...

result:

ok 100000 numbers

Test #15:

score: 0
Accepted
time: 24ms
memory: 3588kb

input:

100000
13 irqnk
13 hfknacfcqcncqn
12 pasppdsdcwt
14 jdceaecccejade
13 ppjppfmttjttfm
13 ndedewndedew
13 axpbbjpba
15 ytsfxaseeae
14 hfoppnhhbf
13 npxdxdnp
14 ztvnqluxzmoucz
13 ggfxfxsssfxg
14 lslmsqquszqml
14 attfgtfa
16 uglmtlmtdugd
13 lazualviuzibbv
15 easvosovoeav
12 zmrjoomrjz
14 usufqmqsmfmm
13...

output:

1
1
1
1
98
4826810
1
1
1
170
1
183
1
1
4097
14
211
13
197
53
4
1
16
15
1
1
38613
15
35831809
1
1
211
28393
226
4097
2745
43
157
1729
1
2
14
16777217
1
16
38221
1
1
1
2985985
1
1
2
157
16
53
273
1
4826810
1
2
273
157
38221
1
211
1
13
170859376
7
1
1
371294
50851
53
1
1
1
1
1
3
98
1
13
537825
1
28393
...

result:

ok 100000 numbers

Test #16:

score: 0
Accepted
time: 23ms
memory: 3560kb

input:

100000
15 cococcciccio
14 tqskqskqssqkkt
12 vfbvbwfbwbiiff
12 waaawwawaaaw
14 hwwwwwhhhh
15 aaaaaxxbxbax
16 otpddvhothvp
15 hhsdihddhkoxs
16 faourogfggff
15 jottjtttjtot
14 vhwuwwwvhwhwuh
14 jjqqqqjj
13 giiigiiiigig
15 hhhsssshshhhhs
13 orraoobaarbb
12 xrjbrjrbrxrb
12 kkqqkkkqqkkq
13 gfttgffgggtg
14...

output:

211
15
13
1
41371
226
17
1
1
211
15
2955
28
16
183
133
20593
183
540765
1
14
4829007
15
2745
183
1
373660
5
1048577
38613
98
1
183
1048577
1052929
7
1
98
2
2
7
50626
1015
170859376
187
35831809
4369
11
1
30583
8
2
13
250705
1
3
4826810
13
50401
15
11
4826810
65
30583
762976
1921
183
273
41371
1
2432...

result:

ok 100000 numbers

Test #17:

score: 0
Accepted
time: 31ms
memory: 3588kb

input:

100000
16 xbwbpxbwbpxbwbp
14 xdeeeexdxdxddxxx
15 ftngoxoxngft
13 ooooow
12 kotkbyktykotyobt
16 lugfwllugfwl
16 izfkfzzkkfifffi
12 iyaveivbbc
15 jeoyootteoyj
13 xkmmmrmmhxxxkmhr
15 gshgghhwbhsssgwb
14 joqdwkqwokdq
16 whdwhwhdwhwhddd
16 dsencgesdecsnpg
16 ccddccccdddcdc
13 ynyfvnnynyfv
14 jlezlwleeezj...

output:

1099512676353
3
226
1
5
16777217
273
1
16
2
16
1
5
1
113
14
15
3
1
2
815759283
371294
1
2745
157
1
1
1
2
1
1
4369
17
1
3003
1
157
23298900881764
38221
1
3
50626
32
1
1
3
77
1475789057
1
1
170
28562
65281
1885
1
1
35831809
883306230
1
11441476
1
1
3006865
2
1
1
53
1
1
1
241
62748518
65537
1
1
1
14
20...

result:

ok 100000 numbers

Test #18:

score: 0
Accepted
time: 30ms
memory: 3596kb

input:

100000
16 pssssspssssssps
12 rsssrc
12 llaaflfaffff
14 pgivzqqqqgivzpqp
14 pnpnpppnpnnnnppp
13 qqqqqqqqqqq
15 jjgjjjgjjjjjjgjg
16 qcccccqcqqqcqcc
13 haahahhhah
16 pgpggzzzppzpzgz
14 jjljlllljljljjj
16 rrorrooorrorrooo
16 hezhhezhhezh
12 tnccrcn
14 lrrrrlrrrrll
12 beojbeojbeoj
13 uzxtmyglmzgy
12 qqnn...

output:

3
1
157
1
123
149346699503
64
3
22
1
1
73014444049
4295032833
1
8865
430002433
1
1261
3003
273
399868
1
2745
665
183
1
24326193
226
187
157
1
3
273
20
7568149
157
1
1
145
85
2
1
915
2562890626
2
429981697
1
7568149
1
1
2198
273
1
1
197
1
1
197
1
13
1
10
1
2
228496
17
799736
1
255
3376
16
3
16
1
1
21...

result:

ok 100000 numbers

Test #19:

score: 0
Accepted
time: 98ms
memory: 3824kb

input:

500000
16 rbrbrbbrrbbrrrr
13 sassssaasaasaas
3 zz
10 zzzzz
6 bibbibbiibiiibbi
10 ppppppppppppppp
2 xxmxmmxmmxxxm
12 rrrrrrrrrrrr
4 ccoc
12 pppppppppp
2 kkkkkkkkkk
10 bbbbbbbbb
8 vdd
5 ooooooooooo
15 xuxx
14 saassasaa
15 n
3 ddddddddd
7 hhh
10 yyyyyyyyyyy
2 l
5 eeeeeeeeeeeeee
10 kkktttttkktk
15 sssss...

output:

3
1
4
11111
119
111111111111111
6734
810554586205
1
5628851293
1023
111111111
1
12207031
1
1
1
9841
57
11111111111
1
1525878906
33
54241
1
1093
43
1
7
3
11
31
6
1
29524
1
1
111
1
1
273
1
469172025408063616
299593
13
4265491084507563
1
883708281
47989
1
1
14
8
31
116719860413533
597871
1
1
960800
610...

result:

ok 500000 numbers

Test #20:

score: 0
Accepted
time: 105ms
memory: 3828kb

input:

500000
11 llbbbbblbbbllbbl
13 lbl
14 oeoeeeeoeeeooo
5 phhpphpphh
11 dtttt
5 oooooqqqooq
8 jf
8 aaaff
14 ubbubuuuububbub
15 ssssssssfffs
3 zzqzqqzq
3 nnsnnnnsn
9 kokookkok
4 ccscscccccsss
7 iimm
7 caccacaacaaa
6 xffxfxxfxffxfxxf
15 qn
10 qr
4 tftftftftfftfft
16 iffiiififiiii
6 sssbssbbb
6 ajaaaaj
5 y...

output:

2
1
15
781
1
1
1
1
1
241
40
1
1
1
8
1
435020803
1
1
1
1
1
1
6
1
1
1
1
1
1
1
1
17008
7
1
1
1
1
47909
1
1
1
1
1
1
1
1
1
1
1
5
15
1
1
2
1
1
1
1
1
1
1
1
1
1
1
7
1
1
1
1
1
1
10609328380
1
1
1
1
5
1
51
1
1
1
1
11
12291
1
1
1
1
1
1
1
1
183
1
1
197
1
1
126
1
1
1
1
1
1
1
175
1440
1
1
1
1
23
1
3595
1
22
1
266...

result:

ok 500000 numbers

Test #21:

score: 0
Accepted
time: 101ms
memory: 3684kb

input:

500000
13 qqrqdddqdd
13 fnnfffnfccffcfc
15 dddd
4 ppppppppppppppp
12 okkkokkkkkkkoko
10 g
16 oooooooooooooooo
9 sjssjjs
7 zzzzzzzzzzzzz
15 eeew
15 qwjjjw
14 yyiyyiiyyiiyiyyi
3 nhhhhnnnhhhn
14 eneeneneeneen
9 qr
8 hh
16 uufulufullul
3 jjj
15 x
16 hhhhhh
7 m
10 jjjjjjjjjjj
14 zzpppzj
10 bbbbbbbbbbbb
1...

output:

1
1
3616
357913941
1
1
1229782938247303441
1
16148168401
1
1
17
1
1
1
9
1
13
1
1118481
1
11111111111
1
111111111111
1
22621
1
1
1
1
4594972986357216
113037178808
62748518
1
2745
1
231627523606480
183063616
1
6
1
2859599056870
4
1
10001
1
1
1
156
1
15
1
564221981491
1
2
1
13
1
15672832819
6725601
17
...

result:

ok 500000 numbers

Test #22:

score: 0
Accepted
time: 113ms
memory: 3600kb

input:

500000
16 clbbb
16 ilil
10 ojjv
8 pplplwpwppww
14 ehhchccece
9 bbbobbboo
11 cdddc
10 pk
14 avaavvvavava
8 eeeemmmmem
7 hzrz
5 ssosos
10 umjmmjujuju
7 wbwibwbbbiiibbiw
12 vfvvffvvvvff
3 eeggee
12 brlrbllbllrblll
15 lmnln
8 rgrggrgrrrr
5 zzqzxzzxxqzxxqqx
3 pkkkkkkppkkkkkkk
12 uuouxxoo
4 tvtvmv
16 tbtb...

output:

1
257
1
1
1
91
1
1
1
1
1
2
1
5
7
4
1
1
1
6
5
1
1
1
1
1
5
13
1
1
1
1
1
1
10
1
1
241
1
1
1
1
12
1
1
1
1
1
1
1
3
1
1
3
3
1
1
1
1
1
1
1
2
1
1
1
4
1
4
1
1
1
1
1
1
1
1
1
10
1
1
1
1
10
1
1
1
11
1
1
12
1
12
1
1
1
1
1
1
8
1
2
1
1
1
1
3
1
1
1
1
1
51
1
1
1
1
6
1
1
211
1
2
1
1
2
1
1
1
1
1
1
17
2
1
1
1
1
3
1
1
1...

result:

ok 500000 numbers

Test #23:

score: 0
Accepted
time: 118ms
memory: 3620kb

input:

500000
6 iwciwwcw
7 gsgssslgllggss
3 txtatxxattaxt
7 mwx
15 pjppccpj
4 gybybbbbb
13 mxmxtxmm
15 ccaccffaaf
8 jdjw
4 zzzzzuquzuzqzzzu
5 ycooo
15 byebebye
14 jaamjmmajajaja
12 thtuht
10 qqjjqjqjpqp
14 drwww
7 nzfznfnzff
12 gcz
16 kns
3 xoxxpo
10 hhmwmmmhhwwh
5 ndvvvnvnd
4 wkrw
13 gzyyyzzzygzy
8 auucuu...

output:

1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
11
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
5
1
1
1
13
2
2
1
1
1
12
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
15
1
1
1
1
1
1
1
1
1
4
1
1
1
4
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #24:

score: 0
Accepted
time: 106ms
memory: 3532kb

input:

500000
14 ff
14 feifyyifffyi
11 ppppppppppppp
8 iyiigggigiyyygy
12 hhvhvmmhhfvmhh
10 kkii
14 llflloofflffofol
13 iygiggiyiyyigyyi
16 chcococohco
15 xdddxxdxddxdxxx
16 vvvvvvvvvvvvvvvv
14 ffff
7 ookt
16 zazzzfff
5 la
16 rppppprrprr
10 ccccccc
16 ucuuyjjyjcujcyju
6 v
5 xtgdt
8 agadadaddagdaga
5 rjraar...

output:

15
1
3452271214393
1
1
11
1
2
1
1
1229782938247303441
2955
1
1
1
1
1111111
1
1
1
1
4
94036996915
1
1
19173961
400
1
1
1
1
15
1
1
1
1
1
1
72559411
328114698808274
1
1
1
1
1
1
17
1
10
94036996915
11
1
1
1
1
67546215517
72559411
1
820
628292358729
1
1
16
1
1
1
1
1
177156
1
22369621
2
3
1
1
1
1
76861433...

result:

ok 500000 numbers

Test #25:

score: 0
Accepted
time: 111ms
memory: 3824kb

input:

500000
7 fypiyfyiifpypyff
16 cccccczczzc
10 vh
5 rcd
8 xvvkxvvvvvkxdk
12 tutumo
15 rrrilr
10 bdh
10 tgtwtwggwtwwg
4 btbqqgtgggqgtt
12 fziiiizfiffzzz
16 dndnddeemmnmd
13 hahhaahahaaahahh
9 dydyyy
12 wjajjrjwr
15 ssspzvzpzv
13 cbbcbcbbbbccp
10 vdho
14 lffololofffql
13 wmbbwbkbmmbmkkw
5 tuuuuttuututuut...

output:

1
1
1
1
1
1
1
1
1
1
1
1
8
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
11
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
15
1
3
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
12
1
1
1
1
1
1
1
1
1
4
1
1
1
2
1
1
1
1
1
1
14
1
1
1
1
1
1
3
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
9
1
1
1
1
1
1
1
1
1
1
1
513
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #26:

score: 0
Accepted
time: 126ms
memory: 3548kb

input:

500000
16 dddgggdjgdjd
7 kbzmbbbkkbz
16 lyq
6 zmzzuzzummuuzm
8 eheedhpehpepphp
10 oaeooeaooaoeaa
5 wkip
9 jbss
15 dhfr
13 kffmffrrrfrkmff
4 cffafaf
14 ybq
15 ececeoeeoo
8 uquiq
10 rruluurrlluur
6 vxjjjj
6 eeexxnxsee
9 xqoxcxqoc
11 kckglgllklgkg
9 rqjqqprp
8 jcp
5 cinccen
9 qbqqqjtjqjt
15 ejererll
4 ...

output:

17
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
3
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
20
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
3
1
1
1
6
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
3
1
1
1
1
1
1
2
2
1
1
1
1
1
5
2
1
1
1
1
1
1
2
1
1
1
1
1
6
...

result:

ok 500000 numbers

Test #27:

score: 0
Accepted
time: 121ms
memory: 3608kb

input:

500000
13 oizfz
10 lnenelnlkkkkenk
13 gxrgxrpppp
8 ilcipl
4 lwlgwlgeee
12 httthttxxeht
15 lskksclc
14 qmqqmmbzb
15 nnqqhnzqz
12 cogchg
10 dgzzgggqzzqzqgdg
4 immmmwwwmiiiilm
6 haalelhl
12 ccpwppctwcp
13 lkqkklkhkkl
6 ryhfyyryfhrfrhfr
12 ddcenn
12 oojttotoff
13 ustsssspttp
10 ssfpspfspccfpf
4 uuvfvfuu...

output:

1
1
14
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
11
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
10
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1...

result:

ok 500000 numbers

Test #28:

score: 0
Accepted
time: 117ms
memory: 3616kb

input:

500000
14 pvvvpppp
16 tctmmymtcyssysy
12 pqqztbq
11 somvvmvvvmgvvs
15 iiiiiiiiiii
11 vggtvgln
14 ihiisxxhhi
15 bbb
16 rrrrrrrr
11 llllllllllll
14 jjjjqjqqjjq
7 ggievvyy
7 sssssssssss
8 xuoxux
7 wbbew
16 wxwwxxxxxxx
10 ooooooo
12 wbwbwwwb
7 eaaea
6 ofooffofoooo
9 fjujuuuffjuj
14 tttt
10 mhlbh
14 mee
...

output:

1
1
1
1
617839704241
1
1
241
286331153
313842837672
1
1
329554457
1
1
1
1111111
1
1
1
1
2955
1
1
1
50
1
9726655034461
1
1
2
12
1
1
1
781
37974983358324
111
1
72559411
1
1
1
1
67546215517
1
1
1
1
3
1
1
13
6
1
435356467
1
1
1
1
1
1
25239592216021
1
1
1
1
1
1
1
1
1
1
11
1
1
1
1
1
1
1
5026338869833
1111...

result:

ok 500000 numbers

Test #29:

score: 0
Accepted
time: 114ms
memory: 3828kb

input:

500000
11 yh
7 fqeqqfefeefeffe
13 esycl
11 qbkqkkkqbbbkk
14 vvwvvww
8 lnzlccczlc
16 jcjjkju
9 yhwh
14 lllq
13 kgbb
7 mmiimmiiimmmmimi
6 wyq
11 ztzttzzzzt
14 mppmnmm
12 ppppzz
6 eeeeeg
15 rl
13 oeueumoumooemoo
11 ldyppppdlddyl
10 ioeoxf
15 cm
5 xwpa
16 fifiifi
12 gxbg
5 qqqqttqtttt
11 rrhrj
7 xxxhhxa...

output:

1
3
1
1
1
1
1
1
1
1
1
1
2
1
13
1
1
3
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
4369
3376
1
1
1
1
1
1
1
1
1
157
1
1
1
1
1
1
1
1
1
1
17
1
1
1
1
1
1
1
1
1
1
1
1
4
1
1
3
1
1
1
1
1
1
1
1
2
1
1
1
24
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
12
1
1
1
3
1
1
12
1
1
1
1
1
1
1
8
1
1
1
1
1
73
1
1
1
1
1
1
6
1
1
1
1
...

result:

ok 500000 numbers

Test #30:

score: 0
Accepted
time: 128ms
memory: 3560kb

input:

500000
7 yycctctyc
8 vnxn
11 cbl
8 dndnnygygng
7 ggndngddgvnvvvn
14 vvettttg
7 nzjj
15 cphpchwwkk
15 lyklkyaytaktt
13 ybxbw
7 jljdjrrljdd
9 ghkhkghkkkhkhh
5 abgj
15 vvdvoddvo
10 yqwwqoy
11 xoxkyu
11 lleefoorffofl
5 coycdybb
11 bxzphzb
12 qop
16 rggtgrgtrgr
5 gegeeegle
8 qqxxlqxllqqxlqx
15 httxxhnx
5...

output:

1
1
1
1
1
1
1
2
1
1
1
10
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
8
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
14
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #31:

score: 0
Accepted
time: 132ms
memory: 3676kb

input:

500000
12 llhmllflhfjml
5 gpor
13 fllghhhgfl
14 sdddqchhsq
10 szsziixz
7 iyfmflyyfy
7 gtrgtgrk
13 uzjzjjgggzuggjgu
16 yoiird
7 ttthhotgghfothfh
16 eygyglelxllx
14 zfvzzqvavqaz
16 ohfhhovfvh
6 pxfxxnixnfxiipx
8 ppacdbddpccbbpp
8 jjjfffwor
14 zaaet
12 ycinn
10 cebbgbgceceebcgb
13 rlqlqouuurrouou
5 blg...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
9
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #32:

score: 0
Accepted
time: 128ms
memory: 3672kb

input:

500000
13 pukuqnnpp
11 yqtsqysvtyvvys
5 njpiw
16 xvyxxsyzy
9 sffrzfsszrccss
9 bjuuugjubgguduub
6 rrbbrrjwjbxrjwxj
11 mmjxjbimjjxbiij
5 gagcattgtarrcac
9 phjpjfjjjfhpvfvp
11 stwzswwmzsz
11 ftplss
5 tvjveeecv
14 yeyfhehk
15 gaanwbawwb
9 ucumomcmmyyo
16 xyacooxxya
14 eelnngngzeennl
15 umummiey
11 wwssg...

output:

1
1
2
1
1
1
1
1
1
1
1
1
2
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #33:

score: 0
Accepted
time: 113ms
memory: 3596kb

input:

500000
13 lxqxll
16 aacfaawcxwwwwc
8 mhfakjfj
12 fffffffffff
9 tgftggkg
16 sdxkd
15 ccccccccccc
15 htttojdjbjoj
13 ggrqqr
10 rrcrekell
7 jyjjjyjyjyjjj
12 tvvveffe
7 bbb
7 llll
11 cccccccccccccc
12 wwwrkwkrwrw
10 z
11 pmmg
16 kdnkndnwd
13 iiiiiii
14 hfheb
11 eayul
10 cioii
8 ttt
7 g
10 nnnnnnnnnnnn
1...

output:

1
1
1
67546215517
1
1
617839704241
1
14
1
1
1
57
400
37974983358324
1
1
1
1
5229043
1
1
1
73
1
111111111111
1
1
1
2
1
1
1
1
1
1
1
1
1
2
1
7
4594972986357216
50
1
1
1
1
1
11488207654
1
1
1
1
1
1
259
1
1
41371
19173961
1
1
1
1
1
1
1
1
1
25736391511831
1
1
31278135027204241
1
14
1
37449
78536544841
1
1...

result:

ok 500000 numbers

Test #34:

score: 0
Accepted
time: 123ms
memory: 3560kb

input:

500000
6 il
15 qjn
8 zkdm
13 imbmfrriqfbrrmqb
10 ozomsomosszsomm
6 swxu
14 hohocho
7 xxjjjjxppjxpx
14 xpzjlzdx
15 nnnllnnn
10 zzzzzzzzuuuuu
11 bbbcbxcccbxbx
12 dptxpjjpdxxnjnn
14 ououuouuuouooo
12 jcfpm
13 ssyy
11 jhajadjaid
8 ddbdbbddd
6 liuruirmmrxulxiu
8 iiuuuf
13 kj
7 jzvy
16 rtrrstrstttsstrt
6 ...

output:

1
1
1
1
1
1
1
1
1
16
1
1
1
1
1
14
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
5
1
1
1
1
1
1
1
1
1
1
1
585
1
1
1
1
1
1
1
1
1
1
1
3
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
15
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
3
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
11
1
1
2
3
1
1
1
1
1
1
1
3
1
1
...

result:

ok 500000 numbers

Test #35:

score: 0
Accepted
time: 128ms
memory: 3592kb

input:

500000
10 miimjipijyi
14 beaebeeage
7 sghsshgmnh
12 jerletrjtrle
6 fkkqfvkzkvfqz
15 qhqhzyzzqqjy
11 vygwybvwbgr
6 aqtatatt
13 mieiinnezmeixie
11 wokww
14 gmzmvgzvgmm
14 rwcccepceru
9 mhmhwwbccmtttw
13 ygiy
10 rraikkdazzkiddak
12 wfkxxwzxwwkxw
6 hqhtnt
12 lxnpnxlnn
10 dduduuuuudt
15 tozddnncd
16 zfee...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
10
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
4
1
1
1
1
1
1
1
1
1
1
1
1
1
1
12
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
11
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
14
...

result:

ok 500000 numbers

Test #36:

score: 0
Accepted
time: 127ms
memory: 3656kb

input:

500000
9 xtxtmswmxdst
7 qezv
9 raardeccrsdscrr
10 lhdhhdhvyy
7 vvebhcheebbvefev
7 lwwglatblwlb
6 bbopf
8 onroknqqnkyq
11 amlc
11 wfrqjrfqj
7 drqdz
14 glzltwlwdlg
13 yzozzqzyyoz
13 woowxwwr
6 fecqy
11 vvvtvtcammatccvv
14 pzcczpam
14 mmkigpbg
7 suaqafeq
11 fcszg
6 xxoouomm
10 ksklllswclclk
12 ggwuswkg...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #37:

score: 0
Accepted
time: 135ms
memory: 3684kb

input:

500000
11 ilmtwvtw
11 gvbvgallllaoaoo
6 eckaammm
8 dhwdnko
9 lbouyu
11 kbgrdo
7 bxaxvoapbpvop
14 zqzeggeqzpggeggp
12 kblukkuruqr
16 pooloonnlddloln
8 gkkpxpooxxp
16 lkcrlrchkklr
9 jqpcpbcjbjlcppbq
16 ryvdhdvvhryyy
9 ilvltjrl
6 lllwwiwjjjblil
9 oxjstk
16 rkckkzkrkiizrr
8 fygddiifdynfnffy
6 ayixqqqiqq...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #38:

score: 0
Accepted
time: 138ms
memory: 3592kb

input:

500000
15 vfdnvdffpvddft
13 ttpvpmnj
8 nullszuvlsn
8 iixxaoexxq
15 dajmitmmi
10 wclcnolwoala
16 harhfazfzfaorrr
8 wqcxcgwt
16 sgasmtmgfs
6 eofvovtc
13 xnmkxnukw
13 owwbovht
6 izqazjjqamjamjmm
15 kkgakfjajd
16 rfntjl
6 nsfsmgfimgsi
10 jdmxgyx
6 lwxcxcywllck
12 vqnyknwqk
14 mpfano
13 mjranbmramrrmrjr
...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
5
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #39:

score: 0
Accepted
time: 109ms
memory: 3676kb

input:

500000
11 ycqkyiuy
13 nqqlnvqinqlqn
7 qp
13 y
15 tbkvo
8 mhgmmhmggmgg
15 looooooll
7 aonpwft
14 fvpfpfppfpv
9 wpoprpwppowrrowr
14 fqkkkqfx
11 ppqqqpqpqqp
7 xvxxxxxvvvvxv
11 tt
14 yyo
12 lllllll
8 ocfdeh
11 h
7 pqfsfspqspff
15 xzoz
16 anapnpnp
11 gemk
12 ooblofflbolfof
14 xssnpyysspyjxns
16 hqllrlllr...

output:

1
1
1
1
1
1
241
3
1
1
1
1
1
12
1
3257437
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
883708281
1
3
1
1
1
1
64
10
1
2380
91
1
1
1
1
1
1
183
597871
1
1
1
1
1
1
17
226
1
1
1
1
9817068105
1
10
1
1
1
1
1
1
1
1
1
1
1
1
2955
1
1
1
12
1
1
1
13
1
1
1
1
40210710958665
1
1
1
1
1
1
1
1
2306881200
19608
1
1
1111
1
1
1
1
1
1
2...

result:

ok 500000 numbers

Test #40:

score: 0
Accepted
time: 119ms
memory: 3564kb

input:

500000
14 ldlklwkkdddd
12 tbtheepwhx
11 yhehcmdvd
7 yrddyyyrdyrd
16 ayyssywaayyyrwa
13 qqqqeeqeeeeqee
11 imzimzmzizzm
16 pwfwfpppfppfff
12 wllwwww
16 yyw
14 ufuuufuufffffff
8 bolhhbobl
9 st
15 bcmcbcccmm
16 lngxl
11 cguicbgbcttg
9 uuqquququuuuqu
14 eve
7 usnus
7 wwwsvyssynsn
10 cqgsqc
10 ffmmmfmfmfm...

output:

1
1
1
1
1
98
1
1
1
1
31
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
13
1
1
1
1
1
273
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
101
1...

result:

ok 500000 numbers

Test #41:

score: 0
Accepted
time: 125ms
memory: 3592kb

input:

500000
10 kaudbwaeuw
8 wewjwjejwwje
8 ucrctrkrk
10 xlyiniltddl
10 munmjucmnjjjumju
8 xwu
15 yfu
10 jare
13 whu
8 yyyybtkbybyrftky
15 mbwmiweiwwm
7 pxkdjo
14 zpxxz
8 ndlxlldadl
16 iivjgjjvjgiijg
11 tatattaatiaooiia
7 sxzzix
15 ywlywkjywylljn
12 cvgds
16 rrrrrreeqqer
15 tstlltpru
11 iifrir
7 gdbxkun
7...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
3
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
9
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #42:

score: 0
Accepted
time: 134ms
memory: 3656kb

input:

500000
13 hfippf
11 awfnxf
11 xztxzuzxttuuzxux
10 fxdwgh
15 lnghghtmhttlht
15 jlilrroaiajjcrr
15 prrwrnzooyo
16 yylxhkxdxklb
8 ynbmnz
11 bbcnvcojcj
14 oguysplolp
16 nnzzntnxtxvxv
9 vrhrnvkhk
12 ewpzzzie
9 njjrrrcjjnjrjrr
14 bccwbcmcm
15 exdrz
11 yqztgyt
15 nwwxnxhnaxw
14 omvk
16 wwkkbafnznfwkf
11 rz...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
14
1
1
1
1...

result:

ok 500000 numbers

Test #43:

score: 0
Accepted
time: 139ms
memory: 3832kb

input:

500000
11 eogamjav
10 ttvggglct
7 hiiaahjist
10 avebeoeaevvvoeo
13 eyseyjqsqjnp
16 isyxssiyiwsos
9 ylgyhjpgm
10 kexdxrrdqlkkxqxx
10 kxjtgs
15 jrippgpj
14 jbfiijaoa
11 ggttxiwh
8 fwjqvvqdwjkqwjwf
16 kenykpbk
13 ffvhduhttd
8 jlasp
7 xgmsmllsz
13 yyppsygggzzp
9 kxstkstlrrxg
11 vvbhcwt
15 xnmvgdnbn
16 e...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #44:

score: 0
Accepted
time: 135ms
memory: 3596kb

input:

500000
9 azirveez
15 omojsvvkf
7 ayjhuufjhffsusf
8 ocaorclohccrah
9 ccgcgoyzyzyhoohh
15 opffooxyzsoxpoo
15 fafxyflzfyzo
16 dqejtttfjfejf
11 tnccadx
8 jlcvlbfl
13 eazsaeesjzsjsnjs
14 fntrfererfcknrr
10 uohikhq
15 cscezzcrfr
7 enslbylysmlse
16 hnfrbanafas
9 bxzembmxzesssa
11 rbtxborjooj
10 hnjicujmnn
...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
3
1
1
1
...

result:

ok 500000 numbers

Test #45:

score: 0
Accepted
time: 147ms
memory: 3668kb

input:

500000
11 nqjqsunjwjqwscuj
10 jzzwsgajl
12 zgpzcvvgpccoobbo
7 llqqyeclbfqcb
8 brenllalevrvn
16 adoqdaqdouemeaoq
14 hfekmhjdj
13 xxrrhzqaaal
7 fsczmoox
16 wcxcbkwutt
13 hbdcptvc
8 csmkmxpr
7 ozylubk
13 vxvzxvvpqxrkp
9 etpbqppgy
10 sarfuiz
8 wfmxsrqrr
12 aaqowhjqg
9 smjumtutsay
13 pfywcvvty
13 fedeotc...

output:

1
1
1
1
1
1
1
1
1
1
1
1
3
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #46:

score: 0
Accepted
time: 115ms
memory: 3592kb

input:

500000
16 ppppppp
13 aimiaiammi
12 jnwaenhhhpa
11 eweeeeweaaewa
9 mmmh
15 bobvfvzbeplf
13 r
8 iiiiiiiii
16 yrxrddrd
15 ddhbciicihdbdbi
10 odgdgdmdomddo
16 pwwhiihuupbnpu
10 zcczc
16 xx
12 llhiihhi
11 erricirrlcris
15 wowppupwpu
10 shwhhwhhwh
13 etltl
11 ejeejeejjejejjee
10 lllllllll
14 cnccnnnnnncnn...

output:

17895697
1
1
1
1
1
1
19173961
1
1
1
1
1
17
1
1
1
1
1
1
111111111
1
1
73
1
1
1
1
1
1
1
1
1
17
1
1
1
82
1
1
9
1
1
1
1
16
1
1
1
1
1
2859599056870
1
1172812402961
13
1
1
2955
1
1
1
1
1
1
1
1
1
1
1
17
3
1
1
1
1
1
1
1
1
8108731
1
139013933454241
1
10
11111
1
1
2
1
1
183
1
585
1
1
1
2
1
1
3616
1
1
1
585
1
...

result:

ok 500000 numbers

Test #47:

score: 0
Accepted
time: 127ms
memory: 3600kb

input:

500000
13 gq
12 aaallavvvv
11 izerciu
10 bs
12 hkzsu
8 xt
14 mbmjmmzqjbmj
15 peiujr
14 klmzhrehm
11 jcuyuhpyu
10 duemxmx
11 ssw
10 pqxldlxfqfl
16 qcqf
8 nvxxvm
10 wvotbosbooo
10 nssdnsdd
12 ccyrzbyrbnwbnw
12 kittywqwe
9 ngcffgfgcggng
11 fjquqfqjqjfyjyqu
10 azb
13 gkvkgassvuvkg
12 sr
14 oiddior
16 cz...

output:

1
13
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
16
1
1
1
1
1
1
1
17
1
1
1
3
759376
1
1
1
1
1
1
1
1
17
1
1
1
1
1
122
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
7
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
3
7
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
366
1
1
1
1
1
1
1
1
1
10
1
1
1
1
1
...

result:

ok 500000 numbers

Test #48:

score: 0
Accepted
time: 124ms
memory: 3516kb

input:

500000
11 usl
9 vovvttvvvvvottov
10 jnxdmkkxmxx
16 yjdxkrdyyq
11 qrqyrl
11 zysmcycscczyttms
11 errpg
14 zxlhvoggpzg
12 joorardoj
11 ted
16 ggwfuwwpp
9 prpxrx
13 mva
11 nxbs
15 nnxnmqmlxhhfx
14 wpgno
16 eyurucrc
14 laakgkfuflglhah
9 ffxfqmmiqfq
8 oihtfv
9 opofopmpcff
14 htmszzs
14 vene
12 rlurfhg
8 a...

output:

1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
7
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #49:

score: 0
Accepted
time: 133ms
memory: 3596kb

input:

500000
9 dtqkkmr
10 lzzltlttkkk
14 rnerddaeryvonvyr
10 mwmmwmmmzn
13 ogrugrbprbqmqp
12 jaajsyiislljnjs
15 rlsstsr
11 qqlqgrr
13 lmmorssramvj
16 nxjrw
12 hhzvzihqvhqivz
11 cblkgklanoack
8 junjcnncncnun
9 pkciccjjck
13 nbkgnbeckcebn
13 asmaogxexxa
12 dcvo
10 ttwwlio
16 bqfxpxht
15 nrfllyfyrlrnlnn
8 ba...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
7
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #50:

score: 0
Accepted
time: 135ms
memory: 3844kb

input:

500000
10 enwndwmqqdqemmm
15 ncsumsbnt
13 cbxybav
8 cpahhikddkhicnip
11 rkobkvezvzl
15 iavbgbexavexig
14 ifibddbdbiffx
9 xhfrxrxbwhafew
8 rvhdxkhx
8 lfflxxbbxhxh
16 meejvum
11 kjxuuxw
11 hxyijjyaajpy
16 ulclxuxccg
12 qwgiwtiqqgiqttw
11 jjhjchjnqhcucucu
14 ejyiifhh
14 kpnifwrj
10 wwwwlujwlf
11 sjfae
...

output:

1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #51:

score: 0
Accepted
time: 141ms
memory: 3592kb

input:

500000
14 ehspvmsseibeib
10 artroiq
9 plmczpvkkvfvc
8 oroqneoraqe
11 sdwndnhdhg
16 xfxxbzkjfmzjmx
14 gchsyjagayjgcac
11 jvvgvfhwlfphj
16 ieeicwwssnemwzc
10 lmodwociiiym
8 xbdgkl
12 fhgncgcccnmm
13 shlpwwhqtqdl
11 rsznznuhrr
8 vledhmlmjmhhzdme
15 lhxgdnju
13 enbhbhneemvtvp
11 xykdkqxdc
16 qlljalbhuc
...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #52:

score: 0
Accepted
time: 142ms
memory: 3656kb

input:

500000
8 qsooopuusuuuprsd
9 xpqooplookpllkh
13 rphqbsnub
15 rsgtrlrbrlzwr
8 vueduffftutviiep
14 afbbkfxaery
10 ypszsjyxcje
8 dgadedkaddhv
14 dmeuyzyluf
10 jwvwwjjrrzjzohvw
9 veyyqphqpdhdq
13 rqydvdtpg
16 juxuivvrjjz
15 zzixhlikj
10 rbrqqhlnmlqm
11 xbzvyeazbexabby
12 jgzleblgtjegbe
13 nrcywqi
10 cddg...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
7
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
7
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #53:

score: 0
Accepted
time: 148ms
memory: 3832kb

input:

500000
14 bzfgszssgfxxsfqc
8 jdqagorggajn
13 xtnllftqkfzz
11 mmyxbjour
12 hchzbmdtl
9 pgqunwzqquyp
16 zxsxvcxbbzmvxsd
9 yteqxdqwodqewdye
14 ptsgtkktocoj
10 weatawifwifdyitw
11 zragobglm
16 lhugjmea
10 jmnjntzvrnxt
9 htzmnftfhmofwh
9 ksaoplzn
12 zcpkmvbzkg
8 joohgyahsr
9 chlysifnh
10 tppcnufcauub
9 k...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
7
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
7
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
7
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #54:

score: 0
Accepted
time: 116ms
memory: 3592kb

input:

500000
11 jb
13 ulg
13 ovpzrqtifzi
12 qcgximmjtict
13 plppvl
13 u
10 eu
10 tftvfvddtofvovt
11 leldjvbwlveed
16 ub
9 beabdadbbud
14 ohoohhhohh
14 qq
16 ccccccccccccc
13 kezoa
15 bc
11 ikwgixzdgpwp
16 fttwaftt
14 ubtkau
15 ofoeooefooo
11 hjdjdjjdhh
13 jvyyyy
15 cmemommocc
11 dgnzu
11 haahtfi
12 xmbxbm...

output:

1
1
1
1
1
1
1
1
1
1
1
15
15
300239975158033
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
183
1
1
1
1
1
1
1
1
1
1
69905
1
1
1
1
1
1
1
1
11
2
1
1
1
579195
4
1
1
1
1
257
91
1
1
1
1
1
1
1
14
1
1
1
1
1
1
1
1
1
3452271214393
1
1
1
1
300239975158033
177156
1
1
1
1
1
1
1
1
1
11
1
1
1
1
11
1
1
1
1
1
1
1
1
1
1
1
1
4
40223...

result:

ok 500000 numbers

Test #55:

score: 0
Accepted
time: 124ms
memory: 3596kb

input:

500000
10 xztcztxttzcztctc
16 ftafrrfatfaaft
16 kb
13 nqjdjm
12 jwjjw
13 fafff
10 mguhydtqv
12 mmmmzmmzzmzzm
9 avndvdvav
14 bbbbjjbb
9 uulklnluhlhhunn
15 pc
15 xrgy
14 vk
14 dcbccdbdbbdbddd
11 oxjwqzqla
13 mavmkyeyyem
9 ymmyyy
16 acabjjbjj
14 zolznlozzlono
16 fjjj
11 fffwwwwfff
10 mjzmrmmm
11 midaib...

output:

1
1
1
1
1
1
1
1
1
15
1
1
1
1
1
1
1
10
1
1
1
12
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
73
820
1
1
1
1
1
1
1
1
1
1
1
1
3
1
1
1
1
1
1
1
1
1
1
1
1
3
1
1
1
1
1
1
1
1
1
11
2
1
16
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #56:

score: 0
Accepted
time: 121ms
memory: 3672kb

input:

500000
12 nuv
9 urxfzsxbbwd
15 pbubkjdmtop
11 naantjnctgxxdl
10 aiaadadiaadiiadd
11 wzwzwzvez
12 nqzdvwzqwindz
12 cvt
13 itosdpbtgpsbtdpg
13 jhfyiryiftqyajyq
14 pjm
14 blm
10 gpupgnupnxn
11 bbbbttttwwb
9 mzmozmzgmm
15 amjmxacvnxaanx
9 kkhvvkvccckhh
16 swssh
12 tdldtcccllcttlj
10 erfajerbjaar
15 byu
...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
14
2
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
13
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #57:

score: 0
Accepted
time: 134ms
memory: 3840kb

input:

500000
10 qqpkczzkpqzpzpcz
14 iuutx
10 crmy
15 umkubuudummmmdu
10 rrhjjljsrsrhoo
15 wsayn
9 dbvdqkx
13 mpxlkcra
9 lblzblbzlwwbzbl
16 wakxxkmmmx
13 kwwwnwigiinvpuuu
11 usjsjjpsjpspp
10 dadfef
15 odnngzrogzrgg
9 blqlblqhblullbq
9 pufvo
16 zjnc
14 lnerwreen
12 xbrcxuuzzvrzrxbx
9 wqfgwpsauqrfuqrf
16 jju...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
10
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1...

result:

ok 500000 numbers

Test #58:

score: 0
Accepted
time: 135ms
memory: 3668kb

input:

500000
10 hntbzjqsi
16 xzomtm
10 xdmmvmlmvdvxmvlx
11 jccxuyxcyurx
9 jdbbor
10 ylvelayazs
11 dalicqte
15 ikihrkkynynfkrh
12 odvcma
11 ovjuc
14 uunuaquqaneaqn
13 hzofcohuho
13 clyglhwlqgyhw
16 gygiuatq
14 fyrhbrpphqt
13 kfmflyemyk
15 tfgkgztzfq
10 rcessj
15 kccowhcwzphzph
12 comycxcyxbx
15 qbvqgve
13 ...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
4
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
4
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #59:

score: 0
Accepted
time: 140ms
memory: 3620kb

input:

500000
11 ixknrp
9 xinvtlbwitbs
12 ywfnuvnoiyv
13 sazgut
10 vzledbyyk
11 qdpzjbfkkt
11 xxtezkzyjexzrvj
12 nzgddftntngztgj
12 bqkasjk
9 rixnxwibbwib
9 ikkpniyrgay
15 qbkvavqxuakub
16 ieligeycvy
10 oadbhchobhloa
13 kctvettjeqqe
16 pccvievvdcidpic
14 xoirnq
14 lncgij
11 vvuaymuoztufuy
13 wzyxsjxj
10 rj...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #60:

score: 0
Accepted
time: 138ms
memory: 3820kb

input:

500000
15 szgpassgybszbaa
10 ngbxnghjl
15 njsjjrnsayipz
10 xzkcfeacaizefp
12 kzhxmvla
13 puprujffjcpikupi
11 gztzcvprgrgpzg
12 msjxsmaqhhxr
15 qsnwkwojz
15 rizuavc
12 zgjdbmtd
16 auvlwibuhoua
15 olzvomjw
12 pbswputzd
13 fulmzblaazfplfj
15 eenpookhhnat
9 robmlwlrwfowwzoo
11 lulveebrkjld
14 ddgbnvwreu...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
4
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #61:

score: 0
Accepted
time: 145ms
memory: 3560kb

input:

500000
16 ogaijmovwmx
9 mnowpiaxa
13 gtmmgnajjnnjbij
11 jylifjabfbljql
12 qitqnifdqiithhhe
14 yvhgukds
10 lgvuxivggdeg
9 kudjiikkgcr
16 waugcoihgcct
10 ihulrfllkb
13 lnytcwbu
13 pwdhrnxa
12 tqsusipqmlk
13 rgaukbws
15 liijubtgy
10 ctfcoffidytefci
13 cirtvnepw
11 ypzfaptjyttzw
16 slxeergjcek
15 dotymm...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
4
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #62:

score: 0
Accepted
time: 151ms
memory: 3824kb

input:

500000
13 kkqzzzmqgueth
14 yfjmdsoshtd
15 frxfxyupixbyc
14 gikglvbhcpb
10 ijgcozvap
15 xkaqeuadqxxsi
11 tddtdisuwgcl
15 xchhxmuidfgu
13 vqvvipfffsqsxoh
11 ykilwoydetl
9 bgwszqishwciiqh
16 akckjeiqeincyaa
16 lrgrrlpruvepsavg
9 cpkhrdlfj
9 zlcdpafzgv
10 ygivwsvvdjee
11 dtoptxxddedekbzt
9 johbnsbaiimhm...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
4
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
4
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
4
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #63:

score: 0
Accepted
time: 113ms
memory: 3584kb

input:

500000
14 pi
14 ygyryyxwcsr
10 ddddddd
15 ogadbjogwobawao
16 vkz
14 dodmctdibtfbeo
14 xxxxxxxxxx
12 giwwiwwwcgi
13 lliun
13 rodod
12 wmmmmmwwmwwmwmmm
10 yccy
11 lllll
16 yxvt
11 bomviwld
13 tgtgnmgnuwwtll
16 jjjjjjj
15 rrrrrrrrrrrrrr
13 lll
15 ezzeeee
11 bbltfjzrkj
13 nunnnunnnu
12 oobodooodbd
13 gn...

output:

1
1
1111111
1
1
1
22250358075
1
1
1
145
11
16105
1
1
1
17895697
2085209001813616
183
1
1
1
1
1
1
1
1
8108731
1
1
14
1
579195
2085209001813616
1
1
1
1
1
1
1
1
1
1
2593742460
1
1
1
1
1
1
241
4361070182715
1
1
1
1
1
1
1
1
1
1
1
15
1
1
1
1
1
1
1
1
21435888
1
1
14
1
1
16105
1
1
1
1
15
1
1
177156
11
1
1
1...

result:

ok 500000 numbers

Test #64:

score: 0
Accepted
time: 125ms
memory: 3536kb

input:

500000
14 asualfauwuwwhlu
10 ccckk
10 rrrrllrrlrrr
12 qjqjq
13 ellaeallaalae
13 llfjppoogkgeu
15 mspqjspmgwj
15 rrnmxgx
15 ercuxvjsh
10 eqaueqeaeuubaq
11 vynlc
14 lwatvlc
14 saghhbhgasta
15 uk
11 pnyptwtcucupr
13 fmrkkruvrfg
10 ahmayypmapya
16 ojuqtuorqrnzhnh
10 qirokkgpt
10 qjsavtewwvai
10 zozozzoz...

output:

1
1
3
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
3
1
1
1
1
1
1
1
1
1
1
1
15
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
2
1
1
1
1
1
157
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
101
1
1048577
3
1
1
1
1
1
1
1
12
1
1
1
340
1
1
1
1
1
1
1
1
1
3
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
273
1
1
1
1
1
1
1
12...

result:

ok 500000 numbers

Test #65:

score: 0
Accepted
time: 120ms
memory: 3844kb

input:

500000
13 sdujva
16 ccffdccdcf
15 vwjhxp
12 ujuvevghtphqv
13 xccxffcxcx
12 lppcpsoocoqcqes
12 joimbktjsoibi
14 amdetavkw
15 ljcp
10 tgao
16 tjrqlyioi
14 mmjjn
15 bwzvjg
11 ffbrefek
14 ftdppdptdpfffdtd
15 ftdy
16 hjzdsvfkw
14 haeyttehyhihia
10 rhjuftlkr
16 czoyuvxzg
11 qxnfsyyynssvxqnx
10 kxfvqksrxrq...

output:

1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #66:

score: 0
Accepted
time: 132ms
memory: 3588kb

input:

500000
14 fclm
15 sbsklbg
16 esescsnnsnceecee
16 mmgpegemmemeg
12 qvsa
15 kfhtcckhtjftcj
14 usiwgby
16 rvmyx
12 ejfwecgvffgdvp
11 brbbbbreerzzeee
15 pblqlyysdbp
14 rwwejajqphwmhe
13 wwceceull
11 cyycchpc
13 cvcrgr
11 vpyvmiejkii
11 kopvbttsk
16 chsllsc
15 kcbhocp
12 daavwtvdaty
10 exdmm
13 gnojlkkfb...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
9
1
1
1
1
1
1
1
1
1
1
1
1
16
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1...

result:

ok 500000 numbers

Test #67:

score: 0
Accepted
time: 131ms
memory: 3612kb

input:

500000
16 yecgk
13 dorgjtdd
13 quxmzcw
15 rkebkzr
15 gjpqc
11 rqzbg
12 delhkekkakatdqkl
12 svshmft
13 lbsdddvvbvsblvl
13 hqenjxnfcjqxlfet
16 lutdmld
14 juujpuwpypulyjl
16 sexkmtuknctusg
10 mrzwesvlc
12 qqcxxxmzbmql
13 aqmgw
14 ouhmavxuekp
13 zooqwzwyoqq
12 truwitu
14 ndlwlrylcscldrm
12 ovyakd
13 svh...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #68:

score: 0
Accepted
time: 139ms
memory: 3612kb

input:

500000
15 qbwgnk
15 ivlzrbflbivir
16 htctlwbclcblyhy
13 tvststsavabotaaa
14 yudjrxg
11 umkykqhrul
13 csqtexzfmrcqme
16 aqjcajbcjdxq
12 yhhchgphusgcysep
14 rwvwcqjsaffnsn
11 tkawdgm
11 lzkmgascza
15 fzuklo
13 vynirt
11 sdgwiuhbp
15 mybhpvyvphfvbsh
14 uutctqiicfjuq
12 wbfktnyyywnfbw
12 dludlqurynddg
1...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #69:

score: 0
Accepted
time: 134ms
memory: 3600kb

input:

500000
10 qftsrwigis
13 wxkuhmhmuozpoz
12 eclwgth
13 nzxpuypgujayni
10 vylliiydlrwowpil
14 uqldroprpkyv
13 ranqneaxnixteee
14 atqddmwbwa
14 jcsqvftwa
10 anagoaosnaskanuo
16 rgjmqxt
14 uulcuwlmelfmquf
15 tkdcuvx
14 lhastmejarz
11 kvwltsp
12 vgdpkcpvzzygam
13 dequwatxj
16 xrttoxgtockzokxk
10 dmpbldbom...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #70:

score: 0
Accepted
time: 136ms
memory: 3536kb

input:

500000
11 qpfvphvvhpfybbia
13 zbdjuvws
16 mypttpwjtripptq
14 agislsujh
15 tptlapjdnjponno
15 jpfdlpkpfkathqhj
10 hswypfysoyqq
14 okkvaojqhvqhm
16 fdhbcjpa
15 jnvofuwe
12 inhcwwnznbwr
16 azrcfbislt
13 ghaldjuen
13 rlwhauwrqnzqrmhz
11 lhmmfxmptpxqj
11 szuhrfqbdt
13 ifowdwgqjwxdjxww
13 zjtbvtqfwo
16 fd...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
9
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #71:

score: 0
Accepted
time: 145ms
memory: 3528kb

input:

500000
10 tihhyzdwhxiostww
10 zrczzpsjapabwz
15 vmumrwkikktp
16 jcjforwdufofren
16 svyupnfbw
14 romtkduxh
10 rcdzcvxddddujvir
15 flyqsxuanl
13 kzijnpkejdqp
14 uvjzwbubpqvpyjz
14 pzdchjpnjpaavclv
16 pmjzbtrrhwy
16 zkzorvswrqkfu
12 vohkmyfemovuccem
12 nqyroqpznbe
16 auekldwbof
16 bcgjrqgbnchuupp
11 nh...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
9
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
9
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #72:

score: 0
Accepted
time: 145ms
memory: 3656kb

input:

500000
14 cmddyhhderqfqjry
12 sclqsrcnolulcig
16 olswzeaqroac
16 hlfwgfeojhljqwme
15 rtbojsrlnky
14 vdytrpgvbjlgdl
12 kxrtszsofgrcx
10 gmtkwxovnj
14 icpwacracsxvvur
15 axheheqqasctjzj
10 sayjjkvcwwsxbb
12 pqcpeaavhmiimyh
13 vthazwcpzqdzv
15 smshdluhqfxt
10 rbxtkoxvhhnovtd
16 godvcadmyfl
10 cgfjgwqlc...

output:

1
1
1
1
1
1
1
9
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
9
1
1
9
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
9
1
1
1
9
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #73:

score: 0
Accepted
time: 115ms
memory: 3828kb

input:

500000
12 a
12 a
16 zwtcjtvutwv
15 thmzcsshpenkvv
12 wjpgwpyxoawccmg
14 rr
15 pn
16 lndl
12 oooooooooo
13 fxxcxbtbtjgg
13 vvvvsvpspvpps
13 o
15 ueqnn
12 yguwgg
15 povzcznnoom
12 mwltjuljtpu
14 bogtiajlcgwcy
13 nnnnnnnnnnnnn
13 fonbffbdggnnqdq
15 gw
13 nnmn
14 owowwvvwooe
15 oridonoc
13 ccmqqcq
14 rb...

output:

1
1
1
1
1
15
1
1
5628851293
1
1
1
1
1
1
1
1
25239592216021
1
1
1
1
1
1
1
1
76861433640456465
1
1
1
1
1
1
1464
15
1
1
21435888
579195
1
1
1
5
1
1
1
1
1
3452271214393
1
2
1
1
1
1
1
1
3452271214393
16105
2
1
328114698808274
1
17
1
1
1
1
1
1
1118481
14
1
1
1
1
1
271453
1
1
1
170
1
1
1
1
1
1
1
8108731
2
...

result:

ok 500000 numbers

Test #74:

score: 0
Accepted
time: 104ms
memory: 3828kb

input:

500000
11 ipsppjissspjsj
11 yettgxygyy
16 ftvkbuo
15 tcbyybv
11 wvwuvuuuvuv
16 gdviwfl
11 fhf
11 jrlgxkfelxtmo
12 sdsssdss
13 aj
12 sg
16 sscccst
11 ttnqsnsstqttns
16 vzz
15 mypyhim
12 gagfgya
13 llku
12 qxgorqzjajvg
14 wmfkfwcgge
14 fffofop
13 xdtvrlpvrwitp
14 tmmmffmtm
16 ann
14 ttiyhenqsssw
16 rc...

output:

1
1
1
1
1
1
1
1
20737
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
9
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
20881
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
2
1
1
17
14
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
133
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #75:

score: 0
Accepted
time: 127ms
memory: 3620kb

input:

500000
15 lljnubrbuyyuixab
16 ocjolljc
12 yrsceyybbzpzia
13 qqlpp
12 eksfsee
14 msssnmnmmnssmn
15 ffiibfibofff
13 xpjnmxplssxsl
12 tjx
12 feffrjfejeejeffe
14 lvzgs
11 essesaesssssssea
11 vqqy
13 yqjaddqa
13 mmjldp
13 vkhm
15 blccbllcl
11 cdxdpmpvscvzqpay
16 nhin
15 olgwoxxwtgwtex
14 mkdqq
11 slyfybj...

output:

1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
3
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
16
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
5
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1...

result:

ok 500000 numbers

Test #76:

score: 0
Accepted
time: 130ms
memory: 3600kb

input:

500000
12 gnqbymxiyhgjb
12 sffjuwmnxbtfxr
12 grrlqxylrqtqzz
13 paorjnvjrs
16 ljhlzl
13 mktlcz
11 jcbrsstthi
11 agvgfnqguainyg
13 jmzg
12 tyrooaa
15 tqqqqqwyt
11 yzqrzphkrp
13 ypxiunufdmfuy
16 nnyxneexxyxyeyny
16 fnsti
12 vtsqqo
16 xzagzbz
12 bjgjgggkbkgb
16 ldrxddd
11 qkquucockc
15 qnregrumx
13 kbbb...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
3
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #77:

score: 0
Accepted
time: 129ms
memory: 3616kb

input:

500000
14 tgfew
15 xqeynuqwinxneyq
12 cbyvapojnrnj
15 bqsbrsseebqreq
14 mooiopklnizp
16 oxqezaujrsh
14 otvtopoavt
15 gdton
15 rlthggjzx
11 pzppjdzba
11 ywhxjbfjj
12 nkuypkqkenuu
16 ztntyc
14 pwqnzif
14 nrhdhycyoqneyq
16 ntaaotg
16 acqycevcw
13 mmvvtmatai
11 rubnqzfzkaw
11 jbrhgcxtjmgrkcvc
11 vqkzhag...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #78:

score: 0
Accepted
time: 135ms
memory: 3836kb

input:

500000
12 nlmwswjmjw
15 cilsvwtgnksdnti
15 xbkncdxx
14 wneetci
16 tiyptiwklv
15 cheipw
11 rdzhmhevecxu
15 feucfxnnbjcbem
16 zmpdaeaxccwos
12 uzvmhbu
15 zaxtaxbxlzxb
14 ltcfwljnm
11 drgydpiceydpob
14 wtepqhxmhbm
16 nyjfsgggfyjvyvf
11 hrmdmhnnzffr
11 nnvwwnfubjofl
16 hkdrdhni
16 zhagbakbqzzjhqk
12 bhn...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #79:

score: 0
Accepted
time: 136ms
memory: 3660kb

input:

500000
12 newzqscnwccgj
13 wxxzyhccuzzwyc
11 okelpgkulkpclku
11 cyebfavhn
11 zhxxyjumnlyjeuhe
13 zrnctdeiqt
16 thhpozhpbwwduoj
16 ndybfiapghbi
13 zwzhhubydtdicunw
15 dswhhffxsewtsbfy
12 rinfcyqttpioczo
11 tgcumhcqtde
14 vueodpyjz
14 htatristuxaugwis
12 mhuusorsocohhmr
11 zixpygh
11 hedbtuyh
12 tdpli...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #80:

score: 0
Accepted
time: 134ms
memory: 3592kb

input:

500000
12 npzqchnceoelqo
13 lhlulykbchlheey
11 rjrpbxvxnywbz
16 aqxphlqqpwdht
11 nhazfged
16 lbdfpjsatjtpzas
13 ijxajfzcm
15 fmirltqu
14 qxmlzjuaut
14 efszfzettilh
12 djzoniwqhs
13 wtagzmfljdtlo
11 txombueymyuofikb
12 pufkjbkcgzftn
12 jhirapnlyyp
15 rqtrbzhtntobojkj
13 laiwxkntk
14 pcursfjzejhrro
14...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
5
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #81:

score: 0
Accepted
time: 141ms
memory: 3532kb

input:

500000
16 jqahevtqrcn
11 ttbzqxmyvzwzp
11 vsrxnlvgbslcbgnv
13 eyfuhboyffympcp
13 ejmuaeizswmivav
15 xjbjxcbuuujtjkza
13 upuwmcfhtwsisz
14 vginahcwxccihv
16 exqsqtuxeltvseg
12 sqvqxjgxlroigr
13 ksqgotxbhwe
12 bfzyyiakmvg
12 hqadfmwyncpc
12 jisydesitxg
14 dgpnboyehlcp
12 omafmabkmsitxko
11 nrffwrrbdaj...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #82:

score: 0
Accepted
time: 137ms
memory: 3596kb

input:

500000
15 dpjowepildtoywko
11 mcmftjlwdmwwcbko
13 dcmokprfsiwcd
14 gkkjlgqpjwxfyj
12 shgnfvacby
16 wkzydfgqmofv
15 jdnlrqqyxccgxy
12 ohwucklpiz
15 doynobgustqeq
14 hapnofpdyfmok
12 goizkxwnmb
12 qtnwhsdutisoee
15 nrobrhemlfxa
13 olrdsxmpuct
14 sdmaznuyqhf
16 builnjymvk
14 qyocsjqkjlalhd
13 udzrfpeky...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
5
1
1
1
1
1
1
1
5
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #83:

score: 0
Accepted
time: 152ms
memory: 3608kb

input:

500000
15 yhgkaytudbqao
14 fkzwjgworqah
11 lxhchvetdvpeuw
16 nondllxsmiayib
12 bsfofmclasoazgv
14 uuycgmkzleludp
16 yblnirchfbgmc
15 pftnverhrmlpu
15 sjmubxzgsdxcjfum
16 esngcmeckbmgayaw
15 kifkhmklzjnjyv
13 flhbxilwrkzj
15 wkavlxkbvovfvdu
13 nltyqgcetqtrsi
13 gfvziuohrdw
14 efaregtcqabjzzg
13 wcizi...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
5
1
1
1
1
1
5
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
5
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
5
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
5
1
1
1
1
5
1
1
1
1
1
...

result:

ok 500000 numbers

Test #84:

score: 0
Accepted
time: 127ms
memory: 3596kb

input:

500000
12 ycyo
12 ncnc
14 iutmtmu
16 agwz
16 modfkkhkkdrkfhr
14 nlplp
12 xmjd
14 gcdfmynfz
14 brjhddsznusuwpx
15 omppoampffp
15 vxivrkqbkbqik
16 k
15 rmeqjyly
13 unqeeeiiqgapesih
14 rrrqqrrrqqqqrr
13 anrrnaawrnxwwaxw
14 tccpkrprhnsnhi
16 kkkkk
13 sooxkcrfck
14 ssmxsmxms
14 cccnnennce
12 a
13 yuugluu...

output:

1
145
1
1
1
1
1
1
1
1
1
1
1
1
15
1
1
69905
1
1
1
1
1
1
1
1
15
14
1
1
311505013051
69905
1
1
1
5
157
1
1
1
1
1
1
54241
1
1
1
1
1
1
1
1
1
1
13
1
1
1
3
67977560
1
1
1
1
1
1
1
1
1
1
183
1
1
1
1
1
15
469172025408063616
9726655034461
1
1
5229043
1
1
1
1
1
1
1
1
1
5628851293
1
1
1
1
149346699503
14
1
1
1
1...

result:

ok 500000 numbers

Test #85:

score: 0
Accepted
time: 122ms
memory: 3688kb

input:

500000
16 mmimppmappa
16 uarzcxyeaitfi
16 sslzp
15 bjodbiddboj
15 zyyjn
12 xxxyqyx
12 mvswvibvstpv
14 dftdcazac
16 eeajxxppvjjlxue
14 knyauyes
15 mavxgwzuht
14 lxd
16 nmyakymmacb
13 ohhgxpgofhk
16 kkekeeekekeeke
13 uuhfhu
13 kuufufkkfffkuk
12 hgwnl
12 bqf
12 zvbbzsz
16 aajzgjivv
14 rwwazeiiewywyrer
...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
3
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
14
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
145...

result:

ok 500000 numbers

Test #86:

score: 0
Accepted
time: 125ms
memory: 3592kb

input:

500000
13 xxvxjjvvxjxiv
13 oovgv
12 oswwxwuo
16 alphpq
14 toroortoto
16 lcbejloxxhdb
16 yunp
14 kkadcacaac
12 uuskudufpppuqpxp
13 pgtpzpgugptzmpgp
15 nwbwwnbg
16 carjewhmm
16 lmhcznitsvmj
15 lauwo
13 kigzgss
13 azgazbdpwrayshyi
13 avtvutarhz
16 afxtk
15 xphqxehqreigpclr
16 wxwwxxwttthww
12 qtdtd
16 ...

output:

1
1
1
1
3
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
14
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
11
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
11
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
17
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #87:

score: 0
Accepted
time: 127ms
memory: 3608kb

input:

500000
14 dbjyjubylgehhx
16 cbrg
13 joujlolm
15 lnmd
13 bjrqkzjazxbj
12 dxsvvosv
14 avuk
12 ttvhhatr
16 clmsdsbfwf
14 pithabwnnvsbvqhk
16 zdczovo
12 eiqddkkq
16 boombxbexbe
15 zrsopgm
12 hcjmshhxio
15 uiqxllhhxnxl
12 zjjooijwlny
13 xcjsyccxcsccjs
12 ebebbcea
15 ywwywwnppyonooo
12 gbkgmmbblgbkmm
14 c...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #88:

score: 0
Accepted
time: 132ms
memory: 3616kb

input:

500000
16 rxxdvismlxdpxv
15 mqbmzbbbqmbj
12 jqfhdlfzp
12 jwxckljya
14 zibddzappdz
14 fattastuslutfls
12 ollixxxixliolebo
15 nllncbchhllcnhb
15 rzylytyzytlt
13 upewn
12 fzbpbqkt
16 lbrfezfut
15 csmwgmwnbz
16 olxxlttffotx
13 ypyywyhyrrhprdy
13 rsfsfrsqbfqyy
16 ptsvpdnd
14 askyxvm
12 bfsatmuqtv
14 wdqu...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #89:

score: 0
Accepted
time: 129ms
memory: 3652kb

input:

500000
14 flwxqhzdvm
14 pqiwptidlggoj
12 jrvhhlcgtwpq
15 hydbordiiirbkdo
15 rfoofruokrgrrrn
16 cxihvobcnrkpjo
15 jlpkzd
14 bkpehkexnbnb
15 pwkfduwppggmwy
13 ejdmntsg
12 jsdoufxboigjll
16 menzahykljammh
13 cnhwmdoxuvsp
13 ezmaxupqhhf
12 jkttvcnrer
16 djcrtjmjb
15 slugkblllmbmggk
16 qqqehehncnqqjsq
14...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #90:

score: 0
Accepted
time: 138ms
memory: 3792kb

input:

500000
16 vaapactwjpmhyz
15 mahqjif
13 iqgcgnzghcg
13 qtiwyjxzknv
16 polieolcg
16 lcspuodf
16 anoflkt
13 adhwujwueebbp
13 aebmrjjet
15 bxaewpjz
12 vaeebwtzmjz
12 fmrczhxi
15 kzfgsdwdu
13 fgmvokbku
13 ursjfdau
13 clddiizrcrcei
14 hgkivhwsyel
16 kqshtvdwckfdqn
13 cwhpodm
13 fyoyugllxzbzhz
15 bqlpdzuqh...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #91:

score: 0
Accepted
time: 136ms
memory: 3584kb

input:

500000
12 aqwiowbwuhh
14 mngverqlzg
16 efzliuzbcjta
13 pyrunmzeuaweaz
15 pxarfvcs
13 yzxolcnyxngt
13 gbitfkeypp
12 qzraoyflghzthrco
13 ckbgldmfdlldcgks
16 vknofulajte
16 sjchylnk
13 ifzktcmtl
13 zxjlrkxehu
16 omnaoxqwgn
15 skvvhiaskugatfoo
14 funqpiixfvxkkue
12 qrtlubybbembqhzl
14 iisshyzusoko
16 ho...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #92:

score: 0
Accepted
time: 134ms
memory: 3616kb

input:

500000
14 eflqzhuqklnoeg
13 essvwpugri
12 fgabrskenz
14 sgaejsxkhjojhsk
13 rrjjwomqznfrnr
16 vrmcmgwszyqm
16 jvbplochzljo
13 ekgzxfsceoptrs
13 ikoraxpzrv
16 ejzxnbewmzlmywjg
15 yblpptcffeyytss
14 jrbqgerdxt
14 bimihswsmurlq
13 jkhzwqtupdnw
14 pfwhqawpiqgjocjh
14 tzqjakumf
12 sjwxourqlz
16 tybanvrxhv...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
11
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
11
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #93:

score: 0
Accepted
time: 136ms
memory: 3612kb

input:

500000
16 duewjqemtydtrvs
13 ftxlbuqdrasy
15 kngrhamxye
12 lbcdodnocdntfjqb
16 xjyvnokudrae
13 rkdaphixutkmyt
16 qvfucwszmxqxpwmu
13 gctayxdnewk
12 fobdbpzphuxfix
13 mbjnxlrxirbiup
15 tesgnnwhpkkv
16 fsyziompzfpirzic
15 nbarbihaszgkssro
12 iockahxjcyp
15 hkujhnoevztord
13 wbpdiiydnjnvjgqb
15 dhfxxzo...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #94:

score: 0
Accepted
time: 145ms
memory: 3596kb

input:

500000
14 qpixmtzhoce
12 kznsbqczouvbggr
15 jozgtlexjvuqxq
12 kcqynzailmxi
12 npbwjmtgzcczstvv
16 bnrhxsogaet
15 eybxgkjptqpgf
16 nnyaevjigqbx
13 gifhybkqtnikdy
13 vlhykdpzhmkutm
15 bpeotrwqjkv
14 daujiclroew
12 dfqiukthsnrk
14 pukjspiyygbpbtvn
15 doeqwabnyrf
12 dfvketmmioguov
13 wgifsqlntauuarr
12 ...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
11
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
11
1
1
...

result:

ok 500000 numbers

Test #95:

score: 0
Accepted
time: 153ms
memory: 3596kb

input:

500000
13 zvbwdumsqfjn
16 lnybccjvravgei
14 kaxchihawbpled
14 dhhkartaeuxalyo
16 imeouochbfzvdez
15 vfuaqaittghcvotp
12 qzfetcampafzyov
13 gocumpfqjxkh
15 wyyuidtbaiogzwav
12 oyvmnvliehcjg
15 makwrheoxajpuphh
13 lwctokxxauthbqw
13 wtjgvmngyjyaqlkw
13 jhfrbhdrmcttyls
13 siemzwukdeobq
16 gjcwpiryoanb
...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
11
1
1
1
1
1
1
1
1
1
1
1
1
11
1
1
11
11
1
1
1
1
1
1
1
1
1
1
1
1
1
1
11
1
1
1
1
1
1
1
1
1
11
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
11
1
1
11
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
11
1
1
1
1
1
1
1
1
1
1
1
1
11
1
1
1
1
1
1
11
1
1
1
11
1
...

result:

ok 500000 numbers

Test #96:

score: 0
Accepted
time: 109ms
memory: 3584kb

input:

500000
16 aws
13 zoiqslobkj
15 oooo
13 jsvl
13 ooooooooooo
15 dddddddddddddddd
16 bbbr
13 bbeeebb
16 jyodznaqteqti
13 zwm
16 ijjjj
16 mffmmmsssfsfs
13 bhbvvhvhbbvhhh
16 vrnwnnvf
14 cwcwcccwc
14 iapeappaiinnezta
14 meqdsuaetm
14 inbczprnduxs
13 xx
13 jxjjx
13 cvhntxeazatk
16 knkwkwgk
15 oocszrrwzo
13...

output:

1
1
3616
1
149346699503
469172025408063616
1
1
1
1
1
1
2
1
1
1
1
1
14
1
1
1
1
14
30941
1
1
402234
1
1
1
3616
1
14
1
1
1
1
4803839602528529
1
2380
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
16
1
1
1
67977560
1
1
41371
1
1
1
1
1
1
1
1
1
1
1
1
1
286331153
15
1
1
1
1
1
1
1
1
286331153
1
1589311291
1
1
1
54241
1
...

result:

ok 500000 numbers

Test #97:

score: 0
Accepted
time: 120ms
memory: 3584kb

input:

500000
15 rzqxbc
14 giggamm
16 qfvqmvyje
13 ssekxxzjsx
14 cmmcubucucmmubmc
15 dk
14 drcdrcdc
13 nakpywbsszytjjw
15 tookkbmktttoo
13 nukuuhhehuh
13 gqizykdgjdpgumt
14 lcdycnxozjipa
13 mvhrnmnbvlvldb
15 rhqqwyosjpwrqwnr
15 js
16 ggigiiggiig
14 bjvqjdd
13 nm
16 fqeenspnsn
15 injtivpxuw
14 pppspsp
16 ds...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
6
1
1
14
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
537825
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
3
1
1
1
1
1
1
1
226
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
3
2
1
1
1
1
1
...

result:

ok 500000 numbers

Test #98:

score: 0
Accepted
time: 124ms
memory: 3596kb

input:

500000
14 jycjpyyp
13 ajedofxqjyrghp
13 okhyjadyyh
15 wamw
15 zzqg
13 bbyislpgrtonwa
13 nqpzzripqfndij
13 fitulxr
14 ssqqqqj
13 tokr
16 zvvzhggcymhzm
13 papi
16 vvbu
15 xdvvfuvvuuldxfvd
15 azzzlzl
15 eevvkkkeekveevv
15 bdhuelrngjzs
16 wwcimhbcadhhout
13 gdsscddwqyypgxc
15 btnbzionpswxtpnr
14 glwvvvj...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
16
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
6
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1...

result:

ok 500000 numbers

Test #99:

score: 0
Accepted
time: 124ms
memory: 3612kb

input:

500000
13 pdpdqnq
15 xrvgcekdj
16 szbtyys
15 zffqzffjjbzzjjqz
16 ngekicvuqsr
13 wokx
16 hxtflvkn
14 okdzxujnqb
14 qtehppqyeea
13 uffxfhpp
15 rbdqmrqoqshxshu
13 robxotooxbxrtr
15 ehthttpmr
13 wxpm
16 znllsei
15 gtzqcxwcnfpilu
14 shcodmuyt
16 lpddhcthtudvpzc
14 zdrctvzxl
13 qheche
13 dmjssvduwrh
16 dg...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
6
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
3
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #100:

score: 0
Accepted
time: 129ms
memory: 3600kb

input:

500000
14 uootgxukitkt
13 jssrnlffsfrnjqsl
16 jxrajjrqraqxqja
14 oxuetc
16 zeblxlteeqb
14 qpemg
14 eoobiktpaugien
16 bpjjoeb
13 vkufbjj
14 gggsusgpsj
14 pmmnyncnbbpm
15 bqlwuqtmoe
16 kpjlkipl
16 jsdnz
16 pauhq
13 haizvnxtmn
16 jdykazbsrkxxzkez
15 fgeimgrw
14 olmfquzhtkxj
14 tosfpt
13 mkbrcew
13 hkdh...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #101:

score: 0
Accepted
time: 134ms
memory: 3612kb

input:

500000
16 lkkiyet
16 cgzhndrpr
13 xyzujtdbtjnlei
16 eegzedizzf
16 cheohglvrdp
16 smqkfc
16 vrwgqgigrfj
14 rlovqeaqxvelegjy
14 hukrntv
13 eywmcfbslrph
16 vfblyrgc
13 uwdpsn
13 tcfyknayarhcvww
16 rfgfkekhhrkeak
16 nrfbdjbtfjt
13 huismw
16 mkedvncofqjsn
15 noeqxj
16 zmwivkfz
14 svorbdymgijlq
13 esvmrrq...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #102:

score: 0
Accepted
time: 133ms
memory: 3564kb

input:

500000
15 ozxaghtgr
13 mzumuyzvtsejblhb
13 xfblrjnc
16 zqpykqlpazykpqa
16 yqgncilcctzlky
14 aezpteatpznntwp
13 obyzjkrtbhuvjc
15 ovjenneovceyj
13 posrzsdzw
16 xjusknnh
14 rmhhzctyhrpgnv
15 xmuzepfq
16 geygbakmypn
15 ucqqxyyuxugcw
15 ricsoguv
16 oaozysysefkeak
14 aqthtgjqabbhdh
14 ogaymrlad
16 xcmdnh...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #103:

score: 0
Accepted
time: 132ms
memory: 3592kb

input:

500000
16 ugcplfmvoprhxm
14 wrvaamtouw
16 ugordhjhzj
15 ebzmytczayg
13 lfaenpqjjgl
16 yofzxxjvixxfje
14 ysbtgtvoflciex
16 ueewzurfeqwuh
16 dhgqrcxtk
14 urhzkfgc
15 vxhesrut
15 btnqsesbwoclf
14 tkggpqlspctpobvg
13 kafxnmchglub
14 agskcxrm
14 vkdzijgqrlcb
14 rozdtnpm
16 aebkguxeanhp
16 bcfildqopunj
16...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #104:

score: 0
Accepted
time: 150ms
memory: 3596kb

input:

500000
13 sdbwqkcxrziof
16 oszxzbwfkyfjat
15 evabjsugreyn
16 difutdxompxkggw
16 ogncdwbjxzpk
16 mwqaylzdt
15 nibhckvimpl
13 ahriwlpfpy
16 bhisjlynxybdxvzv
15 cokzgofkpouqcg
15 uqidnkcgnjwsbz
13 ztrxplukspcnq
15 xbkkhimixqbkzn
13 usogqyoaibqfwxr
16 oitmedvna
14 ohvwzecyyeojv
13 kpegikkngxspjhj
15 pxd...

output:

6
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #105:

score: 0
Accepted
time: 140ms
memory: 3560kb

input:

500000
16 vapsdpctuxghdj
13 hkbsajzyvse
16 cfzawkbmgs
14 hjcrlfxxsyu
16 wjdxaqklryuhir
13 ynrqmoikshvxu
14 smtteazfkejssgb
14 dptbqlhrjf
13 mzaribbwkdvdfa
15 wycihsngljec
16 ifspbdluerm
16 jevkzuxabimc
13 jdpphwnikgcdkc
13 axvvishestclhwa
15 mvopiikkcoxnbe
13 xqvliegzhlnctg
16 suctpbhpxdtfpoo
13 cfd...

output:

1
1
1
1
1
6
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
6
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
6
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #106:

score: 0
Accepted
time: 140ms
memory: 3600kb

input:

500000
14 ngcdhgequyupft
13 ziuozglnkhugxfxh
14 upqulamsbebfpbwu
16 ajksqotcfuy
13 lqytbugestamkk
13 aluchkiverwq
14 mncypgfrwkiuftw
16 gfinwjrczvxts
13 ykmdhwgrcmbojsw
15 volnuzfgrymeq
15 wfczbvrsymln
14 ibfdqhcpvxy
13 rtuqymenwik
14 euyddrxrcdnwszyx
13 tlifkvbuyjz
13 snbacffklajhrxj
14 mjytbgkgbsq...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
6
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #107:

score: 0
Accepted
time: 142ms
memory: 3832kb

input:

500000
13 xfpzcvwatheu
16 pjyajsvwckemd
15 qkuospftaryc
13 fkeheyputvoln
16 radgevvlztssipo
15 peugyawncjol
13 jfdlimwcysnt
13 dweghpdbvohdcrj
15 thaemagzmwkpwzxi
14 fphcxvsmrogkz
15 dnjrfspaotpioeez
15 sxfswnqplrctbxi
13 nxwsathjbvpgu
16 quxnbisbaxvafkpc
14 tbmlwqoeptxsz
14 cuhnnyoiaylzbe
16 xguirf...

output:

1
1
1
1
1
1
1
1
1
1
1
1
6
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
6
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
6
1
1
1
1
1
1
1
6
6
1
1
1
1
1
1
1
1
1
6
1
1
1
1
1
1
1
6
1
1
1
1
1
1
1
1
1
1
6
6
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #108:

score: 0
Accepted
time: 153ms
memory: 3668kb

input:

500000
13 ouhstjmpaldke
16 vaundpoxpbjgwt
13 yunkbxjlhocrs
13 ctvadlyqmnrpi
14 ojaasebsdfrcngrl
16 mlpoehnkqbyjod
15 crgvfsqjpbhfwce
14 cduaxingfbjzo
16 qmabxsvpjjqgtwl
14 dliqrkwcguxnei
15 mcbzgqnywdilh
16 xgdlrqruywutvkh
15 kenlkxlyjzmrcba
14 cmeinbyovxipal
16 fvwyabhegnqrp
16 miltvjbqgqdvfoh
15 v...

output:

6
1
6
6
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
6
1
1
1
1
1
6
1
1
1
6
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
6
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
6
1
1
1
1
1
1
1
6
1
1
6
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
6
1
6
1
1
1
1
6
1
1
1
1
1
...

result:

ok 500000 numbers

Test #109:

score: 0
Accepted
time: 116ms
memory: 3820kb

input:

500000
15 qyuqffmunyyq
16 mnpmpp
15 fddffffddffd
15 ey
14 sywpzohow
14 dmn
16 wrykbupijoqx
15 ww
14 xgnny
16 nknknknkkk
16 aqqijpgj
15 vfv
14 zz
16 npf
15 oyyoiylyiyo
14 q
16 wwwwwwwwwwwwww
14 kctar
16 nnnnnn
16 hhhhhh
15 akkkkaka
16 xx
16 ii
14 rrirr
14 fviwptaznqbc
14 pprabpttrb
16 s
14 yyyyy
15 u...

output:

1
1
1
1
1
1
1
16
1
1
1
1
15
1
1
1
4803839602528529
1
1118481
1118481
1
17
17
1
1
1
1
41371
1
226
16
1
1
1
1
1
1
617839704241
1
1
1
1
1
1
15
1
1
1
4097
1
1
1
1
1
41371
1
1
2085209001813616
1
1
2955
1
1
1
12204241
1
1
1
579195
1
1
1
1
1
1
1
1
1
1589311291
1
273
69905
1
2745954241
1
1
311505013051
4581...

result:

ok 500000 numbers

Test #110:

score: 0
Accepted
time: 120ms
memory: 3532kb

input:

500000
16 dntvxs
14 oi
15 aaymspyxnysxny
15 kzcmmjlmdz
15 eiiiiiei
15 xiwhz
15 rfbfxbrurggfxcxg
15 ssssk
14 vvvlv
16 lzaeelzlaza
15 mmvv
14 vuvuuuu
16 aoaco
16 gqqqg
16 vo
14 odbv
15 xwixqgxpn
14 ccddddd
14 vnm
16 zaeeoqaanetzq
14 ewccyewqe
16 jjjtttt
15 icuff
14 xbwgbjpgzxap
16 vxarmqdhzb
16 ixxhh
...

output:

1
1
1
1
226
1
1
1
1
1
16
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
257
9
1
1
1
1
1
1
1
17
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2955
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
16
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
197
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
17
1
1
1
1
1
1
1
1
1
1
1...

result:

ok 500000 numbers

Test #111:

score: 0
Accepted
time: 124ms
memory: 3544kb

input:

500000
15 gqdjlayacj
14 crdpqwwhneeuwm
15 llpo
16 rrurx
14 pzynly
14 pty
14 dlrbmwjpwdoqxxpj
16 dlktpilsz
15 wjwqjqjwqqq
16 mipgwbc
14 fvafvn
15 falgbblaifygye
15 ccenr
15 sxgqsqgggg
16 ddydyvydy
16 bmwhzalzvpd
15 ybfyb
14 lvvackt
15 qhhiczcv
14 felvjflf
14 sutkqnjey
15 aaesr
16 ccdddwccwwcddd
15 sc...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
13
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1...

result:

ok 500000 numbers

Test #112:

score: 0
Accepted
time: 127ms
memory: 3556kb

input:

500000
14 qbqzbuuqbezzuzqe
16 oeojbjoejkoj
14 vgagkvzk
15 zvidesifpvqs
15 obrks
14 grmsxpatyxve
16 fycxmjlx
16 oneter
14 udnunnqnqqnduqqq
14 rzajchbptajnn
16 elyaz
16 bhjjbff
15 nzrpskxdtbfya
15 kagxxcurx
15 bvvzser
16 ymuneymnnoov
15 bxiiu
16 mwxsrsmkgxgrrm
16 wmdttzmytzvr
16 hazhuahcclkuk
16 fmykz...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
...

result:

ok 500000 numbers

Test #113:

score: 0
Accepted
time: 134ms
memory: 3588kb

input:

500000
14 ihqhabf
14 vshprelzopme
14 wlwalyzkazlfk
16 cbrdziw
14 kmippcci
15 vardcdr
14 nunndoeb
14 clxigderoqqon
14 mcnoosng
14 asaftwkwaww
16 yswxlivhblzbuf
15 ewwirrrrxjijrmxw
15 jaxucjhybwtkb
16 ngdsqfrhgslq
16 ytskzpkny
16 tnaebabzzbhbnthz
15 oohkhdhrflz
16 dzekydq
16 npcucfiyy
15 kokfmmtymomf
...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #114:

score: 0
Accepted
time: 130ms
memory: 3820kb

input:

500000
16 qlpynxnlusbpqs
16 vtkasqmitwepw
16 jyecrufxkahn
16 xyuemumaaxy
15 dsibvlwoxtijkg
15 drjdngzznd
14 javygmarab
15 bxxtxuobtqqtbua
15 npjotjfyfnpfyta
16 ojzsgzycdwwrkaef
14 wdhmgtx
16 mtixdlkz
15 zsyyimtgiglettm
15 pzjtmx
14 wzpksizgd
16 peezhbxrlplel
15 dgqrodu
15 titjyhvu
14 xxnxdrkrqrqxqk
...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
13
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
13
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #115:

score: 0
Accepted
time: 131ms
memory: 3560kb

input:

500000
16 byqtrcdmn
16 yczqdtzcxoq
14 ftoacuczoq
15 frklrkmxmttzrmr
16 eysjwsjygdxvvd
16 sruzpruvk
15 lqwuvhtzfs
14 ratignog
15 xieyrizt
14 lvayrwi
15 qfsfdsjdhsskdt
16 suexagiklrvdq
15 zvynqjnuybe
15 ttfbvkhhgsqzkzpf
14 fkvuiutvoggkicc
15 mzmmmieouazauou
14 pkcuqbrciwslh
15 hojkuzsqaifcb
16 atjywgu...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
13
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
13
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #116:

score: 0
Accepted
time: 128ms
memory: 3564kb

input:

500000
16 ahkvzptamzhwqguo
15 ykuzhuvkhdp
16 trbcupyvaks
16 tygkstmelcusnuj
14 cbqpwyvhicfjfkbe
15 vgvmksrjheg
14 lnqxlighmc
15 zapqmpocoqqlyi
14 okwrvwydvdl
14 jvsmhkpwgtad
14 gclrwnylnmwmgny
14 rzwfnsuivoxwx
16 wgrfqzzorotwowv
15 knzjkipqh
15 kpbwqhohf
14 kllybmcere
14 qembmbchixphxeb
15 xrsgtycal...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #117:

score: 0
Accepted
time: 133ms
memory: 3784kb

input:

500000
16 faqmyxtcj
16 fhukoycvpbn
14 tefvonpsx
16 zwotkdgjvye
14 damznbrqcxshprop
16 wfnaujtdwkijfhkv
14 fnswyokbae
15 cnpvydtzljxum
14 mxywvazcl
14 chkquzwfned
16 vbtlnmzqhp
15 tnzxcrajy
16 uqjgsbwjdh
16 waoamlmgynawnpg
15 biyowquqhgsmdkc
15 qsjywhpmrf
15 jagmkuzdvxlro
14 whrnpltum
15 javlboyhcqgx...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
13
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
13
1
1
1
1
13
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
13
1
1
1
1
1
1
1
1
1
1
1
1
13
1
1
1
13
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #118:

score: 0
Accepted
time: 133ms
memory: 3844kb

input:

500000
14 lenjfpzxmiuyc
16 ctzjauzrqbsj
14 grcufilkjski
15 kuinhzvvfnrwcaj
16 ctqqqwypfeuxq
16 qwvdkazgpyarmox
15 frlbnnqjzyourzbm
16 mbxsylotetjfkk
15 rycaezqreeeopak
16 ckfwglsorz
16 vshpbewembqundt
16 opkobdvlwfrt
15 yaowrguefcvrb
15 gftdkdpwrqqdzfgk
16 jblieyqcws
16 oltifgxhcqwnqu
15 tzxnpgarlj
...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
13
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1...

result:

ok 500000 numbers

Test #119:

score: 0
Accepted
time: 133ms
memory: 3592kb

input:

500000
15 lgfwntjrpevedis
15 mfbvrcizpeq
15 cgkpxrliyhqo
14 qpnwhsgowdolegg
16 rukgpuxjqihzli
16 pswhodxzunk
15 qnjcgivsotkdnx
16 odusajcqdyqkbj
16 ooywqqufhksaukoi
16 ofbpjvlxvqgrnit
14 aypxmiepgkipxoos
15 pypmsgweokcsuawo
16 dsjhcyokjzgevf
15 fbcedtawpqyo
16 skbjfsxljayaorx
14 lqihxgegdxtyrife
14 ...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
13
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
13
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #120:

score: 0
Accepted
time: 130ms
memory: 3532kb

input:

500000
15 gnbdtmlysxfe
15 heismiyzijtgxqb
16 wrpkragheybfnymq
15 csvifoejlxzcqa
14 xqhodlbrmapev
15 zoxtcjgzigelhuq
15 dfaqzjirhybkw
16 uiwbhltjsnahdbn
14 nsszpfogmrwah
16 irqbilwydwaarhte
15 soxhwubyjetinr
14 vetbghfsomrxdz
14 rkuzbjlfecmo
16 hejspiablwxq
14 unexngbjkfnlqp
14 igbxhewkxujcqf
14 vxhv...

output:

1
1
1
1
1
1
1
1
1
1
1
13
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
13
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
13
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
13
1
1
1
1
1
1
1
1
1
13
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1...

result:

ok 500000 numbers

Test #121:

score: 0
Accepted
time: 144ms
memory: 3676kb

input:

500000
16 sneifvgjvoprgcta
16 rhpgkmwsjufbz
14 usbvnepomrxiwq
15 dhmuisgpryzec
16 ojviahdcntvzslm
16 szzkltobhxferd
14 yzbfglcaxrwium
14 jiaxebhkvnzup
14 iyvqospdbrlnh
14 hagsvqqwkeidznb
14 oyyhfpeaqgdtku
14 vpdquhgtebjrcb
14 ydbrpumfzqhsl
15 uzmdyuknxopehfm
15 kfsjatzxbeqrw
15 ptimlsefarshtgx
15 pa...

output:

1
1
13
1
1
1
13
1
1
1
1
1
1
1
1
1
1
1
1
1
13
1
1
1
1
1
13
1
1
1
1
1
1
1
1
1
13
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
13
1
1
1
1
1
13
1
1
1
1
13
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
13
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
13
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #122:

score: 0
Accepted
time: 151ms
memory: 3612kb

input:

500000
16 wlronxjscdvagt
14 fqntvaclyokdxm
14 fdgzqlvcsjbyik
14 xybdvosmtqlgrw
15 ckwjmtpsohqdal
16 kdscocwtvxebqaj
16 pqsbhwokkhxntvgu
14 vsqfkftidxvornwa
16 iykugnxfpkbohlt
14 bhwfeiordlqajyo
14 mtexsudwciqjnb
15 eswjbqtgpcdvru
16 qkabcgbutfrypsaz
16 djmwrfnozvpulbm
15 vqcpjmgfwyubxk
15 zptsfgkojs...

output:

1
13
13
13
1
1
1
1
1
1
13
1
1
1
1
1
1
1
1
1
13
1
1
1
1
1
1
1
13
1
1
1
13
1
1
1
1
1
1
1
1
13
1
1
1
1
1
1
1
1
1
1
1
1
13
1
1
13
1
1
1
1
1
1
1
1
1
1
1
1
13
1
1
1
1
13
1
1
1
1
1
1
13
1
1
1
13
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
13
1
1
1
1
1
1
1
1
1
1
13
13
13
1
1
1
1
1
1
1
1
1
1
1
1
13
1
1
1
13
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #123:

score: 0
Accepted
time: 118ms
memory: 3656kb

input:

500000
16 scakhor
16 rtdtyjdyuad
16 qqfx
16 qzzqzzqqzzzzqq
15 tekzdhahwtmju
16 vsz
15 wggmmwqqgmqmq
15 pppp
15 vpprcgrcse
15 nnnnnnnnn
15 qdcddooqq
15 nnnnn
16 ycezvxde
16 rzhwvloylsjh
15 zuzyzuzz
16 hfhfhfhh
15 ppzhzpzhaazuu
16 hd
15 tmt
16 sgbmq
15 duddiiu
16 wvyyyfwwlywvllfc
16 vppppppvbv
15 nnsm...

output:

1
1
1
17
1
1
1
3616
1
2745954241
1
54241
1
1
1
1
1
1
1
1
1
1
1
1
1
9267595563616
3616
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
17895697
16
16
1
1
1
1
1
1
1
1
1
1
1
1
286331153
1
1
1
1
1
1
1
1
1
1
1
3
1
1
1
16
1
1
1
54241
1
4369
2085209001813616
1
54241
1
1
1
300239975158033
1
1
2
1
1
273
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #124:

score: 0
Accepted
time: 117ms
memory: 3588kb

input:

500000
15 xwduobgnazscekvs
15 wmmmmllmhwhwll
16 aaybyclhbqulaioj
16 vsokknqzy
15 ac
16 cy
16 ddyrdh
16 ooococcoocccocc
16 niiniini
16 jjaaaa
15 abmuuum
15 oojxtjiw
16 mk
15 bwcziixtvltg
16 tqaeaqqj
15 ojbc
15 jiahbqwlgyquhnuh
15 dfddfmdfmffdfdm
15 cvikkuuvvbvb
15 esesvgnne
16 yycccycccyccy
16 hmxvp
...

output:

1
1
1
1
1
1
1
1
1
17
1
1
1
1
1
1
1
1
1
1
1
1
1
16
1
1
1
1
1
1
1
257
1
1
1
1
1
1
1
1
1
1
1
16
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
30583
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
16
1
1
1
1
16
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1...

result:

ok 500000 numbers

Test #125:

score: 0
Accepted
time: 121ms
memory: 3668kb

input:

500000
16 ltlvtvtvq
15 zjdjj
16 xqou
15 zzvzwccczzwz
16 rqwrwqjlnloqjnb
15 altkqtmx
16 hjpdpkxjkjjxkph
15 uogzoui
16 jdzarjqwauua
15 ggpxrgw
16 abyetqaykcr
15 ynqvh
16 mahkvahj
16 oyooxxyxy
15 uxyrlv
16 rqourcy
15 tubt
16 lcs
15 dccvjdrozcw
15 tadipjaq
16 xngfthw
15 mtfiblkdfxigtnk
16 byqfjqtv
15 vv...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
3
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
7
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
7
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
16
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1...

result:

ok 500000 numbers

Test #126:

score: 0
Accepted
time: 128ms
memory: 3684kb

input:

500000
15 qqjwwdcuimuzebsd
16 xzkygzhiolygnzij
16 zvzphzexvzzpv
16 wuizdcbxvtabqmav
15 sskvqzyqahcdoeb
16 drauxsvnoq
15 mvbbimbms
16 memmejujmjmuju
16 afccwafwc
15 hkhtfbhxrxydqbz
15 vexndxe
16 zrhasr
16 xaukrdu
16 kneexxetxnzxtk
15 iape
15 hbca
16 lsnwcharvg
16 zufvrzdjueuf
16 zcidagc
15 etifiqp
15...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
7
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #127:

score: 0
Accepted
time: 126ms
memory: 3528kb

input:

500000
15 ixzbrmuuzi
16 gansypwinupru
15 yuhroq
15 tecsvudwdu
16 qnatwk
15 mrlggwyahml
15 bbbgenp
16 hcubza
15 cskkvzpgk
16 oqcbdcqnnry
15 kgvqieqpvp
15 rmyxtdzglbo
15 hphngpcpco
15 bbbgbyyjij
16 zbmud
16 mfylmegyhe
15 mvbefgf
16 ysebp
16 tzoteezol
16 oljjnv
15 euuuaueewuuuz
16 rftjxjg
15 ffgoofzx
1...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #128:

score: 0
Accepted
time: 130ms
memory: 3596kb

input:

500000
16 zfsermxmbhwc
16 dquzcgmfy
16 pzppxeeemxzmmgp
15 yyanviviexrwoqvb
15 rkxjcra
16 wiifaauizaauaw
15 wrotpyieuxkz
15 dcumjpmcbuxb
16 ksruwd
15 nwqwsgvbebsx
15 gruanleud
15 vbnxcdpfwssyurh
15 ayckreccoiqr
16 lnlimnwngl
15 epaabrsbgmzd
16 htwdbvwt
15 hjivwfbxlqrc
16 kqzlac
16 hhgvflxvubby
15 iik...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
7
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #129:

score: 0
Accepted
time: 116ms
memory: 3556kb

input:

500000
16 ultwbhypqbe
16 ozhgzxthuwougxz
15 oofsxdgh
16 vazudbq
15 rhaftiopkxzy
15 kqbmsreftmqw
16 ikicosntcmki
15 onldfepchwmxquy
15 fthneujpmqzgkd
16 lmmaklnkkvinppl
16 abskqyjpums
16 aaoybyrnsqlsqly
16 efygshuabknlw
16 dwqwrebqhnapvqx
16 oyiyqwozxvmsl
16 fgnlxwqtpujwebmh
15 afevmshg
16 mkuelrcktd...

output:

1
1
1
1
1
1
1
7
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #130:

score: 0
Accepted
time: 130ms
memory: 3616kb

input:

500000
16 reutawnosdqhmyb
16 oyuinqhcwdatf
15 xxqgmfqbzimgbczm
16 lunfsrnigb
15 faivooggwvikpax
15 yzownqwtro
15 xotvtafyukgcl
16 oukubisiiytfyoz
15 pqjwrazfhdsyk
15 jerqfmvowvnulgh
15 khgahqjxpzbw
16 rtolnjzvdlfqsj
16 qiuregrzuuv
16 falkkmgwy
15 tjkxatxmgfjbhzjm
16 pkyihxirwojuzvmd
16 catnekjz
15 z...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #131:

score: 0
Accepted
time: 128ms
memory: 3536kb

input:

500000
15 cyrglhgvoztkqv
16 kvluscklecbmg
15 kqcwodrslucfhi
15 gfnavorkue
16 fcnxpudoiew
15 opilwtnzwei
15 hpfqlisbnjxamq
16 meqkeakneqveigug
15 oeirnyxpxoonxg
15 ogdfnfujuikm
16 ldqvopefw
16 sgnhpjdmriefjah
15 gmkdgfvrhvbc
15 gvdqfbaihbolrje
16 crxtcftzkxttuup
16 rcsxzgrsorgsuodz
15 bmjypyovubfpicq...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #132:

score: 0
Accepted
time: 130ms
memory: 3616kb

input:

500000
16 mtkwlmxedqrcz
15 zoraurtdxzsmu
16 dxmjrhzyuafhew
16 lhpnclzcamovaf
15 pyclswxtrug
16 geibzxxhtkmiftk
15 iwtocmswlmozknkf
15 ylqmcijbdeg
15 alzulzjlwprhmzo
16 zvwdmtqcear
16 kkyonuqdbhxnx
16 vvfhulbjlgoigg
16 arfbphtvutc
15 plwuecwrovf
15 cciibhaeaqraxas
16 gaupfltzch
15 knordmczwauqjs
15 x...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
7
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
7
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #133:

score: 0
Accepted
time: 123ms
memory: 3816kb

input:

500000
15 bafzpfydscpthycn
15 unepxcqhkgiojt
16 yzabexqifhk
15 fkmtvulwmbze
16 ztptdvjsnclqebok
15 swterjcfalg
15 gtjleixcwqfzd
16 vdlbiphkiktmerc
16 rnaebkvlufs
16 egoiprlfbmomdiwz
16 uvhlwtfzpeqvy
16 izbljnwwgqhkpu
16 xyzdeiblrwjo
16 vmuptqvdncew
15 eiyphhwokqcg
15 pwhyzxclluefy
15 ytzbcusvdklq
16...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
7
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
7
1
1
1
1
1
1
1
1
1
7
7
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #134:

score: 0
Accepted
time: 132ms
memory: 3668kb

input:

500000
16 oxtrzdifkwnelj
16 qrxuvrizhceejw
15 bupadytrmksqx
15 oeaikvmfqmybutg
15 jnzxboeirfbkhv
16 svxrxnkohigdw
16 ayvqbcslmjho
15 horqjfwlxvtc
16 lqsoigbjacurx
15 libmsqdanuffzdp
15 mwblfhjkcqgxeg
16 ckphalwyqvgzs
15 ntaulqphbdmf
15 zhwatpngiicdvmb
15 mheznfwdtxbckyj
16 chkadbuyeriv
15 euubvpcxgt...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
7
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
7
1
1
1
1
1
1
1
1
1
1
1
7
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #135:

score: 0
Accepted
time: 127ms
memory: 3788kb

input:

500000
16 hmwtrfrekslzgp
16 acykwqxadfmgne
16 xykunjgtrmacp
16 winyhzsgrimedcqk
16 arywjdfdzghgntuv
15 iseybfltcngmp
15 xulfgeznchipjqs
16 fnvpoudgmjther
16 zrubltqmfvyca
16 drhcpfmnmsbxzoy
16 juxqprbzomsvnk
15 auluqlbyrgifioch
15 mgdirrmiuntoxqyp
16 nuesrvhjlayncmqn
15 elppboztmikwbsn
16 dwxklvzfra...

output:

1
1
1
1
1
1
7
1
1
1
1
1
1
1
1
1
1
1
1
7
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
7
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
7
1
1
1
1
1
1
7
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #136:

score: 0
Accepted
time: 147ms
memory: 3656kb

input:

500000
16 yulvbeviwjmsxgzs
15 jcvrhuzablvpykmx
15 divxabkhgtryioc
15 zolkfrhpnmiqdcy
16 igcfytsksorqnmzx
16 unsfctvlazqpoxj
16 kgcsdxjldwzptae
15 csethlszyicdmgrb
15 ocumemhwbskazpn
16 zaxmchcsqnlujbf
16 szgjrahxpecfkyv
15 cunybphlwemaxqt
16 apsqoklcljebeinx
15 hpbzgknfyiscqe
15 qkhugcestbxyrzm
16 v...

output:

1
1
1
7
1
1
1
1
1
1
1
7
1
1
7
1
1
1
1
1
1
1
7
1
1
1
1
1
1
1
1
1
7
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
7
1
1
1
7
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
7
1
1
1
1
1
1
1
1
7
1
7
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
7
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
7
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #137:

score: 0
Accepted
time: 168ms
memory: 3820kb

input:

500000
15 xzwehbrsciuynok
16 shjrcadpfqtqvglw
16 khzjdupcxtluqmiw
16 wpyvnilofmakuge
16 jwoeizpratcdaysu
16 qxjvyhqdosaegnmp
15 wzfmqtoyprvihbe
15 rcfpznbohabeuwky
15 qwoljfvbcgprhsn
15 jmerpfvyqinwogl
16 npqxiarohvkcfet
15 mcdphrbwfayvjsu
15 lazucsxrwbdnoty
15 iyajxpdseqhlckos
15 ceiwfopdxkzyurt
15...

output:

7
1
1
1
1
1
7
1
7
7
1
7
7
1
7
7
1
7
1
1
7
1
1
1
1
7
1
7
7
1
1
1
7
1
7
1
1
1
1
1
1
1
1
1
1
7
1
1
1
1
1
7
1
1
1
1
7
7
1
7
1
1
1
7
7
7
1
1
1
1
1
7
7
1
1
1
1
1
1
1
1
1
7
7
1
1
1
1
1
7
7
1
1
7
1
1
1
1
7
1
1
1
1
1
1
1
1
1
1
1
1
1
1
7
1
1
1
1
1
7
1
1
7
7
7
1
7
7
1
1
1
1
7
1
1
7
1
7
1
1
1
1
1
7
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #138:

score: 0
Accepted
time: 117ms
memory: 3832kb

input:

500000
16 d
16 rfzxzzbfyzbrzxxb
16 dsdkissmzimzmk
16 pwxjtkvlhgbgc
16 vpttptvvtmmmtm
16 atacjrjehajweeyh
16 owonswcxsyxo
16 lzmbuiszmcssu
16 lmmqmllqmqmqqlq
16 nnn
16 ggg
16 jhjjhjhhhtttt
16 vkv
16 grpi
16 xb
16 jjiukfijkgki
16 iithttvhuvi
16 arra
16 rxobrroesbobr
16 dawwaawdda
16 ssysy
16 cjqvcvqfj...

output:

1
1
1
1
1
1
1
1
1
273
273
1
1
1
1
1
1
17
1
1
1
1
1
1
4369
1
4369
1
4803839602528529
1
76861433640456465
1
1
1
273
17895697
17
17
1
1
1
273
1
1
1
1
1
1052929
1
1
17
1
1
1
1
1
1
3
1
1
1
1
1
273
4369
1
1
69905
17
1
1
1
4369
1
1
1
1
1
1
1
1
17
1
1
1
257
1
1
1
1
1
17
1
1
1
1
1
1
1
1
4369
1
1
1
69905
1
1
...

result:

ok 500000 numbers

Test #139:

score: 0
Accepted
time: 124ms
memory: 3788kb

input:

500000
16 dwdznwvvdotx
16 qmiit
16 lllifiiliffii
16 tbavhbtyvybbaba
16 xbxjbdswhfpwrbzh
16 auvakuooqkhahwo
16 ixuunzmpdumwnw
16 gtzfasyowrevpxhk
16 umzuxgp
16 oomoomooomom
16 omzwkszqzmqkq
16 tpa
16 umijplgwdxv
16 jjeqjjq
16 iillll
16 dfddff
16 howtxdouuufput
16 vysgo
16 iihxdvbdnvuylu
16 pccpc
16 v...

output:

1
1
1
1
1
1
1
15
1
7
1
1
1
1
17
3
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
3
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
15
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
4097
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
69905
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #140:

score: 0
Accepted
time: 116ms
memory: 3680kb

input:

500000
16 wfftqoabg
16 somssssmmomso
16 ejejeexejcxeccc
16 bbmma
16 uvgcr
16 dmcbunij
16 eeeixiexeiexxeei
16 jjtjlllj
16 gjeqqgmqm
16 qfnqdrbxyspokbce
16 qpbspdjt
16 xuk
16 armyicwulbxq
16 jeja
16 lmtnxo
16 dgnsps
16 cvddvg
16 krhmmkmkmhhk
16 qvkv
16 emreorrndov
16 lwjrpclmwrjbgd
16 isgrrlrgrl
16 zx...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #141:

score: 0
Accepted
time: 127ms
memory: 3600kb

input:

500000
16 jevipo
16 ycnjgkdmiqwrbh
16 xbxsoxt
16 pyfnl
16 hzffzw
16 dnlj
16 xpofl
16 ornngw
16 upnav
16 ogoxyryerogkyxg
16 vjhuq
16 ubvovquouubobuoo
16 cdarmdxygpxh
16 kxgjahrw
16 anajnnwwdbadw
16 aozoaiaozoz
16 gunagnn
16 nrzddbrnb
16 yqgaksuhwwzvc
16 tndktdg
16 pdsg
16 btnajryfb
16 oysoksskoks
16 ...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
15
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1...

result:

ok 500000 numbers

Test #142:

score: 0
Accepted
time: 123ms
memory: 3596kb

input:

500000
16 vmvclcxlm
16 repwzatmfxqczds
16 ieqgujc
16 vucpquzuljp
16 jecejlqlj
16 ggoqjpwhgawqjww
16 ktmtluiv
16 pislwswaiiapi
16 zgaufwlqnt
16 uzxcna
16 qncyz
16 tpxhqtalg
16 wwtfyexrt
16 gzctpectpgr
16 jcbvahcyqv
16 gzmpcibvzfogv
16 ofruoprrmuoqpqq
16 vxaslpcqtllf
16 jyssiyf
16 mdjjdsjmtj
16 whncbp...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
15
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1...

result:

ok 500000 numbers

Test #143:

score: 0
Accepted
time: 127ms
memory: 3684kb

input:

500000
16 qihgcmgukcikgm
16 mlkkulcjwp
16 boujfknn
16 mlslnpfdsghq
16 cddcootumtubc
16 rkhhcxqxodw
16 yzrpxq
16 ikflksn
16 xrmbyhbmqjhqx
16 ljnypickdszitqnu
16 zoznziozaiu
16 whtxpbcrgvuxh
16 oraqcps
16 umngxhdw
16 evyxnq
16 kdpvmstmdczkx
16 fevlrsggbqkncpti
16 yjljjtbbszjns
16 nzkptyasmjuin
16 slsm...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
17
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1...

result:

ok 500000 numbers

Test #144:

score: 0
Accepted
time: 129ms
memory: 3620kb

input:

500000
16 dkmthpsgdzhoq
16 hrivpkaacodl
16 zageuktvspxjhlcm
16 adyswqv
16 qvfwfokkovlwhgpo
16 ryscxtvqdfrjkml
16 rlqztibbqkdw
16 gliiutyq
16 uhcxuvng
16 ggljozqbtknsuag
16 qhvvnocsbruji
16 oimsqvzt
16 tdtahkkkhom
16 adrtkgfiu
16 zazkemnehmamkxn
16 vqftuzefompis
16 qseysbwvdkenq
16 lnvxmtvxmbbhln
16 ...

output:

1
1
15
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
15
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #145:

score: 0
Accepted
time: 125ms
memory: 3592kb

input:

500000
16 ixzlcgkkzwnbfvd
16 dzcqlbaetfyux
16 mxtesckoynhavi
16 pxirjnyju
16 jckjyoatazihkohn
16 gfakjpyuhzxlfv
16 yzcsnvtowwg
16 lfwdgkyuqt
16 fqrkyfjvu
16 muwsmjwoswscsnny
16 jbxvtmnw
16 kkbsvuhpqqlfgc
16 jzgfdfxnxeeebzxf
16 fvwukgovwqxrtcim
16 mbiltuisn
16 irvzilmbbzari
16 wjlxkogfhta
16 ghstfjtj...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #146:

score: 0
Accepted
time: 127ms
memory: 3824kb

input:

500000
16 pnqokiwuszexl
16 lqlielrneqbxvcrv
16 nxvhueqegogho
16 nvdjizmepaxe
16 pcesnazqsoh
16 letloymueaftxoul
16 bdxnmlfvhcpyusmt
16 kulboawurd
16 mseqyokxb
16 evwqszbhc
16 ayppqwbldhj
16 uajkdboixflpygcz
16 tjlvrpoevf
16 cojaplznb
16 kangvauoatet
16 pbhzkymhvicvk
16 quylxvvdlxcanr
16 byoiekuqf
16...

output:

1
1
1
1
1
1
1
1
1
1
1
15
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
15
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #147:

score: 0
Accepted
time: 129ms
memory: 3608kb

input:

500000
16 tekiwdrcstxld
16 osujgxmztkhe
16 swsgzgnpbioyyn
16 oaxdphqeldhuftvg
16 ghzequtmcy
16 uyzjwdnstmxh
16 ozzasvxodcxevcan
16 sokdirvcfbypvfh
16 teuymhrdas
16 azdpxqjlygkosim
16 yhbodewctabfnuvj
16 bhegafinvzdl
16 aimmvaghxzwwzt
16 acayjmquzkhugt
16 qgdycmhvbofznpxt
16 myrlopbgdjku
16 ygncuhrpi...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
15
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
15
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
15
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
15
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #148:

score: 0
Accepted
time: 131ms
memory: 3588kb

input:

500000
16 mqrfgisohptky
16 jeehftrkzwfqqyh
16 wfcmstxozbgkehlr
16 bbydndwumkitq
16 upivtpwkxhrg
16 azsugabvmtohs
16 zqvfgfpflcgagor
16 zfanbsituzuwmfc
16 zimrbuycvrdfllqp
16 vruwxehdgmts
16 fnwptnkbcvefr
16 tsuzyqibpeacn
16 oeaqfgkxhcsjskl
16 nhaxvmysoolw
16 fhuovpletwxay
16 ysceiboaazntca
16 rmztjc...

output:

1
1
15
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1...

result:

ok 500000 numbers

Test #149:

score: 0
Accepted
time: 126ms
memory: 3532kb

input:

500000
16 tysmtogwqrpzjfih
16 tbcujrpnwayufho
16 mkeyujtxliqwgdvh
16 emxgdrklizjuwbsl
16 bhuvqlbjienwp
16 anvsldoxpqzm
16 guyczwmjirkly
16 lmwsomtizvcfr
16 leqsamntfpyzdi
16 hxycoralgvsi
16 qhbrkapzjtdgwum
16 nldxfpwohhcedlty
16 bihcaysmxeflo
16 iqauvtdgcolf
16 ctkrxzwpfnivehb
16 psmjblkcgnuwt
16 el...

output:

1
1
15
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
15
1
1
1
1
1
1
1
15
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
15
1
1
1
1
1
1
1
1
1
1
15
1
1
1
1
15
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
15
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
15
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #150:

score: 0
Accepted
time: 120ms
memory: 3620kb

input:

500000
16 qgmujrvjbdztxow
16 imcxaqtlhednvx
16 esozgkolapqxhu
16 wnhrcafeysuvm
16 hepbgjxjclvzycaw
16 nguxhofcqamjklwz
16 tnlemwrzvobah
16 hemgckqluzvoy
16 ftnlqsoacmpkh
16 cgknwtmizjeluod
16 jmpihlaxrnssfmdv
16 jnyxdblckqoeu
16 ihevclwxyaurb
16 bgweicfsqmotp
16 txodwcuknhgmj
16 oetrlfvkdgqxypjx
16 ...

output:

1
1
1
1
1
15
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
15
1
15
1
1
1
1
1
1
1
15
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
15
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
15
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #151:

score: 0
Accepted
time: 125ms
memory: 3596kb

input:

500000
16 ordbswcuziqgyme
16 kdfrlhnrtgupmqe
16 ibwnfekrszmujoq
16 tfrsmzuahcdvybpx
16 tzemhodljqblcycv
16 ftidubsmqnpcly
16 jahmdcglofuwxpyi
16 zlsdhlmoukbexrg
16 wnqvkpgmoiwduxxe
16 vgerwnuocptfgaj
16 xnfeivlsdwqkpzo
16 szlkgiqwrouhat
16 wsajemzchgrfkn
16 zaqfpbxtliwyokm
16 kqhbwlyzmuxepj
16 qsbga...

output:

1
1
1
15
1
1
15
1
1
1
1
1
1
1
1
1
15
1
1
15
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
15
1
1
1
1
1
1
1
1
1
1
1
1
15
1
1
1
1
1
1
1
1
15
1
1
1
1
15
1
1
1
15
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
15
1
1
1
1
15
1
1
1
1
1
1
1
1
1
1
1
15
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
15
1
1
1
1
1
1
15
1
...

result:

ok 500000 numbers

Test #152:

score: 0
Accepted
time: 127ms
memory: 3820kb

input:

500000
16 qhwpeykfrabzlvo
16 kfuoxzasdhijeqys
16 rlhtyuvenaicfmo
16 cxeqvzdkomasbjg
16 dubnctxeyaphzmw
16 yfqzihcepoakxlw
16 qjfrmawgncxjluse
16 pbgdtjscvohrknzw
16 ikjubvzsadnqlcm
16 nlcbdkoapmyxvqe
16 dgtwcehjymszovuf
16 kcwrvyxiolnjupdg
16 fkhjrncgvbzdwts
16 pzjmfgkrcyqetbu
16 pnsclgmoszbfyard
16...

output:

1
1
1
1
1
1
1
15
1
1
15
15
1
1
1
15
1
15
1
15
1
1
1
15
1
15
1
1
1
15
15
1
15
15
1
1
1
1
15
1
15
1
15
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
15
15
1
1
1
1
1
1
1
1
15
15
1
1
1
1
1
1
15
1
15
15
15
1
1
1
15
1
1
1
1
1
1
1
1
1
1
15
1
1
1
1
1
15
1
15
15
1
1
1
15
1
1
1
15
15
1
1
1
1
15
1
15
1
15
1
1
1
15
1
15
1
15...

result:

ok 500000 numbers

Test #153:

score: 0
Accepted
time: 189ms
memory: 3684kb

input:

500000
16 symlqdexvnhtrjof
16 cflyvbgjowzdrnmi
16 xwrvqmskuinfztbl
16 tlpimrcwzangvyxo
16 ozawrxblhcuedtqm
16 vkicboshjfqelwar
16 xdifqcsnzkjehryu
16 qnsbvapuijdcwryg
16 eadwjlrocbvzhtkg
16 sageydpxjmvwkuqc
16 xfgtidumqanzcwvo
16 sfwoiavchrugxkzl
16 uoaxyfmgdphtwiqj
16 kpfojtaydmlurgxq
16 wuprgixsml...

output:

15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
15
...

result:

ok 500000 numbers

Test #154:

score: 0
Accepted
time: 81ms
memory: 3836kb

input:

500000
2 piipiippipipi
2 msmmsmmmmssmmss
2 ssuuuusuussusuu
2 wwwwwwwwwwwwwww
2 vvi
2 xxxxxxxxxxxxx
2 zzzzzzzz
2 oohhoohh
2 hhhhhhhhhhhhhh
2 taaatattatat
2 gggggg
2 qqqqqqqqqqqqqqqq
2 kkkkkk
2 bbbbbbbbbb
2 kqqqq
2 zzkkkzzzzk
2 gggfgffggggffggf
2 ppppqppqpqpqp
2 bbbbbbbbbbbbbb
2 ssfffss
2 jjjxxjjjxjjx...

output:

4714
23500
24884
32767
6
8191
255
204
16383
2229
63
65535
63
1023
16
798
59878
7893
16383
99
14810
90
7348
13
511
8191
7
127
3
460
2047
374
5
14476
2047
2
127
7
23
15
57
7
60
5189
59
8191
32767
63
111
511
6658
2047
7
14
1023
1582
127
8191
8191
4095
255
235
34213
1415
5
18
2031
539
83
1023
293
63
1
8...

result:

ok 500000 numbers

Test #155:

score: 0
Accepted
time: 88ms
memory: 3532kb

input:

500000
2 clcclccclclccclc
2 vivvivvviviiviiv
2 ciccicciiciciici
2 teeettetttttteee
2 rrrmmmmmmmrmrmmr
2 hmhmmmmmmhmmmhhm
2 bppbpbpbbpbpbpbp
2 rrxxxxxxrxxxrxxx
2 eeoooeoeeooooooo
2 nncccccnccnncncn
2 dddhhhdhddhhhhhd
2 eddeeeeededeeded
2 pvpvvppvvpppvvpv
2 vvrrvvvvvrrrrrvv
2 uuaaauaauuuauauu
2 zzbbzz...

output:

46941
46921
46674
36344
57385
41030
38314
49288
50560
49461
58049
40794
42610
53123
50411
52778
58588
45924
48726
40373
38604
44246
43461
38443
35710
48350
54301
57655
45760
56323
55367
45007
37874
60326
53613
45767
46949
49345
62711
39093
57951
36190
53052
46552
44313
39441
42618
54554
60859
39671
...

result:

ok 500000 numbers

Test #156:

score: 0
Accepted
time: 76ms
memory: 3824kb

input:

500000
2 aaaaaaaaaaa
2 yyyyyyyyyyyyyyy
2 ttttttttt
2 dddddd
2 uuuuuuuu
2 kkkkkkk
2 dddddddd
2 xxxxxxxx
2 ooo
2 pppppppp
2 hhhhhhhhhh
2 zzzzzzzzzzz
2 dddddddddddddddd
2 ffffffffffffffff
2 cccccc
2 vvvvvvvvv
2 ffffffff
2 kkkkkkkkkkkkk
2 tt
2 mmmmmmmmmmmmm
2 qqqqq
2 vvvvvvvvvvvvv
2 jjjjjjjjjjj
2 rrrr
2...

output:

2047
32767
511
63
255
127
255
255
7
255
1023
2047
65535
65535
63
511
255
8191
3
8191
31
8191
2047
15
4095
255
255
2047
8191
63
8191
31
32767
16383
255
511
1
3
63
4095
2047
127
8191
4095
7
8191
2047
31
4095
16383
127
65535
32767
31
65535
4095
8191
255
127
31
3
32767
15
127
15
255
65535
1
127
255
7
31...

result:

ok 500000 numbers

Test #157:

score: 0
Accepted
time: 85ms
memory: 3824kb

input:

500000
2 wwwwwwwwwwwwwwww
2 rrrrrrrrrrrrrrrr
2 ffffffffffffffff
2 ffffffffffffffff
2 xxxxxxxxxxxxxxxx
2 ffffffffffffffff
2 gggggggggggggggg
2 pppppppppppppppp
2 ssssssssssssssss
2 vvvvvvvvvvvvvvvv
2 zzzzzzzzzzzzzzzz
2 nnnnnnnnnnnnnnnn
2 hhhhhhhhhhhhhhhh
2 pppppppppppppppp
2 ssssssssssssssss
2 oooooo...

output:

65535
65535
65535
65535
65535
65535
65535
65535
65535
65535
65535
65535
65535
65535
65535
65535
65535
65535
65535
65535
65535
65535
65535
65535
65535
65535
65535
65535
65535
65535
65535
65535
65535
65535
65535
65535
65535
65535
65535
65535
65535
65535
65535
65535
65535
65535
65535
65535
65535
65535
...

result:

ok 500000 numbers

Test #158:

score: 0
Accepted
time: 103ms
memory: 3588kb

input:

500000
4 fffzzzffzz
4 yxyxx
4 mpppmpmmpp
4 cdcddccccddcd
4 zdzd
4 ddooo
4 lw
4 rer
4 wwj
4 mmdmdmdmdmmmd
4 xgxxxgggxxxx
4 xnnxxnxnxxxnxn
4 jjyyj
4 nnnlnlnlnnl
4 dddldllldlldd
4 aavvavvvvav
4 pddddpdddppp
4 ennneneenn
4 lglglgggl
4 ooq
4 qxqqxqqxqqqqxqqx
4 cf
4 mrmrrrmmm
4 ppypyy
4 rrlrl
4 zznn
4 vvq...

output:

1
1
1
1
17
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
3
1
5
1
1
3
1
1
1
1
1
1
19
1
1
1
21845
3
5
1
1
1
3
17
65
77
1
1
5
15
85
1
3
1
1
3
1
19
1
1
1
1
1
1
1
341
1
3
21
1
3
21
5
5
1365
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
3
1
1
1
1
1
5
5
5
3
5
1
5
1
1
1025
5
1
1
1
3
65
1
1
1
1
1
1
1
5
17
1
3
1
1
3
1
1
1
1
85
1...

result:

ok 500000 numbers

Test #159:

score: 0
Accepted
time: 132ms
memory: 3836kb

input:

500000
4 ppnpnnnppppppppn
4 eeeiieeeeeeeeiee
4 wwbwwbwbbwwbwwbb
4 rorrrorrooorroor
4 zzrzzrzzrrzzzrrr
4 yydydddyyddyyddy
4 ttpptttpptttptpp
4 cceccceeeeceecec
4 hhihhhhiiihhiiih
4 oddooododododddo
4 ioiiooiiiioiiioi
4 pppkkkpkpkpkpkpk
4 qqqfqfffqffffffq
4 qaaaqqqaqaaqaqaq
4 tdddddtddtdttttd
4 ttpptp...

output:

1
1
1
17
1
1
1
1
1
257
1
1
1
5
1
5
1
5
1
1
5
1
1
17
1
5
1
1
1
1
1
1
5
5
17
5
5
1
17
1
257
1
5
17
1
1
5
1
1
5
5
257
1
1
1
1285
5
17
1
1
5
1
1
1
1
1
1
85
1
5
1
5
5
1
1
1
1
5
1
1
5
1
1
1
1
1
257
1
1
1
1
5
5
1
85
1
5
1
1
257
1
1
1
1
1
1
1
1
85
5
1
1
1
1
1
5
257
1
1
257
1
5
1
1
1
1
1
17
1
1
1
85
1
1
1
1
...

result:

ok 500000 numbers

Test #160:

score: 0
Accepted
time: 114ms
memory: 3596kb

input:

500000
6 etetyeyyetet
6 uiiiciuiiuc
6 efkkeffeef
6 mpmtpmmpmptmm
6 nkiiikknnkkknii
6 yuuuiiyyy
6 iuuiiuqqiuiuuqiq
6 zrzfffrrzr
6 dgfffgfggfgddgd
6 kbhhhbbh
6 wpwwqp
6 geeedd
6 fzzpzpfppffzzz
6 ijjtittjjittjj
6 taatamtmm
6 cuuzzczuuucuz
6 cuh
6 sswwwtt
6 sraa
6 rvxvvvrxrxrvrx
6 majaj
6 ahfaafhhfa
6 g...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
7
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
7
1
1
1
7
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #161:

score: 0
Accepted
time: 135ms
memory: 3556kb

input:

500000
6 hwwaaaahhhhhhaaw
6 ammaymmyyyaayaya
6 xtttccxtcttcttcx
6 ccrnnnncrrccrrcc
6 aaacakckcacackkc
6 uouuoooossoouoss
6 lorroolllroorrlo
6 jjeeeeejejjejiji
6 jjeekkjekeejjekj
6 sgsgkggsgskskgks
6 xkkxnnxnkkkxxxxk
6 jjjfpjfpfjfjjfjp
6 jjsjsjsjsjsxxjxs
6 caacaoocacocoaac
6 xxyxzxyzzyxzxzyy
6 jljklj...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
7
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
7
1
1
1
1
1
1
1
1
1
1
37
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
37
1
1
1
1
1
1
1
17
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
7
1
1
1
1
1
1
1
1
1
1
1
1...

result:

ok 500000 numbers

Test #162:

score: 0
Accepted
time: 123ms
memory: 3652kb

input:

500000
8 foovohofvhvff
8 ppbbjpzbzjjpzp
8 dtbbrbdtdbdr
8 utuydt
8 memeuumime
8 bmxbxxbtx
8 sxjvxjjsj
8 iaeial
8 bwizziiibiiii
8 kycekkkek
8 rzrtzyzzz
8 iiuuizhuuizu
8 adhk
8 tupbubbbu
8 zxzlj
8 ffegpf
8 jhorh
8 qlpppflfplqqll
8 cilcaillilci
8 yrggrrygiyirygrr
8 nnozg
8 jjpneejnnpjp
8 zffmmimiz
8 bcc...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
9
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
9
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
65
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1...

result:

ok 500000 numbers

Test #163:

score: 0
Accepted
time: 150ms
memory: 3840kb

input:

500000
8 laqqlalqzzaalaqz
8 kfqfqfkufkuqqqqk
8 zqqyzryzqyrqqyrq
8 jkkjpkjpyppypykp
8 igijgxjxggiijgjj
8 rrjjmjmrjumrrruu
8 fmsfssssfsfmwsws
8 cwlllcwbwcbbbcbw
8 jxjaxafxjxaxfafx
8 rcwrcwprpwcccpcc
8 mpmyomyooymoppop
8 xunxxnssxxuxxnsu
8 aaiiiisaxxxiiaax
8 bayyffbyffafbfay
8 srzlzrslllrslzsz
8 xhnhkk...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
3
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
3
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
5
1
1
1
1
1
5
1
1
1
1
1
1
3
1
1
1
1
1
1
1
1
5
1
1
1
1
1
1
1
1
1
1
1
1
1
1
3
65...

result:

ok 500000 numbers

Test #164:

score: 0
Accepted
time: 143ms
memory: 3592kb

input:

500000
10 imcmnfc
10 brrxususbu
10 idiiuxinxiduxuin
10 xxtxtxnzztznhtx
10 totoozztroztrfz
10 bjbuppr
10 iioobiobbohuob
10 ohiooihqoiyy
10 pthssa
10 ruwyutu
10 fiftfaaitty
10 afwffacfaalcfa
10 bmjkfb
10 oorkkfafoaarrrfo
10 vgtttvtyvktkgy
10 ettfteetftyly
10 ikklixkrlri
10 thkuxhuk
10 mjvvojmjvvl
10 e...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #165:

score: 0
Accepted
time: 164ms
memory: 3592kb

input:

500000
10 qosboppbqsspspbo
10 mugmjbubmjuugugj
10 mrpcrmmpacrramar
10 rdkkdroddrkdiiko
10 wzwbzgggwwbbbygw
10 wgfrwwjrgjfjffww
10 hbblmlxhbhxhhmmx
10 jjjjhwjjjwwibhwi
10 lllwbplblwlbhwhh
10 iiuiidiudidrurqr
10 aunlnnuulauuupap
10 ekkkjjpepdpjkpep
10 lllooxplopplhhho
10 dmmpmvdpxmvmmpvv
10 qxidqqqidx...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #166:

score: 0
Accepted
time: 137ms
memory: 3596kb

input:

500000
12 kmmfymzzjymzjj
12 tipwvvppxwxipi
12 pwpiiywiujjupj
12 lwrzvy
12 nwvhqwx
12 tlytukd
12 giihevo
12 aorqgz
12 eifouesfuu
12 hibgiggthgybt
12 pippjeiefjjgg
12 lytpctciity
12 plplgrjpor
12 bbbruccblrrrbch
12 ncnqfbl
12 jrqaafvv
12 xqkqdduxg
12 idfrycdfccdyd
12 sqzggqzqmfqss
12 tmmtybomodbdy
12 ...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #167:

score: 0
Accepted
time: 162ms
memory: 3592kb

input:

500000
12 tqjjqqijtjagjait
12 aacvvkckcfvikcik
12 updspbspubpppeeb
12 hxxxoczohyxhyoyh
12 vumuotvmmvmxuovm
12 rlvsrsrjjsjsvjkk
12 rzzrzzcrggrkrrwc
12 reeydodoaeeyeeyo
12 dcyecezzydcdhdzz
12 rgagegabkabkerrg
12 llksliksjsiqjslq
12 snwwnncwjtnjncsc
12 twyywwywtycttwhu
12 yiqxxfyftyfytyit
12 chicrjrijc...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #168:

score: 0
Accepted
time: 138ms
memory: 3820kb

input:

500000
14 hocrrohpcniinn
14 wjyreeewdowdrjye
14 bhbuhqeerzuur
14 vltpucrrtvt
14 xwxjkuxqqrjuuqr
14 cgpgtaedt
14 cggcchxchnjxbgh
14 ghqpejb
14 qodhgjgol
14 mpmmigxsds
14 wyqdcjm
14 oyeyyoidtmeit
14 ycmlxxdcb
14 ibkbrdel
14 mymkgtwu
14 vhpyorhu
14 qzxddtxdrw
14 vrlvtiyrwwii
14 euqeauqpnsqpq
14 vaavztx...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #169:

score: 0
Accepted
time: 168ms
memory: 3668kb

input:

500000
14 nnfjnnafdzjpafja
14 owbwdcibddofiwdi
14 nippobhbxpxipxnn
14 kovzaakzzuxxxxau
14 oxstzlzoozlnxtxz
14 kumdmaduaadyzudy
14 wsiawmsptatpiiis
14 ttondhoodpnopzhh
14 qqpzkdppbmzpbqmb
14 zhnjzhfvjhuzfzfz
14 mgcocmogwgiicgin
14 kzzzngidjzjnzidn
14 nhtunnjjktupkphp
14 dbcdedhdejecjgcb
14 kgikpplpoo...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #170:

score: 0
Accepted
time: 136ms
memory: 3604kb

input:

500000
16 qfddyikjx
16 tcuauzoiooyc
16 gjxbovvvuuuxjq
16 kjekuyjkyhcjz
16 eegbeorfsoug
16 lheumyjs
16 mjxpnrrhjmpnf
16 ddppudpkvuxnee
16 ixyutyuqlatl
16 kynpbobvdd
16 yjmyrksbe
16 rytviigtbbbuggu
16 agdhljrk
16 icytcyczfczuv
16 zjzjssbbicahi
16 ylrjjqyxrddgyxx
16 yyeeuvrmfmsy
16 incsmdur
16 cbvqhezi...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers

Test #171:

score: 0
Accepted
time: 169ms
memory: 3532kb

input:

500000
16 jiyshsjmyyposmhh
16 zflwfrllsdwyyrdf
16 teerocotazkcooke
16 ttilmimmlnnkkaba
16 eewuxyuwqxqgwqjj
16 mcymdjyxyycvmgdy
16 zobzbhuogbojnzno
16 bfqdtxoxbbdobsxt
16 oiqtwiwqstoiisyb
16 maufmujumhjoeojh
16 hmtzjyhwwmmyimwt
16 idmdaihxwipdwami
16 hlulpjjkkujilpok
16 ayrzppycbybcalca
16 axkxhoohrr...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 500000 numbers