QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#201925#5161. Last GuessRd_rainydays#AC ✓934ms60660kbC++142.1kb2023-10-05 17:41:262023-10-05 17:41:26

Judging History

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

  • [2023-10-05 17:41:26]
  • 评测
  • 测评结果:AC
  • 用时:934ms
  • 内存:60660kb
  • [2023-10-05 17:41:26]
  • 提交

answer


#include<bits/stdc++.h>
#define N 5005
using namespace std;
int n,m;
char s[N][N],t[N][N];
char ans[N],mp[N][N];
int ban[N];
int up[N],lw[N];
int cnt[N],aux=0;
vector<int> G[1005*1005];
int vis[N],match[N],col[1005*1005];
bool dfs(int x,int t){
   for(int y:G[x]){
    if(vis[y]!=t){
      vis[y]=t;
      if(!match[y]||dfs(match[y],t))return match[y]=x,true;
    }
   }
  return false;
}
int main(){
  scanf("%d%d",&n,&m);
  for(int i=1;i<n;i++){
    scanf("%s%s",s[i]+1,t[i]+1);
  }
  for(int i='a';i<='z';i++)up[i]=m,lw[i]=0;
  for(int i=1;i<n;i++){
    for(int r=1;r<=m;r++)if(t[i][r]=='G')ans[r]=s[i][r],ban[r]=1;
  }
  for(int i=1;i<=m;i++)if(ban[i])aux++;
  for(int i=1;i<n;i++){
    for(int r='a';r<='z';r++)cnt[r]=0;
    for(int r=1;r<=m;r++)if(ban[r]&&t[i][r]!='G')cnt[ans[r]]--;
    for(int r=1;r<=m;r++){
        if(t[i][r]=='Y'){
          cnt[s[i][r]]++;
          lw[s[i][r]]=max(lw[s[i][r]],cnt[s[i][r]]);
          mp[s[i][r]][r]=1;
        }
    }
    for(int r=1;r<=m;r++){
        if(t[i][r]=='B'){
          up[s[i][r]]=min(up[s[i][r]],cnt[s[i][r]]);
          mp[s[i][r]][r]=1;
        }
    }
  }
  // for(int i='a';i<='z';i++){
    // lw[i]-=aux[i],up[i]-=aux[i];
    // if(lw[i]!=0||up[i]!=m)cout<<(char)i<<" "<<lw[i]<<" "<<up[i]<<" "<<aux[i]<<endl;
  // }
  int idx=0;
  for(int i='a';i<='z';i++){
    for(int r=1;r<=lw[i];r++){
      idx++;col[idx]=i;
      for(int p=1;p<=m;p++){
        if(mp[i][p]==0&&ban[p]==0)G[idx].push_back(p);
      }
    }
  }
  for(int i='a';i<='z';i++){
    for(int r=lw[i]+1;r<=up[i];r++){
      idx++;col[idx]=i;
      for(int p=1;p<=m;p++){
        if(mp[i][p]==0&&ban[p]==0)G[idx].push_back(p);
      }
    }
  }
  int deg=0;
  for(int i=1;i<=idx;i++){
    deg+=int(dfs(i,i));
    if(deg+aux==m)break;
  }
  // cout<<"debug:"<<idx<<" "<<deg<<endl;
  // assert(deg==idx);
  for(int i=1;i<=m;i++){
    if(ban[i])continue;
    if(match[i])ans[i]=(char)col[match[i]];
  }
  puts(ans+1);

}
/*
8 6
source GYBYBB
slower GBYBBY
slowly GBYBBB
sorted GYGYBB
scream GBGBBB
scattr GBBYBY
strooo GGGGBB
*/

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 34392kb

input:

4 5
reply YYGBB
refer BBBGG
puppy YYGBB

output:

upper

result:

ok 

Test #2:

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

input:

2 12
aabbccddeeff GGGYGBYYYBBB

output:

aabacaaadbed

result:

ok 

Test #3:

score: 0
Accepted
time: 54ms
memory: 58720kb

input:

25 500
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqoqqqqqqqqqqqqqqqqqqqqqqoqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjq...

output:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaoaaaaaaaa...

result:

ok 

Test #4:

score: 0
Accepted
time: 58ms
memory: 57576kb

input:

24 500
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvuvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv...

output:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaasaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

result:

ok 

Test #5:

score: 0
Accepted
time: 57ms
memory: 54600kb

input:

23 500
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqgqqqqq...

output:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

result:

ok 

Test #6:

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

input:

22 500
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccoccccccccccccccccccccccccccccccccccccccccccccccccfccccccccccccccccccccccccccccccccc...

output:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaamaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

result:

ok 

Test #7:

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

input:

30 20
azzzzzzzzzzzzzzzzzzz YBBBBBBBBBBBBBBBBBBB
zazzzzzzzzzzzzzzzzzz BGBBBBBBBBBBBBBBBBBB
zzazzzzzzzzzzzzzzzzz BBYBBBBBBBBBBBBBBBBB
zzzazzzzzzzzzzzzzzzz BBBYBBBBBBBBBBBBBBBB
zzzzazzzzzzzzzzzzzzz BBBBGBBBBBBBBBBBBBBB
zzzzzazzzzzzzzzzzzzz BBBBBYBBBBBBBBBBBBBB
zzzzzzazzzzzzzzzzzzz BBBBBBYBBBBBBBBBBBBB
...

output:

vajyabupqravasaalamj

result:

ok 

Test #8:

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

input:

31 20
azzzzzzzzzzzzzzzzzzz GBBBBBBBBBBBBBBBBBBB
zazzzzzzzzzzzzzzzzzz BYBBBBBBBBBBBBBBBBBB
zzazzzzzzzzzzzzzzzzz BBYBBBBBBBBBBBBBBBBB
zzzazzzzzzzzzzzzzzzz BBBYBBBBBBBBBBBBBBBB
zzzzazzzzzzzzzzzzzzz BBBBYBBBBBBBBBBBBBBB
zzzzzazzzzzzzzzzzzzz BBBBBYBBBBBBBBBBBBBB
zzzzzzazzzzzzzzzzzzz BBBBBBGBBBBBBBBBBBBB
...

output:

addduyasvaafbuqiayia

result:

ok 

Test #9:

score: 0
Accepted
time: 7ms
memory: 32308kb

input:

38 20
azzzzzzzzzzzzzzzzzzz YBBBBBBBBBBBBBBBBBBB
zazzzzzzzzzzzzzzzzzz BGBBBBBBBBBBBBBBBBBB
zzazzzzzzzzzzzzzzzzz BBYBBBBBBBBBBBBBBBBB
zzzazzzzzzzzzzzzzzzz BBBGBBBBBBBBBBBBBBBB
zzzzazzzzzzzzzzzzzzz BBBBGBBBBBBBBBBBBBBB
zzzzzazzzzzzzzzzzzzz BBBBBYBBBBBBBBBBBBBB
zzzzzzazzzzzzzzzzzzz BBBBBBYBBBBBBBBBBBBB
...

output:

sawaaooaaaeakaahaaal

result:

ok 

Test #10:

score: 0
Accepted
time: 460ms
memory: 51764kb

input:

25 500
eppppsppppppappppapppaswppspwppeupppwpwppppwppspppppppapppppspppappwpppppspspuppppppppppupwppeppppppppuppppusppspppppppwppppppppspeppppppppppepspppeppuppppwpppppppppppppwpppppppwppupppppspppppppppppppupeppppppppsppppeppaeppppppppppppppppppappppppppppppppppsppwppuappppepupuapppeppppppapppppppp...

output:

vayjogcjsnarhzfrshqbxhgirsgmitjvlabdikinenuizmgwwuqtzohxzeudgtmnhsaiacratgwgjljtkyetowdwlaibdvksccbsonlmrdjlgbngconrstmidytrdknwgjvyxzueqskrnvqgzmtvaelfxubiaqctbexjeftotinkqfsusinolqbsxjgcrqwkerywwmyylevubemsnzagqjtuvcuhvrbcnfcxznfymkquskbhffkcxrezezkemfyfgfzirxlhanfbvrldlhfcavqzzcbyhycwtknftnxhomqg...

result:

ok 

Test #11:

score: 0
Accepted
time: 934ms
memory: 51704kb

input:

25 500
smxeetdiacxotgkpibsieraggqfjdbjxykzpiinrjxkmcczngkgpidtnacrzonzmrjsyfaiptigawddifgqxiiqibyymxvzncvifqsyfxmeodqwvwgqegpizkzfvsyywomkaviwjcasacijfbpjibvsroitinpfddjzcdkmxeisynrzipizmoyveveqwsfaqixobgrkstwtdtcfbwrvyvrgwdcmjozmitwcfitpzqdnikqbcpzyerwwigzdiczfmagmvacqxwbbiiiqrgxwvprvicjdsajinpmrrn...

output:

lxrggumnthrcukqbzoljgstkkayvmovrpqfbjjwsvrqxhhfwkqkbnmuwthsfcwfxsvlpytjbuzktdmmnykarnnanoppxrefwhejyalpyrxgcmadedkagkbnfqfyelppdcxqtendvhtlthnvyobvzoelscnuzwbymmvfhmqxrgnlpwsfjbjfxcpegegadlytajrcoksqludumuhyodsepeskdmhxvcfxjudhyzubfamwnqaohbfpgsddzkfmjhfyxtkxethardoojjzaskrdebsenhvmltvzwbxsswengqqwz...

result:

ok 

Test #12:

score: 0
Accepted
time: 530ms
memory: 51664kb

input:

25 500
zzzzzzzzzzezzzzzyzzzyfzzzzzyzfzzzzzuzzzzzzzzyezezzzyzzzzzzzzzzzzzzzuzzzzzzzzfzzzzzzzyzzezfzzzzzzzzzzzzzzzzzzzzzzzfzzzzzzzzzzzzzzuzzzzzzzzzzzzzzzzzzzzuzzzzzzzzzzzyzzzzuzzzzzzzyyzzzzzzzzzzzzzzzzzfzzzzzzzzzzyzzzzyzzzzzzeezzzzzzzzzzyzzzzzzzyzezzzfefzuzzzzzzzzzzzzzuzfzzzzzzezzzfzzzzzzzzzzyuezzfzzz...

output:

qjtwjfaynbvccrdxmkyemidubqxmbidthnhseryxlaeymvbvdqgmjplbtulcjwhffjcsftewuqbxixoaeklqmfcvjiyeuthdcnfrqlwcoynrwjtxyinarlkxyfwkcjwxsqbcldqgnhuohjjbalwyasdpgxqdrbenwmyonrsplnurofmmjjfkxwoqabotkkoatikpndnkqcqxmlpggmanbphuvvttrwehopqgmkreelbdmyvrhgivicskkpqgklfpyytlsxixrlogyvqanirnpjbxexfdmsvgfiepdgrsdfgd...

result:

ok 

Test #13:

score: 0
Accepted
time: 5ms
memory: 32608kb

input:

26 500
ffafffffafffffffffffffaaffaffffffffffffffffffffffffafffaffafffffffafffffffffffffffffffffffafaffffffffffafffffafffffffffafaffffffffffffffffffffaffffffffffffffffaffaffffffffffffffaffffffffffafffffafffaaffffffafafffafffffffffffffffaaffffffafffffffffffafffffffffffafffffafffffffaffffffffffafafffff...

output:

llfghgxlfgvvbblhngxzonfzhnfhxhbnvhnlbonzoebgbbwogonfebvfreflvwbvbpfrlvgbgwphwpglglxbhvrevhzvzwbhspyxplzfdhlwwfhgdzjvwdzfhfpusyphuwrkremmrvrkujzlkjkxpxyxkwxdxvxfuxfidwgxvwiujoxskzsjxivodlusqpxuwsqxusffumyuvkqifumrqrrxdskevbmkvsvtqzwshuwcqujjetdpkpytqcweuvrupxhrfrtxvkqryirhusgtjpjplipmrztgcutlitpqgbci...

result:

ok 

Test #14:

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

input:

26 500
eeeeeeeeeeleleeeleeleelleelellelleeeleeeeeeeeeeeeeeeeeeeleeeeeeeleeleeeeelelleeelleeeleeeeeeeeeeeeeeeeeeleeeeeeeleeeeeellleeeeeeleleeeeeeleeeleeeeeeeeeeeeeeleeeeleeeeeeeeeeeeeellleleeeeeeeeeeelleleeeeeleleeleleeeeeeeeeeleeleeelelelleeeeeeleeeleeeeeeeeeeelleeeeeeeeeeeleeeeeleeeeleleeeeeeeellee...

output:

qnmmzkmqsqeqequqeuzunueeomejexqxeqkcxuzssmcumzokscunmqyuuqszzqqjxyoxzzzuueaexjyjhxcubebwkwawkwoomrafsrsqhnmybcyqxrwsbkvxehbjgyyieakjgvivihmwrnbzazskrrmrfzpcuobzanckirryamabpybghxxihkvagspviscpxxoesgwbdhynwdxshcivadawgayxygnbzgkwhrxnfcrzztkcbrxbyugzzjsidbhnzrduvpvvptbeowajjxtbstntxffiwdwswhxsvpkhntjp...

result:

ok 

Test #15:

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

input:

26 500
dddddddddddkddddddddddddddddddddkdddddkddddddddkddddkddddddkddddddddkdddkddddddddddddddddddddddddddddddddddkdddddddddkdkddddddddddddddddddddddddddkdddddddddddkdkkkddddddddddddddddddddkddkddddddddddddddddddddddddddddddddddddddddddddddkdddddddddddddddddkdkdddkddkdddkddddddkdddddddddddddkddddddd...

output:

eseuqorvugldsubeboglgbebuezevvgbdrsguldebbjttyydrolodezbuosdojsuouutsotseobzluvtjozejgsjlyzprjztztgjjthluttdttuosxghodvsvutzzjtoyuzesxuuefhljvtjvpqeeygwvytiyuqiqsduxwizzwewtpsihipfppzspldixsexpfxffffzefyujhpjiuxfwaghwftsrzrffttpjmgjusytxuayjnfmugxvuxtdqshamdvnseamdjxriwmqumghwunpecamasamfnmpnfswsthc...

result:

ok 

Test #16:

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

input:

2 1
s B

output:

a

result:

ok 

Test #17:

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

input:

5 3
idn BBY
mvh BBB
cva BBG
you BBB

output:

ana

result:

ok 

Test #18:

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

input:

3 2
jt BB
bg BB

output:

aa

result:

ok 

Test #19:

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

input:

4 8
jzhqnmbc BBBBBBBY
quubxmwq BBBBYBBB
zkmtxamf BBBYYBBB

output:

ccccctcx

result:

ok 

Test #20:

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

input:

83 28
yyjekmbfltupxglbgnniupgrbbhh YYYYYYBYBBYYYYBBYYBBBBBYGBYY
gvgwlfkbriylbdfmajjupyijghxk GYYYBYYYYBYBBYBYYYBYYYBGBYYB
jjqnbpooxrfsqntbitwbgrplljzp YBYYYYBBYYYYBBBBBBYBYBBBBGBB
lqdozqobdhvzmtusczvxthcfvymz BYGBBBBYBYYBYBYYBBBYBYBYBYBB
tkhuvtpuhnmzphnqhpfzfsokewoh BYYYYBYBYYGBBBBYBBGBBYBBYYBB
gjer...

output:

gndxhueyqpmeryvhxafwwgkjbjss

result:

ok 

Test #21:

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

input:

13 78
imwrldcrlcooqlzmcczciijjughombdengtcurojkwqyuoqltmduvwebvyysshwjythllxhrwmcepz YYYYYYYYYYYYYYYYYBYBYYYYYYYYYYBYBYYBBYBYGYYYBBYBGBBBYYYBBYYYYYBGBYYBBYYYBBBYYY
pkcwlbnthqplkuohoonvnqbouaakqdpwsyoscpqagkfhfpualsnonjnkkdtudoyvknpjgyhaqoxwak YYYYYYBYYYYYYYYYYYBYBYBBBBBBYYYYYYBYYBYBYBYYYBBBYBBBBYBBB...

output:

oeeejtrjrgxeymvqmwizwwslqtohtrzqurkzimxzkbpzoyjetieefcsdpiehqlzjtecpjhfelcighy

result:

ok 

Test #22:

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

input:

38 99
veadnsajqcnbynqxawytaccryhlefhbhusmjhplsemwsagxkiryxfwrsarpmhsrpikievjpafqszuqklxetizrtlwxzxyelalsr YYYYYBYYYGYYYYYYGYYYYYYBYYYYYYYYYBYYBGYBYYYBYYYYGBGBYYBBYBYYBBBYYBYYYGYBYYBYYYBBBYYGYBYBYBYBBBBBBBB
njkybjdzyrkufafkessouzzsbkyimahkltsqqpngkgghqodbebxahavilwxmbmkqkucahpokaktlylhnmyjyxwbmrqhepj...

output:

opvemvpyccxpuywvaduutktjwejvzqybnwebcpgegcfpnmnnimyubztcoqgvfazgaihzejzxqnptlijoacziataqghhtlqwfjdz

result:

ok 

Test #23:

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

input:

4 113
suwodmkfmlkafcxpdgicvnrluhqkmulfirwtawvjxzzufmxruiiezmyebjlpxkzujfxjosfdqlbwfqtyripgsshmclhmtsosukwlgnzqvtbygnlau YYYYYYYYYYYYYYYYYYYYYYYYYYYYYBYYYYYYYYYYYYBBYGYYBYYYBBYGYYGYYYGBYBBBYYBYYYYYGYYYBYYYBBBBYYBBYBYBBYYBYYBBYYYYYYBYB
qpizotexiviavifrwmnhmqgxvxdueohjcyrzsinuuuhpbknejcjupvqhtnlsssylqg...

output:

