QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#463364#8829. AibohphobiaMay_27thAC ✓68ms11896kbC++201.5kb2024-07-04 19:04:292024-07-04 19:04:30

Judging History

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

  • [2024-07-04 19:04:30]
  • 评测
  • 测评结果:AC
  • 用时:68ms
  • 内存:11896kb
  • [2024-07-04 19:04:29]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define i64 long long
#define i128 __int128
#define mp make_pair
#define pb push_back
#define all(x) (x).begin(), (x).end()
void Solve(void) {
  string S; cin >> S;
  vector<int> cnt(26, 0), cnt1(26, 0);
  vector<int> cs;
  for (int i = 0; i < (int)S.size(); i ++) {
    cnt[S[i] - 'a'] ++;
    cnt1[S[i] - 'a'] ++;
    cs.pb(S[i] - 'a');
  }
  sort(all(cs)); cs.erase(unique(all(cs)), cs.end());
  int p = 0, p1 = 1, sz = cs.size();
  vector<char> ans, ans1;
  for (int i = 0; i < (int)S.size(); i ++) {
    while (cnt[cs[p]] == 0) p = (p + 1) % sz;
    ans.pb(char(cs[p] + 'a'));
    cnt[cs[p]] --;
    p = (p + 1) % sz;

    while (cnt1[cs[p1]] == 0) p1 = (p1 + 1) % sz;
    ans1.pb(char(cs[p1] + 'a'));
    cnt1[cs[p1]] --;
    p1 = (p1 + 1) % sz;
  }

  bool flag = true, flag1 = true;
  if ((int)ans.size() > 1 && ans[1] == ans[0] || (int)ans.size() > 2 && ans[2] == ans[0]) flag = false;
  if ((int)ans1.size() > 1 && ans1[1] == ans1[0] || (int)ans1.size() > 2 && ans1[2] == ans1[0]) flag1 = false;
  if (!flag && !flag1) {
    cout << "NO" << "\n";
    return;
  }
  cout << "YES" << "\n";
  if (flag) {
    for (auto x : ans) cout << x; cout << "\n";
  }
  else if (flag1) {
    for (auto x : ans1) cout << x; cout << "\n";
  }
}
signed main() {
  ios_base::sync_with_stdio(false); cin.tie(0);
  cout << fixed << setprecision(10);
  int Tests = 1; cin >> Tests;
  while (Tests --) {
    Solve();
  }
}

詳細信息

Test #1:

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

input:

5
a
sos
abba
icpc
tenet

output:

YES
a
YES
oss
NO
YES
cipc
YES
entet

result:

ok Correct (5 test cases)

Test #2:

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

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
jtvtt
NO
YES
elnpv
YES
ijti
NO
YES
loo
NO
YES
qu
YES
gmvgv
NO
NO
YES
ykkk
YES
o
YES
ummmm
YES
aetvv
YES
lntx

result:

ok Correct (18 test cases)

Test #3:

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

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
ceghpqst
YES
berszrrrrr
YES
ree
YES
ghlryyy
YES
bkwxwxwww
YES
aghisah
YES
gklsvzvv
NO
YES
hqryhqrqqq
YES
dfgsffffff
YES
suzsuzsuz
YES
bcdnrwynrr
YES
aceluele
YES
cfwcwcwcwc
YES
eimemee
YES
eswxesxee
YES
kmpykkkkk
YES
deimorze
YES
fhllll
YES
cluyllll
YES
qruqruq
NO
NO
NO
YES
cn
YES
jlzjlzlll
YES
...

result:

ok Correct (138 test cases)

Test #4:

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

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
flpuvfpuvfuv
YES
cdghnqtuvcvcccc
YES
dgijqrdgqddddd
YES
imniiiiiiiiiiii
YES
deijqsxqqqq
YES
jkvzkvzkkkkkkkk
YES
aegimnwzagmwaaa
YES
bdgbdgbdgbdgg
YES
beqrxzbrxb
YES
chklqstxyxyyy
YES
bdjprvjrrrrrr
NO
YES
agkqykqykqy
YES
aefiteeeeeee
YES
abfhlqsxbfqbb
YES
bcdeovzcvcvcv
YES
abeiqiiiiiiiii
YES
ehxe...

result:

ok Correct (683 test cases)

Test #5:

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

input:

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

output:

YES
abfhkqruzahqzahzahzz
YES
dmopsvwdmpswdmsww
YES
befhjknvxzbfhjkxzkz
YES
aegoqrvwaoqqqq
YES
dehsxzdehzdeeeeeeeee
YES
acdfhijkqrvzackqrcqq
YES
dkquxzdkqkqkqkqqq
YES
jrturturturtutututut
YES
acdghklmtwyagktya
YES
hjqxhjqxhjqxqx
YES
fkzfkzfkfkfkfkfkfff
YES
boqyboqyboqyboybbb
YES
elryelryelryelyelyl
Y...

result:

ok Correct (2713 test cases)

Test #6:

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

input:

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

output:

YES
fghmqtvfghmqvhmvhmvhmvhmhmhmhmm
YES
acipsyaipsaipaipapapapapapapapa
YES
aefgipqruwagiqrugrggggggggggg
YES
ikmnqsiksiksksssssssss
YES
bdhikmprtvyhimrtvyhmrvhmrvmmmm
YES
bcefgklpqrtuxzlplplplll
YES
bkpstbkpstbkstbkstbkbkbk
YES
cgnvcgnvgnvgnvgnvnnnnnnn
YES
dhjlmnstuyhjmtuyhmuyhyhyyyyyyyy
YES
abcegk...

result:

ok Correct (35444 test cases)

Test #7:

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

input:

1
lllvrvrqtekpyfwztplrzmkfmlvllvjmzffllrmemmyjmlllwbiruatutvvumfttuemtjvmfvmjktlfzwmllfitqtvjtqftvergkqtebzjmwtvfjklklgjjevuuqrjzltrutklzytzvjyjuzlvjlivilvwtztijfrmvfkmfkiuxrtpftibbrlzvltbljbjtiqlzzjtyvljklvluutzqjvltenvtjlmtjyejvvlverflbvmkvjfwtlvrvmpbtpllvpbklqkulezkmrmltljvtklvitqelmvqvvfqfofkfyu...

