QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#569956#8829. AibohphobiaATM12345#AC ✓108ms5344kbC++171.1kb2024-09-17 12:49:402024-09-17 12:49:42

Judging History

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

  • [2024-09-17 12:49:42]
  • 评测
  • 测评结果:AC
  • 用时:108ms
  • 内存:5344kb
  • [2024-09-17 12:49:40]
  • 提交

answer

#include <bits/stdc++.h>
#define ll long long
#define Ma 1000005
#define mod 998244353
#define PLL pair<ll,ll>
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define N 26
#define all(x) x.begin(),x.end()
#define pb push_back

using namespace std;

char a[Ma];
string s;
ll f[N];
ll n;
struct node{
	ll num,w;
	bool operator <(const node &A) const{
		return w<A.w;
	}
}t[N];


void sol()
{
	ll tot=0;
	memset(f,0,sizeof(f));
	cin>>s;
	n=s.size();
	ll cnt=0;
	for (ll i=0;i<s.size();i++)
		f[s[i]-'a']++,cnt+=(f[s[i]-'a']==1);
	for (ll i=0;i<N;i++)
		t[i]={i,f[i]};
	sort(t,t+N);
	if (cnt==1&&n!=1)
	{
		printf("NO\n");
		return;
	}
	if (cnt==2)
	{
		ll flag=0;
		for (ll i=0;i<N;i++)
			flag|=(f[i]==1);
		if (!flag)
		{
			printf("NO\n");
			return;
		}
	}
	printf("YES\n");
	while (cnt)
	{
		for (ll i=0;i<N;i++)
		{
			if (!t[i].w)
				continue;
			t[i].w--;
			a[tot++]=t[i].num+'a';
			if (!t[i].w)
				cnt--;
		}
	}
	for (ll i=0;i<tot;i++)
		printf("%c",a[i]);
	printf("\n");
}