aaiaaaaaaayzyywwuxxxwxwwtrdsrvvvvvnntuttqrsqpmopqpppmljekolooozmljlnkmkflklkfihgjgvcggdfiaiivffieaeeecgdbedacbbbc

result:

ok 

Test #24:

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

input:

102 377
gocqhgzrtqkevpckmjqhgbhpxtoliiukyxibpizzagbxroteetcwzpgzybsaxrhvudaxrrzjhisrbumzvaaaokwzpekgczhkbjqlgrdijvecheemmcoieoyhsyhooaxzmronnoovfdwelqbhlrqovoiubzbdixkvzujlsadyysnxcmvcxcsayqjyidlignyemacoyyuwjvpkitgsyjuzjyjtgxzamytxssxbocvprlhksvhegfjuldompxslryoubylyxzaospsxecpctamowqxxngbjtvoskmhv...

output:

fzhbpvvtfsjzghjjvoanwlhesznrmaqdkvrmnkxxcuaxtenfaqpctuywoclxzlgiscpcylgmjmtltvcjmmohwaiihbsonoraefpauuszkmewlodhhorizaizitonwailoikleknwtlngirnvxeujutmnszyjltnniospmismtvvtnltapcyfmjwhhabewciomfutgmqufzdvregkfbllubjmwxvqjiaoicgvslnzmcykvxszfjqevigtekrfbmcihthffbubmertrhniybzfxpjdpyejmvnmyvzyribcyhkw...

result:

ok 

Test #25:

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

input:

84 372
esizksnrmnyidougizdjmkksweafwdywugqdkisbdjaxfjghvoiwxhsmntnkyrimjajlspiqfomzyvpxdpispoveqzrcpfyntfxpcllewbdftkcwpjodchqeyfavuainqvggspnirpjpdcdcljmwzfkbrzleubsvxoeyzwzmmkrbiujgtcwpkeqtenikfnwqspnahiqwdxarppclogyrdpmqwuhqrdhgjfvjxifuksfhpkxjbmywimtettgrtgexekpaacpvtgorcljdnodtdudsatgszvvkpxkhh...

output:

priirafhcttvbcwmukqupwazyrzdryqixzkfnnamuzjifxtwhryteowgwdtrygfvyaxpjzvolkimwxfqpqzevqjmhzezhvtzyowazevweuzictoaxwabyiknexmxymtqvfcvysakdlegsotvhbzrrfcimfazueugoqtrdbcqrkxdtqatexonjtkeargeblphfcxscjdcaqzatcdksezpuwgvunnyymffvdfdpwrhfmvpawqoafeujyguhlelzcfuhnmgqrsxxzfeaxpyvtjxthrqevetoixfmdmzjvkwxixn...

result:

ok 

Test #26:

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

input:

120 341
qddkzllppvsamvuytcyvfmcgdsowlmasqwecvmbfkfgbmiluxdghcvyfiyynhobehlxsoslwjoxkkjmmcjjyjhuntirpeszmmsfcdduerkrzasnxsczqzcyunsqaalvjkkdrksdjhgojrkljxzflsdljjlbjrhjhhblrqhgtljjieelickdyszvkcskljuykzcpeuttphlonwanfndlkqcbgkjvocnwugyyxxbaccwpyrmyaapkciubysrjvemksuamhojymppamhhvvockwocvvjdmmssedjuzn...

output:

tnraljmrauiwhqddhuqxevuwjktugbqedadidsxnduvdoawjznplzlwxkgvfwyrcvyvkcliahpquktdvezcoeoxlmjrflyvrvynqmchlgbxnhxxlmdqdnsugabizimrirmzwdyewmjojiaifcbbrkivmfjuynkrwmctmonrblnataybzyyynwojbqozhdbpyxejgrdsknwzulbicasbwdjmwylxjawtrhgawavmilelwmoomtvlohtdsorjlixtcfedwfabomegtndzvhhfyizcnhiacpvicuwrkmiccrwdk...

result:

ok 

Test #27:

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

input:

500 500
uzkbwmwxenfvjjmbfpvgdgkfcrtjgftkcsdhgxlqcqyrtzqggauozihovqxyepxlqsndunqfvrwqhjszvzmttihgcwvyxugzbkxjwfqvvpakmrkohzrutlbfludsfkzmjrzkqsnstnxnlieshrqfqqfgttcsdinuvqzyueqhhtknnbnhstvabfyfpwszpkwvfzjlfnzgnlzzdeqcemnvcrbbxytfhajyvmaxfmczviyqafmkwmmrelmpmzcbwjltbejfuyizjyggmhkgmuhjijtsrfwzmmmkqieh...

output:

xtkupmikoalqczppaqstzuiezbugnmrfezofiejbxedkwmhldzkqactqmmcsuwmjddllfifimjtratgnnerahiklscixwmfrciloflzwalrxbtfglaouusctqbsevtkhaqtcqqothbasjyihutvpkdgaweyploaqfzsuqjotuxviounxiapvtcfovxyeutvfmgvhyzrcilfuxnappehaifxawqghytxvrylxyxuxkzqmoprdphfgaidifgmdfyvzyzvaxlzxfqbithwwglczjhxuoobaxsotlgfhkdauudoi...

result:

ok 

Test #28:

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

input:

2 500
cjvtcyhtzxnkypncxcydztkdxkosxdtlxzaetauygumxwzgkqittrtirkgnjuwanpdokgrbvwwlxxmivnzgnfelcxzmggmfwrtuexpxxyxuniivgwiykbzhnfbhgtoizuumgvoazbkcgzyhtamdsnnuejfwgmgbffdpnaeulrjfiflxrfqmkxkqkfwqcylsieetenjwbgmzewvgownfiylsvjzijpgrdfozciarqzqckecrwevmdtilipcerlcmbvogajnlfiwwcfurfxgtwbavfogarxcovbrwvlo...

output:

aaaaayaaaaaaapaaaaaaaaaaaaaaaaaaaawaazaaaaaaaaaaaaaaaaaaaaaaaaxaaaaaaaaazyzzwzzzzyzzzzzzzyzzzyyyyyyyyyyyvyyyyiyyyyuwswxswwvxxwxwxxxgxxxxxxxxxxxxxxwvwwwwwwvwwsrvvvpvvvvvvjvvtsstsuuuuuuuuuussststtstttttttttttttttrpqlqqjsrpqrprrrrrrrmrzrrrrrprrrrrrioqqqqqqqopppppjppopmnmlooionoooooonoomlmnjllnlnjmnnnnn...

result:

ok 

Test #29:

score: 0
Accepted
time: 17ms
memory: 36496kb

input:

10 500
ltzpvgzioqzjaorwvcfawsuxrpiaxelpvjvbzkmhmukkanhddeuwnwfbqeiccwqiqsntudhfrrxrwjmphcocxtzbljjcdjmksdvnoklkzvljhmyxsjgzsmuezdeieobpeojmxphuhbkxuqvtokknihunzjztuhuqurethoyiiamwzqppwuiljeygsrclivocqngmwgqeghfwtwunuyvcxcjjufbxwhmijurlgodhscoalsqbdxnizkkjtmqfaynndanjjfzldqukrpmqnsynrvoncnqymegdgvvga...

output:

zzsvrvsgovkzwzzxvwzxzyzzxzkzkzzzzzzwtwvzxxwxxrhyyxyyxytyqyyukuryyyxxxwmiuxuxxaupvrwmzpwouvtvubuvwdtwuuwxwtwuptqpsmvrvwvqkovqtzurvurtqmuvosqvoqssvuntvvtvujsbdvbighrvsptvrossttwhttyspthrrspoqqtsfrnozpprrosmmspssahonqqmnroqpjboopopoappgknqlssbgprlqjovungyxzpkmgxddpperwklinlkmndfphanqzglkqbipqqnsmgjojaj...

result:

ok 

Test #30:

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

input:

20 500
gidefqbkbebgnvcgrjfmkuqtipyqlpvrjndoddvuhkntkznjdkfvggaoavkllvbigfvdafoxziprpozvhukhwheyasblhleoxfxwwruvsilcdrttxcbqfnvplqtemgsoftmsnzrgaikbqmyrbykhtpbmrfpgvjiqszkdapksfhbdkmdawcgonddqgzasjtvrjbgkfwxyopyxhprkrsaoxfblohlqyeenggeusnfvgkxalqzhziuckhyhhmefhjpvfjzolfowjvjeklnxgmymaubfcuineyiuzlzpb...

output:

zmehxlzoloznhlwzzswmwygpzvbzzroxzydzxxiuyxxrwtontwvmujxfpgxbxyjmplrrofhnwctmgmlxbipeuqhwrvtciwskwujzwsbniugzfulaagruhuqwwjmuhwvivksnahtkymzwsptnblivnusvaatakpvnuvzsckvggzskijlmmmarfbsfvfupuqwinockjpsaimqsmlwriqhfrxeznssnshubjnwmqmrjisxskegiikpwsknkcjnebhbmpihxolgjqqmdinszzecqqljqneykpjufaoolcjrzlybh...

result:

ok 

Test #31:

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

input:

40 500
hgrkbariyienlarbtwpgttrlmwgdwjisgwtuelybkqyzibmerddzhxpkrikkdglakynfmvzntqkldilwlredsuwiyhvfmdfymethhuqztlwzlsjsoznrcemnwutebgioqndeywylttipnfkjzwrykcsmyeruqzryjuhcyirlakfmzwyjlisxtpdibravckhsunbfdczcfjcdnjcdkhqticcslsqmbldpvatkvnlgcnjzzpsjgoxbdqaqogdiqwngjjyaxcurpfcotfthvlhnyqvkxalealplywzbj...

output:

zdipaunsvfzbkvwbcjgjdivgermzgnfecegqnkusywqrmgvrokvcyaeesgvyudxypqxsggpowjtgkhessbyyuyqdlzyhupeigfyxdxzuukyevtbmowkxhmafrgsyshaxqisuxjzicqxkyoejcxslkxfuboqwxaxgbqviacqgmobotjikzhpcmgmlmaczeaqvaqmfdomzjmlztjfiinugnhciiqwvnlhmmbcdqoubzvwenibvoaadhunnmipvbqujgwbzavwztlqkfyusjyvpxqluxwfuflqilbkflredekyt...

result:

ok 

Test #32:

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

input:

2 10
dkzttcuhkf BYBYBYBBBB

output:

aaaaaaatck

result:

ok 

Test #33:

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

input:

4 10
hzyqaqgudo YBYBYBBYBY
drzekuoozp BBBBBYYBBB
ydmoszopir YBBYBBBBBB

output:

aaaaoayahu

result:

ok 

Test #34:

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

input:

8 10
xpcbenntvx BBYBBBBYYB
guunnaqbzh YBBBBBYBBB
vkgjtzyejd YBYBYBYBBB
bmlrgczqhc BBBYYYBYBY
gjeqpkftzq YBBYBBYYBB
ytqggdmtoy YYYYBBBBBB
okyanrydin BBYBBYBBBB

output:

cvtycgrcqf

result:

ok 

Test #35:

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

input:

10 10
lvqefvmhvh BBYYYBBBBB
hwzwczqwzo BBYBYBYBBB
ywzwszxeyd BBYBBBBYBB
pxryhjeyhe YBBBBBYBBB
fpplflfrid YYBBBBBBYB
wffgroprrh BYBBBBYBBB
atnazpsxkj BBYBYYBBYB
wjftdvgbca BBYBBBBBYB
lxejbsshfq BBYBBBBBYY

output:

cziqpcnfek

result:

ok 

Test #36:

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

input:

2 20
gvmxjisdtqdzqlcythxc BYBBBBBBYBBBBYBYYYBB

output:

aaaaaaaaaaaaaayhltvt

result:

ok 

Test #37:

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

input:

4 20
juwgnsochomtjjrwkxzx BBYBBYYBYYYYBBYBBYBB
xcfresnspwhbnpufpzut YBYYYYBBBYYYBBBBBBBY
nicdnycdwkcwxkzlexij BYBYBYBBYBBBYBBBYBBB

output:

aaaaaxytbeorswomidhf

result:

ok 

Test #38:

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

input:

8 20
gfbhjraeqpkknoxynzor YBBYYYYYBYBBYYBBBYBB
eoqxnsiomjhzyechxzfk YYBBYYBBYYYYBBBBBBBB
izclftrifyoacpdwwaxi BYBBBBYBBBYYBYYYBYBB
vkmnjqckgcojyuccmzsy YBYYYBBBYBYYBYBBBYYB
kotrkwcofjzhzgwiegsj BYBYBYBBBYYYBYBBYBYY
kuoenzkgqkxjkenvaywp BYYYYYBYBBBYBBBYYBYY
ntfjwmseryvxlgimrynx YBBYYYYYYBYBBYBBBBBB

output:

aaszgvwujrpmdjeohnaa

result:

ok 

Test #39:

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

input:

10 20
fgyncfbwipgvfxmohdbo BBYYYBYYYYBBBBBBYYBB
icbhpbqvluuvwljfzrci YYYYYBYBBYYBYBBBYYBB
cushsnrenivjfzblmwbz YYBYBYYYBYBBBYYBBYBY
iqfqmazradptgidhmewe YYBBBYYYBYYYBBBYBYYB
kebuhncdbrmdpxqmizic YYYYYYYYBYBBYBYBYYBB
vmccbyguslsftfilufvg BBYBYYBYBBBBYBYBYBBB
dvrpdiwvdltezikdbpvv YBYYBYYBBBYYYBYBYBBB
...

output:

hzziywuarkhuetpnqcdb

result:

ok 

Test #40:

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

input:

2 500
gxnlcmqfsmxkzleyreubambwtiyuisiplwrjastyivijshzmfuyjqbqwmtiixxwivmqxpbuboruzaaapaxrllfbonnouzwmjuouvzcoyxytfxmhtfcvsbjvnltirhojtxhtdiqasoajfhrcinjrkzstidvhhdwynweaacmuhctyzeelatwnropiqifxsgxntfycvjrhwpmzeytliurapssrixkjndjzwtjonqzmhhtqyqjacafxkwfrnvjyjcswxrkmhstxgrdaxacuqiqtmdwuiuwzjjekzsaycgc...

output:

aaaaaaaaaaaaaaaaaaaazaaaaaaaaaaaaaaawaaaaaaaaaaaaaaaaaayzzzzzzzzzzzzzzzzzzzyyxxxyyyyyyyyyyyyyyytvxwwxvxxwxxxwxxxxxxxxxxxwwvuwwwwwwwwwwwwwwvrvqvvvvvvtvvvupruustuuuuuuusuuuuuuuuuuupstrtssttttttqttttttttqsssssssssssqqssorqkrrrrqrrrrrpqqqponpqqqqqqqqqlpppppopppoonooojnoklmoooolmnmmnlnnnnnnnnnnnnllkmmlmm...

result:

ok 

Test #41:

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

input:

7 500
kucxpooswpgshqxdswdpxnonzujecioriraskzligwznnduirvonmjmozyxkotblntnzmsgacdjxsrelfbcwhffnqsshpdnuiyvekpkkzhfqadrnhymofwpahuefzyauxunwxjsexozlkauixivyrdrckaxiicawzsvqshnexswpqlnwpfwqxfsqjgefxylqizfouiqmbtkxrjcdpjfhetrphazpatrwkbikmswrsjmuvlmkuhfvzvfpqawtkgtmykusaspvinyqteptvvfgynrehmekerkbpgcbgf...

output:

eeeeeezeeezeyzzzzzzzyzzzwzzzyzzzzyyyyyywwyxxyyyytyyyvyywxvvxwuxwjxxwvvvvxxxwvxxtuvxttwvvwowvuqwtsutvvvsvttvvtmvuturrtuusutsrtuotsttuuuquiuotuuqputtttltrttqfrrrspppsrlrlrrsssrqsqrrsqrnpqisqsqsjslsrspgorrsqsriprrslooorsoqqppqprmppnqqqpmqpkoolpqnpqqqqmoqlqlqopppnkgnnoioojjonilnlmmnlociinkommnoindglinmm...

result:

ok 

Test #42:

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

input:

8 500
zsuejmayajrezxaeoppddvtufobaqqrnadgiydzodggiskvrvfyassjbdhbufhmxctpfdqvhykrkqjjltksstdnskjfspencdneizkxxtfdheyhvmnsjdbrjusilipmplxvnfxthruxwdukolyqivyaufoewysvppuqdcdmvwdwgtaqejnfmgtylhgrfcjqagvotoosbisnibzntaetxvemftcocguvgindrppzlooryrqicloefmktmimfqyxlletbymenpljkjybhyfuahardknwfejcojkxyzsl...

output:

cccccvcncccccycccvzcccxzczzzzzzzzzzzzzwxzzyzzzzyyyttyvyvyyyvyxvyyyyyyvwvxnwxwsqvwxxxvwkxxvtxxxxwpwwvwwwlwwwwwwunrovvvvtvoovtvuturrqutrqssourtrtstursqtsqsulruusturupusstumriruujuuuuusuuukueusssnrsnmrrpspsqrrreqrrmkrqnnpkpqporrmloqrnpnqnrmpoqiqoqompkmqpklqdkppkepqdlnoqqopakipmmpkonimopnjppppplongoojmi...

result:

ok 

Test #43:

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

input:

10 500
fwpisiecngmypltgnpgwungiorybsqujrjynxduhbxkzzcpmprjkmcngffwriwlauogonaytiewzmvhmfkbqzbhvbuzaxgmrzwhznemrkgkqcfcxznjgqfxvivnzxkttungprndxzumatgitszsuhxrbxiyblepjljdwccbmodtyikdewbqekqnyrdpveilrjuidvbxmidaudrahboegnxxojlllcijvhewxbqhckkdisyyoieqnybydwpyiupduxdxdcbsiflmqomhorvpximunuvgeqrpojynfz...

output:

ccccccczxzzmxzzzzzzzzzzzzxtzzzzxzyxpryyyysyyxsfvyyyuwxyyyyyyysyxyyyyxwusxxxixxttwxxxxrxxswmmuvvxxxxxxvwvvwwvsurjwpwwuwwwwwuttujvvuqrtqtrwpupqurquuvvpsvuvsjvivsssrsrtmrqtkqptmstsnttsstlssornstsrssqmqsntqptstoipnsrkrisrjrmsqqpornqppromopqmmopqppqrkopqmqmhjljjpkmjonoopihjjnlmoqmoonohlnnmninloqmmimflkbd...

result:

ok 

Test #44:

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

input:

50 500
rzxpevxmcsvfyfmnmokxtsjtkisntufznueipsounknjbdgoieqoeobnfuncfrokfgdsdujxvtluensnrnyosfsywmltfikmpgofyyutxgxltspvwnqnfvgeolxirwbvvwgwwbxbwbbswrefaklrdmdlzgxpltvbucwfgrpggpobkapydjkzbgfarvqfzssyeepxzesalnpbnuastjecnatiljloelrojistoqxxrwdiehnwbubijlcsgserxmlbbchlhqlndtvmbaztvhspfxdyfuodupczzusgi...

output:

wnerymmcnzjwmwzottpwjihyzctdrtqvzjphooxwejpzdynzqjumdqdiqcaqoljqyqqmqzpyzgtdimiztszbrudzjwzzrzetrtzecjmsytlbzqthoszznwozkhltgtqtzzigoggxmrshmmipzyyqnkyvghvytvgxyxxypkxucrtkvuiqoloynyypqevvnydvycyvttpuxmflhjsluhckbovtutfhioiucgjxpuuhcioufiipivqkcxipsvcgwexiopptdvkbcppjdxrmaimtteakpxbakmwshocpwgbpbgwj...

result:

ok 

Test #45:

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

input:

160 500
hayqlkswaloyrwgikgdxyqsorgjgsohxuyrlfdgptnogrfzfrcmkhyvnpohpgtjhhlalckgubhvbbtinzpykjfayxwqctbmbjdtguonvdihewfxphkfngblmtlxiidbpxnxeiswxfrvbflvisrvxkqqeqzinhgobjfbxhbtfageuinrzyqzhrsqttlmfxgqsdaxkyiajiitwnxnlqggrncbzwrzhtctcunpkhdlqkqtkyfvcuwqftujpufwgeqkrzdfngmshdiwhobeieunukpjgvbdwhjtkaccm...

output:

mjpyvrzpguatqaxutfeenauznkxsfgqfrfdaoydwqimxssimpofnqfailvbgkmearxhgxjvtluftknckiwaeyuedbogewrnlfyzatjgtgrpvjnehxhvwkcydnkwnvxgbifqobxxchmltkwyqpgaanlyunugwtxmayycilokxdtzhcwgpmleawmsvacdywnpnpevqwpkyssvakkmpmslqmgucrzrqoufaausspnahpwkcvrfxhbwcccsbnntbfpstmaesxspfwtseyluftmrkcmifuofjnnhmwfrbveoudsgx...

result:

ok 

Test #46:

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

input:

3 2
qf GB
fq BG

output:

qq

result:

ok 

Test #47:

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

input:

2 25
mzopyxgqdtsjvueklciwbrhna BBBBBBBBBBBBBBBBBBBBBBBBB

output:

fffffffffffffffffffffffff

result:

ok 

Test #48:

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

input:

2 25
jagfzkndilpxwsbrqytcvuhem BBBBBBBBBBBBBBBBBBBBBBBBB

output:

ooooooooooooooooooooooooo

result:

ok 

Test #49:

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

input:

500 25
ugckltahyoirfewnmspbzxqjd BBBBBBBBBBBBBBBBBBBBBBBBB
culezaoqmdwbxgrptynhkfsij BBBBBBBBBBBBBBBBBBBBBBBBB
nisywzjurlckehdfxqotpbmag BBBBBBBBBBBBBBBBBBBBBBBBB
dwsijpgknaorcmeufythlbzqx BBBBBBBBBBBBBBBBBBBBBBBBB
nkbhtrfjygioxlpewqacudmsz BBBBBBBBBBBBBBBBBBBBBBBBB
bitglumeakqsrdwfyxcojzhpn BBBBBBB...

output:

vvvvvvvvvvvvvvvvvvvvvvvvv

result:

ok 

Test #50:

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

input:

2 20
ynjmhdwofqxsaubvlktc BBBBBBBBBBBBBBBBBBBB

output:

eeeeeeeeeeeeeeeeeeee

result:

ok 

Test #51:

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

input:

10 20
wmcthpfyuosdarbnkjql BBBBBBBBBBBBBBBBBBBB
rpktmndxwybuaojvgfse BBBBBBBBBBBBBBBBBBBB
rainqcsldwtgmjbyvoxf BBBBBBBBBBBBBBBBBBBB
ercgnpkbmsaoulifdqhx BBBBBBBBBBBBBBBBBBBB
uehkilromqatgnwsdypf BBBBBBBBBBBBBBBBBBBB
gelbjwyqcstoxnudvkif BBBBBBBBBBBBBBBBBBBB
cixsjvnolhykpfqdatru BBBBBBBBBBBBBBBBBBBB
...

output:

zzzzzzzzzzzzzzzzzzzz

result:

ok 

Test #52:

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

input:

20 7
dmluxoc BBBBBBB
psocfxg BBBBBBB
iglnjde BBBBBBB
zgevtio BBBBBBB
ujzbglx BBBBBBB
snzcdyw BBBBBBB
urvtdyg BBBBBBB
fqrnvwx BBBBBBB
usrpvhe BBBBBBB
ptdqbsc BBBBBBB
tuvfrip BBBBBBB
wmfqncg BBBBBBB
zhufsvm BBBBBBB
jiwngao BBBBBBB
peoajsu BBBBBBB
htcbrdx BBBBBBB
lymcpai BBBBBBB
hzsfwgr BBBBBBB
yqzeaud...

output:

kkkkkkk

result:

ok 

Test #53:

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

input:

3 3
abc GBY
daf BYB

output:

aca

result:

ok 

Test #54:

score: 0
Accepted
time: 5ms
memory: 34348kb

input:

3 3
abc GBY
daf YYB

output:

acd

result:

ok 

Test #55:

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

input:

4 4
bcda YYYY
cdab YYYY
dabc YYYY

output:

abcd

result:

ok 

Test #56:

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

input:

2 4
aabb YBBB

output:

ccca

result:

ok 

Test #57:

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

input:

2 14
welcometonwerc GGGGGGGGGGGGGG

output:

welcometonwerc

result:

ok 

Test #58:

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

input:

2 10
aaaaaaaaab YBBBBBBBBY

output:

bbbbbbbbba

result:

ok 

Test #59:

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

input:

10 40
nvolvefindingafeasibleflowthroughaflowne YBGYBYYGYBYBBYBYYYYYBBBBYYYYYGYBBBBGYBBB
tworkthatobtainsthemaximumpossibleflowra YYGYBYYYYYYBYYYYBBYYBYYYYYYYBBYBYYYGYBYB
tethemaximumflowproblemcanbeseenasaspeci YYYYYYYYYYYYYYYYYYYYYBYBYYBBYBBYBBBBYBBG
alcaseofmorecomplexnetworkflowproblemssu YYBYBYY...

output:

inoitimiwyxibpthnalpuaotmrrfeomoiiolemsi

result:

ok 

Test #60:

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

input:

20 20
maximumflowproblemsi BYBYBBGBBYBYYYBBGBBY
nvolvefindingafeasib YBGBBYBGYBYBBYBBBBYB
leflowthroughaflowne BYBBYBYYYYBBBYBBYBYB
tworkthatobtainsthem YBGYBYYYYYBBBYYBBBYY
aximumpossibleflowra YBYYBBYYBBYBBYBBYBGB
tethemaximumflowprob YYYYBYYBYBBBBBYBYYYB
lemcanbeseenasaspeci BYYBYYBBBBBYBBBBYBBY
...

output:

inoytimizationtheorp

result:

ok 

Test #61:

score: 0
Accepted
time: 5ms
memory: 34572kb

input:

2 10
mympqinaqs YYYYYYYYYY

output:

ysqqapinmm

result:

ok 

Test #62:

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

input:

5 10
yoqojkyfrq YYYYYYYYYY
yoqyroqfkj YYYYYYYYYY
oqyykoqrjf YYYYYYYYYY
rqkjyqooyf YYYYYYYYYY

output:

fyjqoykqor

result:

ok 

Test #63:

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

input:

8 10
ogrpxwryvc YYYYYYYYYY
cwyprvorxg YYYYYYYYYY
cvrwxrgyop YYYYYYYYYY
corwprgvyx YYYYYYYYYY
pwvcgroxry YYYYYYYYYY
cvpgrwrxyo YYYYYYYYYY
xgyrpowvrc YYYYYYYYYY

output:

yrxvwgcopr

result:

ok 

Test #64:

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

input:

2 20
lfyzddchsnrcfbfhpxkh YYYYYYYYYYYYYYYYYYYY

output:

zyxsrpnkhlbhhddfffcc

result:

ok 

Test #65:

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

input:

5 20
bhczdehumywygnhaeeka YYYYYYYYYYYYYYYYYYYY
ezgwuhykcbaehyhednam YYYYYYYYYYYYYYYYYYYY
kdzyancbeuyhhmghaeew YYYYYYYYYYYYYYYYYYYY
emhkzewgdhbhnyauacey YYYYYYYYYYYYYYYYYYYY

output:

zyynwughkmdceaebhahe

result:

ok 

Test #66:

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

input:

20 20
kczuooznpwpyhwvericy YYYYYYYYYYYYYYYYYYYY
ewkyynocucivzrzpwpho YYYYYYYYYYYYYYYYYYYY
ozpihwckecpuvyrnwzoy YYYYYYYYYYYYYYYYYYYY
kczihoyecnzwwpuopvry YYYYYYYYYYYYYYYYYYYY
rwehopuyockzywzicpvn YYYYYYYYYYYYYYYYYYYY
cupzeoonrvwwzkihycpy YYYYYYYYYYYYYYYYYYYY
cvpkhocnuwizzewyryop YYYYYYYYYYYYYYYYYYYY
...

output:

zriwvykzypnhccpuooew

result:

ok 

Test #67:

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

input:

50 20
mrvjqpnuyqwylbbsgkdy YYYYYYYYYYYYYYYYYYYY
mrbykbqusqwypdvlygjn YYYYYYYYYYYYYYYYYYYY
nbyyplqvjgsrmdwqukby YYYYYYYYYYYYYYYYYYYY
kqyvrbqbslmdygupwnjy YYYYYYYYYYYYYYYYYYYY
qjywupyvbsdrbqlgnmky YYYYYYYYYYYYYYYYYYYY
sqgnkyjumwdbvplqyybr YYYYYYYYYYYYYYYYYYYY
dsybujyyqgqnlbvkpmrw YYYYYYYYYYYYYYYYYYYY
...

output:

uydgyvbmrkysqwpjlbnq

result:

ok 

Test #68:

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

input:

2 200
kjgxibzaqovyhfahtzepmneqlrtyqskqjclybnijqdnnaqjwqpcdyhqcivkhiamwnnnrekynlwdhhtwoluuxuivncktinkkmgnavexykunaefwtdtccjdvnjrsshktuiqmugothxrrkrxfbzhzawqdvcnjwfbemdjwmsozfyialxnxbqhndzyhoskwmuamcdsrzxttte YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY...

output:

zzzzzzyzyyywyyyyxxxxxxxxwwwwwwwwuvvvvvvuuuuuutssttttttttttsssnsrrrrprrropoqmooqqqqqqqqqqmommmmnnkkinmnlnnlnnnnnnnnnmhlllgkjijkkkjkkjkgkkijjjjgffiifiiihdfhehhhhhhhhfbeaeeeededdccbbcdddbddcccaacacbaaaaa

result:

ok 

Test #69:

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

input:

5 200
sfcjckdgmwmnnlqezqgivfbrgkwmqronyyojlpqwajmjmgjhtlnsjcmsysflrpmrluakngchrsuncwwbqmlpavprqyvhwplrtqhxpzgtxixarzjsvrfquqemtgfryynowgowzyiyxxjarzfaevasxohhqwsleahueveixdjlybnsxnsbtufoiihtstlhczsczzazjwou YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY...

output:

zzzzzzzzzxyyvyyxyuyyyyxxwxxxxwuvwwwwwwvuwwuuvvvuessttpottttmqtporopprskspjsossnssqsossrqrrmqrqnqjrrororrlpkqqqqnkmnnnnnnelggmlmihlfilflmlglijmmmjhdibheefhljihjjjglbjfeifcbejhagfhgdggahccabfhaaaaccacac

result:

ok 

Test #70:

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

input:

20 200
krxqaxppwikekhvmjispucbtwyennwxkqsvjhwpvcvtqgemfpnvsjoppwvqbyslciwosyqjircnsrpmicagujcstajnwuztjpyjxrwbjpelhukuwynyfjhfoxerfvnotzxgqrrckgsjbtnfmhjtpqcteosfpfjgesbwrxvrtdxhrnrdzlnlnivfwrsxkpvsqkwuyfqgh YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY...

output:

zzzyyvyayyyoyauvougdblmuludoxxgabkxewxxxxxiwvugewxmmvllhtuwtwgewgehweooveqwqhrqwvtttbhvwwwistcpmvvchvkrirtefrcrctfqqiqipkipkqsfrqbschhkppjksrscrkpbcpqpsnnjnpnptgsrfknfrpjfnpfjrnjjsssnjfjjnssjpfrjcjjnn

result:

ok 

Test #71:

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

input:

2 500
blgymzrpzujbijgjxyuadmopdmktpzaovnuecztkbzxgzyvisyljaevyfufxyhyqiqdueuswizdfbebeofpeixebkcoylfbfnbckcmafvwcppobihsmxnvhrsacfeozhlqloqithcbvguyslmdqksinnirkziaicjfrpxhceqgxsbiowjixmoflvtvuquoidzfpusisagkefodwcsvqdwvnfhfygrrobkelcsxdaoddqtmvgxkhnouoqizqwvvudriluplgazarubzbsomyqcaycjjwmyqsmabeisi...

output:

zzzzzxzzyzzzzzzzzzzzzzzzzzzywyyyyyyyyyyyyyyyywxxxxxxxxxxxxxwxxxwwwwwwwwtwwwwvsvvvuvvvvvvvvvvvvvvvvvvvvvvtvvttutuuuuuuuuuuuuuuuttsttttprrrsssssqsssssrsssssssssssrrqrprrrrrrrrrrnpqpoqqqqqqqoqqqqqqqqqppponpoppopopppppllnnnnnmmmoooooooomooooooooooonnknllmlljmmmmmmmmmmmmmmhjlkiklhllllklkljlkjkkjkkkikkkjj...

result:

ok 

Test #72:

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

input:

3 500
fndjpiklrigzxvhtgavgqxjhgclbcusixstqcvopskxdxeaksfcfrlkzdsqjddqnijuqqmxzafjbljcqivkozdwwyjzysrkkpxrymnuavmcjemoiaayfnldynfkjgzzlcywayfwtlcaicnawiagrmlhwrjcdvxrbxavfjqwkejfaahukajyupcyulvnbpqewqooacxbryistjptowptrpiclmkgdpnchtrgijujimyloxgxpxqqhhnidbeiasewjkydmpkecplkxlsyzbsyheqeigyyyujupwdjqzg...

output:

zzzzzzzzzzzyzzyyyyyyyyyyyyyyyyywwwwxxxxxxxwxvxxxxxxwxxxwxwxxxxxxxxxwxxuwwwwwwwwwwwwwwuuvvvukvtvvqvvvvvvvtourtuuuuuuuuuuuuttttttttttttttrttssosrssrrsrsssspssssssssqqqrnqrrrrrrrrrrrrrrqqppqkhppphnqqqqpqqoqqqqqqqnmoopompoopopnppppppppppppkohomoonommmnomnmmmnnlhnnnlnnnnnnnmhimmjkmlhmkhllekhklkljlillllki...

result:

ok 

Test #73:

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

input:

10 500
bupnuqzdcpbbxnmovthxvephnapgnxykdqpefrnsxlalrhtxogfxlpfrcxjmocibrokuejfvalrapnhvzuabrhjfdcnnnaygwtkgoenbewrtlzzdhxmzndkphodrcjbcyivsaxbugccvkqzbygufcpqljzopxafwzyxceegfdqtqqufvtptbllewhlraeotvtdiwnjnbkedfhsfpvrydnerajvkwidyhptbvtstjbwqucskqlecziliyqqrxvahlbahjzlxebblyfmjkxpuyitksjtqsxkmzatzur...

output:

rzzzzzyzzzzzzzwyyzvywzyzzyzzzsuyyymyyuyyyyyywyyvyyywxyyswwwwtuwwvvwwxsixxxxxvxxxxxxvxvvxxsxxxwxumsmjpstpvvokuvvssvsvvrvtiqsqquutpounussrksrouuuuuuprqumsqoumsprotrttsrtjprsltjqtorpsqtottrsqrrrqrqrtprtornmtttrtttqtlpppttqltlipkkknoikmlopobnppinqqqbplgiqoikopqleoqijingnhqqfnikqglfqglingklnnqhjghlgnnkil...

result:

ok 

Test #74:

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

input:

80 500
dvbyutdpoihytugjpvxnzcreuwneaqokypvmieezkevfpngozhxowvwbavznhmbjosgnvskifmpbaflkoxivossyqaoxkvvioupzyygerlqpntmxkctrcodkogiqrvnhkczcdhbnvihopmchnnyayletjmvsflwdmozsgrwkqdijrjzrodqqadsnsmzulhumosmwmohoibrcqswjaohlzmjpjnwifwqunludixjhhupgettgefwzcvygiycdtrenhbydhaopdrzogaadrqwiqiogounuhozeifmox...

output:

tjsoqwjgelvevtbzjtsqlisyramuczsezzctkhktwwrtkhcinoiylllzldhseijviduejjusrlzpfutxtfhofdujrdxalpnnwzonlshtlooitkqoinuxdzzxsvjonixcfsxuigksikmkqskoxmkofjyrblovkaiiycxotibzghrvhqoxzgvvoqfmoepfzneoeyhvoiyaztoqzyeppnrivdgrwwggnecqcforxzxsqdeemhgqkdymquvagrmuycfewrvmzqgfhmjdriozizeevappahrrxnoppqhbwygxwoyb...

result:

ok 

Test #75:

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

input:

500 500
dvbyutdpoihytugjpvxnzcreuwneaqokypvmieezkevfpngozhxowvwbavznhmbjosgnvskifmpbaflkoxivossyqaoxkvvioupzyygerlqpntmxkctrcodkogiqrvnhkczcdhbnvihopmchnnyayletjmvsflwdmozsgrwkqdijrjzrodqqadsnsmzulhumosmwmohoibrcqswjaohlzmjpjnwifwqunludixjhhupgettgefwzcvygiycdtrenhbydhaopdrzogaadrqwiqiogounuhozeifmo...

output:

tfeoqwjveqvevahzjdtqvooypagqdzsezqctrhbywwbsshcinoiymhqzqdbswiwvidiekcmselzpgmagtlhoidgjrdxmppnnfzonmshploaigdwoihvfduzxkvnoniucnvrxigpsikgkcskolvxofjyrblomkwiiyuxotibmghhwhqoxzgvvoqjmojjbzcxoejhvwidfvtoqxyepphrivngrwfggxdmqcwoaxcnsqdgsfheqbdymqutagrmuyclewsvkzqrfhmjdriozizefvvrpamrrxcofpqevwykehoyb...

result:

ok 

Test #76:

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

input:

2 20
xztanpyxqtcnpuzqqyoq BBBGBBBBBBGBBBBBBBBB

output:

aaaaaaaaaacaaaaaaaaa

result:

ok 

Test #77:

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

input:

10 20
opwtpwvtwxouoyqsotzp BBBBBBBBBBBBBBBBBBBB
gzynqjtxzqtzdwupyqxw GBBBBGBBBBBBGBBBBBBB
nqrqzyuqqtqoquynuxwo BBBBBBBBBBBBBBBBBBBB
rovrxornrwtoymtnnrpu BBBBBBBBBBBBBGBBBBBB
wdxtnppzptvzzuzlvqrr BGBBBBBBBBBBBBBGBBBB
uusqpvwtntwxxxdryuqn BBBBBBBBBBBBBBGBBBBB
nxxnnpzsztyndvxlrron BBBBBBBBBBBBGBBGBBBB
...

output:

gdaaajaaaaaadmdlaaaa

result:

ok 

Test #78:

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

input:

15 20
woourpqrstqycprorzzw BBBBBBBBBBBBGBBBBBBB
ypswlxvouotyzsqrpxpo BBBBGBBBBBBBBBBBBBBB
rvporyxupxswysrrzqvd BBBBBBBBBBBBBBBBBBBG
trrqqnpspvprxzzwvszp BBBBBBBBBBBBBBBBBBBB
vyoynttqpvwonpxopsor BBBBBBBBBBBBBBBBBBBB
tyuyqntwonprcnngorwp BBBBBBBBBBBBGBBGBBBB
xyptttooymynxuvspuqz BBBBBBBBBGBBBBBBBBBB
...

output:

daafljaaamaacaagaaad

result:

ok 

Test #79:

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

input:

20 20
syzuzqoytozsurzpsono BBBBBBBBBBBBBBBBBBBB
wesrqwxttsyosvbtsqqq BGBBBBBBBBBBBBGBBBBB
osrvrpppwpqynwotpffv BBBBBBBBBBBBBBBBBGGB
vwvrywzppxslxsunfuxy BBBBBBBBBBBGBBBBGBBB
nwurxytqswvputotrvsz BBBBBBBBBBBBBBBBBBBB
przuyqqnkwuztupqptfm BBBBBBBBGBBBBBBBBBGG
lrqpyysqxnwvjovffosm GBBBBBBBBBBBGBBGGBBG
...

output:

leaadbhhkaaljabffffm

result:

ok 

Test #80:

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

input:

2 500
zxwpopwryvxwuszirrorrqtsnwrwuoonyqsruqtpvwtxmnzxtsrivsnttuxvzjsywsqspssqqvusyqoppwwzzzrwsxwowyznnnttxvgtrptuavzxotqqsuovspzzvxrvqqqvnpqnypeqqwyospooqnuzxtxypyutvoernuctyqzvqsdwpvuunrsypvzvuqqsvqqoxuuznqvvxusynpnuqwzrnosxqslunwvxooyzzsqrvzupyprkvqntnwwowxnsrtnsvszzsxsqysnnsrnwwwqzvyxowoinppbqxy...

output:

aaaaaaaaaaaaaaaiaaaaaaaaaaaaaaaaaaaaaaaaaaaamaaaaaaiaaaaaaaaajaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaagaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaeaaaaaaaaaaaaaaaaaaaaaaaeaaacaaaaaaadaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaalaaaaaaaaaaaaaaaaaaaakaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaiaaabaaaaaaaaa...

result:

ok 

Test #81:

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

input:

10 500
epjvurrwqwslokprtxxnoqpvozzqynewutfwopypqopcxvswnlwavyotqvzfovuvznzuttpztqtvnnysqzrpszbrtwxwvlzqzofwtwrprruwoqzruxunyszooyvzpfwoqrsurpzeozxwuznvvuyorztufnvvuuwxpzpxtusyzwpvwqvmxytssnqsupxxyoxrpqttwwwnkqyyzppuyxqodqsywlrunuxsorzorpqurwrvxqyqynxvoqtsyrvxzvnxzszpunupyqnopxrtprozwtvxzxwrnnnrspvwo...

output:

eajfmkamadalakaacaaafgebgaaaaaelaafalakaaefcaaaaalaaaaaaaamfaagajaagkmaaaaaaaafahagcdkbaaiaajlkaajfaecaaaejaleaacaicgfaaaaihdfakabfafkbeaaakalmaaakaaakafchaeaakagddajaaaaaaakamaaalafmgaaaalaadaaaaaaackafhkbdebaafdfalalafekgaeaaagaaalaaaaajaaalaaiaaagbaabdaaaaafafaahaaaaajkalajagdbaakaceaadaaaaaaaaaa...

result:

ok 

Test #82:

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

input:

15 500
zryswnworvevunwutuxmnzpbspdpqctwosopnwswrwvyyvptypvzqwzzcontrtooysryxxgvrquvnnfnvqetnourqrxbwywtoqwvtvzqhppsnyptroqtsoxwzrqryylrzntnssvtrqxrsnzpxvzxpqrusplhrftenrtsxvpvnpxuokwtzruqtzsryqnywowwurnyoztuwqtrpptysuqvrprpfovwepypwstvipnzgxgwrndvwonuwqwtxotpvxyywzzozwzwtnzozvtsoytxsnqywvarnpnooorps...

output:

fbjaiageadeaafaadbamgigbhddbacaaaakaalajmaaaaabeilahadaacmeljdijammmaagahafaabfaabecakiaaambaaffjaaaaeaahlaeabaagkgahaahacabgmlaciiiaaiifcaggiaajfhaakjfgelhmfaegbjaaafaaddaikaaiaahaaaaafggeabhfegehamlafmaabaacaddjgecfjccelkaaaaaiaaagagikadklamcejcjaaacaaajaafadaagaakmiceaglhamejbbaaeaaedaagccmfaaamj...

result:

ok 

Test #83:

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

input:

20 500
xzqwxnzjotrpypunovrukuwwzxynowyxywvvpnvtnozoqyaxpdorsvpyvvqpsoxrsxwrsnatxosrvuynpylrxvywwqmzqzppuvuytyqurgpwxynoqyrqxpuzytunxrnrrtowrpzuvyorvquopsuqquyrvvnzoupvqrvrdqnoszvxtqnvrxtpotxttuoozppwwysytonzyryntwntustoxqzvvpnsxrvswpxntrwnxtrczqqxtdwksqostroutslsrvyyxsqyywqpwwwuvqwulrspywrnbwnxqswxz...

output:

jcmacekjadahjdcajcadkaaamgkmflkkaghllfakdaacimaajdailgcaajaeagjafakaiaabamemcbbjcalglaacaamdkhggjhlbmafcggkeliijfahaaaalagkcadaaiadaamfafalkaaddhakahclhaikiaabaadccdmacjieaaejalgbeabaajhfjacjaeakalkdialiecaiaafdlmdfgeacagfacffdhcahaaaacmhdeadhkbkcghbhcaellhhbkilmaaaadaiaaajgalkhabgaabiahamaamladllbi...

result:

ok 

Test #84:

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

input:

100 500
xyretptvzrvrxtppxwtoqznyquonurrunoyxxxusttovzmhvuwtquvrvqdovpivrswrwxvstvstrqtywtwtktsqnfsspvrxorvtnovwtpprxncrprsuvsqruqznvsbtsnpszznujxzziwcwsrtfspsnuowypvvtqtpxwlnnxnpsirzspqplsrpqvxzxrrwpywnonrtmzqyrprzwvxuwvntsunuznowququzzntwqvonpvtxpntzqznswrzqwzrsjntzypsnfypvvounhxuqoysxoprwqyuovoxov...

output:

flkebccliaedgbhbadhlkhglfhfkaefkmdgjdhkdkfkdmmhekdellmiemdkacikbafmfgjgglihhjcbkgbfkhegcfmgbgjfgkmhgjbmhdjmfmckmfkmibjbcgkgmhbadafehijdjmbaidceiabfjmlfimfehgccgadfmlcdbkkfiebmdjflkfmcfijlidedkcgededmilldmidaaajchaidikekhdahflcjakgmghjfdfdcdeimkijcamdaahjgjkeagaklfilcjecjhglkcejbefafiffcmklifdbfllhba...

result:

ok 

Test #85:

score: 0
Accepted
time: 7ms
memory: 38660kb

input:

500 500
uynxusnuyztownaqulnzvqzstswqszvpsprsvytsvquwqntnusnxnnvhzhwazupswyyyrpvkpqqpqurtzyixswqxxswprtcqzrtxpxoutrsvtyqsxoyzuuttwtzwqiporzwpnurtpuvywzdyvqozlprvxqmyutqrswnvuzazoqzzwqsonxptownoywrqsrzhowotpupprzuttkvouxrxzzuosspwiwsghyxzourxwtsyorrqwwowxstcylzvpnwzrsqrspszyzptptquzwspyuoroossxqxrnrso...

output:

ccgfmibddhcmefadjlcmijidheabcmdikmcdfadhdieadkaiklfbhefhbhdaecjbcjdjglkkgklegfmlcmilhlaeckefelcahklhgggcddlfbilefbkebdcflfdkciffbgbdkcbhkjmjamdjmkbmlfbciemlhhfagifijjahhbhceijmbclimfbajmekcmchfellkalblelcgkhdigbagjdledjcifmghjagdjlkhcbhbjfcgcffjlfcelaejfbjdekdeckjlgkjdbabfgghkdkmfjibcikhbkmedjkfhelj...

result:

ok 

Test #86:

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

input:

26 26
abcdefghijklmnopqrstuvwxyz YYYYYYYYYYYYYYYYYYYYYYYYYY
bcdefghijklmnopqrstuvwxyza YYYYYYYYYYYYYYYYYYYYYYYYYY
cdefghijklmnopqrstuvwxyzab YYYYYYYYYYYYYYYYYYYYYYYYYY
defghijklmnopqrstuvwxyzabc YYYYYYYYYYYYYYYYYYYYYYYYYY
efghijklmnopqrstuvwxyzabcd YYYYYYYYYYYYYYYYYYYYYYYYYY
fghijklmnopqrstuvwxyzabc...

output:

zabcdefghijklmnopqrstuvwxy

result:

ok 

Test #87:

score: 0
Accepted
time: 7ms
memory: 34488kb

input:

14 6
aaabbb BBBBBB
cccddd BBBYBB
eeefff GYBBBB
ggghhh BBBBBB
iiijjj BBBBBB
kkklll YBBBBG
mmmnnn BBBBBB
oooppp BBBBBB
qqqrrr BBBBBB
sssttt BBBBBB
uuuvvv BBBBBB
wwwxxx BBBYBB
yyyzzz BBBBBB

output:

exdkel

result:

ok 

Test #88:

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

input:

14 20
aaaaaaaaaabbbbbbbbbb YBBBBBBBBBBBBBBBBBBB
ccccccccccdddddddddd BBBBBBBBBBYBBBBBBBBB
eeeeeeeeeeffffffffff BBBBBBBBBBYBBBBBBBBB
gggggggggghhhhhhhhhh BBBBBBBBBBBBBBBBBBBB
iiiiiiiiiijjjjjjjjjj YBBBBBBBBBYBBBBBBBBB
kkkkkkkkkkllllllllll BBGBBBBBBBBBBBBBBBBB
mmmmmmmmmmnnnnnnnnnn BBBBBBBBBGBBBBBBBBBB
...

output:

vtkpwjfsdmzyzwqtrria

result:

ok 

Test #89:

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

input:

14 100
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb YYBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBYBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
ccccccccccccccccccccccccccccccccccccccccccccccccccddddddddddddddddddddddddddddddddddddddddd...

output:

qzzszvveteettokotwrpypnossumognsinjhhhfiowfmfddbwwypwuduxhjduzsoolxftdmmfttxxzmmrktlkkrkvtnliigfleaa

result:

ok 

Test #90:

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

input:

5 20
fxyezqqsaxwjkmwdbcmz YBBYYYBBBGGBBYBYBYYB
cccccccccxwcczqmmdfe YBBBBBBBBGGBBYYYGYYY
dddddddddxwddezqmfcm BBBBBBGBBGGBBYYYGYYY
eeezeedeexweefeemmqc BBBGBBGGBGGBBYBBGYYY

output:

mffzffdefxwffcffmqgf

result:

ok 

Test #91:

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

input:

8 20
xtebkrvpbhlsbbdwfxnl YYBYYYBYBBBYBBYYBBYG
aaaaaaaaawrxtsnpbdkl BBBBBBBBBYYYYYYYYYYG
cccccccccxwrptsnkbdl BBBBBBBBBYYYYYYYYGYG
ddddddddddnwxrkstbpl YBBGBBBBBBYYYYYGYGYG
gggdgggggnpkwxrsdbtl BBBGBBBBBYYYYYGGYGYG
iiidiiiiiptdkwrsnbxl BBBGBBBBBYYYYYGGYGYG
jjjdjjjjjtxndkrspbwl YBGGBBBBBYYGGYGGYGYG

output:

kkjdxkkktkkndprswbjl

result:

ok 

Test #92:

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

input:

10 20
rijdojmjmlqsnybaekud YYYBBBYGBYYYBBBBYBBB
cccccccjccccrsimleqj BBBBBBBGBBBBYYYYYYYY
eeeeeeejeeeeeirsjqml YBBBBBBGBBBBBGYYYYYY
fffffffjfffflisjqmre BBBBBGBGBBBBYGYYYYYY
gggggfgjggggqilrsjem YGBBBGBGBBBBYGYYYGYY
hghhhfhjhhhmsigerjlq GGBBBGBGGBBGYGYGYGYY
hgiiifijhilmiiqegjsr GGBBBGBGGBYGBGYGYGYY
...

output:

hgllrfqjhstmtivevjgv

result:

ok 

Test #93:

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

input:

12 20
fabeuuqijeeiqvmlxikx YYBBYBYYYBBBBBBBBBYB
akaaaaaaaaaaaaaqjufi BYBBBBBBGBBBBBBYYGYY
ccccccccaccccckfiujq YBBBBBBBGBBBBBYYYGYY
ddddddddaddddkfjquic YYBBBBBBGBBBBYYGYGYG
kfffffffaffffiqjdudc YBBBBBBBGBGBGYGGYGGG
ggggggggaifgfdqjkudc BBBBBBBBGYGBGGGGYGGG
hhhhhhihahfkfdqjhudc BBBBBBYBGBGYGGGGBGGG
...

output:

rpinrojpakfpfdqjsudc

result:

ok 

Test #94:

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

input:

5 500
qnplnayaqcthgzrscaeffrjqhrnssuhmegcoitgfoztimbhediaxqwrcxvfabdgcszrewoenuesjalgbkfgetfnsucfxnrlvmnxwihsgnhadsgubjaglsxsjmyvofzsxpmintxsvyialuxxelmbirqhofndroyvkfxdntxdmvhboqypmxpewwevxfymbnvrxcsoutvmshadbjdgxswjdcviwlcjemdjnkeyudrhdqwhiqbtosjqfgseyerovvnhilpgodnfnpmznmypkbwyfzjsvobstnynyvdtedh...

output:

kkkkkzkkqkkikkkkkkkkkkkkkkkkkekkkkkkkkkkkkkkakaakkkkkkkkkkkkkyyaxxyayxtwtrwttqwvvouwwrwyzwzyxwzsmvzpszzzzzzuztrpwvwtttmtnyxouurnruxtryqopqwowqytyyyxyyyyyyysxtyyvovtrtowxwwqrvnrqxvxpxxvuxxxtxxvuxxxxqprhvvvuvgouvvuruuvurkvvdvqvsotvnlmnmnnqosmmqqstptsssnnslpsqmpqnntrptppstlodkqoorjrsprssssjsdssosodjdbh...