output:

YES
abefgijklmnopqrtuvwxyzabefgijklmnopqrtuvwxyzabefgijklmnopqrtuvwxyzabefgijklmnopqrtuvwxyzabefgijklmnopqrtuvwxyzabefgijklmnopqrtuvwxyzabefgijklmnopqrtuvwxyzabefgijklmnopqrtuvwxyzabefgijklmnopqrtuvwxyzabefgijklmnopqrtuvwxyzabefgijklmnopqrtuvwxyzabefgijklmnopqrtuvwxyzabefgijklmnopqrtuvwxyzabefgijklm...

result:

ok Correct (1 test case)

Test #8:

score: 0
Accepted
time: 68ms
memory: 11252kb

input:

1
ltdkuekutrbtetdwdttuvutvkvpdntdtlelvepthdtupiwvelpthttmrrtltvztgvutuvypvtbtrtfyrvfutefedpovbufubttvlpfutptdvevmzrvpslffetetveppvotlpewwrefytevteovnfvbytjvtvvhrptvwtewtotpvetgpvfegvefkbttvetrtabhemvtuktevthtbvbyftvrhepebpywhtttfjelrfrttugpevkkytettltvtudidobvmthsotrtvtbtvhtttbwvlpgghbrevplvpttbedfr...

output:

YES
abdefghijklmnopqrstuvwyzabdefghijklmnopqrstuvwyzabdefghijklmnopqrstuvwyzabdefghijklmnopqrstuvwyzabdefghijklmnopqrstuvwyzabdefghijklmnopqrstuvwyzabdefghijklmnopqrstuvwyzabdefghijklmnopqrstuvwyzabdefghijklmnopqrstuvwyzabdefghijklmnopqrstuvwyzabdefghijklmnopqrstuvwyzabdefghijklmnopqrstuvwyzabdefghi...

result:

ok Correct (1 test case)

Test #9:

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

input:

1
kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk...

output:

YES
dkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk...

result:

ok Correct (1 test case)

Test #10:

score: 0
Accepted
time: 19ms
memory: 11308kb

input:

1
llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll...

output:

NO

result:

ok Correct (1 test case)

Test #11:

score: 0
Accepted
time: 18ms
memory: 11356kb

input:

1
xxsssxssxxsxxsssxxxxxxxsxsssxssxsxxssxsssxsxxsssssxxsxxsssxxsxxxsxxsssxxxssssssxxssxxxssssssxxsssssssxsxsssxsxxsssxxssssxssssssssxsssxssxssssxssxsssssxsxsxxsxssxsxxssssxxsssssssxssxxxssxsxsssxsxxsxxxxxsxsxxxsxsxsxsxxsxxsxssssxxxxsxssssxxsxxssssxsxssxxxxxxsxsxsxxxxsxxxssssxsxxxssxxxsxssxxssxxxssssx...

output:

NO

result:

ok Correct (1 test case)

Test #12:

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

input:

1
xuxjjjuwwxxxuljzwjwuxzwwxxujjxjuxjzwxxzxjjwxxwjxlxujjxlwwxwljwwxzxxwlwxuljtxlxjwlxwzxuzxuxuwwxuttzwjjjwxuxuwjxzxjuwllxxjjxxjxjjxjwxxwxuxjjxjzwwwwwzjuzlzujltxuxwxwjltlwjwxuljlxjuujxxxwjwuwjlxjxlxtwxxxwxlxwwlxjlluxxxwwxuxjwjtwlwwwxjxxjtjjxuwjtwxzujzjlwxxjxuxlxjzuujwjjjxxwwlxxxxxxzxxwjwwjjxxwwxxljzjj...

output:

YES
jltuwxzjltuwxzjltuwxzjltuwxzjltuwxzjltuwxzjltuwxzjltuwxzjltuwxzjltuwxzjltuwxzjltuwxzjltuwxzjltuwxzjltuwxzjltuwxzjltuwxzjltuwxzjltuwxzjltuwxzjltuwxzjltuwxzjltuwxzjltuwxzjltuwxzjltuwxzjltuwxzjltuwxzjltuwxzjltuwxzjltuwxzjltuwxzjltuwxzjltuwxzjltuwxzjltuwxzjltuwxzjltuwxzjltuwxzjltuwxzjltuwxzjltuwxzjl...

result:

ok Correct (1 test case)

Test #13:

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

input:

1
rlaarbabrvbxxbbmbabrxqabbxhgaqhlgbaqrarbqagabglbbxqwaaaxrwawxarxhbvxgqgraablbbabbwxaravbbbxaabahxlitlrmgvhxabbbgxbvgvavablmrbvbbbvqbqbgxghwhbbahxcbhbahababrgvvarvxxbvqbbmgrmqvtvbbbavaqbryambabmhvabvarmlvbqiarbbvambbhxthrbhhyqqxgabxaaqvgqmlibrwqaalraawvraaahbbamaaaqqhmrrabvqavbqvamvbbxtlrvqxvlhhvbm...

output:

YES
abcghilmqrstvwxyabcghilmqrstvwxyabcghilmqrstvwxyabcghilmqrstvwxyabcghilmqrstvwxyabcghilmqrstvwxyabcghilmqrstvwxyabcghilmqrstvwxyabcghilmqrstvwxyabcghilmqrstvwxyabcghilmqrstvwxyabcghilmqrstvwxyabcghilmqrstvwxyabcghilmqrstvwxyabcghilmqrstvwxyabcghilmqrstvwxyabcghilmqrstvwxyabcghilmqrstvwxyabcghilm...

result:

ok Correct (1 test case)

Test #14:

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

input:

1
wwwwwwwwwuuwuuwuuwwwwwwuuwwwwwuwwwwuwwwuwwuwwwwuwwwwuwuuwwuwuwwwuuwuwwwwwwwwuwwwwwwwwuuwuuwwwwuuwwwwwwuwwuwuwwuwwuwuuuuuwuuwwwwwuwuwwwwwuwwuwwwwwuuwwuuwwwuuwuwwwuwwwwwwwwwwwuuwuwwwwwwuwuwwuwwwwwwuwwwwuwuwuwuwwuwwwwwuwuwuwwwwuwwwwuwuwwwwwwwwuwwwwuuwwuwuuuwuwwwwwwuuuwuwwwwuwwwuwwwwuwuuuwwwwwwwwwwwww...