int main()
{
	ll tt=1;
	cin>>tt;
	while (tt--)
		sol();
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3708kb

input:

5
a
sos
abba
icpc
tenet

output:

YES
a
YES
oss
NO
YES
picc
YES
ntete

result:

ok Correct (5 test cases)

Test #2:

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

input:

18
qnx
oooo
tvttj
zzzzz
pvlne
iijt
hjhjj
loo
hh
uq
mgvgv
ewwe
iii
kykk
o
mmumm
aetvv
xntl

output:

YES
nqx
NO
YES
jvttt
NO
YES
lnpve
YES
jtii
NO
YES
loo
NO
YES
qu
YES
mgvgv
NO
NO
YES
ykkk
YES
o
YES
ummmm
YES
atevv
YES
lntx

result:

ok Correct (18 test cases)

Test #3:

score: 0
Accepted
time: 1ms
memory: 3752kb

input:

138
gcseqpht
brrrzsrerr
ree
lgryyyh
wbxkwwwwx
hsihaga
kvvslzgv
dssd
qhrqqqrqyh
dfffffsfgf
ssuzuuzzs
rrwnyrcdnb
ealelecu
ccfwwwccwc
emeieme
xeexeswes
ymkkkkpkk
eimderoz
lflllh
lluylcll
rquqrqu
mllmllll
cscscc
ssssssssss
cn
llljlzlzj
h
kbbxahczit
yxrrrrxlkr
uikiakika
tntnnqntw
sjhxyfsy
fcyyyf
dbvbvdbw...

output:

YES
pqhstgec
YES
zsebrrrrrr
YES
ree
YES
lrhgyyy
YES
kbxwxwwww
YES
isgahah
YES
lkgszvvv
NO
YES
yrhqrhqqqq
YES
sgdfffffff
YES
suzsuzsuz
YES
bwydcnrnrr
YES
auclelee
YES
fwcwcwcwcc
YES
imemeee
YES
wsxesxeee
YES
mpykkkkkk
YES
moirdzee
YES
hfllll
YES
ucylllll
YES
ruqruqq
NO
NO
NO
YES
nc
YES
jzljzllll
YES
...

result:

ok Correct (138 test cases)

Test #4:

score: 0
Accepted
time: 2ms
memory: 3708kb

input:

683
ufvvflppuvfu
ccgchccndvvtqcu
dqgqdddrgddjid
iiiiiiiiiiimiin
dqsiejxqqqq
kkkjzkkzkkvvkkk
aaeamagwzwagmni
bgddgdbbggdgb
xebbzbqrrx
tyxkqsyyclhyx
bjpdrrrrrrjrv
qzzqzzzqqq
ykgaykqyqqk
iefeeetaeeee
qqbabbfbslxfh
ovvczvcdcvecb
ieiiiaiqiiibii
hxeeeexeexxxxh
jxxxjxjrjjjx
jjzjjrzgqnjyj
rqqtzzptqopq
wbsyv...

output:

YES
lpfuvpfuvfuv
YES
nhqgtudvcvccccc
YES
jriqgdqgdddddd
YES
nmiiiiiiiiiiiii
YES
jisedxqqqqq
YES
jvzkvzkkkkkkkkk
YES
zniemwgamwgaaaa
YES
dbgdbgdbgdbgg
YES
zqerxbrxbb
YES
klhqstcxyxyyy
YES
pvdbjrjrrrrrr
NO
YES
agkqykqykqy
YES
aitfeeeeeeee
YES
lahsxqfbqfbbb
YES
zoedbvcvcvcvc
YES
aqebiiiiiiiiii
YES
hexh...

result:

ok Correct (683 test cases)

Test #5:

score: 0
Accepted
time: 3ms
memory: 3740kb

input:

2713
ahrfzkzqahzahbqahzzu
vwwwdpdsopmwmdmss
zhkzhzjefkvnjfbxxbk
oawqeraqvqoqqg
eeeeedsxddeehzeehzee
afrzcqrhdqikqcvqcakj
xqkkkzqquqqkqqkdd
urtrttjuruttutruutut
mktgalyydawhgtcka
qjhjjxxqhhqxqx
fkfzfkffkfkkfffkkfz
byyyqbbboboyqqoobb
eyeyylrleeylerllrly
ggfgzqgyqvqlehnq
rrsjrrjrrjjjjrrrzrr
qyqqyycrqrr...

output:

YES
burkfqhazqhazhazhazz
YES
ovpmsdwpmsdwmsdww
YES
vnexbjhfkzxbjhfkzkz
YES
rgevwaoqaoqqqq
YES
sxhzdehzdedeeeeeeeee
YES
jihfvdzkracqkracqcqq
YES
uxzdkqdkqkqkqkqqq
YES
jrutrutrutrututututt
YES
lmhdwckgtyakgtyaa
YES
jhqxjhqxjhqxqx
YES
zkfzkfkfkfkfkfkffff
YES
qoybqoybqoyboybbbb
YES
reylreylreyleyleyll
Y...

result:

ok Correct (2713 test cases)

Test #6:

score: 0
Accepted
time: 67ms
memory: 3740kb

input:

35444
vvgmvmmhtmgmmhvfhhhmhmqmqhmhhvf
aiiaaaaipaiapsspcppaaappppypapa
qgprgwugggggiqargigggugefgarg
ssikskkmiisksqsssssssn
dtvmryhhtikrrhmmhmmymrmimbvpvv
cpbpprllqzletlllplugkxf
sbpkbkbsptsbkkkbtbtsktkb
ngvnnvnvgcgcnvnngnnnnvgn
mhhyltymyjhynhhyymtyuuuyydjyyys
vlbkkgmtekutxaltkltttkkcakttlkl
njemezmg...

output:

YES
tqgfvhmqgfvhmvhmvhmvhmhmhmhmhmm
YES
cysipasipaipaipapapapapapapapaa
YES
pfewiaqurgiaqurgrgggggggggggg
YES
mnqiksiksiksksssssssss
YES
kpdbityhrvmityhrvmhrvmhrvmmmmm
YES
utxzrqkgfecbplplplpllll
YES
pstkbpstkbstkbstkbkbkbkb
YES
cgvncgvngvngvngvnnnnnnnn
YES
lnsdjtmuhyjtmuhymuhyhyhyyyyyyyy
YES
bcxvue...

result:

ok Correct (35444 test cases)

Test #7:

score: 0
Accepted
time: 39ms
memory: 5276kb

input:

1
lllvrvrqtekpyfwztplrzmkfmlvllvjmzffllrmemmyjmlllwbiruatutvvumfttuemtjvmfvmjktlfzwmllfitqtvjtqftvergkqtebzjmwtvfjklklgjjevuuqrjzltrutklzytzvjyjuzlvjlivilvwtztijfrmvfkmfkiuxrtpftibbrlzvltbljbjtiqlzzjtyvljklvluutzqjvltenvtjlmtjyejvvlverflbvmkvjfwtlvrvmpbtpllvpbklqkulezkmrmltljvtklvitqelmvqvvfqfofkfyu...

output:

YES
angopxwyqubiefrzkmjtvlangopxwyqubiefrzkmjtvlangopxwyqubiefrzkmjtvlangopxwyqubiefrzkmjtvlangopxwyqubiefrzkmjtvlangopxwyqubiefrzkmjtvlangopxwyqubiefrzkmjtvlangopxwyqubiefrzkmjtvlangopxwyqubiefrzkmjtvlangopxwyqubiefrzkmjtvlangopxwyqubiefrzkmjtvlangopxwyqubiefrzkmjtvlangopxwyqubiefrzkmjtvlangopxwyqu...

result:

ok Correct (1 test case)

Test #8:

score: 0
Accepted
time: 36ms
memory: 5240kb

input:

1
ltdkuekutrbtetdwdttuvutvkvpdntdtlelvepthdtupiwvelpthttmrrtltvztgvutuvypvtbtrtfyrvfutefedpovbufubttvlpfutptdvevmzrvpslffetetveppvotlpewwrefytevteovnfvbytjvtvvhrptvwtewtotpvetgpvfegvefkbttvetrtabhemvtuktevthtbvbyftvrhepebpywhtttfjelrfrttugpevkkytettltvtudidobvmthsotrtvtbtvhtttbwvlpgghbrevplvpttbedfr...

output:

YES
qiasznkwjmudoyfgbhlprevtqiasznkwjmudoyfgbhlprevtqiasznkwjmudoyfgbhlprevtqiasznkwjmudoyfgbhlprevtqiasznkwjmudoyfgbhlprevtqiasznkwjmudoyfgbhlprevtqiasznkwjmudoyfgbhlprevtqiasznkwjmudoyfgbhlprevtqiasznkwjmudoyfgbhlprevtqiasznkwjmudoyfgbhlprevtqiasznkwjmudoyfgbhlprevtqiasznkwjmudoyfgbhlprevtqiasznkw...

result:

ok Correct (1 test case)

Test #9:

score: 0
Accepted
time: 53ms
memory: 5276kb

input:

1
kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk...

output:

YES
dkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk...

result:

ok Correct (1 test case)

Test #10:

score: 0
Accepted
time: 11ms
memory: 5276kb

input:

1
llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll...

output:

NO

result:

ok Correct (1 test case)

Test #11:

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

input:

1
xxsssxssxxsxxsssxxxxxxxsxsssxssxsxxssxsssxsxxsssssxxsxxsssxxsxxxsxxsssxxxssssssxxssxxxssssssxxsssssssxsxsssxsxxsssxxssssxssssssssxsssxssxssssxssxsssssxsxsxxsxssxsxxssssxxsssssssxssxxxssxsxsssxsxxsxxxxxsxsxxxsxsxsxsxxsxxsxssssxxxxsxssssxxsxxssssxsxssxxxxxxsxsxsxxxxsxxxssssxsxxxssxxxsxssxxssxxxssssx...

output:

NO

result:

ok Correct (1 test case)

Test #12:

score: 0
Accepted
time: 34ms
memory: 5312kb

input:

1
xuxjjjuwwxxxuljzwjwuxzwwxxujjxjuxjzwxxzxjjwxxwjxlxujjxlwwxwljwwxzxxwlwxuljtxlxjwlxwzxuzxuxuwwxuttzwjjjwxuxuwjxzxjuwllxxjjxxjxjjxjwxxwxuxjjxjzwwwwwzjuzlzujltxuxwxwjltlwjwxuljlxjuujxxxwjwuwjlxjxlxtwxxxwxlxwwlxjlluxxxwwxuxjwjtwlwwwxjxxjtjjxuwjtwxzujzjlwxxjxuxlxjzuujwjjjxxwwlxxxxxxzxxwjwwjjxxwwxxljzjj...

output:

YES
tzluwjxtzluwjxtzluwjxtzluwjxtzluwjxtzluwjxtzluwjxtzluwjxtzluwjxtzluwjxtzluwjxtzluwjxtzluwjxtzluwjxtzluwjxtzluwjxtzluwjxtzluwjxtzluwjxtzluwjxtzluwjxtzluwjxtzluwjxtzluwjxtzluwjxtzluwjxtzluwjxtzluwjxtzluwjxtzluwjxtzluwjxtzluwjxtzluwjxtzluwjxtzluwjxtzluwjxtzluwjxtzluwjxtzluwjxtzluwjxtzluwjxtzluwjxtz...

result:

ok Correct (1 test case)

Test #13:

score: 0
Accepted
time: 40ms
memory: 5316kb

input:

1
rlaarbabrvbxxbbmbabrxqabbxhgaqhlgbaqrarbqagabglbbxqwaaaxrwawxarxhbvxgqgraablbbabbwxaravbbbxaabahxlitlrmgvhxabbbgxbvgvavablmrbvbbbvqbqbgxghwhbbahxcbhbahababrgvvarvxxbvqbbmgrmqvtvbbbavaqbryambabmhvabvarmlvbqiarbbvambbhxthrbhhyqqxgabxaaqvgqmlibrwqaalraawvraaahbbamaaaqqhmrrabvqavbqvamvbbxtlrvqxvlhhvbm...

output:

YES
scyitwlghmqrvxabscyitwlghmqrvxabscyitwlghmqrvxabscyitwlghmqrvxabscyitwlghmqrvxabscyitwlghmqrvxabscyitwlghmqrvxabscyitwlghmqrvxabscyitwlghmqrvxabscyitwlghmqrvxabscyitwlghmqrvxabscyitwlghmqrvxabscyitwlghmqrvxabscyitwlghmqrvxabscyitwlghmqrvxabscyitwlghmqrvxabscyitwlghmqrvxabscyitwlghmqrvxabscyitwlg...

result:

ok Correct (1 test case)

Test #14:

score: 0
Accepted
time: 13ms
memory: 5292kb

input:

1
wwwwwwwwwuuwuuwuuwwwwwwuuwwwwwuwwwwuwwwuwwuwwwwuwwwwuwuuwwuwuwwwuuwuwwwwwwwwuwwwwwwwwuuwuuwwwwuuwwwwwwuwwuwuwwuwwuwuuuuuwuuwwwwwuwuwwwwwuwwuwwwwwuuwwuuwwwuuwuwwwuwwwwwwwwwwwuuwuwwwwwwuwuwwuwwwwwwuwwwwuwuwuwuwwuwwwwwuwuwuwwwwuwwwwuwuwwwwwwwwuwwwwuuwwuwuuuwuwwwwwwuuuwuwwwwuwwwuwwwwuwuuuwwwwwwwwwwwww...

output:

NO

result:

ok Correct (1 test case)

Test #15:

score: 0
Accepted
time: 15ms
memory: 5264kb

input:

1
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...

output:

NO

result:

ok Correct (1 test case)

Test #16:

score: 0
Accepted
time: 35ms
memory: 5248kb

input:

1
xxymtrfydfriirryfiwxxtxwfiwwiirtwiifmxklxddgdrgyxniimirihiitayyidwumtwfxfyifxixrfizfahfafdigkyxigrxtbdwxdiitpxwfxfijirjirfitirqfrxbqiitxhzrwhqtrahrbfdfhrmixwriubiirmwmrmridxrvfvasddrqfrxsmiixrrxwhpifhiinaxxfzeydbavrywtfrwiixtmkqdbxhbxtwfircmririwxaxwmziqxtbrwiifcrwsmrrrmsffitysdixxiyxmrgirhwfrxhcu...

output:

YES
ploejvgnaqbczykusmthdwrxfiploejvgnaqbczykusmthdwrxfiploejvgnaqbczykusmthdwrxfiploejvgnaqbczykusmthdwrxfiploejvgnaqbczykusmthdwrxfiploejvgnaqbczykusmthdwrxfiploejvgnaqbczykusmthdwrxfiploejvgnaqbczykusmthdwrxfiploejvgnaqbczykusmthdwrxfiploejvgnaqbczykusmthdwrxfiploejvgnaqbczykusmthdwrxfiploejvgnaq...

result:

ok Correct (1 test case)

Test #17:

score: 0
Accepted
time: 47ms
memory: 5316kb

input:

2
jjccjhjceccjccccejcjjcccchcecjchccccjeccjccccccceececccccccccjcecccceccjcccccccechejccccbccccjjcccccecjccjccccjccecccjejcceccjccccceejejcjcjccjcccccchcheccejcccjccjcjeccjcccceccecjcccejcccjccccecchjjheccccjcecjcccccchcjccccehjccechccjcbccccccjcjccjccjccejcccjcjccccccccccbejjcjcejecjjcjjcjeccceccbj...

output:

YES
bhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcbhejcb...

result:

ok Correct (2 test cases)

Test #18:

score: 0
Accepted
time: 47ms
memory: 5344kb

input:

2
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee...

output:

YES
qeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee...

result:

ok Correct (2 test cases)

Test #19:

score: 0
Accepted
time: 14ms
memory: 4276kb

input:

2
uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu...

output:

NO
NO

result:

ok Correct (2 test cases)

Test #20:

score: 0
Accepted
time: 13ms
memory: 4188kb

input:

2
rrwwrwwwrrrwrrrrwrrwrwwwrwrrwwwrrwwwwwwwrrwrwrrwrwrwrwwrwrwrrwrrrwrwwwwrwrrrrwrwrwwrwrwwwwrwrrwwwwrrrwwwrrwwrwwwwrwwwwwwwrwrrrrwwwrwwrrwrwrwrwwrrwrwrrrwwwrwrwwrwrwwrwwrrwrwwwwwwwwwwwwwwwrwrrwrwrwwrwwrwwwwrrrrwrwwwwrwrrrrwrwwwrwwrwrwrrrrrwwwwwwrrrrrwrwrwrwrwrrrwwwrrwwwwwwrrwwwwwwrwwwwrwrrwwrwwrrwrw...

output:

NO
NO

result:

ok Correct (2 test cases)

Test #21:

score: 0
Accepted
time: 36ms
memory: 5176kb

input:

2
bwwrbrrbrbbrrbwbwrbbbbvbbwbrrbrvbbrrbbbvrbrbwrbvrrrvrrrrbbrbbbrbbrbrbbrbrvbbwrrbrbbbrbrrbwrwrbbrbbbrbrbbrvbrrbbbbbbbbbrrrrrbvrvbrbrvbbrbbbrbbrrbbrrrbbbvrrrrbbrbbrbbrrbbbrwbrbrbrwrbbrvbbrwbbrrrrbbrrvrrrbrbvvbbrbrrwbwrvbwwrrrbbrwbbbrrvbvbbbbbbwvbvwwbrbrbwrrbbrrbwbwbrbbbrbbbrvvwbrbrrbbrbwrbbrbrbrrrrr...

output:

YES
vwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrbvwrb...

result:

ok Correct (2 test cases)

Test #22:

score: 0
Accepted
time: 41ms
memory: 4800kb

input:

2
nugcuvzcqqzcocufwtvmodbqvqwwcqspphcqiupmvscgyppfuvvobvgvbuopbvouqpbqciugsovgqiquudlfcoucvuvuicumvuyviipawfiukqsiuopgqzxovoviqidvgicbfvxpocuvmqdsnqgqpfscnshtvgvugqabisuovqplsfowybikvlgogpdypaugccqqncgpcgbqstgpvcqwvivmnucpaczikfvpqbvdxqqgipbougqcgeitvvipgtvubqqssvokkvgbvqcwdkfcuqsaxsmucgqqusqsunuxvq...

output:

YES
rhyzlxetnmdbwkafsicpoguqvrhyzlxetnmdbwkafsicpoguqvrhyzlxetnmdbwkafsicpoguqvrhyzlxetnmdbwkafsicpoguqvrhyzlxetnmdbwkafsicpoguqvrhyzlxetnmdbwkafsicpoguqvrhyzlxetnmdbwkafsicpoguqvrhyzlxetnmdbwkafsicpoguqvrhyzlxetnmdbwkafsicpoguqvrhyzlxetnmdbwkafsicpoguqvrhyzlxetnmdbwkafsicpoguqvrhyzlxetnmdbwkafsicpo...

result:

ok Correct (2 test cases)

Test #23:

score: 0
Accepted
time: 36ms
memory: 4868kb

input:

2
sybobwroswosbwsswssbsowobowsbwssowwoosobsbbwsbhwwwbbbwbbwssywwsosrswyswowyroossbbowssswwysbswsbbybbbossyosbbwbyswywwbosboysbwbsosobwsbbwswoywbswysbsbssowyobsbybwswbsbsbsoyosooossrwwrbwowwyyyssswsybbsobbbohbbsywysobswwhbssywsywrbbsyossssbossobwsyyrbbssswwwwbbysbobybsbooobwhsosyybbwosbwbwsbobbssowws...

output:

YES
rhyowsbrhyowsbrhyowsbrhyowsbrhyowsbrhyowsbrhyowsbrhyowsbrhyowsbrhyowsbrhyowsbrhyowsbrhyowsbrhyowsbrhyowsbrhyowsbrhyowsbrhyowsbrhyowsbrhyowsbrhyowsbrhyowsbrhyowsbrhyowsbrhyowsbrhyowsbrhyowsbrhyowsbrhyowsbrhyowsbrhyowsbrhyowsbrhyowsbrhyowsbrhyowsbrhyowsbrhyowsbrhyowsbrhyowsbrhyowsbrhyowsbrhyowsbrh...

result:

ok Correct (2 test cases)

Test #24:

score: 0
Accepted
time: 22ms
memory: 4300kb

input:

2
yyyyyyyyyyyyyyvyyyyyyyvyyyyyvyvyyyyyyyyyvyyvyyyyyyyyyyvyyyyyyyyyyyyyvyyvyyvyyyyyyvyyyyvyyyyyvvyyyyyyyyyyyyyyvyvyvyyyyyyyvyvyyyyyvyvyyyvyyyyyyyyyyyyyvvyyyyvyyyyyyyyvyyyyvyyvyyyyvyvyvyyyyyyyyyvyyyyyyyyyyyyyyyvyyyvyyyyyyyyyyyyyyyyyyyyvyyvvyyyyyyyyvyyyyyyvyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyvyvyyyyyyyyyy...

output:

NO
YES
jpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpcdmjpc...

result:

ok Correct (2 test cases)

Test #25:

score: 0
Accepted
time: 32ms
memory: 4628kb

input:

2
dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd...

output:

NO
YES
tqdnhfblvrtqdnhfblvrtqdnhfblvrtqdnhfblvrtqdnhfblvrtqdnhfblvrtqdnhfblvrtqdnhfblvrtqdnhfblvrtqdnhfblvrtqdnhfblvrtqdnhfblvrtqdnhfblvrtqdnhfblvrtqdnhfblvrtqdnhfblvrtqdnhfblvrtqdnhfblvrtqdnhfblvrtqdnhfblvrtqdnhfblvrtqdnhfblvrtqdnhfblvrtqdnhfblvrtqdnhfblvrtqdnhfblvrtqdnhfblvrtqdnhfblvrtqdnhfblvrtqd...

result:

ok Correct (2 test cases)

Test #26:

score: 0
Accepted
time: 13ms
memory: 4364kb

input:

2
jjjjjjjjjjjjujjjjjjjjjjjjjjjjjjjjjjjjujjjjjjjjjjjjjjjjujjjjjjjjjjjjjujjjjjjjjjjjjjjjjjjujjjjjjjujjjujjjjjjjjjjjujjjjjjjjjjjjjjjjjjjjjujjjjujjjjjjjujjjjjjjjjjjjujjjjjjjjjjujjujjjjjjjjjjjjjujjjjjjjjjjjjjjujjjjjjjujjjjjjjjjjjjjjujjjjjjjjjujjjjjjjjjjjjjjjjjjjjujjjjjjjujjjjjjujjjjjjjjjjjujjjjjjjjjjjjjj...

output:

NO
NO

result:

ok Correct (2 test cases)

Test #27:

score: 0
Accepted
time: 52ms
memory: 4900kb

input:

3
qgugaaagpllaxasaxxgpxxsqapbgqqglxjghagaxgsullgaxxqbpguxggxygfxaxluxpqxglsjxqhypgpaggagfqfugqlsqxlqguuuuqgygpohaggxbxqjzqjgxxsllaxflshqgaqjaagaupxuugjxpsxgsaguupjqsqxagqgupauupxaajqlxgqhdguggrgjxaxfgbqglbgulgqgxqjjxaagxfxxlgullqdxagsjaqlqgxluuusuqyjxfggllzqljpgfaggbugqgxhuluxxggauggayxquaxxufsxxpbs...

output:

YES
oyzrfdbhpsjluaqxgoyzrfdbhpsjluaqxgoyzrfdbhpsjluaqxgoyzrfdbhpsjluaqxgoyzrfdbhpsjluaqxgoyzrfdbhpsjluaqxgoyzrfdbhpsjluaqxgoyzrfdbhpsjluaqxgoyzrfdbhpsjluaqxgoyzrfdbhpsjluaqxgoyzrfdbhpsjluaqxgoyzrfdbhpsjluaqxgoyzrfdbhpsjluaqxgoyzrfdbhpsjluaqxgoyzrfdbhpsjluaqxgoyzrfdbhpsjluaqxgoyzrfdbhpsjluaqxgoyzrfdb...

result:

ok Correct (3 test cases)

Test #28:

score: 0
Accepted
time: 33ms
memory: 4492kb

input:

4
kifbnffgffbsfrfbmfwbkivwdrggfbmimibfbpdfsvfrpmrfmvbpemgiwpbfbmwsfgbwvdamfbfrdgddkndjmmrgtmrrmsbvsfwwfspfftdfibdffffesdkfesbbmipbkrjwdpfgrfofvfpifvnfgrtvfnjmifbiwfbfifxvmsfgmsbdffvjfvdgewibfrrfvrfbbssmwfrskbkfffwfswffbfsedffbmdkmffddbebbrksgiprebrfdwrfngkufmbdffwkbfdeisapfbmbdstwiijbbbodbbbfffikigg...

output:

YES
xuaojtnvkewdpisrgmbfxuaojtnvkewdpisrgmbfxuaojtnvkewdpisrgmbfxuaojtnvkewdpisrgmbfxuaojtnvkewdpisrgmbfxuaojtnvkewdpisrgmbfxuaojtnvkewdpisrgmbfxuaojtnvkewdpisrgmbfxuaojtnvkewdpisrgmbfxuaojtnvkewdpisrgmbfxuaojtnvkewdpisrgmbfxuaojtnvkewdpisrgmbfxuaojtnvkewdpisrgmbfxuaojtnvkewdpisrgmbfxuaojtnvkewdpisr...

result:

ok Correct (4 test cases)

Test #29:

score: 0
Accepted
time: 53ms
memory: 4300kb

input:

5
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn...

output:

YES
bnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn...

result:

ok Correct (5 test cases)

Test #30:

score: 0
Accepted
time: 43ms
memory: 4236kb

input:

6
jjwjwwcwuwccuwccwjwtwtecjcpujwtccczccwuuwucecwwwtjwcceuwujtjujctpwwufcjwtjwjwjuujcwcuujjjctwcucuwzfwcwujjujjuecujcfjtucucctejwcujwtcecfwpucwuucjjuuuuuujcwwcuzcwwcpjfcjwjwpwtwtcwcwctcufutcwjucccwwwccfcjjwpwjujeuwjuctwuczpuucujwujccucjcccuuzetjcfzjuuuueuccuwwjtjjfjpccuujjjwjeccccwtwutuwwjucujctwwwcw...

output:

YES
fpzetjwucfpzetjwucfpzetjwucfpzetjwucfpzetjwucfpzetjwucfpzetjwucfpzetjwucfpzetjwucfpzetjwucfpzetjwucfpzetjwucfpzetjwucfpzetjwucfpzetjwucfpzetjwucfpzetjwucfpzetjwucfpzetjwucfpzetjwucfpzetjwucfpzetjwucfpzetjwucfpzetjwucfpzetjwucfpzetjwucfpzetjwucfpzetjwucfpzetjwucfpzetjwucfpzetjwucfpzetjwucfpzetjwu...

result:

ok Correct (6 test cases)

Test #31:

score: 0
Accepted
time: 16ms
memory: 3924kb

input:

7
yyyyzyzyyyyyyzyzyyyzzyzzzzzzyzzyyyzyzyzyyyyyzyzzzyyzyyzzzzzyyzyzyyzyzyzzyyyyyzyyyyzzyyzzzzyzzyyzyzyzzzzzzyzyzyszyzzzzzyszyzzzzzyzyzzzzzyzzyzyzyzzyzyyzzzzyyyyyyzzyyyzzzyzzyzzyzyzzyyzyzzyzzyzyzzzzyzzzzzzzzyzyzyyyzzyzzyyzyyzzyzyyyzzzyyzzyyyzyzzzzyzzzyzzzyyzzyyzsyzyzzyzyzyzzyyzzyzyyzyyzyzyzyzzzzzzzzzy...

output:

YES
syzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsy...

result:

ok Correct (7 test cases)

Test #32:

score: 0
Accepted
time: 41ms
memory: 4100kb

input:

8
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff...

output:

YES
yfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff...

result:

ok Correct (8 test cases)

Test #33:

score: 0
Accepted
time: 28ms
memory: 4064kb

input:

9
dcuhhbmuswbdfduubwhnhbcbcmuwufhssdswkkscshfqnqdcchufhwwhwnfudpewbkbuqdhcuqdphdkaqmubwkckfhudqnqhcbbnpumknquuweqqqdbdubmkdbeacwmduuubfedumuucudbkpbbwkfbckfqweqbcububnmbnbukwwbmcukeuwccqucfcehqfumckwumufdhkebpkckuqchwfchcfbffmcqkbdcunswhwuukwucqcunhnewmbcfdukwcwcnqfuwdmbbcudubwqmhuuhuubqudwqmeddaquc...

output:

YES
apsmenfkwhqdbcuapsmenfkwhqdbcuapsmenfkwhqdbcuapsmenfkwhqdbcuapsmenfkwhqdbcuapsmenfkwhqdbcuapsmenfkwhqdbcuapsmenfkwhqdbcuapsmenfkwhqdbcuapsmenfkwhqdbcuapsmenfkwhqdbcuapsmenfkwhqdbcuapsmenfkwhqdbcuapsmenfkwhqdbcuapsmenfkwhqdbcuapsmenfkwhqdbcuapsmenfkwhqdbcuapsmenfkwhqdbcuapsmenfkwhqdbcuapsmenfkwhq...

result:

ok Correct (9 test cases)

Test #34:

score: 0
Accepted
time: 29ms
memory: 4068kb

input:

10
ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd...

output:

YES
xddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd...

result:

ok Correct (10 test cases)

Test #35:

score: 0
Accepted
time: 25ms
memory: 4036kb

input:

11
ntthxnnrwzyrnpymfnexntpxttntwpfnzzyuknpnppnpnxnhtdttnhpxvgnvwpnnnhuzpuzzpluppztdxyvyxnknpdxwpwnfnznfnntvuzngpupvpmplpnpgndkxhxmldnxuwawnzzdlxpppwxujdznzdnxartlingtnntzplnunfttnntuumntnmunkxnleungzpttunpnplthygvhzmjxmnxvzzxfpttlnkpynywdnjdpzzfngtvlnnkeylmhxdhnzznmzpzujzuknmgnxyzfuvnnjpzunpxtdmvnyv...

output:

YES
bajrkiefyhwglvudmtxzpnbajrkiefyhwglvudmtxzpnbajrkiefyhwglvudmtxzpnbajrkiefyhwglvudmtxzpnbajrkiefyhwglvudmtxzpnbajrkiefyhwglvudmtxzpnbajrkiefyhwglvudmtxzpnbajrkiefyhwglvudmtxzpnbajrkiefyhwglvudmtxzpnbajrkiefyhwglvudmtxzpnbajrkiefyhwglvudmtxzpnbajrkiefyhwglvudmtxzpnbajrkiefyhwglvudmtxzpnbajrkiefyh...

result:

ok Correct (11 test cases)

Test #36:

score: 0
Accepted
time: 42ms
memory: 4044kb

input:

12
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff...

output:

YES
zfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff...

result:

ok Correct (12 test cases)

Test #37:

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

input:

13
hshhhhhshhhhhhhhhhhhhhhhhhhhshhhhhhhhhhhhhshsshhhhshhhhshhhhhhhhhshhhhhhhhshhshhhhhhhhhhhhshhhhhhhhhhhhhhshhhhhhhshhhshhhhhhhshhhsshsshhhhshhhhhhhhshhhhshhhhhhhhhhhshhhhhhshhhhshhhhhhhhhhhshhhhhhhshhhhhshhhhhhshhhhhhhhhhhhshshhshhhsshhshhhhhhhhhhhhhhhhhhhhhshhhhhshhhhhhhhhhhhhhshhhhhhhhhhhshhhsss...

output:

NO
NO
YES
lemzqtgwdicnsufxrbolemzqtgwdicnsufxrbolemzqtgwdicnsufxrbolemzqtgwdicnsufxrbolemzqtgwdicnsufxrbolemzqtgwdicnsufxrbolemzqtgwdicnsufxrbolemzqtgwdicnsufxrbolemzqtgwdicnsufxrbolemzqtgwdicnsufxrbolemzqtgwdicnsufxrbolemzqtgwdicnsufxrbolemzqtgwdicnsufxrbolemzqtgwdicnsufxrbolemzqtgwdicnsufxrbolemzq...

result:

ok Correct (13 test cases)

Test #38:

score: 0
Accepted
time: 25ms
memory: 3920kb

input:

14
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh...

output:

NO
NO
NO
NO
YES
immmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm...

result:

ok Correct (14 test cases)

Test #39:

score: 0
Accepted
time: 28ms
memory: 4048kb

input:

15
rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr...

output:

NO
YES
iawexgrhiawexgrhiawexgrhiawexgrhiawexgrhiawexgrhiawexgrhiawexgrhiawexgrhiawexgrhiawexgrhiawexgrhiawexgrhiawexgrhiawexgrhiawexgrhiawexgrhiawexgrhiawexgrhiawexgrhiawexgrhiawexgrhiawexgrhiawexgrhiawexgrhiawexgrhiawexgrhiawexgrhiawexgrhiawexgrhiawexgrhiawexgrhiawexgrhiawexgrhiawexgrhiawexgrhiawex...

result:

ok Correct (15 test cases)

Test #40:

score: 0
Accepted
time: 36ms
memory: 3848kb

input:

100
qqqwqxqqqqqqqqqqqqwqqqwqqqqqqqqqqqqqqwqqqwqqqqqxqqqwqqqqqqqqqqwqqqqqqqwxqqqqwqqqqqqqwqqqqqqwqqqqqqqqqqqqqqwqqwwqqqwqwqqqqqqqqqqqwqqqqqqqqwqqqqqqqqwqqqwqwqqqqqqqqqqqqqqwwqqqqqqwqqqwqqqqqqwqqwqqwqqqqqqqqwwqwqqqqqqqqqqqqqqqqqqqqqwwqxqqwqqqqqwqqqqqwqqwqqqqqqqqqqqqwqqqqwqqqqqqqqwqqqqqqqqqqqqqqqqqxwqq...

output:

YES
xwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqxwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqw...

result:

ok Correct (100 test cases)

Test #41:

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

input:

101
odousahacopcorozuyvokjoozvhrrxoxoockjzxxxohoeikjjodcijoookbjzvdheojjayoboyejuozmzvejcojrjjkpjjvxvgopreyjpjavrjioovhxqvpzcjvnvjogpojkjakxoovzubhoxvpoauzxkxxeojuothjoqxshjoouoxohjooytexzhjjojupjowpacajoxxjeohxeziouyuhoobpvhhjgjuxexcjjxcukokoxkbovecydydoyyboeooopzbapdbjjoqquejzoadnprjuqejpbuawoooqd...

output:

YES
ftnwgsimqcybdkperavzhxujoftnwgsimqcybdkperavzhxujoftnwgsimqcybdkperavzhxujoftnwgsimqcybdkperavzhxujoftnwgsimqcybdkperavzhxujoftnwgsimqcybdkperavzhxujoftnwgsimqcybdkperavzhxujoftnwgsimqcybdkperavzhxujoftnwgsimqcybdkperavzhxujoftnwgsimqcybdkperavzhxujoftnwgsimqcybdkperavzhxujoftnwgsimqcybdkperavzh...

result:

ok Correct (101 test cases)

Test #42:

score: 0
Accepted
time: 27ms
memory: 3864kb

input:

102
uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu...

output:

YES
suuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu...

result:

ok Correct (102 test cases)

Test #43:

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

input:

103
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz...

output:

NO
YES
oyulzwshqvafkrnpjdtiexboyulzwshqvafkrnpjdtiexboyulzwshqvafkrnpjdtiexboyulzwshqvafkrnpjdtiexboyulzwshqvafkrnpjdtiexboyulzwshqvafkrnpjdtiexboyulzwshqvafkrnpjdtiexboyulzwshqvafkrnpjdtiexboyulzwshqvafkrnpjdtiexboyulzwshqvafkrnpjdtiexboyulzwshqvafkrnpjdtiexboyulzwshqvafkrnpjdtiexboyulzwshqvafkrnpj...

result:

ok Correct (103 test cases)

Test #44:

score: 0
Accepted
time: 35ms
memory: 3904kb

input:

104
oouuoouoououououoouuoouoououuuuuooooouoouoouooouoouuoouuouooouooouuououuouooououuooooouooooouuuoouuuoououooouuoooooooooooouuuuouuuuoooouuouuuoououoouoouuuuooououououuuouuuuuouuoouoooooouooouuoouuoouuouooouououooouuouououoooououooououooouuuuoooouuuuuooouuoooouoouuuuuuououoouuououooouooououuouoooo...

output:

NO
NO
NO
NO
YES
ngmqxzodvtungmqxzodvtungmqxzodvtungmqxzodvtungmqxzodvtungmqxzodvtungmqxzodvtungmqxzodvtungmqxzodvtungmqxzodvtungmqxzodvtungmqxzodvtungmqxzodvtungmqxzodvtungmqxzodvtungmqxzodvtungmqxzodvtungmqxzodvtungmqxzodvtungmqxzodvtungmqxzodvtungmqxzodvtungmqxzodvtungmqxzodvtungmqxzodvtungmqxzodv...

result:

ok Correct (104 test cases)

Test #45:

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

input:

105
bcjobfehszohbhnbheesyhozbxbnhqzhohyyyjsbysbbseyqqebxoeehbhsbzsnozsjzssynhzsoeoohzyobsozosyjozjsjhsjyvssnfsyhobsffssnofsbsebyzshyssqjjobosszvsesohbzsyseyhhqsyoenajosnnesoozfsasshboaezhnosbeqshqjczsxysejbsbjysyhbshyoessbbnzjhozsohhsssoaszhojosaeseszjbycoysbhjesssvobnhycosveoyszssbzhhhfsehqbhxbhshn...

output:

YES
xcavqfnzejbyohsxcavqfnzejbyohsxcavqfnzejbyohsxcavqfnzejbyohsxcavqfnzejbyohsxcavqfnzejbyohsxcavqfnzejbyohsxcavqfnzejbyohsxcavqfnzejbyohsxcavqfnzejbyohsxcavqfnzejbyohsxcavqfnzejbyohsxcavqfnzejbyohsxcavqfnzejbyohsxcavqfnzejbyohsxcavqfnzejbyohsxcavqfnzejbyohsxcavqfnzejbyohsxcavqfnzejbyohsxcavqfnzejb...

result:

ok Correct (105 test cases)

Test #46:

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

input:

1000
vlvvvlvvlvvvlvlvvvvvvvlvlvvvvvvvvvvvvvvlvvvlvlvvvllvvvvlvvvvvvvvvvvvvvlvvvvvvvlvlvvvvvvvvvvvvvlvvvlvvvvvlvvvvvvvvvvvvvvvvlvvvvvvvlvlvvvvvvvvlvvvvvvvvvvlvlvvvvvlvvvvlvvvvlvvvlvvvvvvvvlvvvvlvvlvvvvvvvlvvvlvvlvvvvlvvvvvlvvvvvvvvvvvvlvvlvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvlvvvvvvvvlvlvvvvvvl...

output:

NO
NO
YES
txqlgtxqlgtxqlgtxqlgtxqlgtxqlgtxqlgtxqlgtxqlgtxqlgtxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxqlgxql...

result:

ok Correct (1000 test cases)

Test #47:

score: 0
Accepted
time: 35ms
memory: 3644kb

input:

1001
nfffnfffffnffnnfnffvnffnnffnnvfffnfnnfnnffffnfvvfffvffvfnfffnfffnfnfffffffffffnffffffffnfvffvfnfvfffffffffffnffvffnvfffnffnnnvffnnffnffnfnffvfffffnffffnffffffnnfffnffvvfvfffffffvffnffffffnfnvnfffnnnnfffnffffnnffnfffnfvnffnvnfffffffffffffffvnffffnffnffffffffffvnffffnfffnfvnvfvfffffffffffnfvnfnff...

output:

YES
bvnfbvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfvnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnf...

result:

ok Correct (1001 test cases)

Test #48:

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

input:

1002
oogmilwmoobuglffxuswdvmohlohofmbfhomoloeoouofgofolwuozmdmvoooxmmsgosohhooioabmeuuzlmuuazfoes
aaaaaataaaaaotaatoaaoaataaataaaaaaoataaaaoaaaaaaaaaaaataaaaaaaaaaataaotataataaaaaaaaoaaaaaaaaaaaaaataoaataaaaaaaoaaaaaaaaaattoaaaaoatoaaaatataaaaaaaaaao
ggggggggggggggggggggggggggggggggggggggggggggggggg...

output:

YES
adxvizwebsghlfumoadxvizwebsghlfumozwebsghlfumosghlfumohlfumolfumofumoumomomomooooooooooooooo
YES
otaotaotaotaotaotaotaotaotaotaotaotaotatatatatataaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
YES
oggggggggggggggggggggggggggggggggggggggggg...

result:

ok Correct (1002 test cases)

Test #49:

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

input:

1003
pqvakizaapvlzllaljsajwskvsasivqlrjqkqlivowvkgrvknasireqqkarqrswjelsvkrjiehksswiskkszwlkvqkqalzjlsqplplkavllwllisaslvdvlivklkkvzplqlqklrqigslislelvqleyllllllzjzwikvxswkvlzkqqiqvlasqixkdqklalqalklpsvvekvkkpzspqlvllsskipillllgpsslslpsizsqoaejkxgkeqmsrllaszrknrlzvrkhllkvjkklkvvkijvgqaqrioaallkvzslv...

output:

YES
ctmbfnuydhoxwejgirazpvsqklctmbfnuydhoxwejgirazpvsqklmbfnuydhoxwejgirazpvsqklmbfnuydhoxwejgirazpvsqklmbfnuydhoxwejgirazpvsqklmbfnuydhoxwejgirazpvsqklmbfnuydhoxwejgirazpvsqklbfnuydhoxwejgirazpvsqklbfnuydhoxwejgirazpvsqklnuydhoxwejgirazpvsqklnuydhoxwejgirazpvsqklnuydhoxwejgirazpvsqklnuydhoxwejgiraz...

result:

ok Correct (1003 test cases)

Test #50:

score: 0
Accepted
time: 35ms
memory: 3708kb

input:

1004
jffjjjjjfffjfjfjfjjjfjffjjjffffjjjjjjffffffjjjjfffjjjjjfjfffjjfffjffjjjfjjfjffjfffjjfjjfffjjjjjjjffjffffjfffffjjfjjjjjjjffjfffffjffjfffffjjfjjjffjfffffffjjfjffjfjfjfffffjfffjjjffjffjjffjjjffjjffffffjfffjjffffjffffjjfjjfjjjfjjjfffjjffjffjjjffjjjfjjffffffjjfjjfjffjffjfffjfffjfjjjfjjjjfjffjfffjjff...

output:

NO
NO
YES
qnkohmacjelwvxpugtibrqnkohmacjelwvxpugtibrqnkohmacjelwvxpugtibrqnkohmacjelwvxpugtibrqnkohmacjelwvxpugtibrqnkohmacjelwvxpugtibrqnkohmacjelwvxpugtibrqnkohmacjelwvxpugtibrqnkohmacjelwvxpugtibrqnkohmacjelwvxpugtibrnkohmacjelwvxpugtibrnkohmacjelwvxpugtibrnkohmacjelwvxpugtibrnkohmacjelwvxpugtibr...

result:

ok Correct (1004 test cases)

Test #51:

score: 0
Accepted
time: 35ms
memory: 3720kb

input:

1005
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq...

output:

YES
oqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq...

result:

ok Correct (1005 test cases)

Test #52:

score: 0
Accepted
time: 45ms
memory: 3768kb

input:

10000
tvbb
ueuiisdeuiiuauaeeuueusidaeiuuipiiiphaaiiuiiapuiieaeueippiiiiudaemhdmeeieisiaseeeuiuhmmihesesaemumuiihpuusiai
wekkkkkkekkkfxkkkkefkkkkfxkkwkkekfkkkekkkkkkekkkxxkkk
ggggggggzgggggggggggzzgggggggg
jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj...

output:

YES
tvbb
YES
dhmpsaeuidhmpsaeuidhmpsaeuidhmpsaeuihmpsaeuimpsaeuisaeuiaeuiaeuiaeuiaeuieuieuieuieuieuieuieuieuiuiiiiiiiiiii
YES
wfxekwfxekfxekfxekekekkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
NO
NO
YES
mgxcanhteqpujnhteqpujteqpujeqpujqpujqpujpujujujujujjjjjjjj
NO
YES
q
YES
dqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq...

result:

ok Correct (10000 test cases)

Test #53:

score: 0
Accepted
time: 45ms
memory: 3764kb

input:

10001
yggyyggggyyyyggggggggyggygggyyggggg
vquennceiwrndbehzbzlrlqlwqs
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn...

output:

NO
YES
ihdcvsuzwbrqnlezwbrqnleqnle
NO
YES
xfgronwvtmlickqhudzjeypnwvtmlickqhudzjeypkqhudzjeypdzjeypjeypp
NO
YES
clnowvgatsyjidfwvgatsyjidfwvgatsyjidfvgatsyjidfgatsyjidfatsyjidfatsyjidftsyjidftsyjidftsyjidfsyjidfsyjidfjidfidfdfdfdfdfdfdfdfdfdfffff
YES
qhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh...

result:

ok Correct (10001 test cases)

Test #54:

score: 0
Accepted
time: 41ms
memory: 3748kb

input:

10002
sitssistttssstssshstssssssttssssshtsssssstssstsssitstststissstthtsstssssstttsststtststisststtssssstsssttsstttsttstttstsssstsssshsssttstttttttsthsstssttssststtssttssiststssssshtisstttsssssttthstssttsstisssststtsssststtststsittstststssttsssssttsstssiststtsssttstttstttsssttsststtssststsstsssstsst...

output:

YES
hitshitshitshitshitshitshitshitshitshitshitsitsitstststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststs...

result:

ok Correct (10002 test cases)

Test #55:

score: 0
Accepted
time: 41ms
memory: 3712kb

input:

10003
llllllllllllllllll
swtiwdqlxpiblvroavecbxnfudmioyjddhovgkvl
gggggggggggggwggggg
wdffffwffffffffffwfdffffdfddfdfffwdffffffwfffffffffffffdfffwdffffwdffwffffdwffffffwffffwfffffwwffffffffffffdffffwffffffffffwwfffffffffdfffffffdffwffffffffffwfffffffwfffffffffffffdffdfffwf
qqqqqqqqqqqqqqqqqqqqqqqqqq...

output:

NO
YES
nyutsrqpamkjhgfecwxbloidvwxbloidvloidvdv
YES
wgggggggggggggggggg
YES
dwfdwfdwfdwfdwfdwfdwfdwfdwfdwfdwfdwfdwfdwfdwfdwfwfwfwfwffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
YES
zqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq...

result:

ok Correct (10003 test cases)

Test #56:

score: 0
Accepted
time: 32ms
memory: 3636kb

input:

10004
ovyvdpdadmdyjvzgdadvdahmpvmddhvyaippizypypmmdhfhdybzpdeamvadypdvdvh
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiuiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii...

output:

YES
bojgfeizhmaypvdizhmaypvdzhmaypvdhmaypvdhmaypvdmaypvdypvdpvdvddddddd
YES
uiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii...

result:

ok Correct (10004 test cases)

Test #57:

score: 0
Accepted
time: 33ms
memory: 3764kb

input:

10005
siissssssssssississssisissisisissiisssiiisssssiisissiisssssissss
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
rrrrrrrrrrrrrrrrrrrrrrrrrrrrrprrrrrrrrrrrrrr
zndyqznbdgxp
dddddddddddddddddddddddddddddddddddddddyddddddddddddd
twtwtttwtttttttttwwttttwwwtwtttwtttttttwtwwwt
aaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

NO
NO
YES
prrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
YES
xqpygbzndznd
YES
ydddddddddddddddddddddddddddddddddddddddddddddddddddd
NO
NO
NO
NO
YES
pxxx
YES
htttttttttttttttttttttttttttttttttttttttttttt
YES
bxrnkeyavltosqcgjfzdhwmuyavltosqcgjfzdhwmugjfzdhwmufzdhwmudhwmuwmumuuuuuuuuu
NO
YES
hytfiqcdjpe...

result:

ok Correct (10005 test cases)

Test #58:

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

input:

99995
nnnnnnnnnvnnnnnnnnnn
xbeylyvhgupwzwqcfwokzotjsaur
k
wwwwwwwww
dddddiddddii
rxgrcjrbur
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyiyyyy
ttttttt
eeee
ggfofqgr
mgvmqmls
nbjv
fdfdfdffdfddfddfffffff
okoooook
kpds
ieri
zzzzzzzzzzzzzzzz
wsb
v
uuuuu
fccccc
xxo
ssssssss
ltttllllllllllll
pppppppp
mmmmmmmmmm
lw...

output:

YES
vnnnnnnnnnnnnnnnnnnn
YES
bxvtsrqplkjhgfecaouyzwouyzww
YES
k
NO
NO
YES
jguxcbrrrr
YES
iyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
NO
NO
YES
oqrfgfgg
YES
lqsgvmmm
YES
nvjb
NO
NO
YES
kpsd
YES
reii
NO
YES
swb
YES
v
NO
YES
fccccc
YES
oxx
NO
NO
NO
NO
YES
liheuwdbvv
YES
mihwx
YES
wd
NO
NO
NO
YES
awogog
Y...

result:

ok Correct (99995 test cases)

Test #59:

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

input:

99996
t
kkkkkkkkkkkk
oolcf
pvyqvvvvvovvvyyvppovqvv
owmwwneepkqteyealh
nnn
vkjolvljdxffovjcld
h
wy
kgkjgg
x
arptppnaaaiyickkhlzbp
japmhjhaa
fwfwfz
gok
mmmmmccmmmmcmmmmmmmmcmmmmm
pms
u
w
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
yyyyyyyyyyyy
yyyyyyyyyyyyyyyyyyy
bl
kkwwwkfwkwmmmwfmkkw
...

output:

YES
t
NO
YES
lfcoo
YES
oqpyvoqpyvpyvvvvvvvvvvv
YES
aytqponmlkhwewewee
NO
YES
kxcofdljvofdljvljv
YES
h
YES
wy
YES
jkgkgg
YES
x
YES
ntyzrlhcbkipakipapapa
YES
mpjhajhaa
YES
zwfwff
YES
okg
NO
YES
mps
YES
u
YES
w
NO
NO
NO
YES
lb
YES
fmkwfmkwmkwmkwkwkww
NO
NO
NO
YES
vooooo
NO
YES
mkjtfvc
NO
YES
vwybdhdhdh...

result:

ok Correct (99996 test cases)

Test #60:

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

input:

99997
vjjjj
sxxsxsxx
mopdojpgmvnbzjoovt
ffffff
uuuuubuuuuuuuuuuu
ss
zuhuuzh
lqqe
epss
rrlrllr
ycevokhitbw
af
a
ztybl
qwgrdkcp
aaaaabaaaaaaaaaaaaa
iiiiyiiiiiiii
x
xxxxxxxx
q
ltmuru
nudmway
za
sw
dddddddddqdddddddddddddd
adox
z
smkb
ppppppppvp
rrdrrrr
uuuuuuu
verjutjrbeeszjcea
gggggqg
irwqcqfwfymwcqqf...

output:

YES
vjjjj
NO
YES
ntzgdbpmvjopmvjooo
NO
YES
buuuuuuuuuuuuuuuu
NO
YES
hzuhzuu
YES
leqq
YES
pess
NO
YES
kiohetvwcyb
YES
af
YES
a
YES
yztlb
YES
kpqrgwdc
YES
baaaaaaaaaaaaaaaaaa
YES
yiiiiiiiiiiii
YES
x
NO
YES
q
YES
lmrtuu
YES
mnudwya
YES
az
YES
sw
YES
qddddddddddddddddddddddd
YES
aodx
YES
z
YES
mksb
YES
...

result:

ok Correct (99997 test cases)

Test #61:

score: 0
Accepted
time: 108ms
memory: 3692kb

input:

99998
nnnnnnnnnnnnnnn
dhthtivcii
u
ttpjcohoe
beedbeeeebbbbee
yxkohypuat
lllllxlllllxllllll
aqqq
yffff
ozhsejmhwrqkiazrmslgtzrrqrgscifkqgbdpvhy
sbbbsssbssssbssssssbsbbssssbbssssssssssssss
kekyerues
ooc
aaaaaaaaaaaaaaaaaaaaaa
lf
qwhbbqwh
xvx
ttthhthttthhtththhhhh
yykusichtq
kkkt
vvvvvfv
w
omkpbmtvriqc...

output:

NO
YES
vdchtihtii
YES
u
YES
pjhecotot
YES
dbebebebebebeee
YES
poatuhxkyy
NO
YES
aqqq
YES
yffff
YES
bywvtpoljfedcakmihqsgzrkmihqsgzrhqsgzrrr
NO
YES
rsuykekee
YES
coo
NO
YES
lf
YES
qhwbqhwb
YES
vxx
NO
YES
kihqstucyy
YES
tkkk
YES
fvvvvvv
YES
w
YES
qbcwvesrpoakitmjtmj
YES
puauaa
YES
piw
YES
sbb
YES
jyae...

result:

ok Correct (99998 test cases)

Test #62:

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

input:

99999
maidfrsnrydqyfdddnsdrfnnifrfdriqq
ggqgtggqgqgtggtg
ojjdcvophgxordscoih
ggigggggiiiggii
uii
lllllll
yfcdrb
xuxxzzibr
edswmxrjbpczllyhkfaqazndi
ssl
hqqqqqqqqq
hhhhhhhhhhhhh
sbi
aaaaaaaaaaaaaaaaaaaaaaa
sosx
kthrsupzoopdhfqiivxyajg
dllllllllllllll
izzzzzzz
xxxxxx
qxqxpss
oycyrwnujuujjucljb
mmmmmpm...

output:

YES
masyiqnrfdsyiqnrfdiqnrfdnrfdrfddd
YES
qtgqtgqtgggggggg
YES
ipgrsvxjhdcojhdcooo
NO
YES
uii
NO
YES
rfdcyb
YES
burizxzxx
YES
byxwsrqpnmkjihfecldazldaz
YES
lss
YES
hqqqqqqqqq
NO
YES
isb
NO
YES
oxss
YES
gzyxavutsrqdkjfpoihpoih
YES
dllllllllllllll
YES
izzzzzzz
NO
YES
pqsxqsx
YES
wnrolbcyujcyujujuj
YES...

result:

ok Correct (99999 test cases)

Test #63:

score: 0
Accepted
time: 91ms
memory: 3716kb

input:

100000
m
fffffffff
eidevqeeleliel
eeeeeee
pppppppppppppppppppppppppppppppppppppppppppppp
laia
a
oodddoddddddod
o
gljllkwllgwwllkkkjwwlkiwkgg
mmmmmmmmmmmmmmmmmmmmmmm
xnttkdk
eiihbiico
aam
y
vvvvvvvvvvvvgvvvvvvvvvv
hxaznvnl
ddzzzx
kkkkkkkkkkkkkkkkkkkkkkkkk
k
jjjjjjjjjjjjj
fxjeekgurrlkujc
jssss
ioieiii...

output:

YES
m
NO
YES
qvdileileleeee
NO
NO
YES
liaa
YES
a
NO
YES
o
YES
ijgkwljgkwlgkwlgkwlkwlkwlll
NO
YES
ndxktkt
YES
ohecbiiii
YES
maa
YES
y
YES
gvvvvvvvvvvvvvvvvvvvvvv
YES
zxavlhnn
YES
xdzdzz
NO
YES
k
NO
YES
lgfxckjruekjrue
YES
jssss
YES
oeiiiiii
YES
klnpstxcjyueijyueieii
YES
wcmwcmwcmmmm
YES
yvvvvvvv
NO
N...

result:

ok Correct (100000 test cases)

Extra Test:

score: 0
Extra Test Passed