result:

ok 

Test #95:

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

input:

10 500
jncrnalnwtivhccjacwevrondacihuksbxcfzraslpdykexafbpxtxwdywjdxoxftifjlhsputwfznboqhgahcuxppyxiqfhuzunswiddtfjohaghympeqadrxijhfoouqpacfgkjnsturviadtwybnryakwkdmtmqqhmkmxziauaacvqebrhiuxnxzpnykmzidwrepmwqclynwfammeafyanrizsihsutuaeyxxpqwhisxznckmggtbmjpqwbcxgxvrdtbujqebrhoqekispgdiyqpiwodkixesj...

output:

pppppbpppppplcgjakppepypoppyqezsklzzgbzzbpzzbqzzzpzihiarjvtpfnnjshnusneyspdlpjekyvusoduuopcseoroebhfvloyjhhcrccwtzitncfpeqouycopkpnpvchrrdaiuussqsvzqtzppobnupxrmwywuocuoyayqzwnyqtyyysywstoyiitnruvvvvvtuswvxxrijpvrexprvwfohuswucuuqtssxxxxxuwxxrxxxxxssitklrubmutnsqtjsttbwsqiwwwhgjmebmwfwwbcqgowlbreocb...

result:

ok 

Test #96:

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

input:

22 500
gektomdzdkkeqsukkkjxppgwmeqldbovakxqbvdgarmqqowxvljdsmantqgcjppfcrcfhibtbhaxgaacxavpjzrkttzvvuyvrvainfgzytcowfzmjgsqbfhmqpnnksxfzddpjvunkphzpghkqtjvrtwaokjovhftfxyvzjyarskrjaiotntdyjakoqcfjkjzysvrqkrcenbykrwsacfylkhrwxxbfdmpaoegezxppsertmxynyffrodszzojlbqittjsglekbkytierwmbposhebqjzpvkxgxihrs...

output:

muukpxuvtkmgyroafqnjqndxahpfovfrzyflqsvgvkoejxecogjnwgybfruvpyofhqntrmtnpapgnfmblyutewednvcmynovearhynguvftivylfqbgbzapamhwdfsginkdriduqerzymretorcylhculwosspeqcsxchxhrazaiucegzbrjfpstrjuusavepgqkdqpevpduezjnwcivndjvkvdrdkcpkxwyqqlvgnqdfbgjhkdriazjpzfghsrcxvfoohjoweqtpqvawreroflfzcdzdcwzvqpsyhcatrhy...

result:

ok 

Test #97:

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

input:

80 500
rqbdmywktaijlbpcjblkmjvsztskxgpxgsqxfotxhbypeeeweorhksgtfrkstrhriwiyznnzyfclnmkqkabjqdrkoltoglioupjvfynemwvlqawrasffdukcamirncrdwkqwlxexnobtswlhtitcmemwpwnvlwgqrcloxcsjwnmqbefvytpdfwefpqgrggsztmybvotcwlzihwqtsrnxsoacsnambbidvohgjgqtbxnqoyjxwjwykbosssdipjmjveqsbxryvtuqwkyjsyeipwvzsrecugzregtay...

output:

hvlhtoafdfakdmwzdfeqzimhmphiqrsoucefcybyauxmdsqnygjaksbstemayxxydepymhzcpfvjotbumsjbyuoxssggqfhxcgovglnoduoktsntkwdzehbqkidequkadtyncjrsrnulnwaaeethuqmziovrxmkamkmbarmyblprtrsrtwiiyojxubpuzlniasjdxtefsfgjchoygezzamvdnlauxmgtjrwqmxrimwupyajkrunqvomzqdyqzvfioyqpbidvgjdngcjlqyrresceukckcaajlthlfmlxlopk...

result:

ok 

Test #98:

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

input:

12 10
azzzzzzzzz YBBBBBBBBB
zazzzzzzzz BGBBBBBBBB
zzazzzzzzz BBYBBBBBBB
zzzazzzzzz BBBYBBBBBB
zzzzazzzzz BBBBGBBBBB
zzzzzazzzz BBBBBGBBBB
zzzzzzazzz BBBBBBGBBB
zzzzzzzazz BBBBBBBYBB
zzzzzzzzaz BBBBBBBBYB
zzzzzzzzza BBBBBBBBBG
glbiyqtwdf BBBBBYBBBB

output:

caccaaacqa

result:

ok 

Test #99:

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

input:

20 10
azzzzzzzzz GBBBBBBBBB
zazzzzzzzz BYBBBBBBBB
zzazzzzzzz BBYBBBBBBB
zzzazzzzzz BBBYBBBBBB
zzzzazzzzz BBBBGBBBBB
zzzzzazzzz BBBBBGBBBB
zzzzzzazzz BBBBBBYBBB
zzzzzzzazz BBBBBBBGBB
zzzzzzzzaz BBBBBBBBGB
zzzzzzzzza BBBBBBBBBG
igffrcksxv BYBBYBBBBB
fysityljns BBBBBBBBYB
nrobvvqnqu YYBBBBBBBY
scbzrhsj...

output:

aunraagaaa

result:

ok 

Test #100:

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

input:

29 20
azzzzzzzzzzzzzzzzzzz GBBBBBBBBBBBBBBBBBBB
zazzzzzzzzzzzzzzzzzz BGBBBBBBBBBBBBBBBBBB
zzazzzzzzzzzzzzzzzzz BBYBBBBBBBBBBBBBBBBB
zzzazzzzzzzzzzzzzzzz BBBGBBBBBBBBBBBBBBBB
zzzzazzzzzzzzzzzzzzz BBBBYBBBBBBBBBBBBBBB
zzzzzazzzzzzzzzzzzzz BBBBBYBBBBBBBBBBBBBB
zzzzzzazzzzzzzzzzzzz BBBBBBYBBBBBBBBBBBBB
...

output:

aakasynakwgaaaxoanag

result:

ok 

Test #101:

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

input:

315 300
azzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz...

output:

aaaaayayyaaxatewagauataaarwaaaxfaaxuauxgrxwavaaavahaavaaasouabqavxaavvmpsaanaaparoeardaaarqawpasraaalqaaapparapqaapnaaarpawaaaaagabmdusaamamaadpaqaaojaanaaanaaaapaaoaaaajmkadqaeakaehmnfajqaaaaaaaraaraaiaaandpcclaaaanadaalahllaaayuaasaaagqhfmkamwaaajablaaaskaagavcaajncfaaggaacadaapkkicjiedaoaagndafgb

result:

ok 

Test #102:

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

input:

25 25
zabcdefghijklmnopqrstuvwx BYYYYYYYYYYYYYYYYYYYYYYYY
zzabcdefghijklmnopqrstuvw BBYYYYYYYYYYYYYYYYYYYYYYY
zzzabcdefghijklmnopqrstuv BBBYYYYYYYYYYYYYYYYYYYYYY
zzzzabcdefghijklmnopqrstu BBBBYYYYYYYYYYYYYYYYYYYYY
zzzzzabcdefghijklmnopqrst BBBBBYYYYYYYYYYYYYYYYYYYY
zzzzzzabcdefghijklmnopqrs BBBBBBYY...

output:

abcdefghijklmnopqrstuvwxy

result:

ok 

Test #103:

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

input:

7 50
tuqaulrnzyyywybpuoehdugdptglplvlppkhhxxppdrkhxdxgd YYBYYYBYGYYBYBBYYYYYYBBYYYBBYBYBYYYYYYGYBBBYYBBBBB
bkunohhytsznqcntvetgbzflhcujlzhxtvublqxznscjshvzve BYYYYYYYYYYYBYYYYYYBBYBYYBYBBBBYYBGBBBGBYYBBYGBBBB
zpqthwonsjjxcxxuwdgpsglsmpbepexhyvodtbrgpwktudklnz YYBYYYYYYBBYYYBYBYBYGBYYYYBYYBBYYYYYYBBB...

output:

ayzxytwszvpttsuitnpmspkpdhhioppnolunnexmdaacuhmkah

result:

ok 

Test #104:

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

input:

20 500
uabfdcdgyqmxgsgauxvngxyebdglyakjsndkpgbzmtpxubzwzdrypaikyjxzwztpawxmbkjdhywlrrwdwmyjuzpkfvzeitcoovjzzjtfalpetwkahtczbujpaymnaketzdwjdpldpchnxbzajnrafcpsowhmszkllmotxhrtbsyujplndjudidelwuxvoxwngolxctirjebsqncludnyzneyxboxjakvyleabonpsmowvzoaovyttvhnpbesttbyfgvctharxoozjffdfzlzjtbnmiqspqhwthrcf...

output:

btzwihwfzwwiewliixonimifxppziiisufxmvzvsnyudmzyzvvneotjhfzxhztrdxuwrzjwqgzzrvzzcfzjwyzvdswsaplxymqwuxlszavkticdaxdxyyycyavcmwptlughqeytnyyttbyyghvsswkyypxeumwzfyshnyzgfqurtvovaqvyprctflhamofnkfkhnpntfqkrigwnvomginqytivvuuufzwpgofevvtivdknnspscbvnxipkvatveiliwcrhbgquujrunzayqsovsjnsazuwjksqansqkeajjl...

result:

ok 

Test #105:

score: 0
Accepted
time: 7ms
memory: 34920kb

input:

50 500
mlflhmhmlvhbaykqextwbeswdlqmlhhzmofeicwyhuvyqjqwuumnpmirtgrboepaosruvhipeadhtwuxtqlfshfbaakarzfzenjinaijsidcoqytyytevycrdrwammzsvysailfremryrtlonlpohxhhonhnmqdnuuynwbilcotucdxbphurpzvjjkaujunppehudtrkggggweudqbmvoqtoxvyzspjzajlxpsmynskdzxrwtujidbsbjpbwlizsejugkzavkznxakoshvaxjceniggefvuqdtwbj...

output:

jzzvkezvbkaecnvdoyztyvzeexgfjtzcvvcmmzkrxmbdezzpzjfztpzxxaxhzazbkcxfadzcjtuzzdxzzzrbjzcffrxhymawhvuosnbvbeeihodjkbhyghbcwvccwkwbemwhswvnyvbbbixxhwyynmuseyeyedpvxbeikupkkbnwnpnnkojdcekuwjixytxyyunhuomnfstyvribxrcwcvvkwixfawvfhibkfmhmrughodiqkrqqtoqkphgvndxpfixinxfqiwprburoqfmqciphuwkfwsqrxpxfrlmrjuoo...

result:

ok 

Test #106:

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

input:

20 500
ayuwtllhqnfdehzldgmmouamniqnnprwlbmoppiokmpxscydolhqqgywjsqlnrsyttoloaoikjvzrxskmwowxtjssclswpoxfefjqqtzxkcxgxtywwdrmkcoyemldljtjvkcirjhcivgcdfijpasmesqpceeoixqaazxtwyggdxtxtksunhwzqvkrttrjwnjxbakjsxdonknqsanteluehvzaytivsfrgpqxoalwbywfuxdyasbshpskglzhdkrsnsxiwypylzmjdtlddtqwvrnomjwhjrerozduc...

output:

eeueezxzjrzyifqmyfowqlyzeulzirxqcjzetzhfonzmbmukzyhzjrszeppquszxxxblwxaurvgauhswpwviybtrxeehprflwyyyyycfuwembueueeqldtvtfjwkuiovglwauwjqkvjrjeplwsteutktsrraqttynwusmqqaizyvfhlwtpagqrxotyfoqztcaeviqgartsxlkgbtdnlcnvzsilasgolartehaedwbsutirqsfvbwapqarvjirdpphyqddwgdzjqknvqsdnkcyvhckethfnfdkycurqrplusn...

result:

ok 

Test #107:

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

input:

10 500
hlowainqwhleemhxgeexvauvsmdxrakudyhvuxjhqreepyfkndruyzuwrfnhaevzdkpfnknymitnqjuvudbwcylkjcmwlwfhavsjmpadfoylhtwuaukxdgwxeqgbwciafzierqihjaxqsbxjbhyiamjwgoupnzlkwoxgfrsclagaevkwfiylpvfboozmplswttjigghixkrlfrpaluroddagokgyayvixdjynfvfawkhenogfymqrvprzqlsnxhzmvyvcvtfftaflzvvxhtuifjoktfpdnvrercle...

output:

yeeeueeeeluyztxykwzyvzzczmyzzzzzdlhdozzpyvszzmzvwymyuwvwyhwwyywqyzkytywaxwuvxxugsxxvnexxtmsmxxwkqxxxhxwoowowlvbwrwtwvtdtowawkwltjwqrwuwdquvaubsornqsgusvocvbnutuuvauqpvurovvqkrueqkrtsmupsmtntlvrqcttsjtsflwzqopntqqmoszwqlrskqrflsralolsgqnkspkoipdoqmfjipntqnbqgbmnbmmndpinpmdnupmkemimzljjcppfnlemlhpkpdc...

result:

ok 

Test #108:

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

input:

20 500
iwwobprhmoyngxrwogeznqjfucciihleorxsgxcxjxlsqhoaakvkwnbhfrazxbrtqwoothwtdoprguinirothdiawdjqddwmbnkkbinwjeuwqydrugiccywxayagrkbnsjaoriyrpynldjiglrhikiipcynkxfobdyoxzqmsvthlplvbebkfepbfpttdgspybmjcyidxaxaodjkilaysrrowetbxkcrwgphhmyeplxvnpsxsinbnmfxoulwuyfcnfypmzuvtqxctqnrlgvbrvjxjzvjxvbfoowmsn...

output:

kkqvkzktykytkkotkgkqthjzvcqxcyswrezrpvuyesvxypzbknzzzvvcvzwklpqtztzhupukfgayhsokqwbyhmytxyuyydyoyysxlvtjvvfxmovyuqvhijxpckwxoauwixjxtjscpmlzxvjqvenwcewhpwkbmpdshohvcnpvuxjmwzukuswktslhfpukrwwwxcsctkrmqfujpasbttksexvqloxkpvmowgehduisqxuuriiuegcuscbuloepqdmwqiiavxlmizuukqulrvpjrhhhfulimcjhfwplnqtuqnfi...

result:

ok 

Test #109:

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

input:

40 500
lennpvhaesjwznotiemclquvfbhxnphpnyhrrijylkxrrstrgmlekwahzzspctybovapkvlepgdspzvxvtclrmtelffwvumcoituylxnqxubwcenuvxvsgxvxuzavuyiimznvigzmrkqoavtwfcybxznhxyfrbxaefvfimfpwuesbqrpwxrunxctvgvapwllecsfrsosbmludeljvximxbsmqsgnzhwisflkihogdbqixxxkwprooumwovxwuxwwpfzsudgtanewxdfxiyegukigcxmjhgojmqnjv...

output:

dhhrjfxtkblovcqrdlrqcmjatktgazpxctjwmpbjurowpzgrpaaytxynxyrvjkkjposelvdnrszjcfmzumeqsvxxjszqxkodmoqhsnsuswaixybhypbqzafokvbekmnmzdkdfptundpoapangpspytvyftaxxwpnagdbioqaetdkttopovkuqurbnljuwcenowqfiuilldnaskdlvgdptkjvmhwxhhyegxyyhyqkmeonyzeurjxjutplefqvbgfhwxmadsebwwljvgvdhgjjgzqibzwuwbhvhkthrqwtnteq...

result:

ok 

Test #110:

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

input:

7 500
nhjurmfptwpsgukjwqqhganfrtbsavaviwabjwanivosdqwewclocqgeawyuyetiaxqocqksukadafixlzcqjkjkfuvwbnzflkcqdixhbbfhnaxeyfjfvcpucfjvplgcrjlqjlozveqmgkbpierghfibktmipvabndpkokrvgvhgikrhqgcnkkwzcldzhamtnsusuxhqsqyrfgvsiegjbnmbtlzlvyiatojxleldtnbfrnxaqaavqdtwsasyxeeqbjfbjuakywcptyayfjgghqxunfdlqlgvazgafv...

output:

kkkxzzyzzzzzzzzxzzzsyxyxxxyyyyyroyyyyyyryyxxsxxuxxsxxtuwvvstvwkwwvtvovwwvwwwwwswwwwvswwwwvtsuvtutsvuvuvvomvvvvvvuvotutspusutupuouuuuuururtrrrqtttstrstttsqttttttqsoorrpssqsspessglrrqnplpoppnrrrqrprmrprkrpqqorrrloqrpqapqqoqqqqqjppqkpioqoqoqpqlklqmpklkonokjnomkmklgmminnnlfjmnnknnnnlmnnknkkniminkllmkdmk...

result:

ok 

Test #111:

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

input:

50 500
fjvtcvkdhphwksdhxuvuhnienmtontugyffzpbliffkcrjbcizldydjqftrqatumvwjjcoshkhciwxkcpwevqafbwttxwkujdigaimazfudmyvcqesaastwfggmcjsmtcearbrzqynmdkgxgzizlaxhbkohbbotkachpjqkmmsvmkogiqhixbngwksteeiaauktuqciihftqwrdwvqcmyqgpwjtipsnoqnsagzjomnqjtzvsylpdqdpapfxdoodbxvxyqmrvkuillaszpnkcahbvakbktrfuqsats...

output:

ouchnsbuynwypdsuntwtysnlfoxnudznsuobszxynccgzxnrutrolunyzsuhufgxztgoucyspoznsnzfcvuyfyzcxzxnsugfudoeczenexexxnnpcqxselhtzxdebygyzogqezqbiszqvbndqxjyylmioyyoleobodixcuyjyoqnhpybrcofxbmnxxnojlmcpyyofjeylukblymqglggnetnltpvcgxnnhdrjvlhvjdgjrnqlcsjsmwpsmmmntsdltberfxxdidrbwetcggpvqvrrlngpgggheekxxwcibtc...

result:

ok 

Test #112:

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

input:

10 500
hdvfzntztjftzhwhklupivisrzogiwdrvuzwabuysraiqrygyefzzyyqgoqyzstcpariuppstyipwyujymubwtkcmfudnbjvmlmpgzpcvrmttcrmzfhqjfezhilsgunngmtfgnrclefuqlhwryparsnyzjchxgfkbjavwicenzieajerrkkzjqnghwsocvkjosrmnmbjhsrrqocvdhdsbwqyswlqmdmnkavexchlvhrehczyzoawbqrpxfrznuebwokclufvnxdgmyglcjnbtqwvikptktkbiczvu...

output:

aaaaaaaxxzaaawzsuqztvzzwwxzzzzyzzywyzxzzyzzzzzxmztxxxsnwyxxoyyqyyywoxtxxxxhwsvtxswwvtvtwwvwwwqswwutvwwwtqutuvvvustvuvtvutvrvtrukvvvlvkvvnuvptvrsunupuuunutslousuntrtqtnnuueqqlsfolttstrplopsosoksnjgqrmnrrlpjmqkqnprrplmrrorlkoqrllrnrqqqrqkknrqqnnropkqooogpompbqonplpoldhmolojkdjpiplpmpdpiilpmolpphlipllh...

result:

ok 

Test #113:

score: 0
Accepted
time: 9ms
memory: 35056kb

input:

50 500
indtujtskbwgmxdvkibvrirswzrvcpiyuyyntxadwsxjixpvgxlliyghubywoqxiloiiebktsgjjfubluyqavdckcutsvuiimgpupytjwcpnoirjqumjbzbkcwlogbmybogrdjhckdepplvunflsveokgbraqorfaozqhjnqwbiigzycaaopcwqvbxxzddipozyzkaynmtxssdoxkljivtotbsrbejeagduwyddmdcxermruoiqxnvddybpxhwhigealmtnzbnfwmvnrfaqptoeazypbqnmhhsmbk...

output:

dagvanqifzzkztpunznzavfigjbkyacgormfzsrkxrzwaifftzbdbxwospzvrnrzkzkxrfsbkqdyusxvauawbkxpvbgrabxvnykljxbsmxymaniyrkywwkmbpjssxxpjaurdkyjnxapkvbyywjgxnsjykkxwbjyoidifpsqnyrsyvfblbkfahxwwwanbwaaqwcbpumchyrvmgrnlfgfyfxyxjuacyflillgrcukxxgmipubonfuhxcumulllxlombjwcbhxjdssncdmhxsvlcbqtbxnquxxxnucxmrnorvll...

result:

ok 

Test #114:

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

input:

20 500
slcocdoeuswpovhxnefsxdchgfnwlduobfdajvwtydpyssopemfjmxxhybwyccommiyistixveoywghtfxdmdturqyumojdxdsxbhqmscboezlfgmrlwccygpbltparhkieqratosgogmxykbihmrryxqgqfygytxttksfhknglfbhejqjzitxzsbzirrtzffaigozubkirbzbnnmihyybpqsravofyatvxuykzjnkkygmtfexebdhhcitnenvitiiegtlwedrupvhbgwsdpprkjdhubvmkvxyusu...

output:

yduauwllzlfefawwiyzyvgczmhzvqeeyszybazzcszzlgxzzfczwuozzbvxyldifrpyzvrtzhjqsczpzxpoxmrtdriylqxukawqyuiyytkwczuwfyqhvxwwymbmbctxlurvbbhtaxxyxfpprrjfnndzjxxsxacuuuxbebikftvgltrlyxrazruetxvjixopqutpmomomxtotuurmjrftfnqegoookbqtnapquwqkiylghfqubmhsbmsojqaonxesisaafplubtytnkaonjbncpslrculjnuvjsrgbfpgubfn...

result:

ok 

Test #115:

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

input:

10 500
roqwtjzrjuwkjwdsrncguryxigdlozkssldrhkipfguyoldfyrosbquckzszvbfjkbhtvatcgdbnkrgszdlwlgnqvlyyrztbdpnvtvqyedmoevnpvoycipvhgglyxhsojpyjjquksdkqlwsglcisppapjlrvowqpzxgzfurbiuwjorofabhyvolrcdarwpshlkvigmnwucgffluinlyqblzuqbziqthcrqgtkyxphdsmbdezmiydqrumajjwofoqsgkghsjjarlkjgqrfigsadcyjdvhxigntkfwt...

output:

vxooozvzzzzyzyzzzzzzzzvzwzxytyyvyyqyyyyyyyvxyycywyyyqxxxxtxwxsxwxvuxwxxxxwxxxkxxxtssvqwwsnwvwvquuwwwwrvwwtswwwwwttutuvrrueovqqvtuqpsurtuussuqutuotqquuuuupttrqsqtntqrqtrfttsjqirqtkqrsqfsiosrqrnssssnqosmsqpqospssnrlsrrmniensllsrmmnirqjnnqrqdopolnpbikopoknnihmojcmmnonojfanfppnmnmnompoopomelioilmpjojppb...

result:

ok 

Test #116:

score: 0
Accepted
time: 8ms
memory: 34476kb

input:

84 372
cghxpccqxmpjhtjdglpdovwbzyqusjaaaczvnuxwducxekfdxytfvidgytsrnsqttxtrbkxlfpiioewbjuhchzmaifgmgozzszkpzehdtrbuakovkrqcsufpylbvidlaysqeaphobqoswwlgvfqlcwmxalphjpjghaphienececljwcyzgwerjpblvsjpyglbhcrncsyutwoyiuswxfwisljgbkffxgcrtlbhcsikvelbqjpaztaasiszygtchgirkazcpgfcfxplcefbpgofwjacaubweqfkmrbf...

output:

hqyecyaaesovzbstegaxbvmsopqajgogzvkmedykxzfulzfmpdzunbukhzvipcuxejqnjgnjyxtmxgnrmoemicwazqxvxrxpvadnbdkyhodesgotytdhgonnifetqoeaivzprxzmicgazvmxcxxdefbxiwtwsdigpjojdlnmixfikifxldzbilkffuetlhqqsextndlxfnahwbszpudqyrfgnhzdftjxuienlthsjvbgqucbftynpnlzpfxmhvtifavfdchtcfwefmepysaaljuyqjuxiwzoskitkgbiyfon...

result:

ok 

Test #117:

score: 0
Accepted
time: 8ms
memory: 34632kb

input:

40 500
bngwwqulygjlplyrkicksgvqqycoamxfcoydohxhytmdmskpyjwuhziugselpxqspsbzoecnmtcgkyrbphotgkvlalmmgzpnenyzurybwxlpllgnrvxgykkqqmqmmbansntkcgmbuovmzpzfinlzwofqungisfrttnxsoqulqmwdyurgvuuppkbgczyyegxmrdufnowmahnflulqmtkhpjjrmawolznbmzfcesnawzxiqhaekaphgdhxfpczmdjmogxtezqhvnxyoaoaapgctcprzcegjajvmplbf...

output:

aeiiregkyfdxaejcrspxhhafdhimdnkrfspxrdjucsetjrxwjhvknjlxxfldydsklaqfvfbunbkruphhpdttelmkrpembpdnrbtmiwpztihdyztfzwkzqfvcvqwqistcfjdzdoehruikinfritocjunkyjgpjbtyqexduoudebqujcxalqtedbdhbcxbqydfrtfbdzvydnhkftttgaycvbdquhsbfkfwkgoecpivhotddbibcfnxleqrqtlxelrzwqnuekjeeqmukjwsossfjlltacqicmvkpohtgifpxwbw...

result:

ok 

Test #118:

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

input:

10 500
golmkejjbmsldxyvlvmbmgoaivglyqadcjhtedubrsjwtdkliqsltksdijsfeyvuttgvbcoqcmhcdjwnbatcprrrpmmnnqgamphfsbsesxqhwpnuxhcxqxeawyptrprmloahypvaivqyzugftstanjrxbbudyrvbkrvmhfqjatvypaevjlgxchmlgxtymnndzwosslntpihighkkspkuspqhxduqoiqlirubexhhpifeiogxqggfdvavhequdgjskvycqehyqgdcmgsuxbksdhhvlpqhhuumviqhu...

output:

jzijajzizmvjyzxzzzzzmzzzovuyhzzczzvzlzzzzzyywwxyxvsryyxwyvqbxswtyiyyyyvmuxxxvjxxxwwhxxwwvicvxtvwmrawurmhaseqsvvvvvprsucoztrvtjtpdtoosdsurtpvqshrsuyspqtsjsruuqlwqsgqljssglauqnsurssfphijqolcsqpwrnfvldmwliprpxomqeorinrpnrbofjjqirmeeczrktnrkjqceqkmusiipqpkphfooqnpknhflqxpqmjxqugjknonomnnpnzjgmnktmnockpi...

result:

ok 

Test #119:

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

input:

38 20
azzzzzzzzzzzzzzzzzzz YBBBBBBBBBBBBBBBBBBB
zazzzzzzzzzzzzzzzzzz BYBBBBBBBBBBBBBBBBBB
zzazzzzzzzzzzzzzzzzz BBGBBBBBBBBBBBBBBBBB
zzzazzzzzzzzzzzzzzzz BBBGBBBBBBBBBBBBBBBB
zzzzazzzzzzzzzzzzzzz BBBBGBBBBBBBBBBBBBBB
zzzzzazzzzzzzzzzzzzz BBBBBGBBBBBBBBBBBBBB
zzzzzzazzzzzzzzzzzzz BBBBBBYBBBBBBBBBBBBB
...

output:

nraaaakkaaanaakkalai

result:

ok 

Test #120:

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

input:

38 20
azzzzzzzzzzzzzzzzzzz YBBBBBBBBBBBBBBBBBBB
zazzzzzzzzzzzzzzzzzz BYBBBBBBBBBBBBBBBBBB
zzazzzzzzzzzzzzzzzzz BBGBBBBBBBBBBBBBBBBB
zzzazzzzzzzzzzzzzzzz BBBGBBBBBBBBBBBBBBBB
zzzzazzzzzzzzzzzzzzz BBBBGBBBBBBBBBBBBBBB
zzzzzazzzzzzzzzzzzzz BBBBBGBBBBBBBBBBBBBB
zzzzzzazzzzzzzzzzzzz BBBBBBYBBBBBBBBBBBBB
...

output:

wqaaaamaaaqspdaaagqa

result:

ok 

Test #121:

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

input:

38 99
lemacjdnpybypkogwdtvhlhmlvzbhkbjaztriqyynvsftexmhjzzxyjthuaeozdpdxpjhtaqtqnddedkjlltttkklenffpfgpjl YYYYYYYYYYYYYYYYYYYYYYYYBYYYBYYYBYYYYYYBYYYYYYYYBGYYYBYBBYBYYYBBBYBYBBBYBGBBBYBYYBBBBBYBBYBBBBBYBYB
ffoiuvnagcedozbnvdgcwehekesyjmonuaviekpeeetvihyvwtnvwucerddzlzdiiltbqtyfyfquaifdjdyadkytyookgn...

output:

jxuzvsbgzldjjcgmrqicxemjuzvxepuwnqgxrkxwhieeztrujjtokrhzsoxuzyrcamgnqbeecqpmyzczdqjkkvfeqjyblgmisto

result:

ok 

Test #122:

score: 0
Accepted
time: 12ms
memory: 36224kb

input:

10 500
avcyabyfbhldqyquiroxejrovopyxbgfslzbrmbbbhvxiozmwggujoagvafzguvgzztetufaehlozosicgjrhqnboxoqzxnwlinkwjtfcmstnhsxpbusuvudgepfwkpuenqjvmpuljzrewqmcldwmglpqfcezkmfueprdnceqlkeobrubhwmugcvkjvimcvqtdhgtcqxzldhntduytagztfheqmlkrvkfllddoemookesremmaxxavxeescpkijpneujkxokegzvfjtpvtwfiosefakjcziiczgco...

output:

ttettttwsqxzyzszzzvzdzzuzxywzbzzyykyxuyyvqvysnyryktyyvyyqyfyyxywmwvxuimvxxxvwssiwxtaxmvxwuglllxxjywxxxxxxvwwwrukzwvcolbsguworwwwwuswjphjmcjappvbxpsruquuotucfcmuqrzqrqcorsdrctphptonpitrtqttrnqexvotjrvgttwcrqsklpwtrdtkgrtnlqtpqrvdnkmnmflxtwnsdqnqqmmodnyqoplirignnmvcbmpnmntgcqjkjnhfrjlklzkiiwninjklhzmp...

result:

ok 

Test #123:

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

input:

20 500
rhqrqfrgwyrzxmjqbfwzxjvlvykkreypsulclulaqxnwwnbongeepchnwgrojedulbplkkwfbxrxbkwtuztgxcfucyirctbhqmfyiicasmzpgtyqucsahojdjewbbxkaoupnzejlvgognwxxjgvtrnctdbblbhovfeellhuglseearomgbdtlnjmhnefntguonarkwoylusekasgztbqelwycvioxwgrmjxnvcxkdbrzfkldjzotbnzuvhyxyesfvaucxynavbkyaisfryutwqeginaehujgakoyp...

output:

avhauaawizaizusgvzvujvrnzaijevzltezxrwlhuszuzqbzlvwwmoeyyawyxxuvhkxqshythdwymxcwhuxgwczrhbqfnbvcrwmwioyqysoyyglywdyeyrdjrwyuuxbvyyxmnhpxreoupeibzzxsttcbdbpjqpxqtojvxppsgxvevxihkjqbqwhsoopzrtreimastjtpybcoxsjpwdquxjkjclhfrsvisaoqxtyffgqmelroaovuaqigoqvbantcwbaflhmfruxriockccrrwbfbccngqjbfmdofbkxtnzhl...

result:

ok 

Test #124:

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

input:

38 99
lcnqdbnunbdbzudjlrywtorribfyxduvteracrxyunifgbivvkzxefslommakqzpqkoipbfckyhghwtjafiwnybobniqqrcybxi YYYYYGYYYYYYYYBYYYYYYYYBYYYYYBYYYYBYYBYBBYYYYYYYBYYYBYYYYYYYYYYYYYBYGYYBYBYYYYBYYYYYBBBBBBBBBBBBBYB
zvnepeuvrwzqrkmgoylqikrcnudzlzehdcyopuqytavurqzqygnpszcnykpfrsjdtlavrlgkkvswqkqrccffxugrcifdqo...

output:

zubrgbxhhkjnuziavazugaylsszczisswzcryqnljpljhkxgmftntwzwfvimbldnkbqeppidzhlskbxsfsxllhhmiqbmffjmomo

result:

ok 

Test #125:

score: 0
Accepted
time: 8ms
memory: 34648kb

input:

40 500
nociyvndtnjzbwfnkoirbeayjufjxljvsglmgbzyqddrlttohklanglgkepoezadibbyjpptxbsbeahwmdssetnwxyifixbcftwpekfiiormtpmyufikfguubzkngohpnroobefeanihvowxgdktkxpkyacxawaafupqcerckoyntlmvgdiehqgdmhftmlorsawglxdvtinmzdluinsnyeywxnvpossghmmnskkafswbeywoomhbidilmfzfjabgormdohxxlqewowhsjddlvltadnetadbynlguo...

output:

taoungefdfzvrcirijhruutyzhsaqivfmbyquozqcnfljyfzgqrjqaistuoebeztwhetxsusgpllqxpjzerwbkwelgrjftssonryajtlrinlqsxcirjqjjfrfxlfydhaalgizsgleguhejmdxlktavuqksdoeeaxaqfnilzcjjlskjlugzaozcyrnnofeiwlsultilcoamprogegafaycikwnhpgshmuolmrfqlewrtrfvntzgqrwfspfvkeesnexqlugjjtcfyhrzyzhhawojdhxlzdbpzvjkgdevlbljvl...

result:

ok 

Test #126:

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

input:

7 500
nngsllnxkpwnspcftnkpuhpuqcmirgfpmtejqrbhhdzylwumotzkqwyvmijqbklpgqewnldqkvgzbxcdhmkqtwsiifslmnpfqqgdotjptxpofzkspqsmegmgmsdyxndckfpdofzmggpiwgrrwhrciavopdwyqxzxthudmqheezbdqihpmkgezeklynghjlufystcgnujxdvrrlgiogbfudpahzltwlnmkmkcqmqmegpuhlgswhuelsoyomaqzgwwxvdkiwfokyetrkjahataworndgcvtqeoznxewh...

output:

pppppppppvpppzpppppzppzpzzwzzzzzzzzzzzzzzzxsyytwsywyyxuyyyvyyyyyyyyyyuxvrxxwvvwvxwxxxvjxvxxxxxsxxxxxxuvuwwvtsvwwvwvwwwvutwvuuustvvuuqulrunuuuukunuusomrsrttturrsqqptkrssrtrrssorsttttkptotttrrrtttstorjpslqmqmqrnrsrppoppqopnhqopnoalqpnmqnponpiqpqknqqoepqkoqogmppnqmnqpnqgpqqqplqkpnloppppggklmpoonmnnngjm...

result:

ok 

Test #127:

score: 0
Accepted
time: 12ms
memory: 35032kb

input:

50 500
uikgvhvrmqsubmwdwhxcmtcpocrpxijhuvsniexaseairmkcbeklcgefagvtljfgiegaocuyuiqwxlxdpxurnojyioqamgwofiwfcmmjgyvigfvcjozervzfmkitsoakpqkjepbkpifrcuydaadlnyzuzqcivynubiadaagsmiahneoivnrxwyebomunjamdlnnbumabxevqugcbfgbqgduhgvjxtreauohsxzpqvglrttolbwlzpgbcqwgocnurrqkpximajmscldqajgqtvdmatypajhmynzcfj...