output:

NO

result:

ok Correct (1 test case)

Test #15:

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

input:

1
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...

output:

NO

result:

ok Correct (1 test case)

Test #16:

score: 0
Accepted
time: 63ms
memory: 11472kb

input:

1
xxymtrfydfriirryfiwxxtxwfiwwiirtwiifmxklxddgdrgyxniimirihiitayyidwumtwfxfyifxixrfizfahfafdigkyxigrxtbdwxdiitpxwfxfijirjirfitirqfrxbqiitxhzrwhqtrahrbfdfhrmixwriubiirmwmrmridxrvfvasddrqfrxsmiixrrxwhpifhiinaxxfzeydbavrywtfrwiixtmkqdbxhbxtwfircmririwxaxwmziqxtbrwiifcrwsmrrrmsffitysdixxiyxmrgirhwfrxhcu...

output:

YES
abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghij...

result:

ok Correct (1 test case)

Test #17:

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

input:

2
jjccjhjceccjccccejcjjcccchcecjchccccjeccjccccccceececccccccccjcecccceccjcccccccechejccccbccccjjcccccecjccjccccjccecccjejcceccjccccceejejcjcjccjcccccchcheccejcccjccjcjeccjcccceccecjcccejcccjccccecchjjheccccjcecjcccccchcjccccehjccechccjcbccccccjcjccjccjccejcccjcjccccccccccbejjcjcejecjjcjjcjeccceccbj...

output:

YES
bcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjbcehjb...

result:

ok Correct (2 test cases)

Test #18:

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

input:

2
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee...

output:

YES
qeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee...

result:

ok Correct (2 test cases)

Test #19:

score: 0
Accepted
time: 19ms
memory: 10532kb

input:

2
uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu...

output:

NO
NO

result:

ok Correct (2 test cases)

Test #20:

score: 0
Accepted
time: 19ms
memory: 10140kb

input:

2
rrwwrwwwrrrwrrrrwrrwrwwwrwrrwwwrrwwwwwwwrrwrwrrwrwrwrwwrwrwrrwrrrwrwwwwrwrrrrwrwrwwrwrwwwwrwrrwwwwrrrwwwrrwwrwwwwrwwwwwwwrwrrrrwwwrwwrrwrwrwrwwrrwrwrrrwwwrwrwwrwrwwrwwrrwrwwwwwwwwwwwwwwwrwrrwrwrwwrwwrwwwwrrrrwrwwwwrwrrrrwrwwwrwwrwrwrrrrrwwwwwwrrrrrwrwrwrwrwrrrwwwrrwwwwwwrrwwwwwwrwwwwrwrrwwrwwrrwrw...

output:

NO
NO

result:

ok Correct (2 test cases)

Test #21:

score: 0
Accepted
time: 48ms
memory: 10824kb

input:

2
bwwrbrrbrbbrrbwbwrbbbbvbbwbrrbrvbbrrbbbvrbrbwrbvrrrvrrrrbbrbbbrbbrbrbbrbrvbbwrrbrbbbrbrrbwrwrbbrbbbrbrbbrvbrrbbbbbbbbbrrrrrbvrvbrbrvbbrbbbrbbrrbbrrrbbbvrrrrbbrbbrbbrrbbbrwbrbrbrwrbbrvbbrwbbrrrrbbrrvrrrbrbvvbbrbrrwbwrvbwwrrrbbrwbbbrrvbvbbbbbbwvbvwwbrbrbwrrbbrrbwbwbrbbbrbbbrvvwbrbrrbbrbwrbbrbrbrrrrr...

output:

YES
brvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvwbrvw...

result:

ok Correct (2 test cases)

Test #22:

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

input:

2
nugcuvzcqqzcocufwtvmodbqvqwwcqspphcqiupmvscgyppfuvvobvgvbuopbvouqpbqciugsovgqiquudlfcoucvuvuicumvuyviipawfiukqsiuopgqzxovoviqidvgicbfvxpocuvmqdsnqgqpfscnshtvgvugqabisuovqplsfowybikvlgogpdypaugccqqncgpcgbqstgpvcqwvivmnucpaczikfvpqbvdxqqgipbougqcgeitvvipgtvubqqssvokkvgbvqcwdkfcuqsaxsmucgqqusqsunuxvq...

output:

YES
abcdefghiklmnopqrstuvwxyzabcdefghiklmnopqrstuvwxyzabcdefghiklmnopqrstuvwxyzabcdefghiklmnopqrstuvwxyzabcdefghiklmnopqrstuvwxyzabcdefghiklmnopqrstuvwxyzabcdefghiklmnopqrstuvwxyzabcdefghiklmnopqrstuvwxyzabcdefghiklmnopqrstuvwxyzabcdefghiklmnopqrstuvwxyzabcdefghiklmnopqrstuvwxyzabcdefghiklmnopqrstuv...

result:

ok Correct (2 test cases)

Test #23:

score: 0
Accepted
time: 44ms
memory: 9728kb

input:

2
sybobwroswosbwsswssbsowobowsbwssowwoosobsbbwsbhwwwbbbwbbwssywwsosrswyswowyroossbbowssswwysbswsbbybbbossyosbbwbyswywwbosboysbwbsosobwsbbwswoywbswysbsbssowyobsbybwswbsbsbsoyosooossrwwrbwowwyyyssswsybbsobbbohbbsywysobswwhbssywsywrbbsyossssbossobwsyyrbbssswwwwbbysbobybsbooobwhsosyybbwosbwbwsbobbssowws...

output:

YES
bhorswybhorswybhorswybhorswybhorswybhorswybhorswybhorswybhorswybhorswybhorswybhorswybhorswybhorswybhorswybhorswybhorswybhorswybhorswybhorswybhorswybhorswybhorswybhorswybhorswybhorswybhorswybhorswybhorswybhorswybhorswybhorswybhorswybhorswybhorswybhorswybhorswybhorswybhorswybhorswybhorswybhorswybh...

result:

ok Correct (2 test cases)

Test #24:

score: 0
Accepted
time: 26ms
memory: 10328kb

input:

