QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#201797#5161. Last GuessTeam_name#TL 119ms4428kbC++204.5kb2023-10-05 16:47:572023-10-05 16:47:57

Judging History

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

  • [2023-10-05 16:47:57]
  • 评测
  • 测评结果:TL
  • 用时:119ms
  • 内存:4428kb
  • [2023-10-05 16:47:57]
  • 提交

answer

#include <bits/stdc++.h>

#define endl '\n'
#define DEBUG_VAR(x) { cerr << "* "#x" = " << x << endl; }

using namespace std;
using LL = long long;


const int N = 1024;

int m, n;
char str[N];
bool isSure[N];

bool can[N][26];
int sureLimit[26]; // Y+G 确切
int unsure[26]; // Y+G 下界
bool nowSet[N];

template<class cap_t>
struct MaxFlowGraph
{
	vector<cap_t> cap;
	vector<int> one;
	vector<int> ver, nxt;
	int idx;

	int n;

	int S, T;
	vector<int> d, cur;

	static constexpr cap_t INF = numeric_limits<cap_t>::max();

	void reset(int n)
	{
		cap.clear(); ver.clear(); nxt.clear();
		idx = 0;
		this->n = n;
		one.clear(); one.resize(n); fill(one.begin(), one.end(), -1);
		d.clear(); d.resize(n);
	}

	MaxFlowGraph(int n) { this->reset(n); }

	vector<tuple<int, int, int>> edges;

	void __addEdge(int a, int b, cap_t c)
	{
		nxt.push_back(one[a]); ver.push_back(b); cap.push_back(c); one[a] = idx++;
		nxt.push_back(one[b]); ver.push_back(a); cap.push_back(0); one[b] = idx++;
	}

	void addEdge(int a, int b, cap_t c) 
	{
		edges.push_back({a, b, c});
	}

	void randomEdge()
	{
		reset(n);
		random_shuffle(edges.begin(), edges.end());
		for(auto [x, y, z] : edges) {
			__addEdge(x, y, z);
		}
	}

	bool bfs()
	{
		queue<int> q;
		fill(d.begin(), d.end(), -1);
		cur = one;

		q.push(S); d[S] = 1;
		while(q.size()) {
			int x = q.front(); q.pop();
			for(int i = one[x]; ~i; i = nxt[i]) {
				int y = ver[i];
				if(cap[i] > 0 && d[y] == -1) {
					d[y] = d[x]+1;
					q.push(y);
					if(y == T) return true;
				}
			}
		}
		return false;
	}
	
	cap_t dinic(int x, cap_t limit)
	{
		if(x == T) return limit;
		cap_t flow = 0;
		for(int i = cur[x]; ~i && flow < limit; i = nxt[i]) {
			int y = ver[cur[x] = i];
			if(cap[i] > 0 && d[y] == d[x]+1) {
				cap_t k = dinic(y, min(cap[i], limit-flow));
				if(!k) d[y] = -1;
				cap[i] -= k; cap[i^1] += k;
				flow += k;
			}
		}
		return flow;
	}

	cap_t maxFlow(int S, int T)
	{
		this->S = S, this->T = T;
		cap_t res = 0;
		while(bfs()) 
			res += dinic(S, INF);
		return res;
	}

	void bringOutAns(int n)
	{
		for(int j = 0; j < 26; j++) {
			int x = n+j+1;

			for(int i = one[x]; ~i; i = nxt[i]) {
				int y = ver[i];
				if(y == S) continue;
				if(cap[i]) continue;
				else str[y] = 'a'+j, nowSet[y] = true;
			}
		}

		// for(int i = one[T]; ~i; i = nxt[i]) {
		// 	int y = ver[i];
		// 	if(cap[i]) continue;
		// 	y
		// }
	}
};


set<int> pos[26];
int S, T;
bool solve(MaxFlowGraph<int> &g)
{
	memset(nowSet, false, sizeof nowSet);
	g.randomEdge();

	g.maxFlow(S, T);
	// if(res < sum) {
	// 	assert(0);
	// }

	g.bringOutAns(n);
	// DEBUG_VAR(isSure[6]);
	for(int i = 1; i <= n; i++) {
		if(nowSet[i] || isSure[i]) continue;
		bool flag = false;
		for(int j = 0; j < 26; j++) {
			if(!can[i][j] || sureLimit[j] != -1) 
				continue;
			str[i] = j+'a';
			flag = true;
			break;
		}
		if(!flag) {
			return false;
		}
	}
	return true;
}