output:

yrmyevpmqyhxsjyzhzphxzdmzbzzzyzusooisupjyvyczvrsjvlxzrxyzvkkzfpzcpxbspfvkdyjkzppipbaxxzjbjzzbmotjmgrvjvzwtgghzgrozorgoynrzyneinyhfrvcvhbxgckhwchwrbrstwacbthwdmcijtggmbrbmmyjyvntjuwxkcxkbkkuudttmctpenueukjkiqxpkvgamomqwwscqpvdsmbkumxdskxrwkrfgtmttknsvixuhpapkxxdxsnkqkgbgpiurfdljidmbxgxowxgqlbnapssswo...

result:

ok 

Test #128:

score: 0
Accepted
time: 7ms
memory: 35064kb

input:

20 500
idgnkmrnbkqgpmdkbfdszsrpghevtsnhgwolxsqqwathzcljlwpcegkceborovpjblydpugpdzmprpdwvhzoxmmchtdxrycqxtlqoankpbdsbkkwdhxmfxaiueqaglafodvimcpglygwxtyckrxkuufsvjjsbfsbbxesiuyqnukafrxdtflkkvnchyfayxvgvwvitxgljtcwnuwmmoloqlbsbhdqxuocnycrnprpkdvuboxdffqyyelptzdyegpoywwkplvejokbueqjyzpwmpozhiuyondtgkjea...

output:

nxiuihifsrdkhmxxeihybiixianixuqtyowytewnieiwiujtoxqryhxjyuzxzizazyfcwzuyyfxrnzzzrzljyxmxuyfzzqkykyhxaidlfvjfwykjrvrrausaxkgruuwvwnwrliifwtmzewkjuwviypqtuvilsinpmiugyfzogafouujwwltuhbwmjoohgkcvrfkfoshjyifjadaxsdstiwdwptitvqfupfngptybvvavuwejovavvmrnssvukvjjqamfphhmosjfxkagzzmgcvywshfrepnpbqpnijqcrhqe...

result:

ok 

Test #129:

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

input:

40 500
snfrdqgnvyyaraqccmotrtokkfmalyybgpwgulvlyxckrcxcldtepcsadrgnmctvegynxumxxilbssrbpamhbiuqiqlywakejtvwikqspifcememdyupghrwclrlpvulxamihrmengmrcgbweadneunrpgnkulxwnxbcmxquvgmipebjnwojpfxnsbhvyctavdqcgrgwjlkjensloiqioeijlwsscfdgtktugkpxngprzvebltcjijglgaifurynycshpoocpkvtdbwsfxcuszwehszqobvmqwxfm...

output:

udxrdmtnzkknqatlogekqetegwwyaittskfweuxnuyzgfbddgpsdqjilqkvlzkqaqkucyzlmztfnfbzbizzhxbaznzyqbrblwdzgfticjosubjwkoirfggroalgjktwolrcajbidgfrnetolznrxirzyydhenyuvbrqgdfziryjckoznwjgqoslevesxxfcalzhfchfnydophllpqfllyosuyaunpupsphfdakkrfxxzsrcurstuheyngfntjztawkmcbwrkliteufdgtjtixpqimshsskpngijxsfwxeidz...

result:

ok 

Test #130:

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

input:

8 500
xiqiycbimxqtfqjpslneyqplebchzxulzwjrgtegxuqgrqhvpnpngcjucxelkmjrizcvnrjqtvddxlpgltxwckqmpkpoadbippkbncrqfdfofscnfgpvyqgrbcdadfufemkbkpcdjmhyfokuxquypgtejulbyglpnrbdydywxfcupytfqnviupqgazwtyjbjxwfleheseyheobucdjqcdrefkqmslnrbjjmqerchombsqkofjgsnlwubvzvgedxljfjccwjrrctghbfuwwomjzzpkyxmcxkfxddgrf...

output:

iyuziiiziiiiiyziiiizzyzzzzyyytzznzzuzzzzzzzuyyxywyvxxyyyyyyyvouwsuwwxxxwrwwwruwxxruxxxuuoxxxoxxxuwtpwhswotwvwwwvwwuwwwwwvwtuttvuuqvqsspvvuuutvsvtvvirvrvvtvsvvttpvvvstttqtntsrrqstrrkooopsbrtrssspiqsspldpsmqrjnmpoprqrrnokqqrqnrlooqnrqlrrmrhrnppqmprmpqmlqijnpqnnipnplijkppipjpkknhnkknoiikmljmnpnlnkjlnlh...

result:

ok 

Test #131:

score: 0
Accepted
time: 8ms
memory: 39072kb

input:

50 500
nxzrlyklxqvmvzvobwxktnrdwljurhvzllrjmfjkvwgcbkirbtiwylejxwfihpzvizdwvsgjaaiqkwriqildaoojglbljohibjkufsaagaxyjhzjfofnxmyhkwmlwbhzmydabjtgagwhedfhaypvajepofyhfbdouxwuhnbgztthctbqjqasonbglubknmeknsnbpctlwccyhiyepytqbcaftfrhwfzxocnndardvufksspvgfmsvcurqyeovcofkswrgwanlsgbllolrlsyweanwprleynusyizj...

output:

ugvvzbjjqedcfqdaaypdzwplkjxxhqxwctfvyyfzhyvgyzqtjwdbvcpzuyzucfcfsdexyyzqcybzdfdecxzjmfkxzyzuctxuilcekpkxyqdcdrhcythcpceyylcykhkwukneeqvtlpvvsystkfwtiivelyqxevatymrcvbwcrwmybvsjnvsastwmbseadrbtmlxveiwucetlasvwdmmmndqgwxulllihgitwqksnwrnidtisxtqiwhlphatsqxkgielvxkhtimijkghhnipfsknmaetknmhaamdgkkebbgoh...

result:

ok 

Test #132:

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

input:

30 20
azzzzzzzzzzzzzzzzzzz GBBBBBBBBBBBBBBBBBBB
zazzzzzzzzzzzzzzzzzz BGBBBBBBBBBBBBBBBBBB
zzazzzzzzzzzzzzzzzzz BBYBBBBBBBBBBBBBBBBB
zzzazzzzzzzzzzzzzzzz BBBGBBBBBBBBBBBBBBBB
zzzzazzzzzzzzzzzzzzz BBBBGBBBBBBBBBBBBBBB
zzzzzazzzzzzzzzzzzzz BBBBBYBBBBBBBBBBBBBB
zzzzzzazzzzzzzzzzzzz BBBBBBYBBBBBBBBBBBBB
...

output:

aafaaytaafnpasaadcas

result:

ok 

Test #133:

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

input:

38 99
qeyynemrcyzwzvuoybvrvzmeehgkxdjsklfkrlthdrgtnwlmgpqrefjgmdwxoifalobzyiffgrdqlwwmvxatxvlhbhqsfnjqpmt YYYYYBYYYYYYGYYYYYYYYYYBBYYYYYYYYYBYYYYYBYYYYYYYBYYYBBYBBBBYYYBYYYYBBYBBBYGYBBBBYBYYBBBYYYYYBYYYYBB
kfjamtsoagrrvlrqjnovogtiwsjwauxmqjmklnumwcarztrhzmhekliwilsnnuhbyewgqjzksoybnqnnggodjblpszvkse...

output:

xqnzuypkiktlzjbaosgvsrtryaomiypcpztlbaauesaakhvhyqcbqqxacpprvhhngjouwhcqccdcjmphhvlrmrhwldraqkaoncb

result:

ok 

Test #134:

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

input:

20 500
nixynynsrobetbjrzejtjkegkaogsaillemsrxikuuedvhrzjovgsfhkiwjzdstergysibyqpvyrwrrcjddsxlyqdlfwvjabmwanmxzkpihmmjxdutsingdorqgszclfjvcpzzjlemkpngmhrwchrycncoefavqmwcqlgyjzxtskapmxwnbdwnctpjsiabbaaurcjvefbpjouneqgejcpsnaahtylxsahmktvhvfzugxkulocepedrphwsujxowmnpdmbbqjulslqijltopnphxllsbrsbwdhyszd...

output:

pzqroexbxaffizotjnzgdvyoyywjtqlvyjbwsvbdjgnocoqxyysypmwqttrqflmydppyrqplayvrylaqydpyqhvjwbjlvpbbvgxrwohycdgqdpyeowmyoxrvayaxrunfoylrxxvxrvxwuavptwqixdtijxntruxttxxxotmoxoavosrbgiutaaionuuqurovovguwbuvprvvngsptjsldntitnckudidbmrpzsogpslpfumlsjqsieopqnowkrtprjfmcofskthzvrqdcshszlrjisjhqpfigdeteylmlqfq...

result:

ok 

Test #135:

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

input:

40 500
qvxlguccwpbtfosxdxjcaslntxgmfxzsantgvrtmcyfwuqgucbdychvadnxfreaiklbmgmadqxpsrwocowtjrhjxyovenmbfmgtuyevakqjiuthlzixijiujvgnpelovuzakwbkmcoivedpzaytfbvcrzrexbiqyeqcprollhrjaqwjxqmiravpxfyifmhwbnfysqbdirmozlhellydconrbxfvunxuplujacyuzkxqpedznvprcimjrxpoilkspgtcceatsormsqnbyhndlgqwaytwsxxfttafsc...

output:

mtarnklgahhndcklhwvngmscqpkmrzgbvzqoudkerdoyiuboiikoytrrzkymzmaeslnzzsccoklrwbihkirnahvkvroahzayrrhamydelysmeoxyqcdqnmystuqvwomedbvlkcbmrdeowtgsbyirzblaetikjvtakcidagkyqxbkrosxzxupeeozugtseetxvzevbxuqzdubbwwawdbicnpfmuzcpoxxbfmtlqhaeuufmjbrdnmxjnlgjrdospukxwcdvbnmrvjadukeputebrfygykjbfnjqeorpixewinc...

result:

ok 

Test #136:

score: 0
Accepted
time: 9ms
memory: 37104kb

input:

50 500
lwgcolotodckvwmbefzrabvbqvekrdkwbovegjovpdlhpzdgeqgplvajpdisoxywdlssiaotqlvqdnndntdofaikqyekozxqjpuvwendiexjwqidxlikzcewckbjxdsnwdwfitpdnvwjnrglnhaazibzoizmfkkajvvvbpvcwdpsnhzepxrkcvnwoyyqnvzwqghqwhwtiarsouxqyqigucxxlxsmvxvmyaujclujbrxuyojcwxqgzszgdnuopfkjfnewiwgopkjefficwslltdgsbrditextdwxox...

output:

hmydzcnbmbhmzyxlhhwjzhuvmhrzdhyjpcclfygyzzzzlahyztxutouksjpzguuukzzivfigwopzkglkcyfyxyzbuwgzyxmaywxzhutgexeigwsycxjowrybkhgypeezxwvxkytebxcvhxikftlmjtyfnxsjreqychowkykfscnnotjufgjrfcwouvwkhgixbrbarohwavvrrwgxvlgkoxecnjrbkoawatoafujpvlndaantrlckokdhxudaoldojulirournpkvcldnnlqncllungqlgnwjltqanttnuugr...

result:

ok 

Test #137:

score: 0
Accepted
time: 7ms
memory: 32408kb

input:

30 20
azzzzzzzzzzzzzzzzzzz GBBBBBBBBBBBBBBBBBBB
zazzzzzzzzzzzzzzzzzz BGBBBBBBBBBBBBBBBBBB
zzazzzzzzzzzzzzzzzzz BBYBBBBBBBBBBBBBBBBB
zzzazzzzzzzzzzzzzzzz BBBGBBBBBBBBBBBBBBBB
zzzzazzzzzzzzzzzzzzz BBBBYBBBBBBBBBBBBBBB
zzzzzazzzzzzzzzzzzzz BBBBBYBBBBBBBBBBBBBB
zzzzzzazzzzzzzzzzzzz BBBBBBYBBBBBBBBBBBBB
...

output:

aajarxrrrwaaphamacra

result:

ok 

Test #138:

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

input:

38 99
pdcxnpchuhnjkesyrhzhbvigmnzsclduhpzbafsdjoqnvqufwccluyijavnbcvwzjmbslitkeoyyusmydcjgupsjugxcnvphnik YYYYYYYYBYYYYYYYYYYBYYYYYBBYYYYBBGBYYYYYYYYBYYBYYBBYBYYBYBBYBBYBBYYYYBYBYYYYBYYYBBBYBYBBBYYBBBBBBBB
aktlvhefxyiyoqbfykdplzvpkqltlcmuoptxhixpddzrwgqvphxngbjhvwojcxztsgmvogdqqphprbqgphbskoqtxcpdbp...

output:

mrsemxxahaymnagshjnrqloywvbyaxtoypqarsgvoypabmdxkgwqfetptzwloafyaldcabytchpfrecsfotfqwbdiywjbibtrse

result:

ok 

Test #139:

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

input:

40 500
uzjmgymcylmysxcrrymwcnofpflbhruopcojnvkcmouoxfwhojapwtnnqefehbrbdxpvqjgmyspqeyybofbetcrfhpaqnljlnrgopvihrreqlxhasxouvgeapflvmxgjyagoxavhhwckjzzjxzdksqmuwizptrfodwvulsqxutedqazctagynmjbuwudnzmrmswbaacywrnwtyebgkbxqpbcdxcszswfpthkfdmzdamuztaigxctsrlsigjmzwsbbeybmymootmivkzmgxjrwkonyiataoefsfmvv...

output:

vhnezeukkrnuaheloemqegutyefhazzyaecrmperlclvgtbelipeqhjuuzeffhgxvupfhvwepvpvvhjqmwzbtdxopswxwqdgminftxppwqadgujhsvgzyjnbsjczwyzizkarjmkxxhfnjblgkiwueexopgbyntecapginzjzfyuramolicsvoprbjenxjuvxnlzsuwncpkycefdqtvfpcvacsgdvbagdwppolhealzlzpbgpxwtvxivhwmximoqqxcbobpuynsaiksrknsxevxuzfneorsuarrasvvekboti...

result:

ok 

Test #140:

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

input:

10 500
xsimzmrnrwkrhlqcudoxlgjohikinljmrhetqfzucreypgkxangkacnjgvzxlnqivnukorergxzmidkdjvluajuppwnlijnfzzkhawhhlcisvrcscjsdwsarerilfycpsrbgrplapfsrmcxrqhrztqgrslrbcxjcwuahohnhfbzpfnfilxihrkssyjtorcgorequvyokoteqsargqttlanlpaeivsrwztwymwnjmknihvrarnxhixaxbxsxhlfxcdkbfnyaqtactwzxfbtcmwdvdlcwyzfcmtljpt...

output:

tdddddddyddzdddddzdyduzyvzxziwwzzzzzzzyzzzzuwzzzzzzzyzwywyysyyusyyvyyuvyyyyyyyxtyyyosywwwuuutxwwrxxxopwxxoxtlvxwxwxtuxxwxxxxxuwuuvwsvwtouuutvtwwwuwmwwuvvvuuuovqvqqvppvuptvevvtupmnskurustmtptsntstpmitolksottsrtnmpqpotidnirspqhnknqssssspqsqrqqlqlqrbrqpqpfoopqpqrqqrrrqprdrqrrqhgrkknrnroegmgirmnahheglol...

result:

ok 

Test #141:

score: 0
Accepted
time: 7ms
memory: 32412kb

input:

13 78
atxrzzdogxijznphsjlluqlrkgskvyztadtywogwecslmxfvqnfwfrdwhplvwhphcldrxatunvxrob YYYYYYYYYBYYBYYYYYYYYYYYYYYYYYBYYYYYYYBYGYBYYBYYYYYBYGYBBYBYBBYBBGBYBYBYYYBGYY
bybporjtlvekycuvihdibibipzsqbwcsqzudxvyebzclyhkzqrqiharctxhbkmliuywlamwpdxosqp YYYYYYYGYYYYYYYYYYYYYBYBGYYYBYBYYYYYYYYYBBBYBBYBYYYBBYYBY...

output:

zaacwsztvkvauavxbyngrlytpyuonrlfrvrektblefkdqqlwbpogbrjpdjsbqodfilnahqfjiaprmp

result:

ok 

Test #142:

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

input:

84 372
qipcbroojpntrdpkaexvlxwjoiyovtvihmxautephjvzpdjvjbqqfsuhsutaqouxxnehofrvqmjcutqifyirgkvmhzuacqwgodopnrtoaufvufswewrvqreefwdwdnbrcuuuorjebvsfruunekopkysnwqioiqmithyfszubxeytclafgnhciwajyuuxzlorqepcodfcwsngahmaplzbisdhgqvrpgogvjkngnbkmrdeahyezspwzlovgaxsqkzbhfbdyldilojyhugijuxjifhgspdqpxpbpjygz...

output:

gmskdfngrsqdewaxsnjswnfsilxseqdhvwzxuuvqsrewxhpumpthhlczvlmahfwsinvelcyyonszsrsbcesgacmakysinpyqeopitreofdawhtqnkhkkgkguekxmhwysqxaemnakvhzhvmcnmygyyewqxxaijysrxlpeueajmlmzjxxxevyldzrcgrmrpkwydymgdbguywfwsqnlpezpqexcaldmusoerkwwvdbudsamipudrspmpdgpvwvdejntfzwmgwjhsfppnrfhzlixwralsnkoszkpczrrdyigwnwr...

result:

ok 

Test #143:

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

input:

40 500
qdeezcmiwkdfctpgdwdffklbrqeluimxulivoceryupjudrqekkbtjogsxgzsjqhbvktutpwpxzaywigylbssvoasicrtocmpdsjhuvxxmkmouviukufiqdtcyghmevuqrcfdxbavmkwhtleuhsbecvejzuulmwqodlgklwcyaoczmhhtihfwwrjsjzivodqeyhvoobzbjkwouxxtrjfbpprikonyscerskpyllvnodnxscxcqoajuqrodqjlaeptbjcfmbjqlfkaczlvjhvnqaiwkjhfxqlczlyw...