2
yyyyyyyyyyyyyyvyyyyyyyvyyyyyvyvyyyyyyyyyvyyvyyyyyyyyyyvyyyyyyyyyyyyyvyyvyyvyyyyyyvyyyyvyyyyyvvyyyyyyyyyyyyyyvyvyvyyyyyyyvyvyyyyyvyvyyyvyyyyyyyyyyyyyvvyyyyvyyyyyyyyvyyyyvyyvyyyyvyvyvyyyyyyyyyvyyyyyyyyyyyyyyyvyyyvyyyyyyyyyyyyyyyyyyyyvyyvvyyyyyyyyvyyyyyyvyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyvyvyyyyyyyyyy...

output:

NO
YES
cdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdjmpcdj...

result:

ok Correct (2 test cases)

Test #25:

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

input:

2
dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd...

output:

NO
YES
bdfhlnqrtvbdfhlnqrtvbdfhlnqrtvbdfhlnqrtvbdfhlnqrtvbdfhlnqrtvbdfhlnqrtvbdfhlnqrtvbdfhlnqrtvbdfhlnqrtvbdfhlnqrtvbdfhlnqrtvbdfhlnqrtvbdfhlnqrtvbdfhlnqrtvbdfhlnqrtvbdfhlnqrtvbdfhlnqrtvbdfhlnqrtvbdfhlnqrtvbdfhlnqrtvbdfhlnqrtvbdfhlnqrtvbdfhlnqrtvbdfhlnqrtvbdfhlnqrtvbdfhlnqrtvbdfhlnqrtvbdfhlnqrtvbdf...

result:

ok Correct (2 test cases)

Test #26:

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

input:

2
jjjjjjjjjjjjujjjjjjjjjjjjjjjjjjjjjjjjujjjjjjjjjjjjjjjjujjjjjjjjjjjjjujjjjjjjjjjjjjjjjjjujjjjjjjujjjujjjjjjjjjjjujjjjjjjjjjjjjjjjjjjjjujjjjujjjjjjjujjjjjjjjjjjjujjjjjjjjjjujjujjjjjjjjjjjjjujjjjjjjjjjjjjjujjjjjjjujjjjjjjjjjjjjjujjjjjjjjjujjjjjjjjjjjjjjjjjjjjujjjjjjjujjjjjjujjjjjjjjjjjujjjjjjjjjjjjjj...

output:

NO
NO

result:

ok Correct (2 test cases)

Test #27:

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

input:

3
qgugaaagpllaxasaxxgpxxsqapbgqqglxjghagaxgsullgaxxqbpguxggxygfxaxluxpqxglsjxqhypgpaggagfqfugqlsqxlqguuuuqgygpohaggxbxqjzqjgxxsllaxflshqgaqjaagaupxuugjxpsxgsaguupjqsqxagqgupauupxaajqlxgqhdguggrgjxaxfgbqglbgulgqgxqjjxaagxfxxlgullqdxagsjaqlqgxluuusuqyjxfggllzqljpgfaggbugqgxhuluxxggauggayxquaxxufsxxpbs...

output:

YES
abdfghjlopqrsuxyzabdfghjlopqrsuxyzabdfghjlopqrsuxyzabdfghjlopqrsuxyzabdfghjlopqrsuxyzabdfghjlopqrsuxyzabdfghjlopqrsuxyzabdfghjlopqrsuxyzabdfghjlopqrsuxyzabdfghjlopqrsuxyzabdfghjlopqrsuxyzabdfghjlopqrsuxyzabdfghjlopqrsuxyzabdfghjlopqrsuxyzabdfghjlopqrsuxyzabdfghjlopqrsuxyzabdfghjlopqrsuxyzabdfghj...

result:

ok Correct (3 test cases)

Test #28:

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

input:

4
kifbnffgffbsfrfbmfwbkivwdrggfbmimibfbpdfsvfrpmrfmvbpemgiwpbfbmwsfgbwvdamfbfrdgddkndjmmrgtmrrmsbvsfwwfspfftdfibdffffesdkfesbbmipbkrjwdpfgrfofvfpifvnfgrtvfnjmifbiwfbfifxvmsfgmsbdffvjfvdgewibfrrfvrfbbssmwfrskbkfffwfswffbfsedffbmdkmffddbebbrksgiprebrfdwrfngkufmbdffwkbfdeisapfbmbdstwiijbbbodbbbfffikigg...

output:

YES
abdefgijkmnoprstuvwxabdefgijkmnoprstuvwxabdefgijkmnoprstuvwxabdefgijkmnoprstuvwxabdefgijkmnoprstuvwxabdefgijkmnoprstuvwxabdefgijkmnoprstuvwxabdefgijkmnoprstuvwxabdefgijkmnoprstuvwxabdefgijkmnoprstuvwxabdefgijkmnoprstuvwxabdefgijkmnoprstuvwxabdefgijkmnoprstuvwxabdefgijkmnoprstuvwxabdefgijkmnoprst...

result:

ok Correct (4 test cases)

Test #29:

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

input:

5
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn...

output:

YES
bnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn...

result:

ok Correct (5 test cases)

Test #30:

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

input:

6
jjwjwwcwuwccuwccwjwtwtecjcpujwtccczccwuuwucecwwwtjwcceuwujtjujctpwwufcjwtjwjwjuujcwcuujjjctwcucuwzfwcwujjujjuecujcfjtucucctejwcujwtcecfwpucwuucjjuuuuuujcwwcuzcwwcpjfcjwjwpwtwtcwcwctcufutcwjucccwwwccfcjjwpwjujeuwjuctwuczpuucujwujccucjcccuuzetjcfzjuuuueuccuwwjtjjfjpccuujjjwjeccccwtwutuwwjucujctwwwcw...

output:

YES
cefjptuwzcefjptuwzcefjptuwzcefjptuwzcefjptuwzcefjptuwzcefjptuwzcefjptuwzcefjptuwzcefjptuwzcefjptuwzcefjptuwzcefjptuwzcefjptuwzcefjptuwzcefjptuwzcefjptuwzcefjptuwzcefjptuwzcefjptuwzcefjptuwzcefjptuwzcefjptuwzcefjptuwzcefjptuwzcefjptuwzcefjptuwzcefjptuwzcefjptuwzcefjptuwzcefjptuwzcefjptuwzcefjptuw...