int main()
{
	// freopen("1.in", "r", stdin);
	srand(time(0));
	cin >> m >> n;

	static char a[N], s[N];

	memset(sureLimit, -1, sizeof sureLimit);
	memset(unsure, 0, sizeof unsure);
	memset(can, true, sizeof can);

	while(--m) {
		scanf(" %s %s", a+1, s+1);

		int cnt[26];
		memset(cnt, 0, sizeof cnt);
		bool hasBlack[26];
		memset(hasBlack, false, sizeof hasBlack);

		for(int i = 1; i <= n; i++) {
			int c = a[i]-'a';
			if(s[i] == 'G') {
				str[i] = a[i];
				isSure[i] = true;
				cnt[c]++;
				pos[c].insert(i);
			} else {
				can[i][c] = false;
				if(s[i] == 'Y') {
					cnt[c]++;
				} else {
					hasBlack[c] = true;
				} 
			}
		}

		for(int i = 0; i < 26; i++) {
			if(hasBlack[i]) {
				sureLimit[i] = cnt[i];
			} else {
				unsure[i] = max(unsure[i], cnt[i]);
			}
		}
	}

	MaxFlowGraph<int> g(n+30);

	S = n+27, T = n+28;

	// int sum = 0; // maxflow 
	for(int i = 0; i < 26; i++) {
		int id = n+i+1;
		if(sureLimit[i] != -1) {
			g.addEdge(S, id, sureLimit[i]-(int)pos[i].size());
			// sum += sureLimit[i];
		} else {
			g.addEdge(S, id, unsure[i]-(int)pos[i].size());
			// sum += unsure[i];
		}
	}

	for(int i = 1; i <= n; i++) {
		if(isSure[i]) continue;
		g.addEdge(i, T, 1);
	}

	for(int i = 1; i <= n; i++) {
		if(isSure[i]) {
			g.addEdge(n+(str[i]-'a')+1, i, 1);
			continue;
		}
		for(int j = 0; j < 26; j++) {
			if(!can[i][j]) continue;
			int id = n+j+1;
			g.addEdge(id, i, 1);
		}
	}

	while(!solve(g));
	

	printf("%s\n", str+1);
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

4 5
reply YYGBB
refer BBBGG
puppy YYGBB

output:

upper

result:

ok 

Test #2:

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

input:

2 12
aabbccddeeff GGGYGBYYYBBB

output:

aabacaebadda

result:

ok 

Test #3:

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

input:

25 500
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqoqqqqqqqqqqqqqqqqqqqqqqoqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjq...

output:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaacaaaaaaaaaaaaaaaaaaaaaaaaaxlaaaaaaaaaaaaaaaaaaaraaaaadaaaaaaaaaaaaaaaaaaaaaaaaanaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaauaaaaaaaaaaaaaaaapaaaaaaaaaaaaaaaaaaaoaaaaaaaaaaaaaaaaaaaaaaaaafaaaaaaaaaaaaaaaaaaaaaoaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaatoaaaaaaaa...

result:

ok 

Test #4:

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

input:

24 500
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvuvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv...

output:

aaaaaaaaaaaaaaaaaaaaaaaaxaiapaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaajaaaaaaaaaaaaakaaaaaaaaaaaaasaaaaaaaaaaaaagtaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaayaaaaaaaaaaaaaaaaaaaaaaaaaaraaaaoaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaalaaaaahaaaaaaaaaaaaaaaaqaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

result:

ok 

Test #5:

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

input:

23 500
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqgqqqqq...

output:

aaaaaaaaaaaaaaaaaaadaaaaaaaaaaaaaaaaaaawbaaaaaaaaaaaaaaaaaaaaaaaaaauaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaahaaaaaoaaaaaacaaaaaaaaaaagaaaaaaaaaavaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaanaaaaaaaalaaaaaaaaaaaaaaaaaaaxaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

result:

ok 

Test #6:

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

input:

22 500
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccoccccccccccccccccccccccccccccccccccccccccccccccccfccccccccccccccccccccccccccccccccc...

output:

aaaaaaaaaaaaaaaaaaaaaabaaaaaaaeaaaaaaaaaaaaaraaaaaaaaaaaaaasaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaataaaaaaaaaaaaaaahaaaaaaaaaaaaaaaaaaaaaaaaamaaaaaaaaaaaaajaaaaaaaaaaaaaaaaaaaaaaaaaaaufaaaaaaaaaaakaaaaaaaafaaaawaaaaaaaaaaaaaaaaaaaaaaaaiaaaaaaaaadaaaaaaaaaaaaaaaaaaaaaazaaaaaaaxaaaaaaaaaaaaaaaaaa...

result:

ok 

Test #7:

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

input:

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

output:

vajrabjpyuavasaamalq

result:

ok 

Test #8:

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

input:

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

output:

aduduvasiaafbqidayya

result:

ok 

Test #9:

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

input:

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

output:

oawaasoaaaeakaahaaal

result:

ok 

Test #10:

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

input:

25 500
eppppsppppppappppapppaswppspwppeupppwpwppppwppspppppppapppppspppappwpppppspspuppppppppppupwppeppppppppuppppusppspppppppwppppppppspeppppppppppepspppeppuppppwpppppppppppppwpppppppwppupppppspppppppppppppupeppppppppsppppeppaeppppppppppppppppppappppppppppppppppsppwppuappppepupuapppeppppppapppppppp...

output:

vayjogcjsnarhzfrshqbxhgirsgmitjvlabdikinenuizmgwwuqtzohxzeudgtmnhsaiacratgwgjljtkyetowdwlaibdvksccbsonlmrdjlgbngconrstmidytrdknwgjvyxzueqskrnvqgzmtvaelfxubiaqctbexjeftotinkqfsusinolqbsxjgcrqwkerywwmyylevubemsnzagqjtuvcuhvrbcnfcxznfymkquskbhffkcxrezezkemfyfgfzirxlhanfbvrldlhfcavqzzcbyhycwtknftnxhomqg...

result:

ok 

Test #11:

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

input:

25 500
smxeetdiacxotgkpibsieraggqfjdbjxykzpiinrjxkmcczngkgpidtnacrzonzmrjsyfaiptigawddifgqxiiqibyymxvzncvifqsyfxmeodqwvwgqegpizkzfvsyywomkaviwjcasacijfbpjibvsroitinpfddjzcdkmxeisynrzipizmoyveveqwsfaqixobgrkstwtdtcfbwrvyvrgwdcmjozmitwcfitpzqdnikqbcpzyerwwigzdiczfmagmvacqxwbbiiiqrgxwvprvicjdsajinpmrrn...

output:

lxrggumnthrcukqbzoljgstkkayvmovrpqfbjjwsvrqxhhfwkqkbnmuwthsfcwfxsvlpytjbuzktdmmnykarnnanoppxrefwhejyalpyrxgcmadedkagkbnfqfyelppdcxqtendvhtlthnvyobvzoelscnuzwbymmvfhmqxrgnlpwsfjbjfxcpegegadlytajrcoksqludumuhyodsepeskdmhxvcfxjudhyzubfamwnqaohbfpgsddzkfmjhfyxtkxethardoojjzaskrdebsenhvmltvzwbxsswengqqwz...

result:

ok 

Test #12:

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

input:

25 500
zzzzzzzzzzezzzzzyzzzyfzzzzzyzfzzzzzuzzzzzzzzyezezzzyzzzzzzzzzzzzzzzuzzzzzzzzfzzzzzzzyzzezfzzzzzzzzzzzzzzzzzzzzzzzfzzzzzzzzzzzzzzuzzzzzzzzzzzzzzzzzzzzuzzzzzzzzzzzyzzzzuzzzzzzzyyzzzzzzzzzzzzzzzzzfzzzzzzzzzzyzzzzyzzzzzzeezzzzzzzzzzyzzzzzzzyzezzzfefzuzzzzzzzzzzzzzuzfzzzzzzezzzfzzzzzzzzzzyuezzfzzz...

output:

qjtwjfaynbvccrdxmkyemidubqxmbidthnhseryxlaeymvbvdqgmjplbtulcjwhffjcsftewuqbxixoaeklqmfcvjiyeuthdcnfrqlwcoynrwjtxyinarlkxyfwkcjwxsqbcldqgnhuohjjbalwyasdpgxqdrbenwmyonrsplnurofmmjjfkxwoqabotkkoatikpndnkqcqxmlpggmanbphuvvttrwehopqgmkreelbdmyvrhgivicskkpqgklfpyytlsxixrlogyvqanirnpjbxexfdmsvgfiepdgrsdfgd...

result:

ok 

Test #13:

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

input:

26 500
ffafffffafffffffffffffaaffaffffffffffffffffffffffffafffaffafffffffafffffffffffffffffffffffafaffffffffffafffffafffffffffafaffffffffffffffffffffaffffffffffffffffaffaffffffffffffffaffffffffffafffffafffaaffffffafafffafffffffffffffffaaffffffafffffffffffafffffffffffafffffafffffffaffffffffffafafffff...

output:

jwqbhmcwfmtvbdjkrgxiopfzkpghcvyrvvrlburiuodlddwubupfedtfrofjvwbvypfnjtgygwpkwpmlmjcbhtnotkftfwbhspbxpliqbhjwwqhgbiltwdigkqpunypkuwrkrommnhrkujflkjklplbxhwedxtcfoefidwbchlioleeshznlxztebgusqpluwsqcosffugbuvkqifomrqrnxbskxhbmkthttqzwnsuwxqojjxtdphpyvqxleuvrupxsrsnvxvkfnyirhusgvlpjnlzngnztgcovxitnqfbci...

result:

ok 

Test #14:

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

input:

26 500
eeeeeeeeeeleleeeleeleelleelellelleeeleeeeeeeeeeeeeeeeeeeleeeeeeeleeleeeeelelleeelleeeleeeeeeeeeeeeeeeeeeleeeeeeeleeeeeellleeeeeeleleeeeeeleeeleeeeeeeeeeeeeeleeeeleeeeeeeeeeeeeellleleeeeeeeeeeelleleeeeeleleeleleeeeeeeeeeleeleeelelelleeeeeeleeeleeeeeeeeeeelleeeeeeeeeeeleeeeeleeeeleleeeeeeeellee...

output:

anwwoydgqgnqxqianrzujuexumxcxxaxhgkcertppmvrdzossvujdayiuqpbbgacxyfxbbziukahxjychxcrbnbwswawkmffdraopuqqhjdkzckgxrwsbsvxehbngyyukqkjgvicihdwrnbtatpkrrdrftpceuzoaecsirryadabsybqexeuhsvagksvuscsxxoesqmbmhynwmxkhcivamawgayxygnztgkwhuxeocrzztkcbrxbkogzznkidbhnouduvpvvszbeowajjxtbstntxffimdwswhxsvpehntjp...

result:

ok 

Test #15:

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

input:

26 500
dddddddddddkddddddddddddddddddddkdddddkddddddddkddddkddddddkddddddddkdddkddddddddddddddddddddddddddddddddddkdddddddddkdkddddddddddddddddddddddddddkdddddddddddkdkkkddddddddddddddddddddkddkddddddddddddddddddddddddddddddddddddddddddddddkdddddddddddddddddkdkdddkddkdddkddddddkdddddddddddddkddddddd...

output:

jsjuyarucfiqnutetowifpetuemjvvgbsxsfcidjtpjttyysxhladrepuonbhjnuhuutdhtndhpzivlbjhmrjfnjgyepxjmbztfjjthiuttdtbcasrwhadvsvutzmjtoquzvsxucefhljobjopqrrqgwoybiyuqiqsduxwimegegtpnlhlpfbpzdpgdirsrxpfxffffmrfqujopjicxfwagowftnemrgfbtpjzleusqtxcaqjsgmcgxvcxbeqshozdvsseamdjxeiwmdcmgowuspzcamasamgnzpnfswsthc...

result:

ok 

Test #16:

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

input:

2 1
s B

output:

a

result:

ok 

Test #17:

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

input:

5 3
idn BBY
mvh BBB
cva BBG
you BBB

output:

ana

result:

ok 

Test #18:

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

input:

3 2
jt BB
bg BB

output:

aa

result:

ok 

Test #19:

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

input:

4 8
jzhqnmbc BBBBBBBY
quubxmwq BBBBYBBB
zkmtxamf BBBYYBBB

output:

ccxccctd

result:

ok 

Test #20:

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

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: 3988kb

input:

13 78
imwrldcrlcooqlzmcczciijjughombdengtcurojkwqyuoqltmduvwebvyysshwjythllxhrwmcepz YYYYYYYYYYYYYYYYYBYBYYYYYYYYYYBYBYYBBYBYGYYYBBYBGBBBYYYBBYYYYYBGBYYBBYYYBBBYYY
pkcwlbnthqplkuohoonvnqbouaakqdpwsyoscpqagkfhfpualsnonjnkkdtudoyvknpjgyhaqoxwak YYYYYYBYYYYYYYYYYYBYBYBBBBBBYYYYYYBYYBYBYBYYYBBBYBBBBYBBB...

output:

ohypjfrjrtiewsllirhzwvpgqkqhtmzhuflzemxzkrxzoytetieipcsdbeegqmzjtijqiwjeociicy

result:

ok 

Test #22:

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

input:

38 99
veadnsajqcnbynqxawytaccryhlefhbhusmjhplsemwsagxkiryxfwrsarpmhsrpikievjpafqszuqklxetizrtlwxzxyelalsr YYYYYBYYYGYYYYYYGYYYYYYBYYYYYYYYYBYYBGYBYYYBYYYYGBGBYYBBYBYYBBBYYBYYYGYBYYBYYYBBBYYGYBYBYBYBBBBBBBB
njkybjdzyrkufafkessouzzsbkyimahkltsqqpngkgghqodbebxahavilwxmbmkqkucahpokaktlylhnmyjyxwbmrqhepj...

output:

oppemvbafcqcuywvadxuvktjwejvzqybnwebcpgegcfpnmnnimyupztcoqgvtuzgaihzejzxynptlijoacziataqghhtlqwfjdz

result:

ok 

Test #23:

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

input:

4 113
suwodmkfmlkafcxpdgicvnrluhqkmulfirwtawvjxzzufmxruiiezmyebjlpxkzujfxjosfdqlbwfqtyripgsshmclhmtsosukwlgnzqvtbygnlau YYYYYYYYYYYYYYYYYYYYYYYYYYYYYBYYYYYYYYYYYYBBYGYYBYYYBBYGYYGYYYGBYBBBYYBYYYYYGYYYBYYYBBBBYYBBYBYBBYYBYYBBYYYYYYBYB
qpizotexiviavifrwmnhmqgxvxdueohjcyrzsinuuuhpbknejcjupvqhtnlsssylqg...

output:

oaiqrrbldnqhjflogivvccbtkndogzemdxiawyltfenkcmlgvfpmvxweqelkiozcmlwcbgviaaxafawaypvugfpeajrdvowieatsjsbpayaputkxk

result:

ok 

Test #24:

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

input:

102 377
gocqhgzrtqkevpckmjqhgbhpxtoliiukyxibpizzagbxroteetcwzpgzybsaxrhvudaxrrzjhisrbumzvaaaokwzpekgczhkbjqlgrdijvecheemmcoieoyhsyhooaxzmronnoovfdwelqbhlrqovoiubzbdixkvzujlsadyysnxcmvcxcsayqjyidlignyemacoyyuwjvpkitgsyjuzjyjtgxzamytxssxbocvprlhksvhegfjuldompxslryoubylyxzaospsxecpctamowqxxngbjtvoskmhv...

output:

fzhbpvvtfsjzghjjvoanwlhesznrmaqdkvrmnkxxcuaxtenfaqpctuywoclxzlgiscpcylgmjmtltvcjmmohwaiihbsonoraefpauuszkmewlodhhorizaizitonwailoikleknwtlngirnvxeujutmnszyjltnniospmismtvvtnltapcyfmjwhhabewciomfutgmqufzdvregkfbllubjmwxvqjiaoicgvslnzmcykvxszfjqevigtekrfbmcihthffbubmertrhniybzfxpjdpyejmvnmyvzyribcyhkw...

result:

ok 

Test #25:

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

input:

84 372
esizksnrmnyidougizdjmkksweafwdywugqdkisbdjaxfjghvoiwxhsmntnkyrimjajlspiqfomzyvpxdpispoveqzrcpfyntfxpcllewbdftkcwpjodchqeyfavuainqvggspnirpjpdcdcljmwzfkbrzleubsvxoeyzwzmmkrbiujgtcwpkeqtenikfnwqspnahiqwdxarppclogyrdpmqwuhqrdhgjfvjxifuksfhpkxjbmywimtettgrtgexekpaacpvtgorcljdnodtdudsatgszvvkpxkhh...

output:

priirafhcttvbcwmukqupwazyrzdryqixzkfnnamuzjifxtwhryteowgwdtrygfvyaxpjzvolkimwxfqpqzevqjmhzezhvtzyowazevweuzictoaxwabyiknexmxymtqvfcvysakdlegsotvhbzrrfcimfazueugoqtrdbcqrkxdtqatexonjtkeargeblphfcxscjdcaqzatcdksezpuwgvunnyymffvdfdpwrhfmvpawqoafeujyguhlelzcfuhnmgqrsxxzfeaxpyvtjxthrqevetoixfmdmzjvkwxixn...

result:

ok 

Test #26:

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

input:

120 341
qddkzllppvsamvuytcyvfmcgdsowlmasqwecvmbfkfgbmiluxdghcvyfiyynhobehlxsoslwjoxkkjmmcjjyjhuntirpeszmmsfcdduerkrzasnxsczqzcyunsqaalvjkkdrksdjhgojrkljxzflsdljjlbjrhjhhblrqhgtljjieelickdyszvkcskljuykzcpeuttphlonwanfndlkqcbgkjvocnwugyyxxbaccwpyrmyaapkciubysrjvemksuamhojymppamhhvvockwocvvjdmmssedjuzn...

output:

tnraljmrauiwhqddhuqxevuwjktugbqedadidsxnduvdoawjznplzlwxkgvfwyrcvyvkcliahpquktdvezcoeoxlmjrflyvrvynqmchlgbxnhxxlmdqdnsugabizimrirmzwdyewmjojiaifcbbrkivmfjuynkrwmctmonrblnataybzyyynwojbqozhdbpyxejgrdsknwzulbicasbwdjmwylxjawtrhgawavmilelwmoomtvlohtdsorjlixtcfedwfabomegtndzvhhfyizcnhiacpvicuwrkmiccrwdk...

result:

ok 

Test #27:

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

input:

500 500
uzkbwmwxenfvjjmbfpvgdgkfcrtjgftkcsdhgxlqcqyrtzqggauozihovqxyepxlqsndunqfvrwqhjszvzmttihgcwvyxugzbkxjwfqvvpakmrkohzrutlbfludsfkzmjrzkqsnstnxnlieshrqfqqfgttcsdinuvqzyueqhhtknnbnhstvabfyfpwszpkwvfzjlfnzgnlzzdeqcemnvcrbbxytfhajyvmaxfmczviyqafmkwmmrelmpmzcbwjltbejfuyizjyggmhkgmuhjijtsrfwzmmmkqieh...

output:

xtkupmikoalqczppaqstzuiezbugnmrfezofiejbxedkwmhldzkqactqmmcsuwmjddllfifimjtratgnnerahiklscixwmfrciloflzwalrxbtfglaouusctqbsevtkhaqtcqqothbasjyihutvpkdgaweyploaqfzsuqjotuxviounxiapvtcfovxyeutvfmgvhyzrcilfuxnappehaifxawqghytxvrylxyxuxkzqmoprdphfgaidifgmdfyvzyzvaxlzxfqbithwwglczjhxuoobaxsotlgfhkdauudoi...

result:

ok 

Test #28:

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

input:

2 500
cjvtcyhtzxnkypncxcydztkdxkosxdtlxzaetauygumxwzgkqittrtirkgnjuwanpdokgrbvwwlxxmivnzgnfelcxzmggmfwrtuexpxxyxuniivgwiykbzhnfbhgtoizuumgvoazbkcgzyhtamdsnnuejfwgmgbffdpnaeulrjfiflxrfqmkxkqkfwqcylsieetenjwbgmzewvgownfiylsvjzijpgrdfozciarqzqckecrwevmdtilipcerlcmbvogajnlfiwwcfurfxgtwbavfogarxcovbrwvlo...

output:

zzcgkygytvpxtpaaanlzlncaefaeiygfikvqcjaepiypoammdhyuaklfabxagaxbzxnadagyopzzcfykrrsfdavglvswaagzzbnxaacwtyakmigkrxtqjxxfyoeacuyrbbggteiqjfandcgqckalootxzxeflrfmsmpauaaaqjtkhfwbvihxuylrruaybivccaayocdzswivhfdnppkcjlrajylfawablrmahowozmrfyqatacdgmiaajxcwvdivnaqljemaflajgkxxahaalyxtppyonkwwiazaxrtbymaw...

result:

ok 

Test #29:

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

input:

10 500
ltzpvgzioqzjaorwvcfawsuxrpiaxelpvjvbzkmhmukkanhddeuwnwfbqeiccwqiqsntudhfrrxrwjmphcocxtzbljjcdjmksdvnoklkzvljhmyxsjgzsmuezdeieobpeojmxphuhbkxuqvtokknihunzjztuhuqurethoyiiamwzqppwuiljeygsrclivocqngmwgqeghfwtwunuyvcxcjjufbxwhmijurlgodhscoalsqbdxnizkkjtmqfaynndanjjfzldqukrpmqnsynrvoncnqymegdgvvga...

output:

bzowiewgotkqmzpqvsucqesmxwkikzthgoteewvydounmrhjsjkilzmpqmwmkumrzufolvmighvfkaopvrxazptgstzvlbidpdcjunzxmmirptmpswywwrpxkoqgvzvxyyypqgiikswroqfmzsnvpzchijvbdpbighofyvquesvturwsqxyxadxconeibqtvacnszolbxcmovrrximtnckvqnzyrejbbngmmrageghbylssbvsrlbrrvuujyxzskcgxddpfdrwvfinxkilalppanrzglkabihwgfstdlljax...

result:

ok 

Test #30:

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

input:

20 500
gidefqbkbebgnvcgrjfmkuqtipyqlpvrjndoddvuhkntkznjdkfvggaoavkllvbigfvdafoxziprpozvhukhwheyasblhleoxfxwwruvsilcdrttxcbqfnvplqtemgsoftmsnzrgaikbqmyrbykhtpbmrfpgvjiqszkdapksfhbdkmdawcgonddqgzasjtvrjbgkfwxyopyxhprkrsaoxfblohlqyeenggeusnfvgkxalqzhziuckhyhhmefhjpvfjzolfowjvjeklnxgmymaubfcuineyiuzlzpb...

output:

hmehvlzolovnhlwhfsqmidgcuvbrzsooxkdkoziubmffvtonawvmucxfpgabnyumflrnofbjwctmbmphbigeuqjmpvxrowiwkujzwibnisgzfueahgsahrqawjzuhszivksyahlkymzwjstnblignisvahtakcjgkvztckuggzmkqjkglqapfbsfpfuplmwxnolkjpsaaybhmwwroezfrxezxnimhkqbpmwaafruisxfkegahhiwecnkclnxwhbmpyhxrogjqqmdxkszzecqhljqlhykpdufanolcjrzkybh...

result:

ok 

Test #31:

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

input:

40 500
hgrkbariyienlarbtwpgttrlmwgdwjisgwtuelybkqyzibmerddzhxpkrikkdglakynfmvzntqkldilwlredsuwiyhvfmdfymethhuqztlwzlsjsoznrcemnwutebgioqndeywylttipnfkjzwrykcsmyeruqzryjuhcyirlakfmzwyjlisxtpdibravckhsunbfdczcfjcdnjcdkhqticcslsqmbldpvatkvnlgcnjzzpsjgoxbdqaqogdiqwngjjyaxcurpfcotfthvlhnyqvkxalealplywzbj...

output:

zdipaunfvfbikrwbcjgjdivgerbzgnfecegqniusywqrmgvrokvpcaeengvvjdxypqcrggpowwtgkhwssbyyubqdlzhhupeugkskdczuukyevtbmowkxhmafrgsyssaxqifuxjzicqxkooejcxslkxfuboqwxaxgblqiaeqgmobotjikzfpzmgmlmaczeaqvaqmfdomzjmlztjfiinugnhciiqfvnlhmmjcdqohbzvwenibvoaqdrubnmipvrqjygwbzavwztlrkgyjsjyvpxqluxwbuflqilbkflredekyt...

result:

ok 

Test #32:

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

input:

2 10
dkzttcuhkf BYBYBYBBBB

output:

aaacakaaat

result:

ok 

Test #33:

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

input:

4 10
hzyqaqgudo YBYBYBBYBY
drzekuoozp BBBBBYYBBB
ydmoszopir YBBYBBBBBB

output:

aaoabyuaha

result:

ok 

Test #34:

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

input:

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

output:

qcvccftyrg

result:

ok 

Test #35:

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

input:

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

output:

kecpqicfnz

result:

ok 

Test #36:

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

input:

2 20
gvmxjisdtqdzqlcythxc BYBBBBBBYBBBBYBYYYBB

output:

aatyaaaaaataaaaahval

result:

ok 

Test #37:

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

input:

4 20
juwgnsochomtjjrwkxzx BBYBBYYBYYYYBBYBBYBB
xcfresnspwhbnpufpzut YBYYYYBBBYYYBBBBBBBY
nicdnycdwkcwxkzlexij BYBYBYBBYBBBYBBBYBBB

output:

bfdthmaoxeraoiaaayws

result:

ok 

Test #38:

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

input:

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

output:

ajuoaemavhpgswrdznja

result:

ok 

Test #39:

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

input:

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

output:

hbzwqeuiknzpyducratr

result:

ok 

Test #40:

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

input:

2 500
gxnlcmqfsmxkzleyreubambwtiyuisiplwrjastyivijshzmfuyjqbqwmtiixxwivmqxpbuboruzaaapaxrllfbonnouzwmjuouvzcoyxytfxmhtfcvsbjvnltirhojtxhtdiqasoajfhrcinjrkzstidvhhdwynweaacmuhctyzeelatwnropiqifxsgxntfycvjrhwpmzeytliurapssrixkjndjzwtjonqzmhhtqyqjacafxkwfrnvjyjcswxrkmhstxgrdaxacuqiqtmdwuiuwzjjekzsaycgc...

output:

pddndaxbecavargjadqhhikaiakhdmabgamqutmrbpayqabeomavtaaueqxewmdsnhuvjtaqnhzwovwwuznwmqhawcqjpposbfezximraaljqawaneaprtlcrdcxaakubroamconiyhaanwoixwnamwsxaszsiqvfanwxozlauqkiphhuaaymjahfahvtakkrmnifdafwlwpvezexzibukizcaaagqayatgpaxakwyyiuavylgzfyvaybmcptkzyzirlfbjrxanpobkoohmktthapjlccabsrvsnuksqnmsv...

result:

ok 

Test #41:

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

input:

7 500
kucxpooswpgshqxdswdpxnonzujecioriraskzligwznnduirvonmjmozyxkotblntnzmsgacdjxsrelfbcwhffnqsshpdnuiyvekpkkzhfqadrnhymofwpahuefzyauxunwxjsexozlkauixivyrdrckaxiicawzsvqshnexswpqlnwpfwqxfsqjgefxylqizfouiqmbtkxrjcdpjfhetrphazpatrwkbikmswrsjmuvlmkuhfvzvfpqawtkgtmykusaspvinyqteptvvfgynrehmekerkbpgcbgf...

output:

vhabecmjmrdcvpiqmbqgtgksmisjvpcfhfegbltvvqqthejsgynloezgtsgtmwcbkzeeroemscfpcffnytzoevepjkzxhbkrgwqmzaszqbgorintlorkakqhxxqyizwbfldffzypakortlfslhhpetgjfekulifmmlqkjttpmvuxzntrouuhdgcoqlylelqeehtlrheuimtqtzsnvpvcbuneiqnxiixsmdldjnkujebpckaqrviufuvjuuhpatbsovkncryaxplryjipiivsbmatrwalxvaicyuewzrxqyos...

result:

ok 

Test #42:

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

input:

8 500
zsuejmayajrezxaeoppddvtufobaqqrnadgiydzodggiskvrvfyassjbdhbufhmxctpfdqvhykrkqjjltksstdnskjfspencdneizkxxtfdheyhvmnsjdbrjusilipmplxvnfxthruxwdukolyqivyaufoewysvppuqdcdmvwdwgtaqejnfmgtylhgrfcjqagvotoosbisnibzntaetxvemftcocguvgindrppzlooryrqicloefmktmimfqyxlletbymenpljkjybhyfuahardknwfejcojkxyzsl...

output:

fjeilpeufuupverwakjbloabewxvcgicrmzwdztkuftefmaioukdeyuanfqfdjyceexlfrykdgultsngxqieijocanhvocsknaazogozqerlqfggnlpfggmlbndalhqesapzurcnwykuzgarqcxlcnvlzfukzxiqivokymgqcpuqkznxodyrknpcuzspbmyhtzvqsewcsckrobbwqjisfrksnknwpcxcntfycykvcehrggutjcqlphvqbjurvvddxrawelofnpzqthdbbgstbihzkcgrcrvcgrmupssgzicv...

result:

ok 

Test #43:

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

input:

10 500
fwpisiecngmypltgnpgwungiorybsqujrjynxduhbxkzzcpmprjkmcngffwriwlauogonaytiewzmvhmfkbqzbhvbuzaxgmrzwhznemrkgkqcfcxznjgqfxvivnzxkttungprndxzumatgitszsuhxrbxiyblepjljdwccbmodtyikdewbqekqnyrdpveilrjuidvbxmidaudrahboegnxxojlllcijvhewxbqhckkdisyyoieqnybydwpyiupduxdxdcbsiflmqomhorvpximunuvgeqrpojynfz...

output:

xatbaflssijfszolfzhrckrrcvpzzyjtwtcyauckxtcwuhcrsektanlscccatojgwhxgfsiwmxftaxkpqtgcowkclbbvkvlxjyimfxtcgodgmwqpsrliiljlscextsjvnlajttikovfszpmfybcspyevnsxgxgqukpxsabpewuvkyowmkyddwuekcemxqkevyxrqzqvikqvdyolgflokeekgghenpcaalznhjryluwlggxfsdrtmezaeazfhlaqknuczfubseqgntuvsndiunojccrnzucmyzffyyplxdznx...

result:

ok 

Test #44:

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

input:

50 500
rzxpevxmcsvfyfmnmokxtsjtkisntufznueipsounknjbdgoieqoeobnfuncfrokfgdsdujxvtluensnrnyosfsywmltfikmpgofyyutxgxltspvwnqnfvgeolxirwbvvwgwwbxbwbbswrefaklrdmdlzgxpltvbucwfgrpggpobkapydjkzbgfarvqfzssyeepxzesalnpbnuastjecnatiljloelrojistoqxxrwdiehnwbubijlcsgserxmlbbchlhqlndtvmbaztvhspfxdyfuodupczzusgi...

output:

unwdymhyntkdlwzexaswlemgzchcrtqvcdpaajxmhsjktnydaajpvpchqcwqnlwrtremqwluhfdpihfzhjzxraqwlwwxaznormpjtjopdcmbikaplcmzpsegaruateqfktdktigrqjsopaippqaqckfighscxdhmkxxdsmgmrftovdixnhndzytkymsynruvycypktzcjtlgrnyfxsskjvvpuzzppnvuwrpjbkbicuoefbipcxrjixiosryiguxsyecgztkziydyhhlpzigvteakvxaekbqtcsocjtbzekwt...

result:

ok 

Test #45:

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

input:

160 500
hayqlkswaloyrwgikgdxyqsorgjgsohxuyrlfdgptnogrfzfrcmkhyvnpohpgtjhhlalckgubhvbbtinzpykjfayxwqctbmbjdtguonvdihewfxphkfngblmtlxiidbpxnxeiswxfrvbflvisrvxkqqeqzinhgobjfbxhbtfageuinrzyqzhrsqttlmfxgqsdaxkyiajiitwnxnlqggrncbzwrzhtctcunpkhdlqkqtkyfvcuwqftujpufwgeqkrzdfngmshdiwhobeieunukpjgvbdwhjtkaccm...

output:

mjpyvrzpguatqaxutfeenauznkxsfgqfrfdaoydwqimxssimpofnqfailvbgkmearxhgxjvtluftknckiwaeyuedbogewrnlfyzatjgtgrpvjnehxhvwkcydnkwnvxgbifqobxxchmltkwyqpgaanlyunugwtxmayycilokxdtzhcwgpmleawmsvacdywnpnpevqwpkyssvakkmpmslqmgucrzrqoufaausspnahpwkcvrfxhbwcccsbnntbfpstmaesxspfwtseyluftmrkcmifuofjnnhmwfrbveoudsgx...

result:

ok 

Test #46:

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

input:

3 2
qf GB
fq BG

output:

qq

result:

ok 

Test #47:

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

input:

2 25
mzopyxgqdtsjvueklciwbrhna BBBBBBBBBBBBBBBBBBBBBBBBB

output:

fffffffffffffffffffffffff

result:

ok 

Test #48:

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

input:

2 25
jagfzkndilpxwsbrqytcvuhem BBBBBBBBBBBBBBBBBBBBBBBBB

output:

ooooooooooooooooooooooooo

result:

ok 

Test #49:

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

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: 4168kb

input:

2 20
ynjmhdwofqxsaubvlktc BBBBBBBBBBBBBBBBBBBB

output:

eeeeeeeeeeeeeeeeeeee

result:

ok 

Test #51:

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

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: 3836kb

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: 4156kb

input:

3 3
abc GBY
daf BYB

output:

aca

result:

ok 

Test #54:

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

input:

3 3
abc GBY
daf YYB

output:

acd

result:

ok 

Test #55:

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

input:

4 4
bcda YYYY
cdab YYYY
dabc YYYY

output:

abcd

result:

ok 

Test #56:

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

input:

2 4
aabb YBBB

output:

ccca

result:

ok 

Test #57:

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

input:

2 14
welcometonwerc GGGGGGGGGGGGGG

output:

welcometonwerc

result:

ok 

Test #58:

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

input:

2 10
aaaaaaaaab YBBBBBBBBY

output:

bbbbbbbbba

result:

ok 

Test #59:

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

input:

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

output:

inoetymirppoibthmtmomapwmrafxomlinoleusi

result:

ok 

Test #60:

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

input:

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

output:

inoptimiyationtheorz

result:

ok 

Test #61:

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

input:

2 10
mympqinaqs YYYYYYYYYY

output:

nsaqmpyqim

result:

ok 

Test #62:

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

input:

5 10
yoqojkyfrq YYYYYYYYYY
yoqyroqfkj YYYYYYYYYY
oqyykoqrjf YYYYYYYYYY
rqkjyqooyf YYYYYYYYYY

output:

qkorqyfjoy

result:

ok 

Test #63:

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

input:

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

output:

rcwvypxogr

result:

ok 

Test #64:

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

input:

2 20
lfyzddchsnrcfbfhpxkh YYYYYYYYYYYYYYYYYYYY

output:

nkfhxfblhddpzccsyhfr

result:

ok 

Test #65:

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

input:

5 20
bhczdehumywygnhaeeka YYYYYYYYYYYYYYYYYYYY
ezgwuhykcbaehyhednam YYYYYYYYYYYYYYYYYYYY
kdzyancbeuyhhmghaeew YYYYYYYYYYYYYYYYYYYY
emhkzewgdhbhnyauacey YYYYYYYYYYYYYYYYYYYY

output:

menbkyehacduahyzwghe

result:

ok 

Test #66:

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

input:

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

output:

zovwuehpyynkccpriozw

result:

ok 

Test #67:

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

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: 1ms
memory: 3928kb

input:

2 200
kjgxibzaqovyhfahtzepmneqlrtyqskqjclybnijqdnnaqjwqpcdyhqcivkhiamwnnnrekynlwdhhtwoluuxuivncktinkkmgnavexykunaefwtdtccjdvnjrsshktuiqmugothxrrkrxfbzhzawqdvcnjwfbemdjwmsozfyialxnxbqhndzyhoskwmuamcdsrzxttte YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY...

output:

vnvhmwehtwqbkvhdenztnedzhouhycnyrkobyxwduarcjtkxaajzoivwxnnstqyzaumktxrhsuwcszicjtmdhjfjwtekcsqxvkuadqdhgmintckqvtmtneiwehnqikskawfrffnbqndfruabpeyckxjqzbnxnihmosntrqnkayuphglwcjgjmoylixlnqzmqldaylrid

result:

ok 

Test #69:

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

input:

5 200
sfcjckdgmwmnnlqezqgivfbrgkwmqronyyojlpqwajmjmgjhtlnsjcmsysflrpmrluakngchrsuncwwbqmlpavprqyvhwplrtqhxpzgtxixarzjsvrfquqemtgfryynowgowzyiyxxjarzfaevasxohhqwsleahueveixdjlybnsxnsbtufoiihtstlhczsczzazjwou YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY...

output:

asqlpugjekueevbaclrpsspozaxivtvoglahmlhfeesyawqyfhlgifnjsgochiwzofistrwtnfsrmncrtrnxmqytkqyzmnnqzxwhjbxzzjlgwufkjilthjhswpcaenqpbxmsguztcrwpalguyojrqyyrvcjqxvaswmnjmawuqofmrshozbicjzxlwlnvdryymhgxsqdr

result:

ok 

Test #70:

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

input:

20 200
krxqaxppwikekhvmjispucbtwyennwxkqsvjhwpvcvtqgemfpnvsjoppwvqbyslciwosyqjircnsrpmicagujcstajnwuztjpyjxrwbjpelhukuwynyfjhfoxerfvnotzxgqrrckgsjbtnfmhjtpqcteosfpfjgesbwrxvrtdxhrnrdzlnlnivfwrsxkpvsqkwuyfqgh YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY...

output:

sivbroyrmqppnseunevnjpcpjkqwrxljkxopwtbxsbkjujnqjeskvxqzcrctkgphgofwvfyyktwyhcfuvttlqqmxowuspemixrhyohupfujrrwpdzsetizxnsrpwlaeipwqjhknpfitvhsnrvqwcknmjwcwirvvfbsggpdvngjfyawjqgynsfsrjljanfsebrtxxtchc

result:

ok 

Test #71:

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

input:

2 500
blgymzrpzujbijgjxyuadmopdmktpzaovnuecztkbzxgzyvisyljaevyfufxyhyqiqdueuswizdfbebeofpeixebkcoylfbfnbckcmafvwcppobihsmxnvhrsacfeozhlqloqithcbvguyslmdqksinnirkziaicjfrpxhceqgxsbiowjixmoflvtvuquoidzfpusisagkefodwcsvqdwvnfhfygrrobkelcsxdaoddqtmvgxkhnouoqizqwvvudriluplgazarubzbsomyqcaycjjwmyqsmabeisi...

output:

qdmvbqizsacjvdjavaizejvlwagrgvdrrzbcxbwgcnpxfcwakdbygmlbryciedxbatqzkzjzsyvzzuyjmcipxnsxiuqjteooxmdjktxajengoswfkylbiotclvoclggqjtippvmsjrerwdygqooigfwjdoxkthfopekzisrskhveiyvdzhieesflgapyfrpildztmuwhlgcurrsuwdaboquwmomvviinfcfptvmmukibexsiyeodsdtakjzfxbiveqizzixzrolpxujqelcwgqjbfgvaznqycopfqvmzjisv...

result:

ok 

Test #72:

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

input:

3 500
fndjpiklrigzxvhtgavgqxjhgclbcusixstqcvopskxdxeaksfcfrlkzdsqjddqnijuqqmxzafjbljcqivkozdwwyjzysrkkpxrymnuavmcjemoiaayfnldynfkjgzzlcywayfwtlcaicnawiagrmlhwrjcdvxrbxavfjqwkejfaahukajyupcyulvnbpqewqooacxbryistjptowptrpiclmkgdpnchtrgijujimyloxgxpxqqhhnidbeiasewjkydmpkecplkxlsyzbsyheqeigyyyujupwdjqzg...

output:

llnllrjwwvnvhqwmsqdelkepkuyjkjhapqqiacfxzdnfmovziwicjtymajohfgtploeugwmrqmwiesrakzpfggtxvcaxignxjejgnarwttqvahfxwyuoqxbxcaorkkpnxhdfxmayqejlladdenephzttjetafwsrnobrmeenvulvtipakftgtsrphbpdirgmxzaryjkaqalzhdksualmgyxguqibwxkikgfdonuxjcuxsagsjkpwyjatcqmwdfjutjpkweywhxcjimrcxfizljgfthajsymqnfsnqftmduwy...

result:

ok 

Test #73:

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

input:

10 500
bupnuqzdcpbbxnmovthxvephnapgnxykdqpefrnsxlalrhtxogfxlpfrcxjmocibrokuejfvalrapnhvzuabrhjfdcnnnaygwtkgoenbewrtlzzdhxmzndkphodrcjbcyivsaxbugccvkqzbygufcpqljzopxafwzyxceegfdqtqqufvtptbllewhlraeotvtdiwnjnbkedfhsfpvrydnerajvkwidyhptbvtstjbwqucskqlecziliyqqrxvahlbahjzlxebblyfmjkxpuyitksjtqsxkmzatzur...

output:

hljbzlewkwkwzrvwhcileyeyjsalrhkceyisjgddgdxxexrzfvqucjrxilzcbgftibpbvzjmwabefkaifwqafsuagbkzudcpuadqmvqtcqnjitdjwwlpqstccrybakereftvpqlzfbvmfflldvmtuuyhyjerkzcgnwahtkqrkecxasqqdhyvqoohzdzqavhhvnaxsqyeebaiabxbltmxysdodbzoglbkaguawglqzxfpwvmnvtstkulwulisldwvtiixrhyqanbhllunmjeobpqceorljtjurbfpyxcyracd...

result:

ok 

Test #74:

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

input:

80 500
dvbyutdpoihytugjpvxnzcreuwneaqokypvmieezkevfpngozhxowvwbavznhmbjosgnvskifmpbaflkoxivossyqaoxkvvioupzyygerlqpntmxkctrcodkogiqrvnhkczcdhbnvihopmchnnyayletjmvsflwdmozsgrwkqdijrjzrodqqadsnsmzulhumosmwmohoibrcqswjaohlzmjpjnwifwqunludixjhhupgettgefwzcvygiycdtrenhbydhaopdrzogaadrqwiqiogounuhozeifmox...

output:

tfeoqwjgeqvfvkhzbttqvooyramqdzsezqjtrhctpwwckhcicoiymhqzpgbseiwviwiakjmsrlzprmcxtdhoidgjveamppdnwzonmnhpkooigkqoihuxdzvxktnoniucnlfjigprikmkqtkolsxofjurbuombwiiycxotibmghhwhqoxzgvvoqdmoepfzcxopyhvoiyfvtoqzyepphrivngfwwlgwesqrjoaxcxsqdgemlgqddyjmuvagrruypfeyscmzqgfhmjdrioyigjfvarpahrsxnofpqevwyjehoyb...

result:

ok 

Test #75:

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

input:

500 500
dvbyutdpoihytugjpvxnzcreuwneaqokypvmieezkevfpngozhxowvwbavznhmbjosgnvskifmpbaflkoxivossyqaoxkvvioupzyygerlqpntmxkctrcodkogiqrvnhkczcdhbnvihopmchnnyayletjmvsflwdmozsgrwkqdijrjzrodqqadsnsmzulhumosmwmohoibrcqswjaohlzmjpjnwifwqunludixjhhupgettgefwzcvygiycdtrenhbydhaopdrzogaadrqwiqiogounuhozeifmo...

output:

tfeoqwjveqvevahzjdtqvooypagqdzsezqctrhbywwbsshcinoiymhqzqdbswiwvidiekcmselzpgmagtlhoidgjrdxmppnnfzonmshploaigdwoihvfduzxkvnoniucnvrxigpsikgkcskolvxofjyrblomkwiiyuxotibmghhwhqoxzgvvoqjmojjbzcxoejhvwidfvtoqxyepphrivngrwfggxdmqcwoaxcnsqdgsfheqbdymqutagrmuyclewsvkzqrfhmjdriozizefvvrpamrrxcofpqevwykehoyb...

result:

ok 

Test #76:

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

input:

2 20
xztanpyxqtcnpuzqqyoq BBBGBBBBBBGBBBBBBBBB

output:

aaaaaaaaaacaaaaaaaaa

result:

ok 

Test #77:

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

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: 0ms
memory: 3860kb

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: 0ms
memory: 3888kb

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: 1ms
memory: 4100kb

input:

2 500
zxwpopwryvxwuszirrorrqtsnwrwuoonyqsruqtpvwtxmnzxtsrivsnttuxvzjsywsqspssqqvusyqoppwwzzzrwsxwowyznnnttxvgtrptuavzxotqqsuovspzzvxrvqqqvnpqnypeqqwyospooqnuzxtxypyutvoernuctyqzvqsdwpvuunrsypvzvuqqsvqqoxuuznqvvxusynpnuqwzrnosxqslunwvxooyzzsqrvzupyprkvqntnwwowxnsrtnsvszzsxsqysnnsrnwwwqzvyxowoinppbqxy...

output:

aaaaaaaaaaaaaaaiaaaaaaaaaaaaaaaaaaaaaaaaaaaamaaaaaaiaaaaaaaaajaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaagaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaeaaaaaaaaaaaaaaaaaaaaaaaeaaacaaaaaaadaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaalaaaaaaaaaaaaaaaaaaaakaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaiaaabaaaaaaaaa...

result:

ok 

Test #81:

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

input:

10 500
epjvurrwqwslokprtxxnoqpvozzqynewutfwopypqopcxvswnlwavyotqvzfovuvznzuttpztqtvnnysqzrpszbrtwxwvlzqzofwtwrprruwoqzruxunyszooyvzpfwoqrsurpzeozxwuznvvuyorztufnvvuuwxpzpxtusyzwpvwqvmxytssnqsupxxyoxrpqttwwwnkqyyzppuyxqodqsywlrunuxsorzorpqurwrvxqyqynxvoqtsyrvxzvnxzszpunupyqnopxrtprozwtvxzxwrnnnrspvwo...

output:

eajfmkamadalakaacaaafgebgaaaaaelaafalakaaefcaaaaalaaaaaaaamfaagajaagkmaaaaaaaafahagcdkbaaiaajlkaajfaecaaaejaleaacaicgfaaaaihdfakabfafkbeaaakalmaaakaaakafchaeaakagddajaaaaaaakamaaalafmgaaaalaadaaaaaaackafhkbdebaafdfalalafekgaeaaagaaalaaaaajaaalaaiaaagbaabdaaaaafafaahaaaaajkalajagdbaakaceaadaaaaaaaaaa...

result:

ok 

Test #82:

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

input:

15 500
zryswnworvevunwutuxmnzpbspdpqctwosopnwswrwvyyvptypvzqwzzcontrtooysryxxgvrquvnnfnvqetnourqrxbwywtoqwvtvzqhppsnyptroqtsoxwzrqryylrzntnssvtrqxrsnzpxvzxpqrusplhrftenrtsxvpvnpxuokwtzruqtzsryqnywowwurnyoztuwqtrpptysuqvrprpfovwepypwstvipnzgxgwrndvwonuwqwtxotpvxyywzzozwzwtnzozvtsoytxsnqywvarnpnooorps...

output:

fbjaiageadeaafaadbamgigbhddbacaaaakaalajmaaaaabeilahadaacmeljdijammmaagahafaabfaabecakiaaambaaffjaaaaeaahlaeabaagkgahaahacabgmlaciiiaaiifcaggiaajfhaakjfgelhmfaegbjaaafaaddaikaaiaahaaaaafggeabhfegehamlafmaabaacaddjgecfjccelkaaaaaiaaagagikadklamcejcjaaacaaajaafadaagaakmiceaglhamejbbaaeaaedaagccmfaaamj...

result:

ok 

Test #83:

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

input:

20 500
xzqwxnzjotrpypunovrukuwwzxynowyxywvvpnvtnozoqyaxpdorsvpyvvqpsoxrsxwrsnatxosrvuynpylrxvywwqmzqzppuvuytyqurgpwxynoqyrqxpuzytunxrnrrtowrpzuvyorvquopsuqquyrvvnzoupvqrvrdqnoszvxtqnvrxtpotxttuoozppwwysytonzyryntwntustoxqzvvpnsxrvswpxntrwnxtrczqqxtdwksqostroutslsrvyyxsqyywqpwwwuvqwulrspywrnbwnxqswxz...

output:

jcmacekjadahjdcajcadkaaamgkmflkkaghllfakdaacimaajdailgcaajaeagjafakaiaabamemcbbjcalglaacaamdkhggjhlbmafcggkeliijfahaaaalagkcadaaiadaamfafalkaaddhakahclhaikiaabaadccdmacjieaaejalgbeabaajhfjacjaeakalkdialiecaiaafdlmdfgeacagfacffdhcahaaaacmhdeadhkbkcghbhcaellhhbkilmaaaadaiaaajgalkhabgaabiahamaamladllbi...

result:

ok 

Test #84:

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

input:

100 500
xyretptvzrvrxtppxwtoqznyquonurrunoyxxxusttovzmhvuwtquvrvqdovpivrswrwxvstvstrqtywtwtktsqnfsspvrxorvtnovwtpprxncrprsuvsqruqznvsbtsnpszznujxzziwcwsrtfspsnuowypvvtqtpxwlnnxnpsirzspqplsrpqvxzxrrwpywnonrtmzqyrprzwvxuwvntsunuznowququzzntwqvonpvtxpntzqznswrzqwzrsjntzypsnfypvvounhxuqoysxoprwqyuovoxov...

output:

flkebccliaedgbhbadhlkhglfhfkaefkmdgjdhkdkfkdmmhekdellmiemdkacikbafmfgjgglihhjcbkgbfkhegcfmgbgjfgkmhgjbmhdjmfmckmfkmibjbcgkgmhbadafehijdjmbaidceiabfjmlfimfehgccgadfmlcdbkkfiebmdjflkfmcfijlidedkcgededmilldmidaaajchaidikekhdahflcjakgmghjfdfdcdeimkijcamdaahjgjkeagaklfilcjecjhglkcejbefafiffcmklifdbfllhba...

result:

ok 

Test #85:

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

input:

500 500
uynxusnuyztownaqulnzvqzstswqszvpsprsvytsvquwqntnusnxnnvhzhwazupswyyyrpvkpqqpqurtzyixswqxxswprtcqzrtxpxoutrsvtyqsxoyzuuttwtzwqiporzwpnurtpuvywzdyvqozlprvxqmyutqrswnvuzazoqzzwqsonxptownoywrqsrzhowotpupprzuttkvouxrxzzuosspwiwsghyxzourxwtsyorrqwwowxstcylzvpnwzrsqrspszyzptptquzwspyuoroossxqxrnrso...

output:

ccgfmibddhcmefadjlcmijidheabcmdikmcdfadhdieadkaiklfbhefhbhdaecjbcjdjglkkgklegfmlcmilhlaeckefelcahklhgggcddlfbilefbkebdcflfdkciffbgbdkcbhkjmjamdjmkbmlfbciemlhhfagifijjahhbhceijmbclimfbajmekcmchfellkalblelcgkhdigbagjdledjcifmghjagdjlkhcbhbjfcgcffjlfcelaejfbjdekdeckjlgkjdbabfgghkdkmfjibcikhbkmedjkfhelj...

result:

ok 

Test #86:

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

input:

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

output:

zabcdefghijklmnopqrstuvwxy

result:

ok 

Test #87:

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

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: 0ms
memory: 3872kb

input:

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

output:

jpktwvfsdmzqzwytrrai

result:

ok 

Test #89:

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

input:

14 100
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb YYBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBYBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
ccccccccccccccccccccccccccccccccccccccccccccccccccddddddddddddddddddddddddddddddddddddddddd...

output:

qzpsftbeneejvokohwtdyvnossumogrsidpfzfhiowhmttznwwwpkadixhjdozumelxftdmkfttxxzamrstlkorkvtnliuyflugm

result:

ok 

Test #90:

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

input:

5 20
fxyezqqsaxwjkmwdbcmz YBBYYYBBBGGBBYBYBYYB
cccccccccxwcczqmmdfe YBBBBBBBBGGBBYYYGYYY
dddddddddxwddezqmfcm BBBBBBGBBGGBBYYYGYYY
eeezeedeexweefeemmqc BBBGBBGGBGGBBYBBGYYY

output:

gffzffdefxwffqmcmggf

result:

ok 

Test #91:

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

input:

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

output:

kkjdmxtkkkkndprswbjl

result:

ok 

Test #92:

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

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: 4096kb

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: 1ms
memory: 4140kb

input:

5 500
qnplnayaqcthgzrscaeffrjqhrnssuhmegcoitgfoztimbhediaxqwrcxvfabdgcszrewoenuesjalgbkfgetfnsucfxnrlvmnxwihsgnhadsgubjaglsxsjmyvofzsxpmintxsvyialuxxelmbirqhofndroyvkfxdntxdmvhboqypmxpewwevxfymbnvrxcsoutvmshadbjdgxswjdcviwlcjemdjnkeyudrhdqwhiqbtosjqfgseyerovvnhilpgodnfnpmznmypkbwyfzjsvobstnynyvdtedh...

output:

xktmpzvyqsriumvxvuttnvmbrkfdneckmkvchnvzwmkkaraahylwzbkkkctkjlvacidaotlsqkjwmjwvovsbkpmygehyxebsmvkkskkslnktziscmvckktokkyxoekqhlexkewcykuzneljodksxpfbhjizsxkzivdvdakwrxecwcdlkkxkxaxfeuoyeaxmrualyeixyhkxkrwgilocfrkakjrsrvdgqsantavckofgaqjivfdqetftfnplsdrfpujsmknjrpycdtggozkgwolineggyjkqxqdnvrajhkwrp...

result:

ok 

Test #95:

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

input:

10 500
jncrnalnwtivhccjacwevrondacihuksbxcfzraslpdykexafbpxtxwdywjdxoxftifjlhsputwfznboqhgahcuxppyxiqfhuzunswiddtfjohaghympeqadrxijhfoouqpacfgkjnsturviadtwybnryakwkdmtmqqhmkmxziauaacvqebrhiuxnxzpnykmzidwrepmwqclynwfammeafyanrizsihsutuaeyxxpqwhisxznckmggtbmjpqwbcxgxvrdtbujqebrhoqekispgdiyqpiwodkixesj...

output:

udppubnyxqyclcgjakfhefyaopwqaeasklahgbhhbppnbpwwcfzssnnmjhtpirniicnmmseykejppompycdsvjuuhpgsmfotebefvrjyocrnrrcwezibdcbbfsluygomkacmvcjrbolouussosolktbcpopfupxlmwowubnupbabyewlaatidpsewftockbblruvgpzotuswlxedkapbnjbpbywfegzswzavgqtoiydzyaewlkbbxblaezioklrmdmgjxaqgjtjuddcqiiawtgxmfdmvjtitcvgozlmeaocm...

result:

ok 

Test #96:

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

input:

22 500
gektomdzdkkeqsukkkjxppgwmeqldbovakxqbvdgarmqqowxvljdsmantqgcjppfcrcfhibtbhaxgaacxavpjzrkttzvvuyvrvainfgzytcowfzmjgsqbfhmqpnnksxfzddpjvunkphzpghkqtjvrtwaokjovhftfxyvzjyarskrjaiotntdyjakoqcfjkjzysvrqkrcenbykrwsacfylkhrwxxbfdmpaoegezxppsertmxynyffrodszzojlbqittjsglekbkytierwmbposhebqjzpvkxgxihrs...

output:

muuipxuvtkmgyroxfqnjjndxahpfovfrzyflnsvgvkoejxecogjnwgyefruvpyofkaatrmtnplpgnfmblyutewednvcmynjvearhynguvftdvyafqbgbzaplhhwdfsglnkdriduqerzymrbtorcyeeculwisspoqcsxchxhrazalucegzbrjfpstrjuusavepgqkdqpevpduczjnwcivndjvkvdrdkcpgxwyqqlvhnqdfkbuhkdriazgpzfghsrcxvfoohjoweqtpqvawreroflfzcizdcwzvqpsyhmatqhy...

result:

ok 

Test #97:

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

input:

80 500
rqbdmywktaijlbpcjblkmjvsztskxgpxgsqxfotxhbypeeeweorhksgtfrkstrhriwiyznnzyfclnmkqkabjqdrkoltoglioupjvfynemwvlqawrasffdukcamirncrdwkqwlxexnobtswlhtitcmemwpwnvlwgqrcloxcsjwnmqbefvytpdfwefpqgrggsztmybvotcwlzihwqtsrnxsoacsnambbidvohgjgqtbxnqoyjxwjwykbosssdipjmjveqsbxryvtuqwkyjsyeipwvzsrecugzregtay...

output:

hvlhtoafdfakdmwzdfeqzimhmphiqrsoucefcybyauxmdsqnygjaksbstemayxxydepymhzcpfvjotbumsjbyuoxssggqfhxcgovglnoduoktsntkwdzehbqkidequkadtyncjrsrnulnwaaeethuqmziovrxmkamkmbarmyblprtrsrtwiiyojxubpuzlniasjdxtefsfgjchoygezzamvdnlauxmgtjrwqmxrimwupyajkrunqvomzqdyqzvfioyqpbidvgjdngcjlqyrresceukckcaajlthlfmlxlopk...

result:

ok 

Test #98:

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

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: 0ms
memory: 3852kb

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:

aurgaanaaa

result:

ok 

Test #100:

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

input:

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

output:

aakaognayskaaaxnawag

result:

ok 

Test #101:

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

input:

315 300
azzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz...

output:

aaaaavavraanajewagadataaarkaaahfaammacpgnxwavaaavaiaaxaaasogabqaixaatoxpsaavaapavceaheaaacqawpabraaaldaaaspanapqaauyaaajgawaaaaagapxduuaalaraaklaqaanjaapaaamaaaacaalaaaajpmaeqarakaeixnyakqaaaaaaaraaraanaaabjpmucaaaadadaapadodaaayuaasaaagqrlobamwaaajadlaaaskaagavqaaynrfaaghaauadaapnkmfcrhsaoaagnmafwf

result:

ok 

Test #102:

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

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: 0ms
memory: 3984kb

input:

7 50
tuqaulrnzyyywybpuoehdugdptglplvlppkhhxxppdrkhxdxgd YYBYYYBYGYYBYBBYYYYYYBBYYYBBYBYBYYYYYYGYBBBYYBBBBB
bkunohhytsznqcntvetgbzflhcujlzhxtvublqxznscjshvzve BYYYYYYYYYYYBYYYYYYBBYBYYBYBBBBYYBGBBBGBYYBBYGBBBB
zpqthwonsjjxcxxuwdgpsglsmpbepexhyvodtbrgpwktudklnz YYBYYYYYYBBYYYBYBYBYGBYYYYBYYBBYYYYYYBBB...

output:

atawynamzdmhnzpdtppsspkpnuhiectoohutvkxlsyixuhmnap

result:

ok 

Test #104:

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

input:

20 500
uabfdcdgyqmxgsgauxvngxyebdglyakjsndkpgbzmtpxubzwzdrypaikyjxzwztpawxmbkjdhywlrrwdwmyjuzpkfvzeitcoovjzzjtfalpetwkahtczbujpaymnaketzdwjdpldpchnxbzajnrafcpsowhmszkllmotxhrtbsyujplndjudidelwuxvoxwngolxctirjebsqncludnyzneyxboxjakvyleabonpsmowvzoaovyttvhnpbesttbyfgvctharxoozjffdfzlzjtbnmiqspqhwthrcf...

output:

bgnuthafzwwdewlimxcnmmifxrpvkixslfwmwarinyudmzvyvvjeotlhfvxoutodfunrzjbqgzjrcoicffinzzobsisapzpdmqwtxlszaskoicdaadijiwciavcmwhtlughcentnystkwoighyswbkhyvxecmizdyshnjzgfyfdtvweavbysgctjteatofbbfkhnpiseykriywivymuinqyniugumulzwpukfbdvahvdklmbpucwonxrpjvatvkgkywcrhbjqjsjrunzayqbhispifazuwvoyqcqxvkiazml...

result:

ok 

Test #105:

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

input:

50 500
mlflhmhmlvhbaykqextwbeswdlqmlhhzmofeicwyhuvyqjqwuumnpmirtgrboepaosruvhipeadhtwuxtqlfshfbaakarzfzenjinaijsidcoqytyytevycrdrwammzsvysailfremryrtlonlpohxhhonhnmqdnuuynwbilcotucdxbphurpzvjjkaujunppehudtrkggggweudqbmvoqtoxvyzspjzajlxpsmynskdzxrwtujidbsbjpbwlizsejugkzavkznxakoshvaxjceniggefvuqdtwbj...

output:

zqjuivauqwaypluotmkyrbtdgpolypzcbvcmmekiymbvumnldxcjtvnuxflkzcftgguvauzqrguzadezzerqlcjmtvxbqixwcphcqoavrbtflouwoshyqjptnvatfjhxbmwgnuhnzvfbsawxhwzdnvwamhekzlaexbcfgdsmkedknzqkknkbbkswwnzjhjxubuokujknmsnzurbbeikxgvhfwixqalxktmhkucbbraggouvferqskviiphzqhtklfgxlcqwjgwepdurknfmqaqpmaqafmnkiiuqwmlirfuyo...

result:

ok 

Test #106:

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

input:

20 500
ayuwtllhqnfdehzldgmmouamniqnnprwlbmoppiokmpxscydolhqqgywjsqlnrsyttoloaoikjvzrxskmwowxtjssclswpoxfefjqqtzxkcxgxtywwdrmkcoyemldljtjvkcirjhcivgcdfijpasmesqpceeoixqaazxtwyggdxtxtksunhwzqvkrttrjwnjxbakjsxdonknqsanteluehvzaytivsfrgpqxoalwbywfuxdyasbshpskglzhdkrsnsxiwypylzmjdtlddtqwvrnomjwhjrerozduc...

output:

riuxkzbahrcyifpmyfoialmweulaigxxcjaefqhfonqmbmukqehejfsqeppqdsnfxsbljkagrvgaqhsgxwviybtzkeqhprflddpybhmfrwemdzegeerlduobpjwkeiivgbwaunjuxnjrjjplksbeujktuhtaqttynrqsmqqeizyhfalqtjagqrxgbyfiuzmcyavwttarttxtzgbtdwlcvvzwrlabgoqlfkehbedwbszkieujjvbwzpuarvuihdartyqhzweszcqklvqadawhyvhjdrthlpfbzycurwrplusy...

result:

ok 

Test #107:

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

input:

10 500
hlowainqwhleemhxgeexvauvsmdxrakudyhvuxjhqreepyfkndruyzuwrfnhaevzdkpfnknymitnqjuvudbwcylkjcmwlwfhavsjmpadfoylhtwuaukxdgwxeqgbwciafzierqihjaxqsbxjbhyiamjwgoupnzlkwoxgfrsclagaevkwfiylpvfboozmplswttjigghixkrlfrpaluroddagokgyayvixdjynfvfawkhenogfymqrvprzqlsnxhzmvyvcvtfftaflzvvxhtuifjoktfpdnvrercle...

output:

ywisulgtzltidlxukzzgvhwcumysywlfdlhdoukpdvsxrmmbcsmzkwvwzhwbqnwnzzkatyxabwuwreugbvunnexgymsmfhlkqsfbhymiousmllbkqpcepydmowavkxldjwqrgcwyitvaxbeoinxvgjrvjcabnengxmamppkarouqqryaeskfgimeeemsnonzeabxitjxnfbwzecvjtmeijkzwplzsferfasqawcigvvykrgkodcdazcigvqetaqexbbmvdewodfgwgmhsuviachylzzhacupfmieclhoklpc...

result:

ok 

Test #108:

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

input:

20 500
iwwobprhmoyngxrwogeznqjfucciihleorxsgxcxjxlsqhoaakvkwnbhfrazxbrtqwoothwtdoprguinirothdiawdjqddwmbnkkbinwjeuwqydrugiccywxayagrkbnsjaoriyrpynldjiglrhikiipcynkxfobdyoxzqmsvthlplvbebkfepbfpttdgspybmjcyidxaxaodjkilaysrrowetbxkcrwgphhmyeplxvnpsxsinbnmfxoulwuyfcnfypmzuvtqxctqnrlgvbrvjxjzvjxvbfoowmsn...

output:

jxqcmnmtydyttcotggjsqhjuvcexcdqmreoravhneukxdpibknzgzavcvuhklqftgtxhupukfgayhlokqpgbhmytlxukhduqrybouxljuufzmwbyuqsmijfpcklxoauditjcelscpmlzybjfeenbcejhmmkbmpdyhohycnpvujomwzdcjywxtulkfpukrzwhdcscturuqvuppavgtkksexjqlzxgfvmfawehduisaxduriplegclsmkymrlvkdgwzivavxfvazfukqolrvpvrhhhkiliscjhfwpenqtjmqfk...

result:

ok 

Test #109:

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

input:

40 500
lennpvhaesjwznotiemclquvfbhxnphpnyhrrijylkxrrstrgmlekwahzzspctybovapkvlepgdspzvxvtclrmtelffwvumcoituylxnqxubwcenuvxvsgxvxuzavuyiimznvigzmrkqoavtwfcybxznhxyfrbxaefvfimfpwuesbqrpwxrunxctvgvapwllecsfrsosbmludeljvximxbsmqsgnzhwisflkihogdbqixxxkwprooumwovxwuxwwpfzsudgtanewxdfxiyegukigcxmjhgojmqnjv...

output:

dhhrjfxtkblovcqrhlrhbmjatktgazpxumqwmpbjurowpzgrpaaptxynxyrvjktjposelvdnrscjcfizumeqsvxxjsrqxkodmoqrsniuswaixjbhypbqqafoivbekmnmqdkdfptpncpoapangpspatvyfzaxywpntgdbioqhetdkatopovkubpkanajuwuenowqfizieldzankdlvsdptkwlmhwxhhbegxyyhyqmmepfyzjurjxkutxlefqtbgfhwxmadskoewljvgvdhgjjgzqibzwuwbhvhkthrqwtnteq...

result:

ok 

Test #110:

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

input:

7 500
nhjurmfptwpsgukjwqqhganfrtbsavaviwabjwanivosdqwewclocqgeawyuyetiaxqocqksukadafixlzcqjkjkfuvwbnzflkcqdixhbbfhnaxeyfjfvcpucfjvplgcrjlqjlozveqmgkbpierghfibktmipvabndpkokrvgvhgikrhqgcnkkwzcldzhamtnsusuxhqsqyrfgvsiegjbnmbtlzlvyiatojxleldtnbfrnxaqaavqdtwsasyxeeqbjfbjuakywcptyayfjgghqxunfdlqlgvazgafv...

output:

grzgcuwkofdzntafvnrmaiyplcfudwudvietruqugpxbvmrifrhmkgnaunxwwplthsydubdcsqzarnkjhptkqiwlglbmksgwsmthinyykzwoekahwhxkuqhsrroroddasnfmvueusxgwfadctaatlcnhbfhklzooezvopwpabgkaxqqchetozugpjvnkusylwzhbtbsflfxpekprsnfqqhjduoxvgitdzfefeatrqesnvlfexcybjyymduxfuaabysmpvemhepvkuexbavsunbpqclsqkgdaftecvxtrkrqv...

result:

ok 

Test #111:

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

input:

50 500
fjvtcvkdhphwksdhxuvuhnienmtontugyffzpbliffkcrjbcizldydjqftrqatumvwjjcoshkhciwxkcpwevqafbwttxwkujdigaimazfudmyvcqesaastwfggmcjsmtcearbrzqynmdkgxgzizlaxhbkohbbotkachpjqkmmsvmkogiqhixbngwksteeiaauktuqciihftqwrdwvqcmyqgpwjtipsnoqnsagzjomnqjtzvsylpdqdpapfxdoodbxvxyqmrvkuillaszpnkcahbvakbktrfuqsats...

output:

xdicnbehfxxyuwsuijwdsskrqucncwfpmdgagzxdhcagzxdzcriolunubfumlfnngsncxgcxpblnbbzfcxiqvytyxyxytolsudojqzjgarwrtdumnjxuhgouvxdwdcbxdohqtyqnjfkzqeqqqxnquymwoxoolkqsodiassnsygsdlpqcrokfvphfjxnbflfbklmbfjedirkehymkgfeggxinutclcgxjwhrhpulevsnqjxnzlgkznmnfqvppjtvlmrnogfxxdttvblpdjslazsvrphnzbylgeyckczpcfqdt...

result:

ok 

Test #112:

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

input:

10 500
hdvfzntztjftzhwhklupivisrzogiwdrvuzwabuysraiqrygyefzzyyqgoqyzstcpariuppstyipwyujymubwtkcmfudnbjvmlmpgzpcvrmttcrmzfhqjfezhilsgunngmtfgnrclefuqlhwryparsnyzjchxgfkbjavwicenzieajerrkkzjqnghwsocvkjosrmnmbjhsrrqocvdhdsbwqyswlqmdmnkavexchlvhrehczyzoawbqrpxfrznuebwokclufvnxdgmyglcjnbtqwvikptktkbiczvu...

output:

fmzemjbivqvckptpvitvcbupgkjuvesuctjahoolnkwufuetvgkrirxdixlokpormnakpoznakqsdfdmvoczdfsvsgibkzxxpxdfwlmdtuewnituuazauxhjlcebptfsbjdalhzpoowgaffkvrfebgwmaqaqdarhrkrnitykludqwklucghyvxktcnazywtpgntgiqquehkczqaxgfptzfbckbamjarxizirlwujilchnmoglpfppeafqifgrvlhdnxaayihreoroabzamlvfyxcdwwhouqsrbkpvhmtvdsv...

result:

ok 

Test #113:

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

input:

50 500
indtujtskbwgmxdvkibvrirswzrvcpiyuyyntxadwsxjixpvgxlliyghubywoqxiloiiebktsgjjfubluyqavdckcutsvuiimgpupytjwcpnoirjqumjbzbkcwlogbmybogrdjhckdepplvunflsveokgbraqorfaozqhjnqwbiigzycaaopcwqvbxxzddipozyzkaynmtxssdoxkljivtotbsrbejeagduwyddmdcxermruoiqxnvddybpxhwhigealmtnzbnfwmvnrfaqptoeazypbqnmhhsmbk...

output:

digddnqijzteytjeirnkunmrcuyoyejgsgcdvsrpbxzgaifskzfdpxpojfqtpnrnkahhnuirkdqhtqxytuveaixanxorhsxeudzljavbmxbvpomefmrwkxcmmgsvcspbtdcotkjaysadjbanrveunvjfwxnydtyjcdpsndfnrisnkjbhdkfbrsdwmnlvtgallcbwutnzxfzmjarlpnayofpasuvcpnzyhlgrzlwxxhgcpubimduwicggumlieoqkdlwfuuxcoimgtllbxlvovbikbdwquxvjnapxqqgcconl...

result:

ok 

Test #114:

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

input:

20 500
slcocdoeuswpovhxnefsxdchgfnwlduobfdajvwtydpyssopemfjmxxhybwyccommiyistixveoywghtfxdmdturqyumojdxdsxbhqmscboezlfgmrlwccygpbltparhkieqratosgogmxykbihmrryxqgqfygytxttksfhknglfbhejqjzitxzsbzirrtzffaigozubkirbzbnnmihyybpqsravofyatvxuykzjnkkygmtfexebdhhcitnenvitiiegtlwedrupvhbgwsdpprkjdhubvmkvxyusu...

output:

qduawwyggxfzlatwiyhnjgcoxhjrkeeysgybaexcthzlgiizncywupiubkxyldilrpyqnrtzhjtncupjepoxmrldrkzfpvukanqjuuiplkwczukaynhlhtrpzbubcgylerzbbhtajhypfmsmrpfnddzjkpsjalwzcxbebikftvalmblyprazzoecxtjixopqutxzomerdtzuudacjrtdfnqegklokbemxypqvwqkoylgjciuqphotjsijqaonxesishzfblubdytkpaozjbbfwsirxukhnuvjsrgbxdgubfx...

result:

ok 

Test #115:

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

input:

10 500
roqwtjzrjuwkjwdsrncguryxigdlozkssldrhkipfguyoldfyrosbquckzszvbfjkbhtvatcgdbnkrgszdlwlgnqvlyyrztbdpnvtvqyedmoevnpvoycipvhgglyxhsojpyjjquksdkqlwsglcisppapjlrvowqpzxgzfurbiuwjorofabhyvolrcdarwpshlkvigmnwucgffluinlyqblzuqbziqthcrqgtkyxphdsmbdezmiydqrumajjwofoqsgkghsjjarlkjgqrfigsadcyjdvhxigntkfwt...

output:

grdgmtmppyqbvtgbwbijddopdhltzsnhwmgiplfepjsxsibsrckpxnqxxmnfkptnetuhjkjubhnvswrpwnpzehltojmagpqrxxwxnhleoawpgwjoyztrcyyeezbdbgcnchmsssflvezsyyakhzofynjwnjgrlzuusrmjvacxawxumhqbnswgdwwlyfjhgfpphdacswqumnfxbpxjrytxlfeqhltjdfuaubmlobjuauhxcfkosfhscceuyreshrjtyncmrwsuoseaklwppzfqfvqcfzwasynyshkzxqqbdtoj...

result:

ok 

Test #116:

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

input:

84 372
cghxpccqxmpjhtjdglpdovwbzyqusjaaaczvnuxwducxekfdxytfvidgytsrnsqttxtrbkxlfpiioewbjuhchzmaifgmgozzszkpzehdtrbuakovkrqcsufpylbvidlaysqeaphobqoswwlgvfqlcwmxalphjpjghaphienececljwcyzgwerjpblvsjpyglbhcrncsyutwoyiuswxfwisljgbkffxgcrtlbhcsikvelbqjpaztaasiszygtchgirkazcpgfcfxplcefbpgofwjacaubweqfkmrbf...

output:

hqyecyaaesovzbstegaxbvmsopqajgogzvkmedykxzfulzfmpdzunbukhzvipcuxejqnjgnjyxtmxgnrmoemicwazqxvxrxpvadnbdkyhodesgotytdhgonnifetqoeaivzprxzmicgazvmxcxxdefbxiwtwsdigpjojdlnmixfikifxldzbilkffuetlhqqsextndlxfnahwbszpudqyrfgnhzdftjxuienlthsjvbgqucbftynpnlzpfxmhvtifavfdchtcfwefmepysaaljuyqjuxiwzoskitkgbiyfon...

result:

ok 

Test #117:

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

input:

40 500
bngwwqulygjlplyrkicksgvqqycoamxfcoydohxhytmdmskpyjwuhziugselpxqspsbzoecnmtcgkyrbphotgkvlalmmgzpnenyzurybwxlpllgnrvxgykkqqmqmmbansntkcgmbuovmzpzfinlzwofqungisfrttnxsoqulqmwdyurgvuuppkbgczyyegxmrdufnowmahnflulqmtkhpjjrmawolznbmzfcesnawzxiqhaekaphgdhxfpczmdjmogxtezqhvnxyoaoaapgctcprzcegjajvmplbf...

output:

aeiirngkyfdxaejcrspxhhafdhimrnwrfsbjrdjucxetjrxwjhvtnjljffldydsklaqftfbfnbkruehhpdttelmkkpembpdnabtaiwpztihdyztfzwkzqfvcvqwkxstckjdzdoehfuikinsritocpunknjgpobayqexeuoudebqujcxdlqtedbdhlcxbqqdfrthbdzvydnhkdtibgaycvbdquhsbfdfwqgoecpivhokdbmxbcunxleqrqtlxemrzwqnwekjeiqmujjssossfelrtvcricmvkpohtgifpxwbw...

result:

ok 

Test #118:

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

input:

10 500
golmkejjbmsldxyvlvmbmgoaivglyqadcjhtedubrsjwtdkliqsltksdijsfeyvuttgvbcoqcmhcdjwnbatcprrrpmmnnqgamphfsbsesxqhwpnuxhcxqxeawyptrprmloahypvaivqyzugftstanjrxbbudyrvbkrvmhfqjatvypaevjlgxchmlgxtymnndzwosslntpihighkkspkuspqhxduqoiqlirubexhhpifeiogxqggfdvavhequdgjskvycqehyqgdcmgsuxbksdhhvlpqhhuumviqhu...

output:

nnieavoismljyzjwnesnmmdeovjyhogclivwlzeqtriyjgaujuszkflytvlbxwgkdiqrrfxmbuwdxjovomrhxppzdicfmnlgmdajzxnhameqmzzfiyespixozpnvejpcdbdlqdkybqplsjhlzmywpqafjswnrbcwzbglrjjorsaurnonyeefuhixbolccghwvgfvtdtwlimqkxnizepkilhstfbhfzjhirmeeczybtgmphkcjrkuusijxfpkpyfqvogsknhfnmxwkbnxqumjqnvgosaqgrzdgkpktanvcwia...

result:

ok 

Test #119:

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

input:

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

output:

nraaaaikaaakaakkalan

result:

ok 

Test #120:

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

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: 3924kb

input:

38 99
lemacjdnpybypkogwdtvhlhmlvzbhkbjaztriqyynvsftexmhjzzxyjthuaeozdpdxpjhtaqtqnddedkjlltttkklenffpfgpjl YYYYYYYYYYYYYYYYYYYYYYYYBYYYBYYYBYYYYYYBYYYYYYYYBGYYYBYBBYBYYYBBBYBYBBBYBGBBBYBYYBBBBBYBBYBBBBBYBYB
ffoiuvnagcedozbnvdgcwehekesyjmonuaviekpeeetvihyvwtnvwucerddzlzdiiltbqtyfyfquaifdjdyadkytyookgn...

output:

jxuzvsbozlpjjcgmrqicxemjudvxenuwfqggrkxwhieectrujjtokrhzzoxuzyrsamgnqbeecqxmyzczdqjkkvzeqjpblgmisty

result:

ok 

Test #122:

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

input:

10 500
avcyabyfbhldqyquiroxejrovopyxbgfslzbrmbbbhvxiozmwggujoagvafzguvgzztetufaehlozosicgjrhqnboxoqzxnwlinkwjtfcmstnhsxpbusuvudgepfwkpuenqjvmpuljzrewqmcldwmglpqfcezkmfueprdnceqlkeobrubhwmugcvkjvimcvqtdhgtcqxzldhntduytagztfheqmlkrvkfllddoemookesremmaxxavxeescpkijpneujkxokegzvfjtpvtwfiosefakjcziiczgco...

output:

dqecqktnsqwryoezwtntdkhcqnucubycarkvhnahccvzynhrdktclvnaqdfnkxwsmtgnvixxgjxxlssiwfxarmaieogllplajyyxvvetawxjizzkzfycolbogqzhmxgfnmctjihjtgjaphjbxpgswebukjyofcmpaczmctcqvodrchjhadftmiifcpgthkxexvkmllvgpdwwtwuklpwrwwqugpkhcaqiiyvdnsbxtfmxhwasdtnsfmbngbyuvpwedbaquivcbtjdemticqzuqfwfmpznhztilwwbxhswrzht...

result:

ok 

Test #123:

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

input:

20 500
rhqrqfrgwyrzxmjqbfwzxjvlvykkreypsulclulaqxnwwnbongeepchnwgrojedulbplkkwfbxrxbkwtuztgxcfucyirctbhqmfyiicasmzpgtyqucsahojdjewbbxkaoupnzejlvgognwxxjgvtrnctdbblbhovfeellhuglseearomgbdtlnjmhnefntguonarkwoylusekasgztbqelwycvioxwgrmjxnvcxkdbrzfkldjzotbnzuvhyxyesfvaucxynavbkyaisfryutwqeginaehujgakoyp...

output:

cohhuwosickifqsgfrrpjurnjaijyvrltqxxrxlhuszuzqbwlhcwuznynewhxxjwhkbceayrhdvvmacqhaxgbczvhbqfnfichpbeioeqjrokmglawdueyrdjrreulxbvyykunmybpuouueibzzjsatcbdbpjqyfqtojnpprsixdeowibkjqvqwhifopzdtreimannjydyscoxnjpwgqbxckjclhfjzvisiqlxuyfrgqoslmwsovkaxizqyvbvwwcwbaflhvdtuxxiyckccvrwolaccigqdxcodofbkxtbzhz...

result:

ok 

Test #124:

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

input:

38 99
lcnqdbnunbdbzudjlrywtorribfyxduvteracrxyunifgbivvkzxefslommakqzpqkoipbfckyhghwtjafiwnybobniqqrcybxi YYYYYGYYYYYYYYBYYYYYYYYBYYYYYBYYYYBYYBYBBYYYYYYYBYYYBYYYYYYYYYYYYYBYGYYBYBYYYYBYYYYYBBBBBBBBBBBBBYB
zvnepeuvrwzqrkmgoylqikrcnudzlzehdcyopuqytavurqzqygnpszcnykpfrsjdtlavrlgkkvswqkqrccffxugrcifdqo...

output:

zubrgbihhnjnuziavazugaylsszcgisswkcryqhljpljhkxzmftntxzwfvimblsnkbqeppwdzdlskbxofsxllhhmiqbmffjmomz

result:

ok 

Test #125:

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

input:

40 500
nociyvndtnjzbwfnkoirbeayjufjxljvsglmgbzyqddrlttohklanglgkepoezadibbyjpptxbsbeahwmdssetnwxyifixbcftwpekfiiormtpmyufikfguubzkngohpnroobefeanihvowxgdktkxpkyacxawaafupqcerckoyntlmvgdiehqgdmhftmlorsawglxdvtinmzdluinsnyeywxnvpossghmmnskkafswbeywoomhbidilmfzfjabgormdohxxlqewowhsjddlvltadnetadbynlguo...

output:

oaoungefdfzvrsirojhrvutyzhsadivfmbyqmozqcnsljyfzgqrjqaistuoebeztwfetxsupgpllqxpjxerwbkwelgrjxtssonrncjtlrintqsxcirjqjjfrfxnfydhaalgizsgdequhejmdxlktavuqksdoeoaxaqfnilvcjjlfkjlugzaozcyrnnjcejwlsultilcoamprwgegdfaycikwnupgshmuoemrfqlewrtrfohtzgqrwfgpyvkxesnelqlugjjtcfyhrzkzhramojdhtlzdjpzvjkgderlbljhl...

result:

ok 

Test #126:

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

input:

7 500
nngsllnxkpwnspcftnkpuhpuqcmirgfpmtejqrbhhdzylwumotzkqwyvmijqbklpgqewnldqkvgzbxcdhmkqtwsiifslmnpfqqgdotjptxpofzkspqsmegmgmsdyxndckfpdofzmggpiwgrrwhrciavopdwyqxzxthudmqheezbdqihpmkgezeklynghjlufystcgnujxdvrrlgiogbfudpahzltwlnmkmkcqmqmegpuhlgswhuelsoyomaqzgwwxvdkiwfokyetrkjahataworndgcvtqeoznxewh...

output:

hswabubetxcphmsnljzqpnkauqfapojgtxvzvtxzmujmqynjuxolgujuatueddbskpnstqstjszogergpsvoiqfafazgxzyyntuhjcyivazuriovecqwzbuolbpvddlkhhmtisiunknfbykpxzpiudqefwifmhrpwqfhfrspariimuahsslhifdtqwlqihsxafdqctxdbyfkgmqggbjpmtlzgudiikiqjinvvqbliknmgaezuwcfuvnppchaqtixbylnrbvwdkgcyuppkuyxrefbnbdxoyphoakfgbznrpvj...

result:

ok 

Test #127:

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

input:

50 500
uikgvhvrmqsubmwdwhxcmtcpocrpxijhuvsniexaseairmkcbeklcgefagvtljfgiegaocuyuiqwxlxdpxurnojyioqamgwofiwfcmmjgyvigfvcjozervzfmkitsoakpqkjepbkpifrcuydaadlnyzuzqcivynubiadaagsmiahneoivnrxwyebomunjamdlnnbumabxevqugcbfgbqgduhgvjxtreauohsxzpqvglrttolbwlzpgbcqwgocnurrqkpximajmscldqajgqtvdmatypajhmynzcfj...

output:

rqfisodytwupcbcrprpqgrrlvbuzzliqkkumgidpgvewgqosjfbxxsfrzxbyhxpmoisesbivqdxpoxpvukbaxazdqjzokcuqtnurleizctjxtogmozkrlackklsieinnvpjiovlfyvckpgcyzixhsxeahttzkhwptjjnzmoeblwbivjgtpunxobvehiwrzgtymckzljmemkdkrexylgzttquqwgsxjnrbwjfypnerqkmkcbjfivbemfydvimuhsznmpddxssokugbcxilufoqaanpdxsionkdblmezeskqrj...

result:

ok 

Test #128:

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

input:

20 500
idgnkmrnbkqgpmdkbfdszsrpghevtsnhgwolxsqqwathzcljlwpcegkceborovpjblydpugpdzmprpdwvhzoxmmchtdxrycqxtlqoankpbdsbkkwdhxmfxaiueqaglafodvimcpglygwxtyckrxkuufsvjjsbfsbbxesiuyqnukafrxdtflkkvnchyfayxvgvwvitxgljtcwnuwmmoloqlbsbhdqxuocnycrnprpkdvuboxdffqyyelptzdyegpoywwkplvejokbueqjyzpwmpozhiuyondtgkjea...

output:

nxamjhifoxdkhmxeedhybbixxanuxrhbaoqooeanieiwlujtojqruhjjzutfdikaznfcwzuyxwcvndtlriljcymxfkfcuqeykyhiaidlfvjfwfkjrkmdlivfhygrufxvwnarliiizxmzewsjukfiypottlizuanpgqygyfzoozfouynlvldufbtmjoohgoovtfteohhwyipjadaxqdoeiadwlgilgyluwozgvtybmjasuwejqvamqmwnisvutubjnamyphhmusrvxfagzzmgcvywshqrcpnhblpniqqcehpe...

result:

ok 

Test #129:

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

input:

40 500
snfrdqgnvyyaraqccmotrtokkfmalyybgpwgulvlyxckrcxcldtepcsadrgnmctvegynxumxxilbssrbpamhbiuqiqlywakejtvwikqspifcememdyupghrwclrlpvulxamihrmengmrcgbweadneunrpgnkulxwnxbcmxquvgmipebjnwojpfxnsbhvyctavdqcgrgwjlkjensloiqioeijlwsscfdgtktugkpxngprzvebltcjijglgaifurynycshpoocpkvtdbwsfxcuszwehszqobvmqwxfm...

output:

udxrdmtnzkknqatybgekqrtegwwyaittsffweuxnulzdfbddgpsdqjilqkvlsjqalbucyzlpotfndbtbiqohxbannzyqbrbiwdzgcticjosubjwkoirfgzrealgjktwoyzckjbikgfrsetdlzjrxirzyydhehyuzszfgcfziryjckoznwjgqoblevesxxfcalzhtchwnydolhllpqfllyosuyavnpupsplfdakkrfxzzsrccrsnuheengfnqjztawkmabwrklqteufdgtjtlfpqimshsbkpngijmnfwvexdz...

result:

ok 

Test #130:

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

input:

8 500
xiqiycbimxqtfqjpslneyqplebchzxulzwjrgtegxuqgrqhvpnpngcjucxelkmjrizcvnrjqtvddxlpgltxwckqmpkpoadbippkbncrqfdfofscnfgpvyqgrbcdadfufemkbkpcdjmhyfokuxquypgtejulbyglpnrbdydywxfcupytfqnviupqgazwtyjbjxwfleheseyheobucdjqcdrefkqmslnrbjjmqerchombsqkofjgsnlwubvzvgedxljfjccwjrrctghbfuwwomjzzpkyxmcxkfxddgrf...

output:

yvmjcaiewffetnrzdgwbrukhyubnolawdoccmhzpcrwraovyexhpqnubjunigbipoeoqtkbldpbikvlapiikklskflvvsgpylcpesgqdbbchwbtsieffokyeywxiiilotwrluszlouawiniwqswqwvviwabnexincgdqvtxlgarxoifplfebwjnjkxzganccffhhbxfgczqnczimjalpgkdnusyjzyqrghawphtinsrggvpymskpuxlrrjsznvcqvtuekavunirrcjmtiukrufydliegritivgriytqwctpv...

result:

ok 

Test #131:

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

input:

50 500
nxzrlyklxqvmvzvobwxktnrdwljurhvzllrjmfjkvwgcbkirbtiwylejxwfihpzvizdwvsgjaaiqkwriqildaoojglbljohibjkufsaagaxyjhzjfofnxmyhkwmlwbhzmydabjtgagwhedfhaypvajepofyhfbdouxwuhnbgztthctbqjqasonbglubknmeknsnbpctlwccyhiyepytqbcaftfrhwfzxocnndardvufksspvgfmsvcurqyeovcofkswrgwanlsgbllolrlsyweanwprleynusyizj...

output:

urxvhrcpykpcdswsiuuhkvplejgvpksqutfvoessasrwyubyrodftcpiprifcftawgeakuuwdwgsbeidcxdvlfkfayjdvaekmlungjgiludlqyccctomacfmssdozhkjuwncfvvjlhprxfplktvniqccwyqgtgfmtnkhydqcwlmyyldjiosmatymhoezdrcpilciojwgbdtuqvuidxsmaaeqflukjldwgebwwfkunkhxrlteeergitrbbptzsvtiimlvydtpzmdrkxzxuipqshuinefgnmhlfceokjelygtx...

result:

ok 

Test #132:

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

input:

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

output:

aafaaysaafnpasaadcat

result:

ok 

Test #133:

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

input:

38 99
qeyynemrcyzwzvuoybvrvzmeehgkxdjsklfkrlthdrgtnwlmgpqrefjgmdwxoifalobzyiffgrdqlwwmvxatxvlhbhqsfnjqpmt YYYYYBYYYYYYGYYYYYYYYYYBBYYYYYYYYYBYYYYYBYYYYYYYBYYYBBYBBBBYYYBYYYYBBYBBBYGYBBBBYBYYBBBYYYYYBYYYYBB
kfjamtsoagrrvlrqjnovogtiwsjwauxmqjmklnumwcarztrhzmhekliwilsnnuhbyewgqjzksoybnqnnggodjblpszvkse...

output:

gqnzxcpkiktlzjbrosxvyrtryaomiypruclqbaauepaokpvhyqbhqqzackprvhhngtsuwhcqccdcjmphhvlomrhwljsapdapncb

result:

ok 

Test #134:

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

input:

20 500
nixynynsrobetbjrzejtjkegkaogsaillemsrxikuuedvhrzjovgsfhkiwjzdstergysibyqpvyrwrrcjddsxlyqdlfwvjabmwanmxzkpihmmjxdutsingdorqgszclfjvcpzzjlemkpngmhrwchrycncoefavqmwcqlgyjzxtskapmxwnbdwnctpjsiabbaaurcjvefbpjouneqgejcpsnaahtylxsahmktvhvfzugxkulocepedrphwsujxowmnpdmbbqjulslqijltopnphxllsbrsbwdhyszd...

output:

pnqrwexbhaffigdnenxndvyorlejtdkwzjbwsybdjgnocoqjiyswnmvqttroflmsdppurqpnaqvrclaqkdpvqhujjbjlvpbbrgxrekhycdgudpkevomkoxivajarrjyfoyflhxrvrlxwcanpfwqixdnijpnrrgntkxnkhhmixqafrqtbgiltaaixnuyquxyhodguwbdsjifvnkcpbjsldjkvtacumddotmsrzmlbvslmuumlqyglieopxvowpttpvbfmcffshthzvyyhvvhkzlropsdhqyfigveteyldiisq...

result:

ok 

Test #135:

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

input:

40 500
qvxlguccwpbtfosxdxjcaslntxgmfxzsantgvrtmcyfwuqgucbdychvadnxfreaiklbmgmadqxpsrwocowtjrhjxyovenmbfmgtuyevakqjiuthlzixijiujvgnpelovuzakwbkmcoivedpzaytfbvcrzrexbiqyeqcprollhrjaqwjxqmiravpxfyifmhwbnfysqbdirmozlhellydconrbxfvunxuplujacyuzkxqpedznvprcimjrxpoilkspgtcceatsormsqnbyhndlgqwaytwsxxfttafsc...

output:

mtarcslgahhndcklhwfngvscqpkmezguvzqougoeruobiuboieyortrrztumzmaeslnwzscpoylrwkihbirnahmkvroahzayrrhauydelyvmeofsqndqnxostukvbomedbvlkcbmrdeoltgsbyirzbdaetikwvtakcidggkyqdbkrrsxzxfpeoyzugtsxetxvzevbxqqzdibbwwvkdiicnpfmlzcpoxxbfmtlqhaesuqmjbrdnmxjnlgjrdospukxwcogbjmrvjadukeputebrfygykjbfnjqeoyqixekinc...

result:

ok 

Test #136:

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

input:

50 500
lwgcolotodckvwmbefzrabvbqvekrdkwbovegjovpdlhpzdgeqgplvajpdisoxywdlssiaotqlvqdnndntdofaikqyekozxqjpuvwendiexjwqidxlikzcewckbjxdsnwdwfitpdnvwjnrglnhaazibzoizmfkkajvvvbpvcwdpsnhzepxrkcvnwoyyqnvzwqghqwhwtiarsouxqyqigucxxlxsmvxvmyaujclujbrxuyojcwxqgzszgdnuopfkjfnewiwgopkjefficwslltdgsbrditextdwxox...

output:

hpbbtonxmoomcxqdhhwkcvuyntgzccijlmcbhchfzzhglkhhvmifhgikuypnggugkzdhvflnwgkhkrlkcvlyxtriumwzfvmlenlrxacgurewgwjkgxjfrlfaobqujfayowvxayhwvicvqxfiftkobcyblnpxrtchuxookhmmsanelefzfdeifcwdbvwkhgkfbjnrognznrvyleaphhcuoxhgsorbbogzatlernjpfhaoafvrjblauaczsbdioexajjbyjotnlywtyhzgtlqcbxlpdfurkneyllnanrtofuqr...

result:

ok 

Test #137:

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

input:

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

output:

aajarwhrrraapxamacra

result:

ok 

Test #138:

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

input:

38 99
pdcxnpchuhnjkesyrhzhbvigmnzsclduhpzbafsdjoqnvqufwccluyijavnbcvwzjmbslitkeoyyusmydcjgupsjugxcnvphnik YYYYYYYYBYYYYYYYYYYBYYYYYBBYYYYBBGBYYYYYYYYBYYBYYBBYBYYBYBBYBBYBBYYYYBYBYYYYBYYYBBBYBYBBBYYBBBBBBBB
aktlvhefxyiyoqbfykdplzvpkqltlcmuoptxhixpddzrwgqvphxngbjhvwojcxztsgmvogdqqphprbqgphbskoqtxcpdbp...

output:

mrsemxxahaymnagshjnrqlotwvbyyxtyypqagslvoypofmdxkgyqfetpbzwwoayyaldcpbytchwfrecsfotfqrbdiywjbibtrse

result:

ok 

Test #139:

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

input:

40 500
uzjmgymcylmysxcrrymwcnofpflbhruopcojnvkcmouoxfwhojapwtnnqefehbrbdxpvqjgmyspqeyybofbetcrfhpaqnljlnrgopvihrreqlxhasxouvgeapflvmxgjyagoxavhhwckjzzjxzdksqmuwizptrfodwvulsqxutedqazctagynmjbuwudnzmrmswbaacywrnwtyebgkbxqpbcdxcszswfpthkfdmzdamuztaigxctsrlsigjmzwsbbeybmymootmivkzmgxjrwkonyiataoefsfmvv...

output:

vhnezeyfkunnaheloqmqlguthefhazzylecrprxrlclvgtbeliscphchuzeffhgxvupfhvwepvpvvhjqmwzbtdhopawmxqdgwinftbmpwqaegcjpsvgqyjnbsxcrwyzieksrjmkxxhxnjblgkikueevopgmyutecaigistjmgyurauoeiksvoprbjenxjuvxnlzguwncpkafefdqtvfpcvacsgdvbwrdwppolhealzlzpbgdxwtvxivhwrximoqqxcbobpuyniviksrbzsfevxuzaneorsuatrasvvekboti...

result:

ok 

Test #140:

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

input:

10 500
xsimzmrnrwkrhlqcudoxlgjohikinljmrhetqfzucreypgkxangkacnjgvzxlnqivnukorergxzmidkdjvluajuppwnlijnfzzkhawhhlcisvrcscjsdwsarerilfycpsrbgrplapfsrmcxrqhrztqgrslrbcxjcwuahohnhfbzpfnfilxihrkssyjtorcgorequvyokoteqsargqttlanlpaeivsrwztwymwnjmknihvrarnxhixaxbxsxhlfxcdkbfnyaqtactwzxfbtcmwdvdlcwyzfcmtljpt...

output:

rkurbrczgdrcsnyofybbyulydluotcxsdmvowrsitxhilzubyfmeiutwofiukofwigxrgmjyuetygmwzngdbvmtvniuesxuvjblrydekponaqqjologialtqpcezwhhfjetiajvotrdevtatkukixzcgddpzxiuypvgqyjgnprugwxglwdqoduyygkopalupaagzakzwrfsbhvhvswibtxaxkfzqvqmqmjgxhqlptcxmgokdpurrqefazhlxddmsjwwzwbbzstwiogtaodspkjkfsdqoealzmkxwctspadbz...

result:

ok 

Test #141:

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

input:

13 78
atxrzzdogxijznphsjlluqlrkgskvyztadtywogwecslmxfvqnfwfrdwhplvwhphcldrxatunvxrob YYYYYYYYYBYYBYYYYYYYYYYYYYYYYYBYYYYYYYBYGYBYYBYYYYYBYGYBBYBYBBYBBGBYBYBYYYBGYY
bybporjtlvekycuvihdibibipzsqbwcsqzudxvyebzclyhkzqrqiharctxhbkmliuywlamwpdxosqp YYYYYYYGYYYYYYYYYYYYYBYBGYYYBYBYYYYYYYYYBBBYBBYBYYYBBYYBY...

output:

evacvostrhffrfkxbypgqluzpouanfwrdvqqptbyenbdqjlwklrzjrgaadsbtobyilaanvijlmkrpp

result:

ok 

Test #142:

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

input:

84 372
qipcbroojpntrdpkaexvlxwjoiyovtvihmxautephjvzpdjvjbqqfsuhsutaqouxxnehofrvqmjcutqifyirgkvmhzuacqwgodopnrtoaufvufswewrvqreefwdwdnbrcuuuorjebvsfruunekopkysnwqioiqmithyfszubxeytclafgnhciwajyuuxzlorqepcodfcwsngahmaplzbisdhgqvrpgogvjkngnbkmrdeahyezspwzlovgaxsqkzbhfbdyldilojyhugijuxjifhgspdqpxpbpjygz...

output:

gmskdfngrsqdewaxsnjswnfsilxseqdhvwzxuuvqsrewxhpumpthhlczvlmahfwsinvelcyyonszsrsbcesgacmakysinpyqeopitreofdawhtqnkhkkgkguekxmhwysqxaemnakvhzhvmcnmygyyewqxxaijysrxlpeueajmlmzjxxxevyldzrcgrmrpkwydymgdbguywfwsqnlpezpqexcaldmusoerkwwvdbudsamipudrspmpdgpvwvdejntfzwmgwjhsfppnrfhzlixwralsnkoszkpczrrdyigwnwr...

result:

ok 

Test #143:

score: 0
Accepted
time: 21ms
memory: 3988kb

input:

40 500
qdeezcmiwkdfctpgdwdffklbrqeluimxulivoceryupjudrqekkbtjogsxgzsjqhbvktutpwpxzaywigylbssvoasicrtocmpdsjhuvxxmkmouviukufiqdtcyghmevuqrcfdxbavmkwhtleuhsbecvejzuulmwqodlgklwcyaoczmhhtihfwwrjsjzivodqeyhvoobzbjkwouxxtrjfbpprikonyscerskpyllvnodnxscxcqoajuqrodqjlaeptbjcfmbjqlfkaczlvjhvnqaiwkjhfxqlczlyw...

output:

hvyaimtfhwagtucqpbyhwknfueloquixuybilawxsvzduxjighumudrkevlgvgebauzghqnnpcotbhwjkdfxsphrkhftwromcehwjkmhqlscjydptpsslxxdnbvndppxtejybakwbsrnykwhtvdecchcmmzuqqwgbuyioqjfxvtxivuutuxiwouqfsmzadfhkcvepvvnyfvyeetcaebqcyzhcbxsnlldgpvibubkzxhiixvpxlrixrksjnkgagguzmtgwfqznntikucuizuexznjnqpqshylosvtkywcshdo...

result:

ok 

Test #144:

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

input:

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

output:

wkyaaqmqaraauyvmraaj

result:

ok 

Test #145:

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

input:

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

output:

fshawwoasogpawalcjfw

result:

ok 

Test #146:

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

input:

315 300
azzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz...

output:

afxqaqaagolalapaaaayaolaqaaravaqanggajaaaaelqadnjqbaaawaahacdanaapaeaoanwabaaaaaaopasapcsakaauvaaaraaaadaaaaxakhaaqaaqxapsqaaaaatdawaaaajfyaaahgaaaaaaecbsmrsptuauaaajaaqakaayyvaaaahaaaxfxaabaagradapuaadanpaaaaqeagswcfqwdiaajlatgaamoakacdfhmamfaangwqqaaocxappubjaagmsjsfwvnuaaadupaaaesfavalnigpfaamtck

result:

ok 

Test #147:

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

input:

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

output:

eragaosayaarlayppgja

result:

ok 

Test #148:

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

input:

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

output:

wauarfalnafaantapgva

result:

ok 

Test #149:

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

input:

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

output:

mccaamqadlwosqadaaja

result:

ok 

Test #150:

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

input:

38 99
amimobtouampmyfcupgtlsdjbtftablgthpaamgzurxxpzhqmahepdflzsnsiwgepjejgzvlbndsilxrhegxmxofimocmhunwvn YYYGYYYYYYBYBYYYYYYYYYYYYYYYYGYYYYYYBBYYYYYYBYYYBBBYBYBBYYYBYYYYBYYYYYYBBYYBBBGYBYYYBBYBBBYYBBYYYYB
gyzmrybfmjlbxvzqqdbekapnixntkelxammnjmqzppfyfiarfhjrfvzsfsdfwmxyhnaeqktbysrtzteeutpvldzyuldvlq...

output:

ozzmbjrwthdfoglvdgyontgctxcetbbepvguvadapjtccuewocsirztzmxenjfuarscorrcaclzjvjxtxgivvqtyrwenedhwgpu

result:

ok 

Test #151:

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

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:

agultamapa

result:

ok 

Test #152:

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

input:

315 300
azzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz...

output:

aaljfauaaoaauaathadpajapeaqgacauaaaaaaijhksvatqauoauaamkaaaodcawyaaaaaanomgawabmajaraaemaaallaaaaakabaauajpiammnayrafdcaataxgkaeuegxaaxaewaaanaakkaiaaanaaaaayaujaajraspklasawhajgovaaotikadxauatuadacdaiafryasandxiwauaxanaxtaaaawlaqcgnaetauaxaaealaadtaeuayaveaaasdjaaubaaoaahakxlaqacaaaamvaaenawsoaiaaa

result:

ok 

Test #153:

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

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: 3908kb

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:

aaanraacve

result:

ok 

Test #155:

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

input:

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

output:

daasamkaiaasxaaiarka

result:

ok 

Test #156:

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

input:

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

output:

sopoagsaaaanaayaaahf

result:

ok 

Test #157:

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

input:

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

output:

nfebtaaaaxooasapnpvb

result:

ok 

Test #158:

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

input:

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

output:

aamokaarkxadaaklydsf

result:

ok 

Test #159:

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

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:

aadhrqvuaa

result:

ok 

Test #160:

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

input:

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

output:

dddnwmiajdhddlevkfgddddoytcbxuqsrdp

result:

ok 

Test #161:

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

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: -100
Time Limit Exceeded

input:

27 50
iiiiiiiiriiiiiirirrirriiiiiiriiiriiiiiiiriiiiiirii BBBBBBBBYBBBBBBYBYYBYYBBBBBBYBBBYBBBBBBBYBBBBBBYBB
iiiiiiiixiiiiiixixxixxiiiiiixiiixiiiiiiixiiiiiixii BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
iiiiiiiifiiiiiififfiffiiiiiifiiifiiiiiiifiiiiiifii BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...

output:


result: