QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#389929#6507. Recover the StringzhaohaikunAC ✓1018ms200108kbC++204.3kb2024-04-14 21:16:502024-04-14 21:16:50

Judging History

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

  • [2024-04-14 21:16:50]
  • 评测
  • 测评结果:AC
  • 用时:1018ms
  • 内存:200108kb
  • [2024-04-14 21:16:50]
  • 提交

answer

#include <bits/stdc++.h>
#define debug cerr << "\033[33m[" << __LINE__ << "]\033[0m "
#define SZ(x) (int) x.size() - 1
#define all(x) x.begin(), x.end()
#define ms(x, y) memset(x, y, sizeof x)
#define F(i, x, y) for (int i = (x); i <= (y); i++)
#define DF(i, x, y) for (int i = (x); i >= (y); i--)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
template <typename T> T& chkmax(T &x, T y) {return x = max(x, y);}
template <typename T> T& chkmin(T &x, T y) {return x = min(x, y);}
template <typename T> T& read(T &x) {
	x = 0; int f = 1; char c = getchar();
	for (; !isdigit(c); c = getchar()) if (c == '-') f = -f;
	for (; isdigit(c); c = getchar()) x = (x << 1) + (x << 3) + (c ^ 48);
	return x *= f;
}
const int N = 2e6 + 10;
int n, m, deg[N], len[N], fa[N], g[N], fv[N];
int val[N];
vector <int> v[N], vv[N], s[N], r[N], l[N];
bool vis[N];
int find(int x) {return x == fa[x] ? x : fa[x] = find(fa[x]);}
void merge(int x, int y) {
	x = find(x), y = find(y);
	if (x == y) return;
	fa[x] = y;
	for (int i: r[x]) r[y].push_back(i);
	for (int i: l[x]) l[y].push_back(i);
}
void zhk() {
	read(n), read(m);
	F(i, 1, n) {
		vis[i] = false;
		deg[i] = val[i] = g[i] = 0;
		s[i].clear(), l[i].clear(), r[i].clear(), v[i].clear(), vv[i].clear();
	}
	F(i, 1, m) {
		int x, y; read(x), read(y);
		deg[y]++;
		v[x].push_back(y);
		vv[y].push_back(x);
	}
	F(i, 1, n) sort(all(vv[i]));
	queue <int> q;
	F(i, 1, n)
		if (!deg[i]) q.push(i), len[i] = 1;
	if (q.size() == 1) {
		F(i, 1, n) cout << 'a';
		cout << '\n';
		return;
	}
	int mx = 0;
	while (q.size()) {
		int x = q.front(); q.pop();
		for (int i: v[x]) {
			chkmax(mx, len[i] = len[x] + 1);
			if (--deg[i] == 0) q.push(i);
		}
	}
	F(i, 1, n) s[len[i]].push_back(i);
	fa[1] = 1, fa[2] = 2;
	r[1].push_back(2);
	l[2].push_back(1);
	g[vv[s[mx][0]][0]] = 1;
	g[vv[s[mx][0]][1]] = 2;
	val[1] = vv[s[mx][0]][0];
	val[2] = vv[s[mx][0]][1];
	DF(i, mx - 1, 2) {
		vector <pair <int, int>> e;
		int p = mx - i + 2;
		vis[p] = false;
		fa[p] = p;
		l[p].push_back(find(p - 1));
		r[find(p - 1)].push_back(p);
		for (int j: s[i]) vis[g[j]] = false;
		queue <int> q;
		auto work = [&] (int x, int y) {
			if (vis[y]) return;
			val[y] = x;
			q.push(y);
			vis[y] = true;
			if (g[x]) e.emplace_back(y, g[x]);
			else g[x] = y;
		};
		auto update = [&] (int t, vector <int>& x) {
			vector <int> w;
			for (int k: x) if (find(k) != t) w.push_back(find(k));
			sort(all(w));
			w.resize(unique(all(w)) - w.begin());
			swap(x, w);
		};
		for (int j: s[i]) {
			fv[g[j]] = val[g[j]];
			update(g[j], l[g[j]]);
			update(g[j], r[g[j]]);
		}
		auto solve = [&] (int pos) {
			if (vis[pos]) return;
			int j = val[pos];
			if (vv[j].size() == 1) {
				work(vv[j][0], pos);
				for (int k: r[pos]) work(vv[j][0], k);
			} else {
				for (int k: r[pos]) {
					if (vis[k]) {
						work(vv[j][0] ^ vv[j][1] ^ val[k], pos);
						break;
					}
					if (vv[val[k]].size() == 2 && vv[val[k]] != vv[j]) {
						vector <int> a = vv[j], b = vv[val[k]];
						int tt = -1;
						for (int ta: a) if (tt == -1)
							for (int tb: b) {
								if (ta == tb) {
									tt = ta;
									break;
								}
							}
						int t1 = a[0] ^ a[1] ^ tt, t2 = b[0] ^ b[1] ^ tt;
						work(t1, pos);
						work(tt, k);
						for (int t: r[k]) work(t2, t);
					}
				}
			}
		};
		for (int j: s[i]) solve(g[j]);
		while (q.size()) {
			int x = q.front(), j = fv[x]; q.pop();
			if (x != p) {
				if (vv[j].size() == 1) {
					for (int k: r[x]) work(vv[j][0], k);
				} else {
					for (int k: r[x]) {
						work(vv[j][0] ^ vv[j][1] ^ val[x], k);
					}
				}
			}
			for (int j: l[x]) solve(j);
		}
		for (int j: s[i])
			if (!vis[g[j]]) {
				F(i, 1, mx)
					if (i & 1) cout << 'a';
					else cout << 'b';
				cout << '\n';
				return;
			}
		for (auto [a, b]: e) merge(a, b);
	}
	F(i, 1, mx) val[i] = 0;
	string ans1 = "", ans2 = "";
	int tot = 0;
	F(i, 1, mx) {
		if (!val[find(i)]) val[find(i)] = ++tot;
		ans1 += char('a' + val[find(i)] - 1);
	}
	F(i, 1, mx) val[i] = 0;
	tot = 0;
	DF(i, mx, 1) {
		if (!val[find(i)]) val[find(i)] = ++tot;
		ans2 += char('a' + val[find(i)] - 1);
	}
	cout << min(ans1, ans2) << '\n';
}
signed main() {
	int _ = 1;
	cin >> _;
	while (_--) zhk();
	return 0;
}