result:

ok Correct (6 test cases)

Test #31:

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

input:

7
yyyyzyzyyyyyyzyzyyyzzyzzzzzzyzzyyyzyzyzyyyyyzyzzzyyzyyzzzzzyyzyzyyzyzyzzyyyyyzyyyyzzyyzzzzyzzyyzyzyzzzzzzyzyzyszyzzzzzyszyzzzzzyzyzzzzzyzzyzyzyzzyzyyzzzzyyyyyyzzyyyzzzyzzyzzyzyzzyyzyzzyzzyzyzzzzyzzzzzzzzyzyzyyyzzyzzyyzyyzzyzyyyzzzyyzzyyyzyzzzzyzzzyzzzyyzzyyzsyzyzzyzyzyzzyyzzyzyyzyyzyzyzyzzzzzzzzzy...

output:

YES
syzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsyzsy...

result:

ok Correct (7 test cases)

Test #32:

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

input:

8
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff...

output:

YES
yfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff...

result:

ok Correct (8 test cases)

Test #33:

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

input:

9
dcuhhbmuswbdfduubwhnhbcbcmuwufhssdswkkscshfqnqdcchufhwwhwnfudpewbkbuqdhcuqdphdkaqmubwkckfhudqnqhcbbnpumknquuweqqqdbdubmkdbeacwmduuubfedumuucudbkpbbwkfbckfqweqbcububnmbnbukwwbmcukeuwccqucfcehqfumckwumufdhkebpkckuqchwfchcfbffmcqkbdcunswhwuukwucqcunhnewmbcfdukwcwcnqfuwdmbbcudubwqmhuuhuubqudwqmeddaquc...

output:

YES
abcdefhkmnpqsuwabcdefhkmnpqsuwabcdefhkmnpqsuwabcdefhkmnpqsuwabcdefhkmnpqsuwabcdefhkmnpqsuwabcdefhkmnpqsuwabcdefhkmnpqsuwabcdefhkmnpqsuwabcdefhkmnpqsuwabcdefhkmnpqsuwabcdefhkmnpqsuwabcdefhkmnpqsuwabcdefhkmnpqsuwabcdefhkmnpqsuwabcdefhkmnpqsuwabcdefhkmnpqsuwabcdefhkmnpqsuwabcdefhkmnpqsuwabcdefhkmnp...

result:

ok Correct (9 test cases)

Test #34:

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

input:

10
ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd...

output:

YES
xddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd...

result:

ok Correct (10 test cases)

Test #35:

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

input:

11
ntthxnnrwzyrnpymfnexntpxttntwpfnzzyuknpnppnpnxnhtdttnhpxvgnvwpnnnhuzpuzzpluppztdxyvyxnknpdxwpwnfnznfnntvuzngpupvpmplpnpgndkxhxmldnxuwawnzzdlxpppwxujdznzdnxartlingtnntzplnunfttnntuumntnmunkxnleungzpttunpnplthygvhzmjxmnxvzzxfpttlnkpynywdnjdpzzfngtvlnnkeylmhxdhnzznmzpzujzuknmgnxyzfuvnnjpzunpxtdmvnyv...

output:

YES
abdefghijklmnprtuvwxyzabdefghijklmnprtuvwxyzabdefghijklmnprtuvwxyzabdefghijklmnprtuvwxyzabdefghijklmnprtuvwxyzabdefghijklmnprtuvwxyzabdefghijklmnprtuvwxyzabdefghijklmnprtuvwxyzabdefghijklmnprtuvwxyzabdefghijklmnprtuvwxyzabdefghijklmnprtuvwxyzabdefghijklmnprtuvwxyzabdefghijklmnprtuvwxyzabdefghijk...

result:

ok Correct (11 test cases)

Test #36:

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

input:

12
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff...

output:

YES
zfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff...

result:

ok Correct (12 test cases)

Test #37:

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

input:

13
hshhhhhshhhhhhhhhhhhhhhhhhhhshhhhhhhhhhhhhshsshhhhshhhhshhhhhhhhhshhhhhhhhshhshhhhhhhhhhhhshhhhhhhhhhhhhhshhhhhhhshhhshhhhhhhshhhsshsshhhhshhhhhhhhshhhhshhhhhhhhhhhshhhhhhshhhhshhhhhhhhhhhshhhhhhhshhhhhshhhhhhshhhhhhhhhhhhshshhshhhsshhshhhhhhhhhhhhhhhhhhhhhshhhhhshhhhhhhhhhhhhhshhhhhhhhhhhshhhsss...

output:

NO
NO
YES
bcdefgilmnoqrstuwxzbcdefgilmnoqrstuwxzbcdefgilmnoqrstuwxzbcdefgilmnoqrstuwxzbcdefgilmnoqrstuwxzbcdefgilmnoqrstuwxzbcdefgilmnoqrstuwxzbcdefgilmnoqrstuwxzbcdefgilmnoqrstuwxzbcdefgilmnoqrstuwxzbcdefgilmnoqrstuwxzbcdefgilmnoqrstuwxzbcdefgilmnoqrstuwxzbcdefgilmnoqrstuwxzbcdefgilmnoqrstuwxzbcdef...

result:

ok Correct (13 test cases)

Test #38:

score: 0
Accepted
time: 19ms
memory: 5676kb

input:

14
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh...

output:

NO
NO
NO
NO
YES
immmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm...

result:

ok Correct (14 test cases)

Test #39:

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

input:

15
rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr...

output:

NO
YES
aeghirwxaeghirwxaeghirwxaeghirwxaeghirwxaeghirwxaeghirwxaeghirwxaeghirwxaeghirwxaeghirwxaeghirwxaeghirwxaeghirwxaeghirwxaeghirwxaeghirwxaeghirwxaeghirwxaeghirwxaeghirwxaeghirwxaeghirwxaeghirwxaeghirwxaeghirwxaeghirwxaeghirwxaeghirwxaeghirwxaeghirwxaeghirwxaeghirwxaeghirwxaeghirwxaeghirwxaeghi...

result:

ok Correct (15 test cases)

Test #40:

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

input:

100
qqqwqxqqqqqqqqqqqqwqqqwqqqqqqqqqqqqqqwqqqwqqqqqxqqqwqqqqqqqqqqwqqqqqqqwxqqqqwqqqqqqqwqqqqqqwqqqqqqqqqqqqqqwqqwwqqqwqwqqqqqqqqqqqwqqqqqqqqwqqqqqqqqwqqqwqwqqqqqqqqqqqqqqwwqqqqqqwqqqwqqqqqqwqqwqqwqqqqqqqqwwqwqqqqqqqqqqqqqqqqqqqqqwwqxqqwqqqqqwqqqqqwqqwqqqqqqqqqqqqwqqqqwqqqqqqqqwqqqqqqqqqqqqqqqqqxwqq...

output:

YES
qwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwxqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwqwq...

result:

ok Correct (100 test cases)

Test #41:

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

input:

101
odousahacopcorozuyvokjoozvhrrxoxoockjzxxxohoeikjjodcijoookbjzvdheojjayoboyejuozmzvejcojrjjkpjjvxvgopreyjpjavrjioovhxqvpzcjvnvjogpojkjakxoovzubhoxvpoauzxkxxeojuothjoqxshjoouoxohjooytexzhjjojupjowpacajoxxjeohxeziouyuhoobpvhhjgjuxexcjjxcukokoxkbovecydydoyyboeooopzbapdbjjoqquejzoadnprjuqejpbuawoooqd...

output:

YES
abcdefghijkmnopqrstuvwxyzabcdefghijkmnopqrstuvwxyzabcdefghijkmnopqrstuvwxyzabcdefghijkmnopqrstuvwxyzabcdefghijkmnopqrstuvwxyzabcdefghijkmnopqrstuvwxyzabcdefghijkmnopqrstuvwxyzabcdefghijkmnopqrstuvwxyzabcdefghijkmnopqrstuvwxyzabcdefghijkmnopqrstuvwxyzabcdefghijkmnopqrstuvwxyzabcdefghijkmnopqrstuv...

result:

ok Correct (101 test cases)

Test #42:

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

input:

102
uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu...

output:

YES
suuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu...

result:

ok Correct (102 test cases)

Test #43:

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

input:

103
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz...

output:

NO
YES
abdefhijklnopqrstuvwxyzabdefhijklnopqrstuvwxyzabdefhijklnopqrstuvwxyzabdefhijklnopqrstuvwxyzabdefhijklnopqrstuvwxyzabdefhijklnopqrstuvwxyzabdefhijklnopqrstuvwxyzabdefhijklnopqrstuvwxyzabdefhijklnopqrstuvwxyzabdefhijklnopqrstuvwxyzabdefhijklnopqrstuvwxyzabdefhijklnopqrstuvwxyzabdefhijklnopqrst...

result:

ok Correct (103 test cases)

Test #44:

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

input:

104
oouuoouoououououoouuoouoououuuuuooooouoouoouooouoouuoouuouooouooouuououuouooououuooooouooooouuuoouuuoououooouuoooooooooooouuuuouuuuoooouuouuuoououoouoouuuuooououououuuouuuuuouuoouoooooouooouuoouuoouuouooouououooouuouououoooououooououooouuuuoooouuuuuooouuoooouoouuuuuuououoouuououooouooououuouoooo...

output:

NO
NO
NO
NO
YES
dgmnoqtuvxzdgmnoqtuvxzdgmnoqtuvxzdgmnoqtuvxzdgmnoqtuvxzdgmnoqtuvxzdgmnoqtuvxzdgmnoqtuvxzdgmnoqtuvxzdgmnoqtuvxzdgmnoqtuvxzdgmnoqtuvxzdgmnoqtuvxzdgmnoqtuvxzdgmnoqtuvxzdgmnoqtuvxzdgmnoqtuvxzdgmnoqtuvxzdgmnoqtuvxzdgmnoqtuvxzdgmnoqtuvxzdgmnoqtuvxzdgmnoqtuvxzdgmnoqtuvxzdgmnoqtuvxzdgmnoqtuv...

result:

ok Correct (104 test cases)

Test #45:

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

input:

105
bcjobfehszohbhnbheesyhozbxbnhqzhohyyyjsbysbbseyqqebxoeehbhsbzsnozsjzssynhzsoeoohzyobsozosyjozjsjhsjyvssnfsyhobsffssnofsbsebyzshyssqjjobosszvsesohbzsyseyhhqsyoenajosnnesoozfsasshboaezhnosbeqshqjczsxysejbsbjysyhbshyoessbbnzjhozsohhsssoaszhojosaeseszjbycoysbhjesssvobnhycosveoyszssbzhhhfsehqbhxbhshn...

output:

YES
abcefhjnoqsvxyzabcefhjnoqsvxyzabcefhjnoqsvxyzabcefhjnoqsvxyzabcefhjnoqsvxyzabcefhjnoqsvxyzabcefhjnoqsvxyzabcefhjnoqsvxyzabcefhjnoqsvxyzabcefhjnoqsvxyzabcefhjnoqsvxyzabcefhjnoqsvxyzabcefhjnoqsvxyzabcefhjnoqsvxyzabcefhjnoqsvxyzabcefhjnoqsvxyzabcefhjnoqsvxyzabcefhjnoqsvxyzabcefhjnoqsvxyzabcefhjnoqs...

result:

ok Correct (105 test cases)

Test #46:

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

input:

1000
vlvvvlvvlvvvlvlvvvvvvvlvlvvvvvvvvvvvvvvlvvvlvlvvvllvvvvlvvvvvvvvvvvvvvlvvvvvvvlvlvvvvvvvvvvvvvlvvvlvvvvvlvvvvvvvvvvvvvvvvlvvvvvvvlvlvvvvvvvvlvvvvvvvvvvlvlvvvvvlvvvvlvvvvlvvvlvvvvvvvvlvvvvlvvlvvvvvvvlvvvlvvlvvvvlvvvvvlvvvvvvvvvvvvlvvlvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvlvvvvvvvvlvlvvvvvvl...

output:

NO
NO
YES
glqtxglqtxglqtxglqtxglqtxglqtxglqtxglqtxglqtxglqtxglqtxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglqxglq...

result:

ok Correct (1000 test cases)

Test #47:

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

input:

1001
nfffnfffffnffnnfnffvnffnnffnnvfffnfnnfnnffffnfvvfffvffvfnfffnfffnfnfffffffffffnffffffffnfvffvfnfvfffffffffffnffvffnvfffnffnnnvffnnffnffnfnffvfffffnffffnffffffnnfffnffvvfvfffffffvffnffffffnfnvnfffnnnnfffnffffnnffnfffnfvnffnvnfffffffffffffffvnffffnffnffffffffffvnffffnfffnfvnvfvfffffffffffnfvnfnff...

output:

YES
bfnvbfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnvfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfnfn...

result:

ok Correct (1001 test cases)

Test #48:

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

input:

1002
oogmilwmoobuglffxuswdvmohlohofmbfhomoloeoouofgofolwuozmdmvoooxmmsgosohhooioabmeuuzlmuuazfoes
aaaaaataaaaaotaatoaaoaataaataaaaaaoataaaaoaaaaaaaaaaaataaaaaaaaaaataaotataataaaaaaaaoaaaaaaaaaaaaaataoaataaaaaaaoaaaaaaaaaattoaaaaoatoaaaatataaaaaaaaaao
ggggggggggggggggggggggggggggggggggggggggggggggggg...

output:

YES
abdefghilmosuvwxzabdefghilmosuvwxzbefghlmosuwzfghlmosufhlmouflmoufmoumoumomomooooooooooooooo
YES
aotaotaotaotaotaotaotaotaotaotaotaotaotatatatatataaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
YES
oggggggggggggggggggggggggggggggggggggggggg...

result:

ok Correct (1002 test cases)

Test #49:

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

input:

1003
pqvakizaapvlzllaljsajwskvsasivqlrjqkqlivowvkgrvknasireqqkarqrswjelsvkrjiehksswiskkszwlkvqkqalzjlsqplplkavllwllisaslvdvlivklkkvzplqlqklrqigslislelvqleyllllllzjzwikvxswkvlzkqqiqvlasqixkdqklalqalklpsvvekvkkpzspqlvllsskipillllgpsslslpsizsqoaejkxgkeqmsrllaszrknrlzvrkhllkvjkklkvvkijvgqaqrioaallkvzslv...

output:

YES
abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabdefghijklmnopqrsuvwxyzabdefghijklmnopqrsuvwxyzabdefghijklmnopqrsuvwxyzabdefghijklmnopqrsuvwxyzabdefghijklmnopqrsuvwxyzabdefghijklnopqrsuvwxyzabdefghijklnopqrsuvwxyzadeghijklnopqrsuvwxyzadeghijklnopqrsuvwxyzadeghijklnopqrsuvwxyzadeghijklnopqrs...

result:

ok Correct (1003 test cases)

Test #50:

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

input:

1004
jffjjjjjfffjfjfjfjjjfjffjjjffffjjjjjjffffffjjjjfffjjjjjfjfffjjfffjffjjjfjjfjffjfffjjfjjfffjjjjjjjffjffffjfffffjjfjjjjjjjffjfffffjffjfffffjjfjjjffjfffffffjjfjffjfjfjfffffjfffjjjffjffjjffjjjffjjffffffjfffjjffffjffffjjfjjfjjjfjjjfffjjffjffjjjffjjjfjjffffffjjfjjfjffjffjfffjfffjfjjjfjjjjfjffjfffjjff...

output:

NO
NO
YES
abceghijklmnopqrtuvwxabceghijklmnopqrtuvwxabceghijklmnopqrtuvwxabceghijklmnopqrtuvwxabceghijklmnopqrtuvwxabceghijklmnopqrtuvwxabceghijklmnopqrtuvwxabceghijklmnopqrtuvwxabceghijklmnopqrtuvwxabceghijklmnopqrtuvwxabceghijklmnoprtuvwxabceghijklmnoprtuvwxabceghijklmnoprtuvwxabceghijklmnoprtuvwx...

result:

ok Correct (1004 test cases)

Test #51:

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

input:

1005
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq...

output:

YES
oqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq...

result:

ok Correct (1005 test cases)

Test #52:

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

input:

10000
tvbb
ueuiisdeuiiuauaeeuueusidaeiuuipiiiphaaiiuiiapuiieaeueippiiiiudaemhdmeeieisiaseeeuiuhmmihesesaemumuiihpuusiai
wekkkkkkekkkfxkkkkefkkkkfxkkwkkekfkkkekkkkkkekkkxxkkk
ggggggggzgggggggggggzzgggggggg
jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj...

output:

YES
btvb
YES
adehimpsuadehimpsuadehimpsuadehimpsuaehimpsuaeimpsuaeisuaeiuaeiuaeiuaeiueiueiueiueiueiueiueiueiuiuiiiiiiiiii
YES
efkwxefkwxefkxefkxekekkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
NO
NO
YES
aceghjmnpqtuxehjnpqtuejpqtuejpqujpqujpqujpujujujujujjjjjjj
NO
YES
q
YES
dqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq...

result:

ok Correct (10000 test cases)

Test #53:

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

input:

10001
yggyyggggyyyyggggggggyggygggyyggggg
vquennceiwrndbehzbzlrlqlwqs
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn...

output:

NO
YES
bcdehilnqrsuvwzbelnqrwzelnq
NO
YES
cdefghijklmnopqrtuvwxyzcdehijklmnpqtuvwyzdehjkpquyzdejpyzejpyp
NO
YES
acdfgijlnostvwyadfgijstvwyadfgijstvwyadfgijstvyadfgijstyadfijstyadfijstydfijstydfijstydfijstydfijsydfijsydfijdfidfdfdfdfdfdfdfdfdfffff
YES
qhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh...

result:

ok Correct (10001 test cases)

Test #54:

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

input:

10002
sitssistttssstssshstssssssttssssshtsssssstssstsssitstststissstthtsstssssstttsststtststisststtssssstsssttsstttsttstttstsssstsssshsssttstttttttsthsstssttssststtssttssiststssssshtisstttsssssttthstssttsstisssststtsssststtststsittstststssttsssssttsstssiststtsssttstttstttsssttsststtssststsstsssstsst...

output:

YES
histhisthisthisthisthisthisthisthisthisthistististststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststst...

result:

ok Correct (10002 test cases)