output:

hvbaimtfhwzgtucqpbyhwknfueloquixuybixawxsszduxjighumkdxkevlevgvbaxvghqynpcotbhwjcdfxsphrkhfnwromcevwjkmhqljcjydptpkslxxdndvndppetejybaawbsrnyzwftvwecchhmmzuqywgbuyioqjfxvtxivuutuxiwouqfsmzadfhuwkepvknyfvyeetzbebqcythcbxsnlldgpvibubkzlhiixvpxlrixrlpenjgagguzmtgrfqonntikucnizuqczsjnqpqshylosvtkywcchdg...

result:

ok 

Test #144:

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

input:

29 20
azzzzzzzzzzzzzzzzzzz YBBBBBBBBBBBBBBBBBBB
zazzzzzzzzzzzzzzzzzz BYBBBBBBBBBBBBBBBBBB
zzazzzzzzzzzzzzzzzzz BBYBBBBBBBBBBBBBBBBB
zzzazzzzzzzzzzzzzzzz BBBGBBBBBBBBBBBBBBBB
zzzzazzzzzzzzzzzzzzz BBBBGBBBBBBBBBBBBBBB
zzzzzazzzzzzzzzzzzzz BBBBBYBBBBBBBBBBBBBB
zzzzzzazzzzzzzzzzzzz BBBBBBYBBBBBBBBBBBBB
...

output:

yvyaawmraqaaurjmkaaq

result:

ok 

Test #145:

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

input:

31 20
azzzzzzzzzzzzzzzzzzz YBBBBBBBBBBBBBBBBBBB
zazzzzzzzzzzzzzzzzzz BYBBBBBBBBBBBBBBBBBB
zzazzzzzzzzzzzzzzzzz BBYBBBBBBBBBBBBBBBBB
zzzazzzzzzzzzzzzzzzz BBBGBBBBBBBBBBBBBBBB
zzzzazzzzzzzzzzzzzzz BBBBYBBBBBBBBBBBBBBB
zzzzzazzzzzzzzzzzzzz BBBBBYBBBBBBBBBBBBBB
zzzzzzazzzzzzzzzzzzz BBBBBBYBBBBBBBBBBBBB
...

output:

fwhaowfassgcawaoljwp

result:

ok 

Test #146:

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

input:

315 300
azzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz...

output:

ayxqayaagoyapapaaaayaxlaxaarawaqawgtajaaaaelqaluwosaaawaahavqanaapaqasaneabaaaaaavpasaqtgakaauvaaaraaaasaaaarakoaaqaaqxagtsaaaaatpawaaaajfgaaahgaaaaaaeqcsmppqguauaaajaarakaaqdvaaaaeaaaqkxaabaagjapapuaadabmaaaaqeajsdolqidmaamlamcaaloakandfhmacfaangwfdaaonxappubhaahdsjbjwdfnaaadupaaacsfavainfgffaacncc

result:

ok 

Test #147:

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

input:

29 20
azzzzzzzzzzzzzzzzzzz YBBBBBBBBBBBBBBBBBBB
zazzzzzzzzzzzzzzzzzz BYBBBBBBBBBBBBBBBBBB
zzazzzzzzzzzzzzzzzzz BBGBBBBBBBBBBBBBBBBB
zzzazzzzzzzzzzzzzzzz BBBYBBBBBBBBBBBBBBBB
zzzzazzzzzzzzzzzzzzz BBBBGBBBBBBBBBBBBBBB
zzzzzazzzzzzzzzzzzzz BBBBBYBBBBBBBBBBBBBB
zzzzzzazzzzzzzzzzzzz BBBBBBYBBBBBBBBBBBBB
...

output:

eyagaysaraarlagppoja

result:

ok 

Test #148:

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

input:

30 20
azzzzzzzzzzzzzzzzzzz YBBBBBBBBBBBBBBBBBBB
zazzzzzzzzzzzzzzzzzz BGBBBBBBBBBBBBBBBBBB
zzazzzzzzzzzzzzzzzzz BBYBBBBBBBBBBBBBBBBB
zzzazzzzzzzzzzzzzzzz BBBGBBBBBBBBBBBBBBBB
zzzzazzzzzzzzzzzzzzz BBBBYBBBBBBBBBBBBBBB
zzzzzazzzzzzzzzzzzzz BBBBBYBBBBBBBBBBBBBB
zzzzzzazzzzzzzzzzzzz BBBBBBGBBBBBBBBBBBBB
...

output:

wavarfaluafaantapgna

result:

ok 

Test #149:

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

input:

31 20
azzzzzzzzzzzzzzzzzzz YBBBBBBBBBBBBBBBBBBB
zazzzzzzzzzzzzzzzzzz BYBBBBBBBBBBBBBBBBBB
zzazzzzzzzzzzzzzzzzz BBYBBBBBBBBBBBBBBBBB
zzzazzzzzzzzzzzzzzzz BBBGBBBBBBBBBBBBBBBB
zzzzazzzzzzzzzzzzzzz BBBBGBBBBBBBBBBBBBBB
zzzzzazzzzzzzzzzzzzz BBBBBYBBBBBBBBBBBBBB
zzzzzzazzzzzzzzzzzzz BBBBBBYBBBBBBBBBBBBB
...

output:

mccaacsajlwomqadaada

result:

ok 

Test #150:

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

input:

38 99
amimobtouampmyfcupgtlsdjbtftablgthpaamgzurxxpzhqmahepdflzsnsiwgepjejgzvlbndsilxrhegxmxofimocmhunwvn YYYGYYYYYYBYBYYYYYYYYYYYYYYYYGYYYYYYBBYYYYYYBYYYBBBYBYBBYYYBYYYYBYYYYYYBBYYBBBGYBYYYBBYBBBYYBBYYYYB
gyzmrybfmjlbxvzqqdbekapnixntkelxammnjmqzppfyfiarfhjrfvzsfsdfwmxyhnaeqktbysrtzteeutpvldzyuldvlq...

output:

ozzmbjrwthdfpglvdgyontgctxcetbbevvgurauapjtccuewocsirztzmxenjfuarscorhcaclzjvjxtxgivvqtyrwenedowgpd

result:

ok 

Test #151:

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

input:

20 10
azzzzzzzzz GBBBBBBBBB
zazzzzzzzz BYBBBBBBBB
zzazzzzzzz BBYBBBBBBB
zzzazzzzzz BBBYBBBBBB
zzzzazzzzz BBBBYBBBBB
zzzzzazzzz BBBBBGBBBB
zzzzzzazzz BBBBBBYBBB
zzzzzzzazz BBBBBBBGBB
zzzzzzzzaz BBBBBBBBYB
zzzzzzzzza BBBBBBBBBG
gdsscwqous YBBBBBBBYB
dwinyxqdqu BBBBBBBBBY
zhnowhvsns BBBBBBBBBB
xkdiostp...

output:

aumgtapala

result:

ok 

Test #152:

score: 0
Accepted
time: 7ms
memory: 34508kb

input:

315 300
azzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz...

output:

aayjfayaaoaayaathanvagaxwavnacauaaaaaaxjhxpwatqaxxauaaxxaaaxrcauuaaaaaatrmgawavmanaeaawuaaapfaaaaakabaauauuuammnaduapucaatauukaegeikaaxatnaaaraakkaiaaaoaaaaalanjaajsaqpkfasaoiajiobaadtokaocauadmaqacgabasryasanmhkwaoadaqadtaaaawlanjggaetalahaaealaadeaelayaveaaasdjaajiaaiaajaklladacaaaameaaedawsoaiaaa

result:

ok 

Test #153:

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

input:

31 20
azzzzzzzzzzzzzzzzzzz GBBBBBBBBBBBBBBBBBBB
zazzzzzzzzzzzzzzzzzz BGBBBBBBBBBBBBBBBBBB
zzazzzzzzzzzzzzzzzzz BBGBBBBBBBBBBBBBBBBB
zzzazzzzzzzzzzzzzzzz BBBGBBBBBBBBBBBBBBBB
zzzzazzzzzzzzzzzzzzz BBBBGBBBBBBBBBBBBBBB
zzzzzazzzzzzzzzzzzzz BBBBBYBBBBBBBBBBBBBB
zzzzzzazzzzzzzzzzzzz BBBBBBYBBBBBBBBBBBBB
...

output:

aaaaavegoaaeatcagaaa

result:

ok 

Test #154:

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

input:

20 10
azzzzzzzzz GBBBBBBBBB
zazzzzzzzz BGBBBBBBBB
zzazzzzzzz BBGBBBBBBB
zzzazzzzzz BBBYBBBBBB
zzzzazzzzz BBBBYBBBBB
zzzzzazzzz BBBBBGBBBB
zzzzzzazzz BBBBBBGBBB
zzzzzzzazz BBBBBBBYBB
zzzzzzzzaz BBBBBBBBYB
zzzzzzzzza BBBBBBBBBY
qzrjviywup BBYBYBBBBB
mhroevgubl BBYBYYBBBB
dfhcfqjgpp BBBYBBBBBB
gjnwpser...

output:

aaavraance

result:

ok 

Test #155:

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

input:

29 20
azzzzzzzzzzzzzzzzzzz YBBBBBBBBBBBBBBBBBBB
zazzzzzzzzzzzzzzzzzz BGBBBBBBBBBBBBBBBBBB
zzazzzzzzzzzzzzzzzzz BBGBBBBBBBBBBBBBBBBB
zzzazzzzzzzzzzzzzzzz BBBYBBBBBBBBBBBBBBBB
zzzzazzzzzzzzzzzzzzz BBBBGBBBBBBBBBBBBBBB
zzzzzazzzzzzzzzzzzzz BBBBBYBBBBBBBBBBBBBB
zzzzzzazzzzzzzzzzzzz BBBBBBYBBBBBBBBBBBBB
...

output:

daasamkaxaasiaadarka

result:

ok 

Test #156:

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

input:

31 20
azzzzzzzzzzzzzzzzzzz YBBBBBBBBBBBBBBBBBBB
zazzzzzzzzzzzzzzzzzz BYBBBBBBBBBBBBBBBBBB
zzazzzzzzzzzzzzzzzzz BBYBBBBBBBBBBBBBBBBB
zzzazzzzzzzzzzzzzzzz BBBYBBBBBBBBBBBBBBBB
zzzzazzzzzzzzzzzzzzz BBBBGBBBBBBBBBBBBBBB
zzzzzazzzzzzzzzzzzzz BBBBBYBBBBBBBBBBBBBB
zzzzzzazzzzzzzzzzzzz BBBBBBYBBBBBBBBBBBBB
...

output:

ysfsaopaaaanaahaaago

result:

ok 

Test #157:

score: 0
Accepted
time: 7ms
memory: 32368kb

input:

38 20
azzzzzzzzzzzzzzzzzzz YBBBBBBBBBBBBBBBBBBB
zazzzzzzzzzzzzzzzzzz BYBBBBBBBBBBBBBBBBBB
zzazzzzzzzzzzzzzzzzz BBYBBBBBBBBBBBBBBBBB
zzzazzzzzzzzzzzzzzzz BBBYBBBBBBBBBBBBBBBB
zzzzazzzzzzzzzzzzzzz BBBBYBBBBBBBBBBBBBBB
zzzzzazzzzzzzzzzzzzz BBBBBGBBBBBBBBBBBBBB
zzzzzzazzzzzzzzzzzzz BBBBBBGBBBBBBBBBBBBB
...

output:

sfebtaaaaxooanapnpvb

result:

ok 

Test #158:

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

input:

29 20
azzzzzzzzzzzzzzzzzzz GBBBBBBBBBBBBBBBBBBB
zazzzzzzzzzzzzzzzzzz BGBBBBBBBBBBBBBBBBBB
zzazzzzzzzzzzzzzzzzz BBYBBBBBBBBBBBBBBBBB
zzzazzzzzzzzzzzzzzzz BBBYBBBBBBBBBBBBBBBB
zzzzazzzzzzzzzzzzzzz BBBBYBBBBBBBBBBBBBBB
zzzzzazzzzzzzzzzzzzz BBBBBGBBBBBBBBBBBBBB
zzzzzzazzzzzzzzzzzzz BBBBBBGBBBBBBBBBBBBB
...

output:

aakokaaryxadaaksmdfl

result:

ok 

Test #159:

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

input:

20 10
azzzzzzzzz GBBBBBBBBB
zazzzzzzzz BGBBBBBBBB
zzazzzzzzz BBYBBBBBBB
zzzazzzzzz BBBYBBBBBB
zzzzazzzzz BBBBYBBBBB
zzzzzazzzz BBBBBYBBBB
zzzzzzazzz BBBBBBYBBB
zzzzzzzazz BBBBBBBYBB
zzzzzzzzaz BBBBBBBBGB
zzzzzzzzza BBBBBBBBBG
wvzqnqfrwy BYBBBGBYBB
whmfqjpixb BYBBYBBBBB
ytdmgqlwso BBGBBGBBBB
vjwojycf...

output:

aadvrqhuaa

result:

ok 

Test #160:

score: 0
Accepted
time: 5ms
memory: 32624kb

input:

23 35
zzzzzzzzzzzzzazzzzzzzzzzzzdzazzzzzz BBBBBBBBBBBBBYBBBBBBBBBBBBYBBBBBBBB
zzzzzzzzzzzzzzzzbzzzzzzzzzezzzzbzzz BBBBBBBBBBBBBBBBYBBBBBBBBBYBBBBBBBB
zzzzzzzzzzzzzzzzzzzzczzczzfzzzzzzzz BBBBBBBBBBBBBBBBBBBBYBBBBBYBBBBBBBB
zzzzzzzzzzzzzzzzzzzzzzzzzzgzzzzzzzz BBBBBBBBBBBBBBBBBBBBBBBBBBYBBBBBBBB
zzzzzz...

output:

ddddddddddyxwvutsrqponmlkjbihgfedac

result:

ok 

Test #161:

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

input:

27 10
vvvnnvvvnv BBBYYBBBYB
vvvjjvvvjv BBBBBBBBBB
vvvyyvvvyv BBBBBBBBBB
vvvttvvvtv BBBBBBBBBB
vvvaavvvav BBBBBBBBBB
vvvoovvvov BBBBBBBBBB
vvveevvvev BBBBBBBBBB
vvvhhvvvhv BBBBBBBBBB
vvviivvviv BBBBBBBBBB
vvvssvvvsv BBBBBBBBBB
vvvqqvvvqv BBBBBBBBBB
vvvrrvvvrv BBBBBBBBBB
vvvkkvvvkv BBBBBBBBBB
vvvddvvv...

output:

nnnxxnnnxn

result:

ok 

Test #162:

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

input:

27 50
iiiiiiiiriiiiiirirrirriiiiiiriiiriiiiiiiriiiiiirii BBBBBBBBYBBBBBBYBYYBYYBBBBBBYBBBYBBBBBBBYBBBBBBYBB
iiiiiiiixiiiiiixixxixxiiiiiixiiixiiiiiiixiiiiiixii BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
iiiiiiiifiiiiiififfiffiiiiiifiiifiiiiiiifiiiiiifii BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...

output:

rrrrrrrrcrrrrrrcrccrccrrrrrrcrrrcrrrrrrrcrrrrrrcrr

result:

ok 

Test #163:

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

input:

27 100
wwwwzwwwzwwwzzwwwwwwzzzzwzwzzzzzwzwwzzwwwzwzwzwwwwzzzwwzzzwzwwzzzwzwzwzwwzwwzzzzwzzzwzwzzzzwzzwwzzww YYYYBYYYBYYYBBYYYYYYBBBBYBYBBBBBYBYYBBYYYBYBYBYYYYBBBYYBBBYBYYBBBYBYBYBYYBYYBBBBYBBBYBYBBBBYBBYYBBYY
hhhhzhhhzhhhzzhhhhhhzzzzhzhzzzzzhzhhzzhhhzhzhzhhhhzzzhhzzzhzhhzzzhzhzhzhhzhhzzzzhzzzhzhzzzz...

output:

bbbbwbbbwbbbwwbbbbbbwwwwbwbwwwwwbwbbwwbbbwbwbwbbbbwwwbbwwwbwbbwwwbwbwbwbbwbbwwwwbwwwbwbwwwwbwwbbwwbb

result:

ok 

Test #164:

score: 0
Accepted
time: 38ms
memory: 35668kb

input:

27 500
uuuuuuuuuuuuuuuuunuuuuuuuuuuuuuuuunuuuunuuuuuuuuuuuuuuuuuuuuuunuuunuunnnuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuunuuuuunuuuuuuuunnnnuuuuuuunuunuunuuuuuuuuuuuuuunuuuuuuuuuuuuuuuuuuuuuuuuunuuuuuunuuuuunuuuuunuuuuunuuuuuuuuuuuunuuuuuuuuuuuuunuuuuuuuuuuununuunuuunuunuuuuuuuuuuuuuuuuuunuuuuuuuuuuuuuuu...

output:

nnnnnnnnnnnnnnnnnlnnnnnnnnnnnnnnnnlnnnnlnnnnnnnnnnnnnnnnnnnnnnlnnnlnnlllnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnlnnnnnlnnnnnnnnllllnnnnnnnlnnlnnlnnnnnnnnnnnnnnlnnnnnnnnnnnnnnnnnnnnnnnnnlnnnnnnlnnnnnlnnnnnlnnnnnlnnnnnnnnnnnnlnnnnnnnnnnnnnlnnnnnnnnnnnlnlnnlnnnlnnlnnnnnnnnnnnnnnnnnnlnnnnnnnnnnnnnnnlnlnnnn...

result:

ok