详细

Test #1:

score: 100
Accepted
time: 7ms
memory: 15908kb

input:

3
1 0
5 6
2 4
2 5
5 3
4 3
1 5
1 4
8 11
1 2
1 4
1 6
2 5
3 4
3 6
4 5
4 7
5 8
6 7
7 8

output:

a
aba
aaba

result:

ok 3 lines

Test #2:

score: 0
Accepted
time: 181ms
memory: 15968kb

input:

26837
1 0
2 1
2 1
3 2
1 3
2 3
3 2
3 1
1 2
5 5
4 3
5 1
1 2
3 2
5 3
5 6
2 4
2 5
5 3
4 3
1 5
1 4
5 5
1 5
2 1
2 4
4 5
3 4
6 6
1 4
5 3
2 4
4 6
3 6
2 3
4 3
1 3
3 4
2 1
7 8
2 5
1 3
7 1
3 5
7 6
1 2
4 6
6 3
8 11
2 6
2 7
3 7
8 1
6 4
4 5
7 4
7 1
3 8
2 8
1 5
8 10
8 1
4 5
7 8
3 5
3 1
7 3
1 2
5 2
6 4
6 3
9 11
5 2...

output:

a
aa
ab
aaa
aab
aba
aab
abc
aaaa
aaab
aaba
aabb
aabc
aaba
abab
abac
abba
aaab
abbc
abca
abac
aabc
abcd
aaaaa
aaaab
aaaba
aaabb
aaabc
aabaa
aabab
aabac
aabba
aaabb
aabbc
aabca
aabcb
aabcc
aabcd
aaaba
abaab
abaac
ababa
aabab
ababc
abaca
abacb
aabcb
abacd
aabba
abaab
abbac
abbba
aaaab
abbbc
abbca
abaac...

result:

ok 26837 lines

Test #3:

score: 0
Accepted
time: 185ms
memory: 15976kb

input:

6450
148 290
30 17
69 52
99 36
15 20
96 129
17 64
86 137
74 81
145 138
135 30
113 118
26 52
125 60
39 34
15 59
112 92
126 68
13 23
33 96
145 148
71 88
77 51
81 86
12 127
54 5
47 31
13 21
49 137
51 66
135 48
45 62
93 53
133 119
76 65
94 104
103 25
10 143
44 2
4 80
92 57
131 99
64 28
36 148
53 122
35 ...

output:

abbabaababbaabbabaab
abbcacababccababcbca
abcdefghijklmnopqrst
abaababaabaababaabab
abcabcabcabcabcabcab
abaabaabaabaabaabaab
ababaababaababaababa
abaabaabaabaababaaba
abababababababababab
abacabacabacabacabac
abacabadabacabaeabac
aabaabbabbbaabbaabba
aaababbcbbccaaaabcac
abcadefghijfklmkcbdf
aabaca...

result:

ok 6450 lines

Test #4:

score: 0
Accepted
time: 181ms
memory: 16068kb

input:

970
920 1834
730 734
56 197
114 794
161 101
228 454
791 135
423 9
877 886
875 387
840 727
730 643
587 823
112 816
672 87
911 365
251 329
478 863
76 580
869 898
906 598
222 116
523 621
349 645
601 897
109 271
26 594
877 691
409 891
245 286
146 591
289 95
786 850
576 8
131 507
6 285
71 695
853 713
265...

output:

ababbabaabbaababbaabbabaabbaababbabaababbaabbabaab
ababccababcbcaabcbcacabcababcbcaabcbcacabbcacababc
abcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxz
abaababaabaababaababaabaababaabaababaababaabaababa
abcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcab
abaabaabaabaabaabaabaabaabaabaabaabaabaabaaba...

result:

ok 970 lines

Test #5:

score: 0
Accepted
time: 180ms
memory: 16624kb

input:

237
3672 7338
128 799
1687 1156
3289 2676
17 11
10 2456
3634 1671
1180 2885
1838 3438
272 406
1704 2120
2612 2145
3172 1407
2717 3154
2801 1157
1377 2383
3458 3086
1633 3374
1922 869
958 248
2150 2186
1010 2998
370 1368
3407 2495
3644 987
1582 1701
2231 3541
1600 1620
2574 2836
3238 2131
1373 1548
2...

output:

abbaabbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababba
aabcbcacabbcacababcbcacababccababcbcaabcbcacabcababcbcaabcbcacabbcacababcabcbcacabbcacababccababcbca
abcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvzxyabcdefghijklmnopqrstuvzwyabcdefghijklmnopqrstuvz...

result:

ok 237 lines

Test #6:

score: 0
Accepted
time: 267ms
memory: 21508kb

input:

30
33368 66730
8076 11100
29514 11018
19224 28482
7851 20178
15965 14582
27252 7790
21764 13370
14476 32499
32535 26445
13036 10117
21957 8939
27288 2575
94 31016
28912 8162
11851 20676
1998 14167
23076 4834
13894 23588
4510 16856
4125 24548
7174 31028
20038 16939
13363 29338
27074 24233
14616 29951...

output:

abbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaab...

result:

ok 30 lines

Test #7:

score: 0
Accepted
time: 499ms
memory: 74152kb

input:

8
380248 760490
124441 243214
318264 317073
80812 184051
371269 92314
147997 324777
348208 151765
277437 22744
135856 228557
170049 232045
211622 83057
272356 232823
47448 177829
101380 373767
357788 184436
373026 30555
89629 377654
213780 51067
227975 39349
216809 210156
42077 295276
195939 221049
...

output:

abbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaababba...

result:

ok 8 lines

Test #8:

score: 0
Accepted
time: 244ms
memory: 135868kb

input:

1
1000000 999999
486593 40134
567630 575732
673482 763704
372903 393266
657204 514133
677524 433408
258586 60505
668823 278755
406509 351060
877657 86847
393838 390004
323007 188430
833631 698149
362171 368078
725792 944166
810862 211037
579856 958663
293964 656704
398325 41189
393451 571249
585688 ...

output:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

result:

ok single line: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'

Test #9:

score: 0
Accepted
time: 882ms
memory: 149312kb

input:

1
999720 1999418
478960 367385
278842 195576
978938 976238
621173 945176
934972 578856
824323 381756
538870 587404
445290 681032
934823 385654
924723 412221
85667 342451
175667 376718
825906 546292
215330 897312
29111 214255
903178 224277
622872 949028
895275 674752
744266 238233
917807 485857
50574...

output:

ababbaaaabbaaababbbabaaababaabbaababbbabbbaababbaaaabbabbbbbababbbaababaababaabbaabbbbbaabaababbbbbbbaaabbabaaabbaabbbababaabaabbbaabbabababbababababbbaabbbbbbbabbbabbbbbaabbaaaaabbbbabbaaaaababaabbababaababababbababbaabbabaaaababaabbababbbbaaaabaaabbaababaaaabbbabaaaaabbbaaabbaababbbaaaabaabbbbaabb...

result:

ok single line: 'ababbaaaabbaaababbbabaaababaab...abbbaabaababbaaabbaabbbababbbba'

Test #10:

score: 0
Accepted
time: 879ms
memory: 150248kb

input:

1
999962 1999902
52152 909124
778034 197109
215551 980572
351009 284250
906426 112777
146723 864320
128930 437120
297457 358563
702334 350219
168315 3105
750352 326219
541338 400633
725295 147687
463415 95558
557045 884970
906696 895067
8701 56935
472957 784385
733678 464051
491501 368221
717902 907...

output:

aababbaaabbaaaabbabaabbbabbaabaaaabbabbabbbbabbbaaabbbbbbaabbaabbabbabbabaaaabaabbaaababbbbbaaababaaaababaabbababbbababbabaaaaaaabbaabbababbaabbaabaabababbaaabaaaaababababbbabbaabaaababbbaaaabaababbbbbaababbabbaaaabbbabbbbbaabaaabaaabbaaabbbbababbaabbbbbbbabababbbbaabaaaaabbbabbbbabaaaaabbaabbabbbaa...

result:

ok single line: 'aababbaaabbaaaabbabaabbbabbaab...aababaaaaaabbabaabbbbaabbaabbab'

Test #11:

score: 0
Accepted
time: 865ms
memory: 148284kb

input:

1
999932 1999842
994049 660788
387551 736624
508811 633488
317145 571345
906407 201785
430886 611119
183526 415265
720900 956714
207924 571189
781568 293026
258860 300050
29668 968606
711768 267147
140099 193742
353070 17072
117128 701452
842704 198461
918561 757129
879182 813948
245889 282501
46994...

output:

aabaaabababbabbababbbaaabbababaabaabaabbababbbababababbbabbbaabbabaabbaaaaaabababbaaababbabbabbabaaabaabbabaaabbbabbaabaaaaaaaabaabbaababbaaababababbbabaaaaaababbbabbbabbabbbabbaaaababbbbabbbabbaababaabbbabaaabbabaaabbaaabababbbabaaabbaaababbbaaababbaabbbabbbbbabbbabbbabbbbabaaaaaaabaababbaaabababaa...

result:

ok single line: 'aabaaabababbabbababbbaaabbabab...baabaaababbaaaaabaaabbbaaaabbaa'

Test #12:

score: 0
Accepted
time: 839ms
memory: 149196kb

input:

1
999960 1999898
696875 9265
618298 741593
334125 932167
316155 284255
923880 106712
771194 353262
31998 417868
845589 256875
591867 976859
220019 209003
829310 14740
460460 37659
538159 801865
462765 878326
602060 979546
157850 511382
761195 500165
433201 295913
87888 947492
306572 761401
978020 91...

output:

aaaaabbabaabbbabababbaaaabbaaaabaabaababbabbbaabbaaabbbbaaaaabababbaabaabbbabbaaabbabbaabbaabaaabbaaaababbababaabbbaabaababaabbbbabbbbbbaabbaababbabbbbbabbaabbaabaaababbaaaaaabbbaaaaaabbababaabaaababbabaaaabbbbbababbabaabbabbabbaaabaaaaabaaaabbabaaababbabbbbbbaaaabaabbaababbaaaaaaaababbaababaaabbbab...

result:

ok single line: 'aaaaabbabaabbbabababbaaaabbaaa...bbbbbbbbabaaaaaaaaabbabbaaaabbb'

Test #13:

score: 0
Accepted
time: 870ms
memory: 147120kb

input:

1
999286 1998549
332293 847900
781086 328251
89438 882788
175083 14440
572430 574257
809569 484269
663930 438265
122446 76616
651689 649277
10930 366807
865522 459778
415599 426786
191310 197100
747014 674992
395012 954730
372947 143720
681954 55327
377093 403183
960062 910427
919504 396335
314041 2...

output:

aabbacbacbccccabcacccabbbabcccacbaaaaaaccacbccaacbbaaacbcbaccbbacaacabcaccccaabcabccaaccbaaabbabbccbbbcbcbbbccababbbbbcaabbacaaacaabbaacbaabbbbbcbccaccbbcbabcbacccabcbbcbcaaabbbabbaccacacbaacaabbaacccacbaabbccbbcabacabbcbababccbbcbaacacbaccaaabbabbbbbaacbbbaaabacaabcacaaaccaaccbcababacbbabbababacbcc...

result:

ok single line: 'aabbacbacbccccabcacccabbbabccc...acbacbbabaaacaccbccaabbbbaaaaba'

Test #14:

score: 0
Accepted
time: 845ms
memory: 150656kb

input:

1
999331 1998641
729147 538731
921253 798894
885546 677818
298747 97157
180087 234737
418721 783414
901052 913813
595106 405323
295245 567060
70011 388501
377766 19230
874327 848890
928988 650497
238183 939267
593826 388828
573609 454635
81052 5415
661081 742732
500902 266652
996206 520864
328011 14...

output:

aabacbaaccbabbabbacaccbbabcbccabcabbbacbccacbabccbbcacbabbcbbabbacacccaaccccbaaccbaabcbcaaaaaacacbccbbcaabcbaabaccbcabacaccbbbabccabaaabbbbbcbacacacaabcacaabccccabcaabaacacbccabaaccabaccaabcacbccbbabbacbbcbabccaabbbcbacbbbcabaabcabacbaaccaccacabcacbaccaabacacccbabaacbbbcbcabcbabcababbaabacaacacccacb...

result:

ok single line: 'aabacbaaccbabbabbacaccbbabcbcc...cacacacaaaaacbbaaaccbaacbccaaca'

Test #15:

score: 0
Accepted
time: 880ms
memory: 149060kb

input:

1
999390 1998754
371866 116100
905495 392764
44483 862055
894183 603825
297556 557791
204825 860195
258135 783387
213801 233286
733327 526541
291442 435626
497561 467258
125745 889357
162794 595141
727020 316815
329022 931460
658882 219351
855248 963142
453518 646179
49612 456747
168958 167848
23953...

output:

aabbbccaaddebdeebadbabadcdddbacaacababeeabbeebddadedaddaadedcdebccabeaebcdbaabceaceebabeeeddeecaecccddabdbbacadaedceddbecaecdcbdaebbdbaacaaebddaeaaabaddbecaacacacedccdabbaaacdeaccacdbaeeecaecbeddcdaecabceaebdebaeceebbbcdbdeacdcbacceaaebeecbecdaadcabbdbcadbaaeabcdaeabcdcaabdbcebecacebcdceeeacebbabada...

result:

ok single line: 'aabbbccaaddebdeebadbabadcdddba...eeccdaabdcbadbdcbaecedbdccdaeba'

Test #16:

score: 0
Accepted
time: 894ms
memory: 150304kb

input:

1
999332 1998641
340224 312609
496357 621563
282231 31016
9727 518497
345711 368257
231510 162608
370656 157276
520228 905900
444817 419597
284400 368374
619796 817878
542290 224955
388559 105743
824688 371866
837389 734221
600626 944539
93565 550551
676681 298291
663021 283487
761202 315067
748929 ...

output:

aaaabbcaddcacaecdedaadbcbeadddbebbedeededceddedcadadacadceddbddbcadcdabedaabdbccededaccedabecacbacdcacebaecaabbdeedcdaacaacaceaeeedeecbbbeedacdeaaebcadaddcdecaadebabbcbcbbddcadcbeabeaededbcacdbbdcabeaaeaaedabdbcbeadaddadedddaebcacacbdbdedcccaabbbdaebdadecbecabaedadcbceecbdadacdbbdabeaaddebcbacdcbaca...

result:

ok single line: 'aaaabbcaddcacaecdedaadbcbeaddd...eacabbeddaaebbabcadcccbccbacdaa'

Test #17:

score: 0
Accepted
time: 837ms
memory: 149244kb

input:

1
999739 1999440
205098 344014
307300 441050
151960 549625
675401 498542
254496 388186
804623 686320
449469 974202
149674 935006
81205 629864
388824 158142
4307 138602
862844 464387
337179 904964
437580 558766
679226 445604
698011 971021
661578 367602
698306 240195
179735 321954
638187 260543
541268...

output:

ababcdefdgfcdafhhceahiifjgafafcigfgfagjdjigccjgfcjifaegcghjiadafegiaajfbjjbajdddjjjfggggjgaccdchcafcddbhcfchbjjcjfjbihebdjbbcfafbfhdfhibdjhcgajahjibfgicfibadjacggejebbgjijaafdidgbajgidffahebabbghecffcfgiaficgichiffadidjfheaibhfbhjegeghjbecdjdjjhadjaieieeebagcehdicjdgbdadgceaaefahgfjjaebiajdjdibeheeb...

result:

ok single line: 'ababcdefdgfcdafhhceahiifjgafaf...cfhdacdjbjjddfgcabahhcdeiicjjce'

Test #18:

score: 0
Accepted
time: 849ms
memory: 150328kb

input:

1
999710 1999383
937916 289472
397745 223193
993084 450771
753199 164546
143627 180490
834071 338355
930758 765524
949290 91931
660057 139978
516021 518052
871186 290530
170047 970212
327356 621467
28958 564133
69866 550611
793613 404090
468057 410337
75929 627503
834050 483273
545988 569261
672096 ...

output:

aabcdefgfbhhccdeigdgjbffiadhbfiidghdehbddedajggcahedibjegediaeeafjbiedbgaagfehgigbghdgbjjfcbggfgcdghahahijjiagaiihbeiiefchhhgdjchecefccfhdadfeffibffhebdbjicccgehhchdcfjibbjbajbcigefgiahjhahgdahfjjifjgcjbggjbbhhhahbebbaeeajabcgahjiaajaaejcjgffhcadeggjhdibddggjibajejdbaahiigbdcdafbcdebjiedbgjbidfhddgg...

result:

ok single line: 'aabcdefgfbhhccdeigdgjbffiadhbf...jgaagcajigbaejchgeebccacidafbfd'

Test #19:

score: 0
Accepted
time: 268ms
memory: 134436kb

input:

1
1000000 999999
278296 106049
911981 972246
893106 498127
783362 841190
100615 892567
336171 546759
879578 798806
821558 165334
240626 948176
766870 782719
698585 659818
433374 475363
210776 45956
160561 881213
929083 451179
276955 528871
172610 1150
945837 980812
612046 510874
516551 688101
401500...

output:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

result:

ok single line: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'

Test #20:

score: 0
Accepted
time: 753ms
memory: 169676kb

input:

1
999999 1999994
581178 432299
504497 15192
717769 924100
36894 56780
350786 794293
246364 706614
179777 929163
22940 704272
114548 224999
620984 147378
124534 370669
505076 273968
57565 156162
541654 824947
916216 571797
789038 941852
350195 648312
405505 10481
468099 554657
404064 883737
532801 98...

output:

abababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababab...

result:

ok single line: 'ababababababababababababababab...bababababababababababababababab'

Test #21:

score: 0
Accepted
time: 1018ms
memory: 179752kb

input:

1
999998 1999991
502440 225432
907870 129550
370548 895535
620827 138519
897488 833709
258967 197331
89186 611424
230243 115052
954916 685415
382575 991163
444881 168318
477042 695931
194483 310115
507944 516190
212825 890287
912499 452579
963934 970547
834795 353372
605876 302159
822307 403587
8405...

output:

abbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabbabb...

result:

ok single line: 'abbabbabbabbabbabbabbabbabbabb...abbabbabbabbabbabbabbabbabbabba'

Test #22:

score: 0
Accepted
time: 948ms
memory: 168880kb

input:

1
999998 1999989
595730 310210
908053 394407
461180 848797
672792 775917
456419 134484
715782 940107
711822 990066
783823 505433
358475 383299
798906 799596
4778 559674
386597 918032
282719 688058
607254 369671
418402 146760
860019 606201
702960 835553
465554 416276
659508 639592
630598 289700
66072...

output:

abbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbacabbac...

result:

ok single line: 'abbacabbacabbacabbacabbacabbac...bbacabbacabbacabbacabbacabbacab'

Test #23:

score: 0
Accepted
time: 954ms
memory: 158964kb

input:

1
999995 1999984
985741 202112
113452 812649
354353 812277
914828 794156
237877 784099
83225 363810
460713 920418
882028 800901
100788 205903
159925 413984
967001 483208
331627 948744
570437 582893
13328 86930
767339 632074
18502 997818
406585 599919
467701 341607
864711 804632
818010 362731
824254 ...

output:

aaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaababaaabaaabab...

result:

ok single line: 'aaabaaababaaabaaababaaabaaabab...ababaaabaaababaaabaaababaaabaaa'

Test #24:

score: 0
Accepted
time: 870ms
memory: 149848kb

input:

1
999928 1999843
780792 443802
738669 482072
537914 842795
629514 977885
89155 978805
453095 46839
277560 840110
720578 751856
364055 148013
864991 290855
773216 943671
870509 856883
849463 758421
599401 354294
524399 488376
232309 297812
740639 386214
453935 356707
625717 765634
728871 222854
36708...

output:

aaabcbaabccacabbaababababaaacccbbcbbabbbbcbaacbcbbacbbcccaaabbbccbbcbabcabbcbabcbcbbacacaacaabbcacbcaaabcbaabccacabbaababababaaacccbbcbbabbbbcbaacbcbbacbbcccaaabbbccbbcbabcabbcbabcbcbbacacaacaabbcacbcaaabcbaabccacabbaababababaaacccbbcbbabbbbcbaacbcbbacbbcccaaabbbccbbcbabcabbcbabcbcbbacacaacaabbcacbc...

result:

ok single line: 'aaabcbaabccacabbaababababaaacc...ababaaacccbbcbbabbbbcbaacbcbbac'

Test #25:

score: 0
Accepted
time: 912ms
memory: 199000kb

input:

1
999999 1499996
543259 17410
19444 340297
23045 521300
220491 517443
277358 699622
73281 353606
236580 492358
61489 960056
25447 699120
947866 294363
416423 700035
663938 203930
587798 626412
119412 932504
356124 522705
998857 821629
431645 781068
770294 779724
460263 352045
492971 437971
713950 27...

output:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

result:

ok single line: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...aaaaaaaaaaaaaaaaaaaaaaaaaaaaaab'

Test #26:

score: 0
Accepted
time: 889ms
memory: 200108kb

input:

1
999995 1666656
736110 238662
757868 998415
999757 499768
536662 916281
191889 814237
827493 381474
933680 557775
651039 859217
237652 74864
880236 132591
307103 760321
652664 255367
80727 20495
507135 237884
807816 745273
270055 548401
445131 301136
223348 388513
292530 343547
578614 388705
521277...

output:

abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb...

result:

ok single line: 'abbbbbbbbbbbbbbbbbbbbbbbbbbbbb...bbbbbbbbbbbbbbbbbbbbbbbbbbbbbba'

Test #27:

score: 0
Accepted
time: 878ms
memory: 170620kb

input:

1
999993 1749983
595579 814696
327705 510109
536334 271682
620018 432155
412505 289942
665142 441124
350800 63011
483144 947240
337574 886923
624489 421699
221457 114074
734558 176491
142497 821589
121560 550912
358811 975552
751179 826483
4064 100220
258397 922145
394636 377389
340087 105288
726323...

output:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

result:

ok single line: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...aaaaaaaaaaaaaaaaaaaaaaaaaaaabcc'

Test #28:

score: 0
Accepted
time: 898ms
memory: 181932kb

input:

1
999993 1749984
937616 625816
762346 22851
726456 395539
926060 571115
113925 536234
690350 377377
525070 441287
676627 835623
310294 10102
170929 243269
577589 244722
840841 629717
815448 625133
789045 504009
905089 388319
37685 731720
780422 230864
511016 156558
375563 227687
996628 539165
448530...

output:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

result:

ok single line: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...aaaaaaaaaaaaaaaaaaaaaaaaaaaabcb'

Test #29:

score: 0
Accepted
time: 872ms
memory: 177436kb

input:

1
999988 1799974
272583 553224
447286 80771
135525 875348
666935 218672
221924 744489
118232 17188
510481 743534
66653 300315
399230 683231
620142 623017
101269 291946
418755 469087
940309 938856
603391 293126
162392 860833
405308 936441
849089 712878
345016 920023
838505 643662
934571 733849
206169...

output:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

result:

ok single line: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...aaaaaaaaaaaaaaaaaaaaaaaaaaabcbb'

Test #30:

score: 0
Accepted
time: 888ms
memory: 181436kb

input:

1
999989 1799974
394181 16581
308288 634682
454294 259463
471255 163678
115045 266353
374379 136268
52432 566963
739256 679897
24680 754251
799118 792028
229739 758927
356760 117919
421180 876570
626405 269626
422620 174902
520306 499740
665404 333936
743633 730264
709674 596406
212752 589750
721550...

output:

aabccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc...

result:

ok single line: 'aabccccccccccccccccccccccccccc...ccccccccccccccccccccccccccccccd'

Test #31:

score: 0
Accepted
time: 884ms
memory: 180148kb

input:

1
999989 1799975
24536 137379
541157 206748
597020 60725
19432 457939
753214 238628
261688 912657
947769 16579
125882 154154
715162 790130
205358 642463
774676 663968
256799 875020
502834 991186
601178 37705
855895 553717
807265 490075
79730 363532
55965 538155
986027 888849
16901 280271
231853 4774...

output:

abcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc...

result:

ok single line: 'abcccccccccccccccccccccccccccc...cccccccccccccccccccccccccccccbd'

Test #32:

score: 0
Accepted
time: 904ms
memory: 175908kb

input:

1
999979 1833289
364231 543612
523125 271482
854736 862318
405507 855879
821055 491549
587061 476005
128121 226970
183541 38439
280888 598824
328331 108649
617236 500088
652029 910165
764067 821008
989754 643822
491048 861904
58132 631817
239822 685227
720179 484733
499306 852279
840613 760882
80374...

output:

abbccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc...

result:

ok single line: 'abbccccccccccccccccccccccccccc...cccccccccccccccccccccccccccccda'

Test #33:

score: 0
Accepted
time: 883ms
memory: 161064kb

input:

1
999954 1888796
122361 559279
205193 834613
374594 405095
878564 249600
538793 722786
52799 85206
253351 343187
535747 960048
33454 575011
431376 88194
556341 815309
485850 992899
512868 349950
760376 589038
413704 516300
989011 300924
73939 50293
623606 951119
316613 298790
440555 638746
388323 78...

output:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

result:

ok single line: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...aaaaaaaaaaaaaaaaaaaaaaabbbcccbb'

Test #34:

score: 0
Accepted
time: 910ms
memory: 163120kb

input:

1
999934 1908957
955017 948150
166974 296456
963707 829370
706918 267298
546809 124119
969554 628903
379973 306743
456631 803543
238750 774259
878450 120296
904553 855039
891169 663361
802073 913415
973328 822262
605847 476614
147288 380850
836173 848702
205649 209898
581304 433889
853387 370589
118...

output:

aaababbbcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc...

result:

ok single line: 'aaababbbcccccccccccccccccccccc...cccccccccccccccccccccccccccccdd'

Test #35:

score: 0
Accepted
time: 903ms
memory: 158296kb

input:

1
999748 1951884
946054 84413
520941 27892
575519 19356
189505 958539
273920 732229
373048 681332
493649 783015
263583 191027
976308 886309
393997 577732
706673 354590
274643 516619
28102 841415
409089 826633
908019 27119
914629 166713
521185 626765
236569 55597
905451 104983
617368 312135
81747 127...

output:

aaaaaababbaccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc...

result:

ok single line: 'aaaaaababbaccccccccccccccccccc...ccccccccccccccccccccccaadadadaa'

Test #36:

score: 0
Accepted
time: 871ms
memory: 148600kb

input:

1
994416 1979010
333589 672562
217796 383366
195815 615683
443265 404340
506106 626164
227338 432208
903693 38364
68319 456698
714982 331060
312388 704973
835854 575846
975963 607066
345076 718039
362193 807702
555309 399904
393522 171874
877706 913101
46202 560967
697077 978405
497163 25776
545561 ...

output:

aababbaaaabaabbbabbaaaaabaabbaaaabababbbaaaaaaaaabbccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc...

result:

ok single line: 'aababbaaaabaabbbabbaaaaabaabba...bbbdddbdbdbbddddbbbbdbbbdddddbb'

Test #37:

score: 0
Accepted
time: 696ms
memory: 130704kb

input:

1
870934 1740349
450944 400485
17338 516587
456520 576927
765024 651162
785591 553758
475887 732013
718720 748469
705835 607741
743365 608502
502487 380450
211524 851264
185324 710270
751871 793385
774210 142733
496783 825408
668678 798043
251722 837502
863085 397688
244750 160991
151634 420124
9891...

output:

aababbaaaababbabaaaababababaaabaabaabbbbbaabbababaabaaabbaaabbababbbabbbbaabbbabbbaaabbbbbbabaaababaabbbabaaaababaaabbbababbbabababbabbbabababbbbababaaaaabbbbabaaaababbaaaabaaabbaabbbbabbbbbbbbbabbaaaababbaaaaaaabbbabbbbabababbaaabbabaabaabbaabbaaaababaabababbbbaaaaabaabbabbbbbababbaaaaaabbbbbbbabba...

result:

ok single line: 'aababbaaaababbabaaaababababaaa...ccccccccccccccccccbdbbbdddbbbdb'

Test #38:

score: 0
Accepted
time: 859ms
memory: 148052kb

input:

1
999031 1998056
944253 701177
628834 522605
520716 797045
506918 534084
163450 696654
464837 813105
951327 209327
824890 750039
933647 185454
11519 579956
95574 81609
492846 648834
614729 860588
427887 611641
968765 146575
154287 818208
330364 256095
835410 746829
846144 349485
239782 397457
558582...

output:

abaabababababababaababababaababababababaabababababababababababababaababababababaababababababababababababababaababababababaabababababababaababababaababababababaabababababababababababababaababababababaabababababababaabababababababababababaababababababaabababababababaabaabababaababababababababababababa...

result:

ok single line: 'abaabababababababaababababaaba...abaababababababaabababababababa'

Test #39:

score: 0
Accepted
time: 875ms
memory: 146816kb

input:

1
999548 1999091
422115 853930
565292 438783
501180 310346
952818 22930
642971 559612
830855 315318
638983 191748
212109 528253
787910 766955
515304 152973
408264 956327
636228 836347
563762 784356
343709 694055
834593 612441
313506 495311
650371 432455
8144 808728
60914 642164
287419 51046
794199 6...

output:

ababababaababababababababababababababaabababababababababaabababababababababaababababababababababababababaabababababababababaabababababababababaabababababababababababababababaabababababababababaabababababababababaababababababaababaabababababababababaabababababababababababababababaabababababababababaa...

result:

ok single line: 'ababababaababababababababababa...bababababababababaababababababa'

Test #40:

score: 0
Accepted
time: 856ms
memory: 151228kb

input:

1
999998 1999989
812718 119195
852062 35062
446860 289428
53266 149860
441650 213413
995388 212232
377071 217372
71092 162001
438017 609254
109719 613095
61502 178674
345506 326136
825281 411970
458954 651702
761293 214401
609001 650188
123058 137071
964235 576431
818728 826355
861967 692367
832186 ...

output:

aabaaabaabaaabaabaabaaabaabaabaaabaabaabaabaaabaabaaaabaabaabaaabaabaabaaabaabaabaaabaabaabaaabaabaabaaabaabaaabaabaaabaabaabaaabaabaabaaabaabaaabaaabaabaabaaabaabaabaaabaabaaaabaabaabaaabaabaabaaabaabaabaaabaabaabaaabaabaabaaabaabaaabaabaaabaabaabaaabaabaabaaabaababaabaabaaabaabaabaaabaabaabaaabaab...

result:

ok single line: 'aabaaabaabaaabaabaabaaabaabaab...aabaaabaabaabaaabaabaabaaabaaba'

Test #41:

score: 0
Accepted
time: 827ms
memory: 149112kb

input:

1
998754 1997501
451412 492960
726415 403338
928913 362336
857791 678191
238935 188419
678763 507681
553984 74721
838132 943571
489725 165026
806587 845224
502506 78048
257234 890333
283114 912547
640075 830790
449511 826830
113685 161576
112225 415952
229521 391946
875997 239904
499456 287006
11157...

output:

aabaaabaaabaaaabaaabaaabaaabaabaaabaaabaaabaaabaaabaaabaaababaaaabaaabaaabaaabaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaaabaaabaaabaaabaabaaabaaabaaabaaabaaabaaabaaabaabaabaaabaaabaaabaaabaaabaaabaaababaaaabaaabaaabaaabaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaa...

result:

ok single line: 'aabaaabaaabaaaabaaabaaabaaabaa...abaaabaaabaaabaaabaaabaaabaaaba'

Test #42:

score: 0
Accepted
time: 850ms
memory: 148172kb

input:

1
999222 1998436
993501 132099
48846 183770
297728 66724
161996 843450
672810 894635
816951 954890
437547 968733
48967 816374
238907 869034
779830 748459
953370 582290
27183 314266
683290 379328
151146 307161
679971 308083
682350 286314
734455 354118
239968 883890
543228 421357
922468 771119
269140 ...

output:

aabaabaababaabababaabaabaabaabaababaabababaabaabababaababaabababaabaabaabaabaababaabababaabaabaaababaabababaabaabaabaabaababaabababaabaabababaababaabababaabaabaabaabaababaabababaabaabaabaabababaababaabababaabaabaabaabaababaabababaabaabaabaabaababaabababaabaabababaababaabababaabaabaabaabaababaabababa...

result:

ok single line: 'aabaabaababaabababaabaabaabaab...aabaabaabaabaababaabababaabaaba'

Test #43:

score: 0
Accepted
time: 847ms
memory: 149980kb

input:

1
999725 1999444
664670 565167
967787 695001
170527 752383
173228 417676
739062 540710
871443 628541
808963 826302
90038 904852
396949 776174
347345 400231
896373 96375
949201 169656
111022 726139
444369 823707
370890 584629
546841 224917
2344 628006
800299 122072
973102 64289
223609 277451
720535 8...

output:

abaabaaabaabaabaabaabaaabaabaabaaabaabaababaabaabaaabaabaabaaabaabaabaaabaabaababaababaaabaabaabaaabaabaabaaabaabaababaabaabaaabaabaabaaabaabaabaaabaabaabaabaaabaabaababaabaabaaabaabaabaaabaabaabaaabaabaabaabaabaaabaabaabaaabaabaabaabaabaaabaabaabaaabaabaababaabaabaaabaabaabaaabaabaabaaabaabaababaab...

result:

ok single line: 'abaabaaabaabaabaabaabaaabaabaa...aaabaabaabaaabaabaabaaabaabaaba'

Test #44:

score: 0
Accepted
time: 855ms
memory: 148780kb

input:

1
999654 1999299
30602 172621
724993 843932
823873 367926
519281 345676
451224 486360
208251 495917
369708 72147
658814 195811
440175 562094
199991 262910
205602 366720
59342 295528
153228 436417
68160 175579
100322 642320
35483 837722
839003 481624
398776 808033
198567 244024
163998 760727
412944 9...

output:

abaaaabaaaaabaaaaabaaaabaaaaabaaaabaaaaabaaaaabaaaabaaaaabaaaaabaaaabaaaaabaaaabaabaaaabaaaaabaaaaabaaaabaaaaabaaaabaabaaaabaaaaabaaaaabaaaabaaaaabaaaabaaaaabaaaaabaaaabaaaaabaaaaabaaaabaaaaabaaaabaaaaabaaaaabaaaabaaaaabaaaabaaaaabaaaaabaaaabaaaaabaaaaabaaaabaaaaaabaaaabaaaaabaaaaabaaaabaaaaabaaaaba...

result:

ok single line: 'abaaaabaaaaabaaaaabaaaabaaaaab...aabaaaaabaaaabaaaaabaaaabaaaaab'

Test #45:

score: 0
Accepted
time: 856ms
memory: 146944kb

input:

1
998811 1997615
158918 240736
388772 621431
903373 657920
948689 463964
884561 430124
206324 484677
914395 922092
142285 499809
147309 196726
3451 208408
478448 357093
303405 735753
753349 832821
634378 174262
686864 283732
16295 877863
863702 23898
728539 838364
881492 391660
425541 237359
856425 ...

output:

aababaababaababaababaabababaababaababaabaabaababaababaababaababaababaabababaababaababaabaaababaabababaababaababaababaabababaababaababaababaababaababaabababaababaababaabaabaababaababaabaaababaabababaababaababaababaabababaababaababaababaababaababaabababaababaababaabaabaababaababaababaababaababaabababa...

result:

ok single line: 'aababaababaababaababaabababaab...aababaababaabababaababaababaaba'

Test #46:

score: 0
Accepted
time: 890ms
memory: 148512kb

input:

1
999690 1999373
268108 252374
194334 144775
770635 509695
495558 419232
510168 234386
66646 351508
398663 232011
535269 968977
684048 103204
632474 206208
825713 578878
847058 209101
711204 73258
222200 647777
443019 648885
803052 887437
854600 876933
205388 959551
567956 903094
503004 888894
89432...

output:

aabaabaabaabaabaaabaaabaabaabaabaabaaabaabaaabaaaabaabaabaabaababaabaabaabaaabaaabaabaabaabaabaabaaabaabaaabaaaabaabaabaabaababaabaabaabaaabaaabaabaabaabaabaabaabaabaaabaaabaabaabaabaabaaabaabaaabaaaabaabaabaabaababaabaabaabaaabaaabaabaabaabaabaabaaabaabaaabaaaabaabaabaabaababaabaabaabaaabaaabaabaab...

result:

ok single line: 'aabaabaabaabaabaaabaaabaabaaba...baabaabaabaaabaaabaabaabaabaaba'

Test #47:

score: 0
Accepted
time: 854ms
memory: 147856kb

input:

1
999839 1999672
462162 478949
577424 220785
373029 724936
899929 832248
227554 75491
221012 792110
629456 158252
599297 274500
638859 564076
92593 465959
371098 419442
282644 437025
366787 435382
560793 603604
702728 44323
717565 247279
729025 754490
473119 906781
796048 739217
223066 620188
291188...

output:

ababaababaabababababababababaababaabababababababaabababaababababaababaababababababababababababababaababaabababababababaabababaababababaababaabababababababababababababaabababaababababaababaabababababababababaababaabababababababaabababaababababaababaabababababababaaababaabababababababaabababaababababa...

result:

ok single line: 'ababaababaabababababababababaa...baababababaababaabababababababa'