Test #55:

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

input:

10003
llllllllllllllllll
swtiwdqlxpiblvroavecbxnfudmioyjddhovgkvl
gggggggggggggwggggg
wdffffwffffffffffwfdffffdfddfdfffwdffffffwfffffffffffffdfffwdffffwdffwffffdwffffffwffffwfffffwwffffffffffffdffffwffffffffffwwfffffffffdfffffffdffwffffffffffwfffffffwfffffffffffffdffdfffwf
qqqqqqqqqqqqqqqqqqqqqqqqqq...

output:

NO
YES
abcdefghijklmnopqrstuvwxybdilovwxdilovdv
YES
wgggggggggggggggggg
YES
dfwdfwdfwdfwdfwdfwdfwdfwdfwdfwdfwdfwdfwdfwdfwdfwfwfwfwfwfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
YES
zqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq...

result:

ok Correct (10003 test cases)

Test #56:

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

input:

10004
ovyvdpdadmdyjvzgdadvdahmpvmddhvyaippizypypmmdhfhdybzpdeamvadypdvdvh
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiuiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii...

output:

YES
abdefghijmopvyzadhimpvyzadhmpvyzadhmpvyadhmpvyadmpvydpvydpvdvdddddd
YES
uiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii...

result:

ok Correct (10004 test cases)

Test #57:

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

input:

10005
siissssssssssississssisissisisissiisssiiisssssiisissiisssssissss
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
rrrrrrrrrrrrrrrrrrrrrrrrrrrrrprrrrrrrrrrrrrr
zndyqznbdgxp
dddddddddddddddddddddddddddddddddddddddyddddddddddddd
twtwtttwtttttttttwwttttwwwtwtttwtttttttwtwwwt
aaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

NO
NO
YES
prrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
YES
bdgnpqxyzdnz
YES
ydddddddddddddddddddddddddddddddddddddddddddddddddddd
NO
NO
NO
NO
YES
pxxx
YES
htttttttttttttttttttttttttttttttttttttttttttt
YES
abcdefghjklmnoqrstuvwxyzacdfghjlmoqstuvwyzdfghjmuwzdfhmuwzdhmuwmuwmuuuuuuuuu
NO
YES
cdefhijkmnp...

result:

ok Correct (10005 test cases)

Test #58:

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

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
abcefghjklopqrstuvwxyzouwyzw
YES
k
NO
NO
YES
bcgjruxrrr
YES
iyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
NO
NO
YES
fgoqrfgg
YES
glmqsvmm
YES
bjnv
NO
NO
YES
dkps
YES
eiri
NO
YES
bsw
YES
v
NO
YES
fccccc
YES
oxx
NO
NO
NO
NO
YES
bdehiluvwv
YES
himwx
YES
dw
NO
NO
NO
YES
agowgo
Y...

result:

ok Correct (99995 test cases)

Test #59:

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

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
cfloo
YES
opqvyopqvypvyvvvvvvvvvv
YES
aehklmnopqtwyewewe
NO
YES
cdfjklovxdfjlovjlv
YES
h
YES
wy
YES
gjkgkg
YES
x
YES
abchiklnprtyzaikpapap
YES
ahjmpahja
YES
fwzfwf
YES
gko
NO
YES
mps
YES
u
YES
w
NO
NO
NO
YES
bl
YES
fkmwfkmwkmwkmwkwkww
NO
NO
NO
YES
vooooo
NO
YES
cfjkmtv
NO
YES
bdhvwydhdh...

result:

ok Correct (99996 test cases)

Test #60:

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

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
bdgjmnoptvzjmopvoo
NO
YES
buuuuuuuuuuuuuuuu
NO
YES
huzhuzu
YES
elqq
YES
epss
NO
YES
bcehikotvwy
YES
af
YES
a
YES
bltyz
YES
cdgkpqrw
YES
baaaaaaaaaaaaaaaaaa
YES
yiiiiiiiiiiii
YES
x
NO
YES
q
YES
lmrtuu
YES
admnuwy
YES
az
YES
sw
YES
qddddddddddddddddddddddd
YES
adox
YES
z
YES
bkms
YES
...

result:

ok Correct (99997 test cases)

Test #61:

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

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
cdhitvhiti
YES
u
YES
cehjoptot
YES
bdebebebebebeee
YES
ahkoptuxyy
NO
YES
aqqq
YES
yffff
YES
abcdefghijklmopqrstvwyzghikmqrszghqrszrr
NO
YES
ekrsuyeke
YES
coo
NO
YES
fl
YES
bhqwbhqw
YES
vxx
NO
YES
chikqstuyy
YES
tkkk
YES
fvvvvvv
YES
w
YES
abceijkmopqrstvwjmt
YES
apuaua
YES
ipw
YES
sbb
YES
aejy...

result:

ok Correct (99998 test cases)

Test #62:

score: 0
Accepted
time: 64ms
memory: 3648kb

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
adfimnqrsydfinqrsydfinqrdfnrdfrdd
YES
gqtgqtgqtggggggg
YES
cdghijoprsvxcdhjooo
NO
YES
uii
NO
YES
bcdfry
YES
biruxzxzx
YES
abcdefhijklmnpqrswxyzadlz
YES
lss
YES
hqqqqqqqqq
NO
YES
bis
NO
YES
osxs
YES
adfghijkopqrstuvxyzhiop
YES
dllllllllllllll
YES
izzzzzzz
NO
YES
pqsxqsx
YES
bcjlnoruwycjuyjuju
YES...

result:

ok Correct (99999 test cases)

Test #63:

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

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
deilqveileleee
NO
NO
YES
aila
YES
a
NO
YES
o
YES
gijklwgjklwgklwgklwklwklwll
NO
YES
dkntxkt
YES
bcehioiii
YES
maa
YES
y
YES
gvvvvvvvvvvvvvvvvvvvvvv
YES
ahlnvxzn
YES
dxzdzz
NO
YES
k
NO
YES
cefgjklruxejkru
YES
jssss
YES
eioiiiii
YES
ceijklnpstuxyeijuyeii
YES
cmwcmwcmwmmm
YES
yvvvvvvv
NO
N...

result:

ok Correct (100000 test cases)

Extra Test:

score: 0
Extra Test Passed