QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#333980#1388. Tekstówka [A]Huasushis10 ✓1150ms77196kbC++142.5kb2024-02-20 22:13:002024-02-20 22:13:01

Judging History

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

  • [2024-02-20 22:13:01]
  • 评测
  • 测评结果:10
  • 用时:1150ms
  • 内存:77196kb
  • [2024-02-20 22:13:00]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
int n, m, q;
#define N 3010
#define M 100010
#define endl '\n'
string s, t, ret;
int a, b, c, d;
int ans[M];
vector<tuple<int, int, int, int, int>> que[N * 4];
#define ls(u) (u * 2)
#define rs(u) (ls(u) | 1)
void add(int u, int l, int r, tuple<int, int, int, int, int> inf) {
  int mid = (l + r) >> 1;
  if (get<1>(inf) <= mid) add(ls(u), l, mid, inf);
  else if (get<0>(inf) > mid) add(rs(u), mid + 1, r, inf);
  else que[u].emplace_back(inf);
}
auto getp(string s, string t) {
  int n = s.size(), m = t.size();
  vector<vector<int>> p(n + 1, vector<int>(m + 1)), q = p;
  for (int i = 0; i <= n; ++i) p[i][0] = i + 1;
  for (int i = 0; i <= m; ++i) q[0][i] = 1;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      int P = p[i + 1][j], Q = q[i][j + 1];
      if (Q < P && s[i] != t[j]) swap(P, Q);
      swap(P, Q);
      p[i + 1][j + 1] = P;
      q[i + 1][j + 1] = Q;
    }
  }
  vector<vector<int>> res(m + 1, vector<int>(n + 1));
  for (int i = 0; i <= n; ++i) {
    for (int j = 0; j <= m; ++j) res[j][i] = p[i][j];
  }
  return res;
}
auto init(int r, string x) {
  string y(t);
  if (r) {
    reverse(x.begin(), x.end());
    y = ret;
  }
  return getp(y, x);
}
void solve(int u, int l, int r) {
  if (l == r) return;
  int mid = (l + r) >> 1;
  if (!que[u].empty()) {
    auto lh = init(1, s.substr(l, mid - l + 1));
    auto rh = init(0, s.substr(mid + 1, r - mid));
    for (auto [a, b, c, d, id] : que[u]) {
      vector<int> z(d - c + 3), y(d - c + 3);
      for (int i = 1; i <= d - c + 1; ++i) {
        ++z[i];
        --z[min(m - lh[mid - a + 1][m - c - i + 1] - c + 2, d - c + 2)];
        ++y[max(rh[b - mid][i + c] - c, 1)];
        --y[i + 1];
      }
      for (int i = 1; i <= d - c + 2; ++i) z[i] += z[i - 1], y[i] += y[i - 1];
      for (int i = 0; i <= d - c + 1; ++i) {
        ans[id] = max(ans[id], z[i] + y[i + 1]);
      }
    }
  }
  solve(ls(u), l, mid);
  solve(rs(u), mid + 1, r);
}
int main() {
  cin.tie(nullptr) -> sync_with_stdio(false);
  cin >> n >> m >> q;
  cin >> s >> t;
  ret = t;
  reverse(ret.begin(), ret.end());
  for (int xw = 1; xw <= q; ++xw) {
    cin >> a >> b >> c >> d;
    --a, --b, --c, --d;
    if (a == b) {
      for (int i = c; i <= d; ++i) {
        if (t[i] == s[a]) {ans[xw] = 1; break;}
      }
    } else {
      add(1, 0, n - 1, make_tuple(a, b, c, d, xw));
    }
  }
  solve(1, 0, n - 1);
  for (int i = 1; i <= q; ++i) cout << ans[i] << endl;
  return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 1
Accepted

Test #2:

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

input:

1 1 1
u
u
1 1 1 1

output:

1

result:

ok single line: '1'

Test #3:

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

input:

1 1 1
p
j
1 1 1 1

output:

0

result:

ok single line: '0'

Test #4:

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

input:

10 10 100
uuuggggggg
gguguguugg
1 2 5 6
2 5 3 4
6 9 1 7
5 6 7 8
7 10 1 1
7 7 3 8
5 6 2 8
3 3 4 10
3 5 3 6
3 5 2 10
3 8 4 5
1 1 7 8
5 8 4 7
4 5 2 5
1 6 1 9
4 8 1 2
3 4 4 7
1 3 3 9
4 5 2 9
2 9 2 5
1 7 3 4
1 8 4 6
3 3 1 9
2 6 5 7
3 7 6 6
7 8 1 4
4 6 6 8
10 10 4 9
5 5 4 7
2 6 3 8
4 9 7 8
2 10 5 8
4 8 1 ...

output:

1
2
4
0
1
1
2
1
3
3
1
1
2
2
4
2
2
3
2
2
2
2
1
2
1
2
1
1
1
3
0
2
4
1
2
3
2
3
2
2
2
1
3
1
1
1
0
1
6
3
3
2
1
2
1
3
1
2
3
1
1
4
2
4
1
3
4
4
2
3
2
3
1
3
3
1
2
3
1
4
1
1
2
2
2
3
1
3
1
2
4
3
2
2
2
1
4
3
1
2

result:

ok 100 lines

Test #5:

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

input:

10 10 100
sewiutkocr
zacwikoumr
5 7 3 8
6 10 2 5
7 7 5 7
3 9 2 10
5 6 7 7
2 7 1 3
8 9 3 8
5 9 1 1
3 8 7 8
3 8 3 5
9 10 5 7
4 5 3 8
9 10 1 8
5 9 7 9
4 7 3 6
1 2 1 8
3 10 4 7
3 5 1 9
3 9 3 6
2 9 5 7
9 9 2 3
1 9 4 6
5 10 3 10
4 9 3 5
2 9 2 9
2 4 10 10
1 4 6 6
2 8 6 9
1 9 8 9
5 8 5 7
2 3 3 4
3 5 2 7
8 1...

output:

1
1
1
4
0
0
1
0
1
2
0
2
1
1
2
0
4
3
3
3
1
3
3
1
4
0
0
2
1
2
1
2
0
4
1
0
1
1
2
3
0
1
0
4
2
0
1
2
0
2
1
1
4
3
0
1
0
1
2
1
2
1
1
3
0
1
1
4
4
1
4
0
1
0
2
1
1
0
1
2
1
2
1
3
1
3
0
0
2
0
0
2
2
1
0
3
2
2
0
4

result:

ok 100 lines

Test #6:

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

input:

599 600 600
rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr...

output:

71
74
39
139
23
71
247
133
135
156
1
264
56
25
24
230
142
29
374
28
61
46
18
116
82
71
40
188
154
60
215
226
94
84
147
12
25
244
112
198
71
28
4
135
65
21
193
113
3
149
5
112
82
11
302
147
76
43
19
153
88
41
5
96
131
114
127
1
116
31
26
104
26
92
272
65
100
166
119
22
235
21
112
10
316
53
152
79
52
...

result:

ok 600 lines

Test #7:

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

input:

595 600 600
ehhehhehhehheeeeeeehehheehehhhhehehehhheheeeheeeeheehhheeeheeeheheehheehhhehhhehehheeeeeheeheeeeehhhhehehheehhhheehhheeeehehheeeeeeeehheeeheeehhehhehhhhhhhehheeehhehhhehehheeehehhehhehhhhehehheehhehehehehhehhehheheeheehheehhhheeeheeeheheheeehhheeeeeeeheeehehhheehhehhehheehhhehehehheehhee...

output:

27
135
57
257
103
76
216
90
82
205
302
40
91
34
15
186
4
215
89
27
344
176
141
18
66
115
201
49
19
115
101
22
10
102
139
18
90
101
152
106
93
200
212
52
97
169
12
108
32
252
141
197
31
128
98
21
169
70
98
39
44
177
44
239
19
15
15
266
61
125
39
143
66
57
85
174
125
15
165
84
188
159
49
25
32
82
28
2...

result:

ok 600 lines

Test #8:

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

input:

596 597 600
uuyuvvyyvyuuyuuvvuvyvyvvvvuvvvvyvyuyyyvuvuvuyuuuyuyvuvyuuyvyuvvyvuuuvvyuyvyuvyvuvuvvyvvuvyvvvvuvuuvyuuuvuvvuvvvuyyuvyvyvuyvyvyvvuvyvyvvuuvuyyvvuvyuyuyvvvyyyuuyyvyuuuvvuuuuyuyvuuvvvyuvuyuuuvyuvyuyyuvuvuyvyvuvuvuuuvyyyuyuyyuuvuuuyuyvuvuyuvyvvyyvuvvvuuuyuuyuyuyvvvyvvuuyvvuuyvyvuuuyvyyvvuuvu...

output:

217
114
10
121
4
69
49
84
70
21
165
77
18
105
114
36
28
6
272
9
101
125
301
93
186
197
23
87
186
34
173
172
178
16
143
58
142
26
41
230
176
66
106
59
37
136
8
114
36
149
114
49
93
1
66
222
18
230
103
86
6
184
42
81
196
43
55
165
32
166
198
62
120
61
190
90
280
69
17
85
127
4
329
67
71
21
55
14
279
8...

result:

ok 600 lines

Test #9:

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

input:

600 600 600
gvewjwvwgvjwweunuweueeujvgunngjnvewuwnngwvwjnwewnnguvgjjjugnujevuwvnwvvnvujnjvjjjvwuwnwuvjwgjvujvneuegvenvgugnuvwwujugjjvgvgwvgevjjjnewwuwewgegjewujenjvuvjgunegeewevwjunvvewngunuugwjnuwugeuvugnvenunnuugjjguvgjuggwnnnwjgnjjuunneugvwweueevewjuggwjvgnjnnjjvuvwuujjjuujwnvnuuvjeujnwwjweeeggvw...

output:

96
84
34
172
47
246
70
78
20
99
13
3
67
91
100
131
26
40
43
7
225
49
18
154
33
20
115
9
144
96
25
189
80
45
89
122
49
106
84
123
40
71
31
24
52
110
150
141
102
24
99
59
181
161
72
12
31
112
24
16
151
68
173
42
59
17
161
36
44
192
45
193
130
38
26
82
87
54
54
4
90
97
204
97
73
46
31
35
101
172
31
117...

result:

ok 600 lines

Test #10:

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

input:

600 600 600
twutcmajasxjtcozzvxwohnnrqbfnkqovdaakdktmysnlbgumvnkqiepylzxyicmxbmgtipesarvbxqpdtdgbwjekctgolexbuscjmghxfbvjnfrctwuxmbubmezjsbdntmiiwujapftehzziiybewuaefkhiagwsxinvadmibtiobeeufurgfabgygzobsyjdrvlarcxsqqfnevdxpvjjtjrisdobpxpmyyewrjagcgqifaaxrmxacdazqxkyxzctevraltkspbwxuvkskmolbvdmkeqwdu...

output:

58
46
63
9
36
23
84
25
37
10
18
46
45
34
102
83
30
31
48
41
9
28
75
131
28
147
29
13
45
112
42
86
25
127
109
54
26
75
94
36
29
69
74
33
21
44
34
26
82
61
63
37
69
74
37
63
67
40
82
22
57
42
89
50
47
142
3
72
139
114
40
7
18
31
77
79
26
35
170
63
54
53
7
124
13
86
53
37
64
12
90
9
3
92
80
20
91
24
17...

result:

ok 600 lines

Test #11:

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

input:

600 595 600
gyygyggyyggygyygyggygyyggyygyggyyggygyyggyygyggygyygyggyyggygyygyggygyyggyygyggygyygyggyyggygyyggyygyggyyggygyygyggygyyggyygyggyyggygyyggyygyggygyygyggyyggygyyggyygyggyyggygyygyggygyyggyygyggygyygyggyyggygyygyggygyyggyygyggyyggygyyggyygyggygyygyggyyggygyygyggygyyggyygyggygyygyggyyggygyyg...

output:

77
5
20
26
31
9
35
158
13
198
30
101
117
237
113
6
222
84
402
156
49
182
125
64
114
50
187
92
244
109
40
79
33
83
154
23
279
183
15
55
11
57
112
54
37
36
28
103
46
85
87
337
49
139
27
324
85
65
15
31
174
188
20
104
105
193
156
86
227
101
130
16
207
199
20
2
11
133
30
112
120
130
1
228
378
92
127
62
...

result:

ok 600 lines

Test #12:

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

input:

598 596 600
awnwnanawwnanawawnnawawnwnawnanawawnnawawnwnaawnwnanawnawawnwnaawnwnanawwnanawawnwnanawawnnawawnwnaawnwnanawnawawnwnaawnwnanawwnanawawnawnwnanawwnanawawnnawawnwnanawawnwnaawnwnanawwnanawawnawnwnanawwnanawawnnawawnwnawnanawawnnawawnwnaawnwnanawwnanawawnnawawnwnaawnwnanawnawawnwnaawnwnanaw...

output:

44
203
184
188
271
246
34
56
140
182
9
215
135
67
51
144
134
11
6
47
74
68
163
94
120
72
140
57
28
136
148
139
18
233
79
45
29
82
40
285
174
194
33
98
383
70
105
12
85
181
161
93
137
26
41
50
1
228
14
17
70
199
56
256
185
190
357
38
259
64
311
123
147
156
63
33
202
141
197
45
250
87
322
208
30
80
83...

result:

ok 600 lines

Test #13:

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

input:

596 600 600
aaaayyayyyyycyyyyyyayayyyyyyyyayyyyybyyyayyyyyyayyyayyayyyyayyyyayyybyybyyyyayyyyyyyayyyayybbyyyyyyycayyyyyayyayyyyycyyyayyyyyyyayyyyyyyaayayyyyayyyyyyyyyaabyayyyyyayayaaayyayyyyyyycayyyayyyyycayyyyyyybyyyyayyyayayayabyayayayyyyyayyybaayyyyaayyyyyaayyyyyycybyyayybyyyyyyyyyyyyayaaaayayayy...

output:

2
38
26
26
52
49
16
11
79
1
6
11
17
64
2
1
8
48
2
15
19
15
1
44
6
23
43
61
5
53
33
44
69
43
15
34
35
52
19
86
25
41
20
16
48
3
57
24
34
5
16
3
44
51
41
69
14
30
32
11
9
32
47
5
12
39
37
14
7
20
105
0
28
39
16
2
46
10
7
4
5
89
13
34
21
14
31
44
2
15
4
21
3
113
13
35
36
59
53
4
3
19
38
2
61
2
44
8
40
...

result:

ok 600 lines

Test #14:

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

input:

599 595 600
yyyyyyyyyyyyyyyyyyabayyyyyyyyyyyyyyyyyyyyaaayyyyyyyyyyyyyyyyyyyyyayyyayyayyyyyyyyyyyyyayyayyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyayyyyyyyyyyayyyyyyyyyyyayybyyyyyyyyayayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyayyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyybyyayyyyyyyyyyayyyyyyyayyyyyyyyyyyybyyyaya...

output:

5
15
1
13
14
18
8
6
36
4
11
8
8
44
13
1
16
24
9
31
47
25
22
29
6
18
3
15
21
13
10
1
37
12
18
12
14
2
6
25
1
0
3
24
9
3
11
22
18
15
26
23
5
4
12
2
12
12
21
14
5
40
33
12
7
9
21
3
11
3
5
1
3
26
13
21
37
3
1
11
3
3
8
5
11
23
7
6
14
8
3
6
2
5
10
10
4
14
14
2
25
2
3
19
20
7
27
20
5
5
2
4
22
31
21
16
9
4
...

result:

ok 600 lines

Test #15:

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

input:

600 600 600
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyayyabyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyaayyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyayyyayyy...

output:

19
2
4
6
1
0
4
4
12
8
2
12
12
3
10
2
17
5
21
0
1
3
18
2
5
11
6
13
10
6
1
3
1
3
5
24
1
6
4
4
12
3
9
0
0
1
21
5
2
2
5
8
1
3
3
3
0
11
6
4
2
0
3
9
12
4
0
4
0
4
16
0
4
0
20
3
10
7
2
3
10
12
25
4
7
4
4
2
29
3
4
10
12
1
9
6
14
7
1
2
4
13
5
13
5
4
2
1
1
2
3
17
0
3
1
4
22
0
17
3
4
10
0
5
4
5
0
1
6
1
0
11
4
2...

result:

ok 600 lines

Test #16:

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

input:

597 600 600
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyy...

output:

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

result:

ok 600 lines

Test #17:

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

input:

596 599 600
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyy...

output:

1
2
0
1
1
0
2
2
1
1
2
0
0
0
0
1
4
0
1
3
3
1
0
2
0
2
0
1
0
0
0
0
2
3
1
1
4
1
3
0
0
2
5
3
1
2
0
0
0
4
0
0
5
0
0
0
2
4
0
2
2
1
1
3
0
0
3
4
3
0
2
1
1
3
0
0
0
0
2
1
1
1
0
0
2
0
4
3
1
3
0
4
3
4
2
0
0
0
0
0
0
1
0
0
0
0
4
2
1
4
3
1
0
0
0
1
2
0
0
0
3
1
0
0
1
0
2
1
1
1
0
0
3
0
0
3
0
1
0
3
2
0
2
3
1
2
2
4
0
0
...

result:

ok 600 lines

Test #18:

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

input:

595 599 600
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy...

output:

0
0
2
0
1
2
0
1
0
1
1
3
1
1
0
0
0
0
1
0
0
2
0
1
1
0
1
1
1
0
1
1
1
1
0
0
0
0
0
1
1
1
1
0
0
0
0
0
0
2
1
0
0
0
1
1
0
0
0
0
0
0
0
0
1
1
0
0
0
1
1
0
1
0
1
1
1
2
1
0
0
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
1
0
2
0
0
0
0
0
2
1
1
0
0
0
0
0
0
0
1
0
0
1
0
0
2
2
1
0
0
0
0
1
1
0
2
2
0
2
1
1
0
0
0
1
0
0
0
0
0
0
...

result:

ok 600 lines

Test #19:

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

input:

600 597 600
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy...

output:

0
0
1
2
2
3
1
0
0
3
1
1
1
0
1
1
1
0
0
0
0
0
0
1
1
2
2
1
3
2
1
2
0
1
1
0
0
0
0
1
1
1
0
1
0
1
1
0
1
1
1
0
1
0
1
0
1
1
1
1
1
0
1
1
0
1
1
1
1
0
0
0
0
0
0
1
1
1
2
0
1
1
1
1
0
1
1
1
1
2
1
1
1
1
0
2
0
0
1
1
2
1
0
1
0
2
2
0
0
1
0
2
2
2
0
0
3
1
0
1
0
2
0
0
0
1
0
0
2
1
0
0
2
0
1
0
1
1
1
1
0
0
1
1
1
0
0
0
1
1
...

result:

ok 600 lines

Test #20:

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

input:

600 600 600
iieiiieeieiieeiieeeeeeeeeiiieeeieeieiiieieiieeieiieiieeiieeeeeiiiieiieeeeeeeeieieieieieeeeiieieeieeieiiieeeiieiiiieieiieeeieeeeiieeeieieieeeiieeeiiieiieiiieieieiieeieeeieieeieeeeeieieeeeieieiieiiieiiiiiieiieieieiieeeeeeeeiiiieeiieieieiieieiieieeeeieeeieieiieieeiieeiieeiieiiiiieieeeiiieii...

output:

451
468
450
379
454
443
475
455
462
422
414
458
425
357
442
351
466
170
427
445
423
421
432
453
279
152
316
456
380
419
378
451
422
399
421
443
429
373
454
461
412
381
435
372
380
225
478
437
393
444
400
417
204
420
399
437
334
435
423
353
366
398
432
452
414
474
448
339
466
470
375
399
441
458
472
...

result:

ok 600 lines

Test #21:

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

input:

598 595 600
oocvvovvcoooocvccvvccccvvooovcccocvooocccoovcvoovovoocvccovvccvvcvvooooocvovvocovvcvvcvvcooccovvcocoooovvooccvvoccvvoooocvccovcoococvvoccooooocvvvvvvvvvcoovvvovcvococcovccooccccccccvcvvvvocccoccoooovcoovocccooovcccvcoovocvvovooccooovccocvvvvoooooccvcoccococvvovcvvoovcccvcccooovvvcvcoocov...

output:

338
415
351
355
402
418
380
400
398
396
385
368
309
357
419
336
362
376
412
317
324
417
385
415
367
311
357
348
330
376
387
368
388
424
408
400
385
385
389
403
341
280
413
374
300
391
369
393
395
371
402
378
351
348
367
360
230
410
276
282
405
279
356
380
392
283
347
405
259
409
410
354
275
417
308
...

result:

ok 600 lines

Test #22:

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

input:

600 600 600
vrbjqtzxquhwydnhbnthcgrnihflqnepgglzzaqdfytyjhtnyepkpindqcnigactnchdoieasatoewbwzarqdvywmzqyrdagygqcodfwkktvvdkekzraixnbwsxmdsyglvoglmonaoygvalnusaxkrurwavcnhfiqtqjoaksfobinwrawckushbiyvcfwrxnzpnynvjfejfftrnyyyvmbnisusklaxddptriaokjcuizzdhkuirrjafhmlnzdlwcywzheuohrabkjqblntdhtzodudzeepha...

output:

169
186
141
184
175
172
129
155
175
171
147
134
157
184
136
183
183
142
159
142
168
108
155
172
179
180
159
158
182
187
179
153
167
186
149
187
186
88
189
170
187
187
170
145
167
163
172
174
178
164
154
176
188
143
177
151
159
184
155
167
171
176
146
136
190
186
190
135
157
189
184
171
174
83
93
165...

result:

ok 600 lines

Test #23:

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

input:

197 595 600
pniprybjihujrnuoascppggksbxfvrirsyvtqpatpxjhocdivnmebqxxpmlikyiiqmlsolvyaxggcbrgvjcnuaqdhhlhgrbfhgvcpchpyimbbvwxstphotzbwdiurrxhqmnfywggxhbksevlhcsjwjayvokrwfacpnfcnubmtjilxdgnojhioqwbreypkuozjgyor
urqwnxbszesevjqnjpfbqyligohhjgxrrifxmwmheomumwgwrpnpzupvbygwzjszciaseqsvixpflhrfuvtwbstlkj...

output:

23
47
46
27
32
27
38
23
61
53
39
15
11
3
46
3
63
19
33
52
24
7
67
6
48
7
74
72
9
41
61
41
11
34
38
22
50
25
39
1
19
17
11
15
39
5
9
21
19
17
5
38
38
61
26
25
18
15
3
5
31
11
50
40
22
19
21
25
23
24
12
15
27
32
28
41
38
22
68
2
14
40
27
31
52
30
18
11
24
36
6
6
23
35
39
14
27
3
33
20
63
31
38
19
58
4...

result:

ok 600 lines

Test #24:

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

input:

600 200 600
dzoekkzgisowzzbdgkbizogediiigwssgdkkbdkwkedbkiiewikwkowisgsewwigsiikekwgbkisoiogbbbogswgddggzooizigwiwbikdeekebwwoiwgbksbsoozossbwgigwdggwzwgossegkigidgdzekdsbziskzwbswzzizgsowwwboisizibzbgiogwdgiiwdizwezwigdbiwzewbewieiigkoesiidwzdewkzboswddieddwwozewbwiiogiwegoioswkdesdzgzkiwkekkgibbsd...

output:

18
65
71
67
40
8
103
14
72
44
8
20
17
36
52
33
38
42
18
79
9
67
85
42
35
39
56
89
26
54
9
59
45
4
13
28
4
28
25
36
69
83
68
70
7
72
2
41
12
23
23
22
48
34
78
69
11
17
35
77
59
31
13
35
38
17
103
34
23
8
49
36
6
44
35
108
27
46
28
32
35
93
15
100
11
21
6
45
8
17
9
69
52
2
19
55
91
7
65
107
30
14
29
2...

result:

ok 600 lines

Test #25:

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

input:

146 600 600
cwgnwnnnwwgggwwwgwnccnccwcgwwgnnnnggcnwcwwgwwwgccnwwnnncnccnwccgggnnccwnwcwggcccncwnnwgwccgcngwwwngcncgcggngngngccgcgnncnnwcgcgwgwggngcncgcccwnwgc
ggnwnggngwcwwnnwncncwgcwcgcgwncgggwwnncngngnnncggcnnwgcgwnngggcggwgwwcgwngcwgggcwwgcngncwccgccwwwwnccccnwcgnnngcgggngncnccncngwwgcnncgcnnwwwc...

output:

59
61
11
24
69
27
1
49
14
7
17
69
4
27
6
31
50
9
46
1
29
48
107
49
82
92
12
60
4
27
61
90
79
17
8
14
83
25
36
123
8
83
52
36
30
13
48
26
1
11
22
96
18
10
33
29
24
34
44
6
41
16
92
31
45
24
36
2
80
10
55
9
59
43
16
27
3
18
75
39
65
66
13
58
31
68
32
21
45
19
63
89
18
50
11
52
52
35
9
51
16
22
41
13
4...

result:

ok 600 lines

Test #26:

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

input:

600 150 600
ffffoofofffoofoffoffoffffofffofoofoooffoooooofoffoooooooofffofffooffoofoooffoooffoffofofofofffofoffffoffofofoffoooffffoofffooofffooffofofoofoooffoofoofofoofoooffffoofooofooffoofooooffffoffofffoffofofofofoofffoffffofoooffffofoofoofooofffooooofffoffffffofofffffoooffofffffofoffoooffofffofof...

output:

33
36
77
20
46
39
50
86
67
15
10
17
57
34
104
52
41
7
5
120
76
37
25
111
85
43
31
24
8
4
42
33
101
18
27
26
6
34
14
25
35
38
88
68
2
47
63
4
30
38
22
72
92
57
45
40
60
6
4
85
38
6
10
122
16
67
95
32
6
14
41
102
1
110
35
12
22
56
72
16
40
43
4
50
5
13
105
23
43
42
67
64
80
32
21
32
29
94
36
49
73
101...

result:

ok 600 lines

Subtask #2:

score: 1
Accepted

Test #27:

score: 1
Accepted
time: 129ms
memory: 8872kb

input:

600 599 100000
ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg...

output:

129
267
44
49
81
73
54
341
188
308
170
248
224
34
217
3
217
102
41
24
140
436
117
56
13
13
191
1
153
84
199
85
143
126
111
227
232
156
188
4
210
29
100
115
105
277
105
125
99
156
291
48
17
27
56
158
125
158
30
256
30
227
155
287
53
9
364
17
25
275
48
559
40
71
237
163
151
77
101
41
46
98
2
107
105
7...

result:

ok 100000 lines

Test #28:

score: 0
Accepted
time: 138ms
memory: 8816kb

input:

599 596 100000
lxxkkkkklkllxxlxklxkkklklkxkkklxkxklxxxxlxllkklkxxxxkxlklkkxkkllxklkllxxlkkxlxxlklxxklllkxlxkkxllkxkkkkkxllllllkkklkkklxlxlkxlkllxkkxlxxlllklkkxlklxlklxlkkkxlxklkxxlxkkxxlkkkklxkxkxxlxllllxlllxklkxllkkklllkkkkkkxlxxxlxxxkxkllkxkllxklkxkkxxxlkxxlxllxkklllxlxlkxxkxxklllkkllkxxkkkllxxxlk...

output:

128
111
59
14
171
88
350
100
74
114
77
19
246
27
29
76
101
132
44
103
109
125
75
152
227
161
370
273
198
83
127
108
107
75
43
163
215
126
172
158
58
142
59
8
111
18
96
95
19
10
62
137
56
16
88
29
136
57
29
211
269
6
260
149
85
22
162
17
212
352
80
40
278
265
57
101
31
35
63
175
109
18
60
88
36
84
17...

result:

ok 100000 lines

Test #29:

score: 0
Accepted
time: 133ms
memory: 8804kb

input:

600 600 100000
pthhyypncknytzxxtkoypipcftcfphyyzxitooyficztfybpxbytcnofiffnftybotbnhbfzbnkcpcfxpfbfknxfbyofczbitnkotptpnnophhbxxxccoptxhhfhznztcxoobfbkohotxnzpopfxzbcxzynhbokooyikhhtihictpnpkfpxkccxcxibnozzytytftcihkhizohytfxcfyfhyhfciibyicbykkohnnnxnochzhobiiknioofypihckcyczbnptihozbczbztfconhzhnxo...

output:

41
66
7
53
12
46
18
74
10
18
166
65
102
15
57
107
14
75
85
41
30
187
22
75
18
7
68
95
77
119
50
46
133
93
45
73
10
48
79
50
171
5
5
88
168
4
134
33
73
5
156
69
47
93
32
52
195
115
64
38
38
168
113
18
76
42
43
125
190
2
70
9
73
12
49
105
46
142
79
50
21
59
119
52
47
32
84
89
51
100
88
17
17
120
7
11
...

result:

ok 100000 lines

Test #30:

score: 0
Accepted
time: 222ms
memory: 8816kb

input:

600 600 100000
sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss...

output:

600
599
599
599
599
599
598
599
599
598
598
598
599
598
598
598
598
598
598
598
598
597
598
598
598
598
598
597
597
597
598
598
598
598
597
597
597
597
597
598
598
598
597
597
597
597
597
597
597
598
598
597
597
597
597
596
597
597
597
597
598
597
597
597
597
596
596
596
597
597
597
597
597
597
597
...

result:

ok 100000 lines

Test #31:

score: 0
Accepted
time: 212ms
memory: 8752kb

input:

600 600 100000
ppaaapaappppapppaaaaappppppaapaaaapappppappppapppapappaapapppappaaapapaappaapaapapaaapappapaappppapppaappapppappppapapaapaaaaaappppppppappaapaaaappappaapappapppaaaapappppapaaaaaaappaapppapaapaappappaapaaaaapaappaapapaappaaapaaaaaapapappppapapaaaaapaapaaaapppaaaapppapappaapaaaapppppapp...

output:

474
473
473
473
473
474
473
472
473
473
472
472
473
473
473
472
472
473
472
473
473
472
471
472
472
472
472
473
472
472
472
472
472
473
473
473
471
471
472
471
472
472
472
473
472
471
471
472
472
471
472
472
472
472
472
471
470
471
471
472
472
472
472
472
471
473
471
471
471
471
471
471
471
472
471
...

result:

ok 100000 lines

Test #32:

score: 0
Accepted
time: 128ms
memory: 8908kb

input:

597 600 100000
jrrjrjjrrjjrjrrjrjjrjrrjjrrjrjjrrjjrjrrjjrrjrjjrjrrjrjjrrjjrjrrjrjjrjrrjjrrjrjjrjrrjrjjrrjjrjrrjjrrjrjjrrjjrjrrjrjjrjrrjjrrjrjjrrjjrjrrjjrrjrjjrjrrjrjjrrjjrjrrjjrrjrjjrrjjrjrrjrjjrjrrjjrrjrjjrjrrjrjjrrjjrjrrjrjjrjrrjjrrjrjjrrjjrjrrjjrrjrjjrjrrjrjjrrjjrjrrjrjjrjrrjjrrjrjjrjrrjrjjrrjjrj...

output:

212
10
218
180
152
79
15
122
42
24
140
59
10
109
161
145
162
242
112
178
108
227
308
213
325
243
2
124
151
65
150
142
265
313
84
228
35
96
134
78
61
18
63
47
230
181
222
93
196
109
72
333
5
299
41
122
69
129
224
30
36
24
164
237
206
170
222
110
114
130
103
221
162
54
110
84
23
214
64
32
121
2
81
76
...

result:

ok 100000 lines

Test #33:

score: 0
Accepted
time: 129ms
memory: 9016kb

input:

598 598 100000
rgmagmarmargargmgmarmargargmrgmamargargmrgmagmarargmrgmagmarmarggmarmargargmrgmamargargmrgmagmarargmrgmagmarmargrgmagmarmargargmmargargmrgmagmarargmrgmagmarmargrgmagmarmargargmgmarmargargmrgmaargmrgmagmarmargrgmagmarmargargmgmarmargargmrgmamargargmrgmagmargmarmargargmrgmamargargmrgmag...

output:

26
107
182
53
10
117
188
84
143
132
159
213
125
163
63
163
56
262
63
90
181
27
54
104
83
61
107
96
172
43
72
32
93
31
211
14
233
162
106
31
275
109
206
63
76
59
122
28
11
72
373
16
11
427
9
78
180
44
70
26
211
103
162
25
67
185
169
150
56
180
233
270
34
6
53
285
48
118
90
30
169
15
76
48
5
66
39
51
...

result:

ok 100000 lines

Test #34:

score: 0
Accepted
time: 130ms
memory: 8836kb

input:

600 600 100000
yyaayyyyyyyayyyyyyyyyyyayyyyyayyyayyyyyyyyyyayyyyyyyyyyyyyyyyaaayyyyyyyyyyyyyayyyyyyyyyyabyyyyyyyyayyyyyyyyyyayyyyyyyyayyayaayyyyyayyyyyyyyyyyayyyyyyyyyyyyyayayyyyyyyyyyyyyyayyyyyyyyyaayayayyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyaabyyyyyyyyyyyyyayyyyyybyyyyyyybyyayyyyyyyyyyyyyyyyyyyyy...

output:

9
21
0
26
25
10
16
17
4
20
14
23
10
4
25
25
39
22
14
20
6
34
21
34
14
34
21
5
18
8
29
39
7
8
13
5
22
27
25
22
2
14
0
1
12
0
17
7
12
7
3
23
19
3
19
33
8
27
1
10
14
0
11
27
40
5
0
8
8
6
0
13
19
3
19
1
26
4
16
7
3
5
4
21
16
16
9
4
27
9
14
12
4
18
10
3
20
7
26
9
28
9
13
8
9
1
43
36
8
10
16
6
32
9
12
29
...

result:

ok 100000 lines

Test #35:

score: 0
Accepted
time: 128ms
memory: 9016kb

input:

600 597 100000
yyyyyyayyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyaayyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyaayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy...

output:

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

result:

ok 100000 lines

Test #36:

score: 0
Accepted
time: 130ms
memory: 8856kb

input:

600 600 100000
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy...

output:

1
1
0
1
0
0
1
1
0
0
0
0
3
1
4
2
0
0
0
2
4
1
1
0
0
0
0
1
2
1
1
0
3
0
0
0
1
3
0
0
0
1
0
2
0
0
3
0
0
2
0
1
1
0
1
4
1
3
0
0
2
1
2
1
0
1
0
2
2
0
1
0
0
0
0
1
3
1
0
0
4
2
3
0
1
1
1
3
4
2
1
1
3
3
1
1
0
0
0
1
0
3
0
0
0
0
3
0
0
0
1
0
1
0
4
2
1
0
3
0
0
4
0
2
1
0
1
0
1
1
0
0
1
3
3
2
1
2
0
0
0
2
2
0
1
2
1
1
2
0
...

result:

ok 100000 lines

Test #37:

score: 0
Accepted
time: 204ms
memory: 8744kb

input:

595 600 100000
yuuyuuuyuyyuuyuuuuuuyyyuuuyuuuuuyyyuuyuyyyuuyuuyuuyyuuuyyyyuyuuuyyyuuuuyuyuuyuuyuuuuyuyyuyuyuuuyuyyuuuyuyuuyyyyyyuyyuuyuuyuuyyyuuuyuuuuuyuyyyyyyyyyuyyyyyyuyyuyyyyuuuyuyyuuyyuyuyyyuyuuuuyyyyuyuyuyuuyuyyyyuyuuyyyuuuyyyuuuyyuuyuuyyyyuyuyyuyuyyyuuuyuyuuuyuuyyuyyyuuyyyuyyuuuuyyyuuyuyyuyyyu...

output:

1
2
2
4
5
6
7
8
6
9
8
11
13
14
15
15
12
18
18
20
21
22
23
24
24
26
27
25
29
30
31
30
33
34
35
31
37
38
35
40
41
42
43
44
45
45
47
48
49
50
51
52
49
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
70
73
71
75
74
74
78
79
79
81
82
83
84
85
86
86
88
89
90
91
92
93
94
95
96
97
98
97
99
101
100
101...

result:

ok 100000 lines

Test #38:

score: 0
Accepted
time: 205ms
memory: 8840kb

input:

598 600 100000
dbdrbcbrcbrdrdbddbrrdrrdcdbddcccrrddddrcrddcbcddbbcbcrbcbrrcrrbdrbbrdbrbdrcrbrddrdbrrrdddbbrdcbdddcbbdcdcrbdbdrccbbcbddrdccbcdcrddrbbdcbbdbbcdrdcbrdrbbrrbbrccbbbdbcbrcbbrrbcddcbddcrbcdddddrcrdrdrbbbddbbrdrccbrdbbdbrddcrdrdbccrrdrbbbbrbdbrrdcbdrbdbrrdbddbdrbbdrrcdddcbccrbccrcrcbbrcdcdb...

output:

1
3
3
4
3
6
7
8
9
10
11
12
13
14
15
16
17
18
18
20
21
21
23
23
25
26
27
28
28
30
31
32
33
34
35
36
37
38
39
40
41
42
41
44
45
44
47
30
49
50
51
52
52
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
77
84
85
86
87
88
89
90
91
92
93
94
95
95
97
95
98
100
101
102
...

result:

ok 100000 lines

Test #39:

score: 0
Accepted
time: 192ms
memory: 8688kb

input:

595 600 100000
wrqnimoioqniomihmiqcxohhrrwxrhxnxmcrqwoiqmxonrcxiriixcmomxxowmriqximhwoorrcmwqiconnqcmioiwxxwxmqrcqhchhxmqhmriohnihonoimqhxqixxwncooohohnnxqhhhoqnhhrwxnroqqinmmhwrxhhnmrwommqcooxnxqicinrhrnwocnmionrxmmhqmhccocixqqwrqixrnqomwhrcxocochmicixoncxrwowmqimoxwcoxiriqmcxqncnqmwoonocxxihhiiqxi...

output:

2
2
3
4
5
6
7
8
9
10
2
12
13
14
14
16
16
18
19
19
21
22
23
24
25
26
27
28
29
30
31
31
33
33
35
35
37
38
39
40
37
42
43
44
45
45
47
48
49
50
49
51
53
49
55
56
57
58
59
60
60
61
62
63
64
64
66
67
60
68
69
69
69
70
68
72
73
74
75
76
77
78
79
79
81
82
82
83
83
82
84
82
85
86
87
88
87
90
90
92
91
93
91
9...

result:

ok 100000 lines

Test #40:

score: 0
Accepted
time: 109ms
memory: 7092kb

input:

195 600 100000
ycjfiapjcnfrvarzqbmhkxmxiysiqkcegzraixnnctvqmowfgnmawkcugeksqumspmgbncsuiqiaeccwxlosqrcdjwkfpnfjrpvrxjoukarkoyqoerqdrlyfgskfntagzcrtljxkbzxuefjdavcgseahcmygonawcpwnhkbgjisizlbvyztqiqbszantfbplwjk
yyycfmlhwztxtsqyqgiepeyplvphvtllckdpywnhfjxibwaumsgljxtqvlcmqourpnctoexwwcfhuvdewwslwnvsa...

output:

1
7
49
32
37
19
19
42
71
6
11
14
21
28
11
15
39
28
86
31
12
52
7
58
35
27
29
12
29
26
25
16
45
7
9
39
24
27
4
11
26
27
2
8
3
52
20
15
22
23
31
5
7
13
54
30
14
54
33
33
12
18
24
37
43
16
26
29
18
14
31
4
36
10
10
16
15
27
44
4
9
8
36
22
23
24
7
5
35
19
58
41
7
9
25
54
16
37
9
20
22
23
32
7
27
36
17
1...

result:

ok 100000 lines

Test #41:

score: 0
Accepted
time: 104ms
memory: 6808kb

input:

145 595 100000
rrrtotgggogotgtgootgoortgogrogorroortrrttgrgogottggrtortrrgtgggootgtgggrotrtrrrtrrgotorrgogtrrgtogttgrottrggtrorgrogoogrtrtrrgrgrotoottrooggrttgg
trggrgtgoogorgootgggrorrrgrrtogtogrttrrtroogotrotrgrtogrtrotgtooorggrgtottrgrroogggrrtrgrtgotogorggrrgrtrrrttroogoogotgrgtgogogrortgootgotr...

output:

42
15
41
14
125
18
26
77
17
27
44
77
70
7
13
2
103
14
94
28
23
78
19
30
38
73
1
64
61
54
38
28
8
14
44
50
16
39
7
91
47
39
70
12
13
44
12
14
3
32
24
3
12
89
29
95
61
29
19
14
58
14
68
2
23
23
81
52
47
104
54
43
33
1
77
2
34
37
62
36
62
2
46
75
35
70
12
4
73
25
7
78
11
13
28
31
36
63
51
82
24
24
70
8...

result:

ok 100000 lines

Test #42:

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

input:

1 600 100000
v
wvvwwwwvwwwvvwwwvvvwvwvvwvwwwwvwwwvwvwwvvvvwwvvwwwvwwvvwvvvvvvvwwwvvwvwwwwvvwwwvwwwwvwwwvvwwwvvwvwwwvvwvvwvvwwwwwwvwwvvwvwwvvwvvwvvwwvvvvvvwvwwwwvvvvwwwvvvwwwvvvvwwvvwvvvvvvwvwwvwvvwwvvvvvwvvwwwvwwwwwwvwwwvwwwvwwvwvwvvwvwvvvvvwvwwvvwvvwvwvvvvwvwvvvwwwwwvwwwvvvwvwwvvvwvvvvwwvvwvwwvwwvw...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 100000 lines

Test #43:

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

input:

600 600 1
sppspsspppsppsppppsssspsssspppppppspppppssspppppspppsppppssssspssspsspspppspssppsppspssppppspppppppsppppspppspspssssssspssspspssssspspsspsssppspsppppppppppsssppspsspspssppppppspspspsppspspppsspppppsppspsspppssspssppspssspssssspsppssspssppssspppssppsppsspspsssssssspppssspppppsppsspppspppsps...

output:

122

result:

ok single line: '122'

Subtask #3:

score: 1
Accepted

Test #44:

score: 1
Accepted
time: 138ms
memory: 8964kb

input:

598 600 100000
vvavvaaavvvaavavavaaaaaaaavvavavvavvvavvaavvvaaaaavvvvvaavaavvvvvavvavaavavaavvvaaavvvvaavvaavaavvvvavvavvvvvavavavvavavvaavvavavvaavvaavaaavvaavaaavavavvavaavvvvaaavvavavavvaavvvvaavvvavaavvvvavavvaavvvvavvavavvvvvvaaaaavvaaavvvvaaavvvaavavvvvvavaavvavavaaavvaavaaaavaavavvvvvvaaavavv...

output:

104
29
89
42
15
20
112
3
143
38
126
67
105
170
51
309
128
188
173
88
91
147
21
4
138
94
244
19
123
14
308
90
28
345
60
308
56
113
126
266
10
207
253
79
278
45
120
132
176
43
89
87
102
82
43
88
148
61
60
46
35
113
198
342
7
209
211
20
75
118
103
113
92
210
154
58
64
49
103
30
18
101
102
53
55
27
30
3...

result:

ok 100000 lines

Test #45:

score: 0
Accepted
time: 140ms
memory: 8932kb

input:

600 599 100000
sovouoquoudzqsdqodzozduuvvzozuuozuuooovussdodqqsvzzzzqqvudsozosdzouquuzuouvzduvzqsozqduvvoudodqsdvvoqdsqdszuuzoddqozosvdosqvuzuszzuduzusuusvszzqssvvsvoooduvdosuduzovsoouduvodqsdsvddvussudvdzvozqzdvvvdqzqdzdszudqsusvvdsozquzdsduosddvsqzozdsqsvoddosdsvouvzdzodqsvdoououzoudvqquddssddvvuo...

output:

96
48
62
185
134
95
134
192
83
40
144
59
64
141
65
135
47
45
174
201
4
62
12
150
193
102
54
53
21
66
12
64
23
31
146
53
101
72
74
15
1
51
55
211
163
141
47
46
18
29
84
92
27
88
113
32
24
198
12
99
111
183
39
59
107
33
83
173
49
56
71
159
118
53
111
74
57
27
49
109
126
50
61
55
60
70
68
209
118
62
30...

result:

ok 100000 lines

Test #46:

score: 0
Accepted
time: 131ms
memory: 8916kb

input:

599 597 100000
dlobkkabzmxeckcjomzodkuaruhhgelyijvtqsvlyppvyndaeqtryvqunyislfxjuebpngeloinzimyzftnvwinbrllgrjngfetmxfhjhxrjgmvlmvufanvuclwtcfcyqacnpyzkohlqqluuynwgrcwyasfurncabtuzlkaxuppnpsxsufhxmtkygeuezfrfvlocyqavsuvmlshrxdozmulelzraocluuvsyuqhmtxdigfvojbpcjpcxbznsgwlwgfumirgcfecaxbolrbxsoppdeajtk...

output:

68
64
108
26
76
108
25
45
119
38
67
12
13
39
60
61
44
50
16
34
21
58
8
3
126
3
28
89
5
47
23
43
91
18
59
97
101
73
88
2
47
5
20
17
41
58
68
35
46
123
1
70
9
36
37
51
113
37
24
32
38
103
27
0
78
2
24
55
15
14
120
47
42
67
83
64
62
54
100
25
119
21
107
48
81
80
74
93
60
74
85
89
58
87
36
107
90
30
71
...

result:

ok 100000 lines

Test #47:

score: 0
Accepted
time: 201ms
memory: 9392kb

input:

600 600 100000
ppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 100000 lines

Test #48:

score: 0
Accepted
time: 208ms
memory: 8652kb

input:

600 600 100000
ohlkedunzaykbsophifzejvspalbivprvxeqtwfzlkqnijbezjzcyheozxwogvbgaerxzwsjnbfihytnhbuhkbmxthgxkwikmfehngudhkgnxowldcgwlftsxdkmaoujlvbyoxhkqqiibqqqfpvehrsmvkpyipddnzklaeocxxcynwrnvzhjmaxmldubmhekhoglngtzgjsqgsntlwerlisymmiaoxaemdgucuhiswftkbkjwimpobntyxmqdcjjbrmiuebfdwgazhahvhziaesrqjbek...

output:

191
191
190
191
190
191
190
190
191
190
191
190
191
190
190
191
190
190
190
190
191
190
190
191
190
190
191
190
190
190
191
190
190
191
190
190
191
190
190
190
190
190
190
190
190
191
190
190
190
190
191
190
190
190
191
190
190
191
190
190
191
190
190
190
191
190
190
190
191
190
190
190
190
190
190
...

result:

ok 100000 lines

Test #49:

score: 0
Accepted
time: 133ms
memory: 8808kb

input:

600 600 100000
cbdbdcdcbbdcdcbcbddcbcbdbdcbdcdcbcbddcbcbdbdccbdbdcdcbdcbcbdbdccbdbdcdcbbdcdcbcbdbdcdcbcbddcbcbdbdccbdbdcdcbdcbcbdbdccbdbdcdcbbdcdcbcbdcbdbdcdcbbdcdcbcbddcbcbdbdcdcbcbdbdccbdbdcdcbbdcdcbcbdcbdbdcdcbbdcdcbcbddcbcbdbdcbdcdcbcbddcbcbdbdccbdbdcdcbbdcdcbcbddcbcbdbdccbdbdcdcbdcbcbdbdccbdbdc...

output:

55
129
82
18
49
81
26
29
224
133
75
98
87
197
29
176
57
22
116
17
46
85
224
91
122
318
19
20
31
54
124
136
82
56
167
290
4
21
25
54
222
194
48
1
132
170
10
149
62
55
277
156
2
25
128
284
13
190
40
7
169
94
4
119
41
145
195
36
20
304
110
193
11
15
52
43
31
225
102
41
27
179
168
18
6
152
34
296
77
37
...

result:

ok 100000 lines

Test #50:

score: 0
Accepted
time: 132ms
memory: 8924kb

input:

596 596 100000
yyyyyyyyyyyyayyyyyyyyyyyyabyyyyayyyayayyyyyyyyyyyyyyyyyyaybyyyyyyyayyyyyyyyyyyyayyayayyayyyyyyyyyyyyyyyayyyyyyyyyyayyyybyayyyyayyyyayyyayycyyayayyybyyyyyyyayyyyayaayyyyybyyayayyabyayyyyyyyyyyybyyyyyyyyyyyayyyyyayaybcayyyyyyybayaayayyyyybyyybyayyayyyyyyaayyyyyaayyyaycyyyyayyayybyyayayy...

output:

28
8
1
47
9
23
72
5
15
27
6
31
60
22
22
8
7
0
5
68
40
9
83
36
28
10
6
29
3
4
7
15
22
8
28
16
1
10
4
62
32
29
56
89
2
22
4
18
32
1
57
4
2
3
25
4
22
6
14
61
8
47
10
20
3
3
18
35
72
28
23
18
5
9
48
10
14
11
15
14
57
32
16
8
2
2
39
12
16
8
55
11
19
3
75
44
77
66
1
66
19
8
58
14
6
99
53
76
14
30
3
7
18
7...

result:

ok 100000 lines

Test #51:

score: 0
Accepted
time: 130ms
memory: 8904kb

input:

598 600 100000
yyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyayayyyyyyyyyayayyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyayyyyyayyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyybyyyyyyyyyy...

output:

6
2
22
9
2
2
12
1
9
2
12
12
13
16
18
23
8
2
11
14
0
3
2
2
8
3
7
14
2
6
9
0
9
9
6
6
7
12
0
0
3
6
1
0
13
10
14
9
1
19
8
5
15
9
8
7
9
1
16
2
9
14
0
26
5
14
6
7
1
5
22
10
16
3
12
23
11
12
14
12
2
4
3
6
1
8
25
1
10
10
5
3
6
3
13
1
7
15
13
0
0
0
0
5
3
18
16
1
4
7
8
4
0
0
4
1
27
23
11
4
1
5
4
8
7
11
4
20
3...

result:

ok 100000 lines

Test #52:

score: 0
Accepted
time: 130ms
memory: 8952kb

input:

600 600 100000
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy...

output:

0
0
1
0
2
0
0
0
2
2
2
1
2
2
1
0
0
2
2
1
0
0
1
0
1
1
0
3
0
2
4
0
0
2
2
1
0
0
1
3
2
2
0
1
2
0
1
1
4
3
0
1
2
3
0
0
1
2
2
1
1
2
1
3
2
2
0
2
1
2
1
1
1
1
5
2
1
0
2
2
2
1
0
0
0
1
1
3
1
1
1
0
1
0
2
1
0
0
1
2
0
2
1
1
0
2
0
0
0
1
1
2
5
2
0
0
4
2
1
2
1
1
1
1
1
1
3
0
0
1
3
2
1
2
1
3
2
4
2
1
4
1
0
1
1
1
3
0
1
5
...

result:

ok 100000 lines

Test #53:

score: 0
Accepted
time: 129ms
memory: 8860kb

input:

600 598 100000
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy...

output:

0
1
1
0
0
0
0
0
0
0
0
1
1
1
0
0
0
0
1
1
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
1
0
0
1
1
0
0
0
0
1
0
0
0
1
0
0
0
0
0
1
0
0
1
1
0
0
0
0
0
0
0
0
0
1
0
0
0
0
1
0
1
0
1
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
1
0
1
0
1
0
0
0
1
0
0
1
0
0
0
0
0
1
0
0
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
1
0
...

result:

ok 100000 lines

Test #54:

score: 0
Accepted
time: 205ms
memory: 8904kb

input:

599 596 100000
zanaznnnzanazaznnaannannnanaannnanannanzzzazanzazzzanananzannanzaazznnaaazananaazzznnnanaazaannaznnaznznzznazznazzanannnznznaaznzaanannanaaaaannnznnzzznzaaannnananznananzaannzzzznzaznnnzaznanaznaananaaznzznzaanaazaannzzaazzannnnzznzannznzanazannznnaanannnzaaannaaznzanazznzzaaaznzznnaz...

output:

1
1
3
3
5
6
7
8
8
10
11
12
13
14
14
11
17
18
19
20
21
22
23
24
25
25
27
28
22
30
31
32
33
31
35
36
37
38
39
40
41
42
43
44
44
46
47
48
49
50
51
52
53
54
55
55
57
58
59
57
61
62
63
64
46
61
67
60
69
70
71
72
72
73
75
76
77
78
79
80
81
82
83
84
85
86
87
88
86
90
91
92
92
94
95
93
93
98
99
100
101
102
...

result:

ok 100000 lines

Test #55:

score: 0
Accepted
time: 195ms
memory: 8648kb

input:

599 597 100000
uczhhlcrzcurllcluzzuchcclrlrcrrlchuczruzczllzzrlccurlhhcuuzcucrzuruuhhuzhzlccrrzurlhucuuczchzhhrucuhchlzhllrrzucllhlcczcrcuczrrcclrruhczzhhhllzcrclzulrrlculzhcrhhlhhllhlrlczllchrrzlzclzzlzuhucuuzrlhrurluuzrcuhuhhhczrhuucuzzzcrcruclzullhrhhhhhuzhlhcllcruhrclcuzhrzhzzuchhluzuzuzururzrzu...

output:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
15
6
18
19
20
21
22
20
24
25
26
27
28
29
30
31
32
26
33
35
36
37
36
39
40
41
42
43
44
45
46
46
48
49
50
51
52
53
53
55
56
57
58
59
59
61
62
62
64
65
66
67
68
69
70
71
72
72
60
75
76
77
78
79
80
81
82
75
82
85
86
87
88
89
90
91
92
92
92
95
96
97
98
99
100
101
102
1...

result:

ok 100000 lines

Test #56:

score: 0
Accepted
time: 197ms
memory: 8812kb

input:

598 597 100000
rmzluflvffhvbynxmlhrlskuqtzsgukxmgdlfubznbpwyiwdbxbwrbieutdtxwohlirghaozbjoyftkvjnqufqxgiubqgqsieilqvjswhlywsovgsjgclcchdhkaxxbgwxkxhxvngwtelusixzscxvhnodjittghpifuyqfjeatwcausglvukzqbfyjcmlmuccxrotvetgqbjbgcexvhubtwqrskhlhthwgzqbztklublmheniiuiakkvzpdeaaowkkljlkybtrdjkhjcaimyxlpkopci...

output:

1
1
3
4
5
6
7
8
9
10
10
12
7
14
15
15
16
18
19
19
21
22
23
24
24
25
26
27
28
29
29
28
28
31
32
33
34
35
36
37
37
38
35
39
40
41
41
41
42
41
41
43
43
44
44
45
45
45
45
46
46
47
48
46
49
50
50
50
51
51
51
52
53
53
54
55
55
56
56
56
56
51
57
58
58
57
58
59
60
60
61
61
61
61
62
63
64
62
65
66
67
68
69
7...

result:

ok 100000 lines

Test #57:

score: 0
Accepted
time: 55ms
memory: 7072kb

input:

600 200 100000
mqgmqqnirmiwigtniwmrmeeinxgmwrqimrtqxwwtiirrxqgttrxeewmgrrqmiwwnnrxnmxnntxrntmxtwnwwtqxmxrqxnitegtrexmiegrrrgtmiegxntqinixxgxigtrwinwtggerxewxngiqrmiqmwqwxqxiwtxewxmnxwtergexximeqqmqmqinqennwtnengxgtnrwmteeqiiwgmmeinnwxinixneierggtmmgrgnwwtgmremiqwgiimggxrxtgmmenngnqgtwegmnemtiiiiwwgx...

output:

3
18
64
36
76
8
15
15
40
76
55
56
40
50
38
40
42
64
13
74
63
60
20
64
32
91
112
5
4
125
21
65
93
18
40
33
31
104
50
21
65
82
78
12
16
2
70
14
33
14
13
33
35
61
67
84
10
35
108
74
50
16
1
23
3
14
31
64
28
41
52
85
88
12
0
6
46
41
76
33
40
89
78
70
8
40
6
7
6
13
32
42
31
49
91
47
92
102
20
18
30
30
24...

result:

ok 100000 lines

Test #58:

score: 0
Accepted
time: 50ms
memory: 6868kb

input:

600 150 100000
lcccllcclclllclllclllllllclcclllccllcllcclcllclccccllclcllcclcllllcccccccccllccclccllcllcllcllclccllccllcclllllccclccclllcllcllccccclccllcclllllllccclllccccclcccclclllccllclllclccccclclllclccccllclccclccclccllllccllccllllccccllllccllclclclclllcllclcccclclccllclcllcccclcclclclcllccccll...

output:

26
110
46
28
26
15
6
5
25
46
65
15
34
45
26
30
5
64
16
15
30
33
63
67
43
26
63
11
32
22
67
8
85
61
86
62
20
10
57
72
48
17
7
20
58
59
12
26
108
20
66
62
51
65
17
33
9
19
6
30
54
94
73
80
18
32
1
10
118
18
4
70
49
34
45
66
28
22
62
94
11
86
56
22
17
8
23
46
2
5
106
16
16
31
23
71
57
75
24
41
30
25
84...

result:

ok 100000 lines

Test #59:

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

input:

600 1 100000
vcvcvcccccvvvcccvccvvvvvvcvvcccvvcvccccvvccccvcvvvvvvcvcccccccccvvvcccccvvvvcccvcvccvcccvccccvvvvccvcvccvvccvvvvvccccvcccvccvcvvvvcvcvvvcccccvccvcvvvcvvccvcvvcvvcccvvccvcccvccvvcvcvvcvcvccccvcvccvcccccvcvcvvvvvccvvccvccvvvcccvvcvcvcccvvvvvcvccvvvvccccvvcvvcvvcvvcccvvvvvvccccccvcvvvvvcvc...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 100000 lines

Subtask #4:

score: 1
Accepted

Test #60:

score: 1
Accepted
time: 221ms
memory: 74440kb

input:

3000 3000 5000
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww...

output:

1391
560
1096
565
277
1797
1279
524
764
778
56
206
1829
1023
934
83
742
977
616
126
742
292
385
1384
276
66
1265
663
59
351
815
284
1316
201
876
535
243
1102
606
328
112
117
584
22
772
350
377
398
297
378
181
64
735
39
38
449
638
52
30
195
70
238
1231
323
24
1298
51
2017
1537
1665
202
1217
1097
683
...

result:

ok 5000 lines

Test #61:

score: 0
Accepted
time: 419ms
memory: 74560kb

input:

3000 2997 5000
hhbbhbllbhlhllllllblhbhhbhhhhlbbbhhhbhlblhbhhllllhhhhblbhbbhlbhlhbhhlblblbhlbblhhlllhlbllbbbllhhbllbhbhlbllllhllhhllhlhblhbhhhbhhllbbllhbbblbblhhhbhhllhbhlblblblbhhhblblbhlbhhhhbbhllbbbbhbhlllllhllhlhhblllllhbbbhlllhbllbhbhlllbblhbhhlbhbbbhblbllhbbblllbhhlhblbhbhllhbhlbblhlllllhhllhbb...

output:

221
209
189
592
369
196
440
26
7
183
111
1678
1253
922
876
567
508
140
1263
320
343
67
43
1603
283
1404
58
225
95
380
669
153
1086
915
195
1231
758
698
552
147
461
93
164
918
166
1157
508
180
114
372
222
1193
619
90
187
1273
799
215
970
1256
1057
320
754
537
503
397
1511
112
1187
940
8
110
35
75
500...

result:

ok 5000 lines

Test #62:

score: 0
Accepted
time: 364ms
memory: 74228kb

input:

3000 2995 5000
dxyfopgwwiyioofvgxwfigotwytfymvmvgmvfvwtodfoxfmgvxtdiypfmdpxgxtwidgpdtdywxiyxvptdvoowpmfoyveeymywdtxttwwomdodmtddvevwidmdwfeypmfwgypiwmgdtifvpoexpgmwemmetftvwfmgtmxmdigiymwgvdeogyfxvyppeeioettmyvwggomxgwtyfvoftwpipmtteiwgoewdetgfxfemoxigxxmtxoyiodmwtdoixxffdogmofmvttdtmwtmyyweegpoytwt...

output:

198
115
643
143
172
383
546
332
127
137
157
78
90
256
279
321
327
230
145
7
15
22
111
102
498
426
548
165
217
623
650
544
335
916
481
152
193
340
408
445
31
176
600
246
301
216
284
625
704
270
138
515
452
215
466
149
245
335
47
456
156
454
436
193
436
564
602
753
307
418
147
332
789
507
245
779
308
...

result:

ok 5000 lines

Test #63:

score: 0
Accepted
time: 99ms
memory: 74280kb

input:

3000 3000 5000
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv...

output:

3000
2999
2999
2999
2999
2999
2998
2999
2999
2998
2998
2998
2999
2998
2998
2998
2998
2998
2998
2998
2998
2997
2998
2998
2998
2998
2998
2997
2997
2997
2998
2998
2998
2998
2997
2997
2997
2997
2997
2998
2998
2998
2997
2997
2997
2997
2997
2997
2997
2998
2998
2997
2997
2997
2997
2996
2997
2997
2997
2997
...

result:

ok 5000 lines

Test #64:

score: 0
Accepted
time: 118ms
memory: 74228kb

input:

3000 3000 5000
aappapapaaapapppaaappaaapaappaappaaapappaappapppppapppaaaapappapppppppaapapapaapappappaappappaapppppaaaaapaaaapppaaapppaappaapapppaappapappppppppapaappaaapappppapapapppppapaapaappapappapapaaaapppppaaappaapppaapapappppppaaaapaappapapaapaappppapppaaaapaaappppppappppaappappaaaaaapappppap...

output:

2422
2421
2422
2421
2421
2422
2420
2421
2421
2422
2420
2420
2421
2421
2422
2421
2420
2420
2421
2421
2422
2419
2421
2420
2420
2421
2421
2422
2419
2419
2420
2420
2420
2421
2421
2422
2420
2419
2419
2421
2420
2420
2421
2421
2422
2421
2420
2419
2419
2420
2420
2420
2421
2421
2422
2419
2421
2419
2419
2419
...

result:

ok 5000 lines

Test #65:

score: 0
Accepted
time: 251ms
memory: 74564kb

input:

3000 2997 5000
feefeffeeffefeefeffefeeffeefeffeeffefeeffeefeffefeefeffeeffefeefeffefeeffeefeffefeefeffeeffefeeffeefeffeeffefeefeffefeeffeefeffeeffefeeffeefeffefeefeffeeffefeeffeefeffeeffefeefeffefeeffeefeffefeefeffeeffefeefeffefeeffeefeffeeffefeeffeefeffefeefeffeeffefeefeffefeeffeefeffefeefeffeeffef...

output:

1000
1042
455
253
739
258
735
507
756
458
67
35
191
835
52
306
174
601
121
217
1009
1472
570
117
189
476
448
1606
703
1690
728
879
253
528
174
729
237
103
885
530
107
1054
371
1426
612
575
337
338
439
936
149
41
422
402
219
187
113
382
1307
88
366
880
1118
537
314
22
676
920
583
65
118
98
392
525
19...

result:

ok 5000 lines

Test #66:

score: 0
Accepted
time: 260ms
memory: 74568kb

input:

3000 3000 5000
zuntuntzntzutzununtzntzutzunzuntntzutzunzuntuntztzunzuntuntzntzuuntzntzutzunzuntntzutzunzuntuntztzunzuntuntzntzuzuntuntzntzutzunntzutzunzuntuntztzunzuntuntzntzuzuntuntzntzutzununtzntzutzunzunttzunzuntuntzntzuzuntuntzntzutzununtzntzutzunzuntntzutzunzuntuntzuntzntzutzunzuntntzutzunzuntu...

output:

224
149
69
722
217
384
163
231
1196
184
648
131
94
93
393
322
185
91
1053
38
504
414
946
566
1024
242
1822
269
538
1192
563
1151
708
147
331
475
964
108
314
154
555
944
94
340
132
549
569
93
665
1192
19
232
1314
1272
1393
63
1317
418
836
745
22
236
300
458
1269
124
219
777
327
240
93
645
1133
16
576...

result:

ok 5000 lines

Test #67:

score: 0
Accepted
time: 271ms
memory: 74556kb

input:

3000 3000 5000
yyabyyyyyyyyyyyyyyayyyyyayyyyyyyayyyyybyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyybayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyybyyyybyybyyyyyyayyyyyyyyyyyyyyyyyyyyyayyyyyyyyyaayyyyyyyyyayyyyyyyyyyyyayyyyyyayyyyyyyyyyayyyayyyyyayyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyy...

output:

180
35
5
53
12
48
40
53
67
42
45
64
11
2
96
65
43
131
138
30
30
171
22
67
41
59
118
152
57
96
38
160
8
94
173
77
8
10
198
25
89
0
14
29
63
54
30
35
2
82
110
55
9
35
41
68
18
29
172
43
1
16
28
4
85
177
60
19
206
40
202
34
107
62
15
153
92
131
98
69
7
48
26
100
27
9
3
12
148
59
77
63
5
161
202
92
63
1...

result:

ok 5000 lines

Test #68:

score: 0
Accepted
time: 266ms
memory: 74248kb

input:

2995 2997 5000
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyaayyyyyayyyyyayyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyy...

output:

41
22
43
7
18
55
4
2
16
10
12
6
49
38
1
0
64
8
22
8
13
25
1
2
50
29
1
22
24
8
23
13
1
3
62
30
24
34
43
53
2
4
46
1
12
28
20
44
23
13
60
2
26
10
0
0
16
8
8
22
41
3
0
5
2
87
36
24
49
13
2
16
33
42
31
12
19
31
33
15
16
42
35
20
8
19
36
14
35
4
20
8
17
30
57
18
22
7
32
5
29
57
0
43
19
10
12
17
18
1
10
4...

result:

ok 5000 lines

Test #69:

score: 0
Accepted
time: 259ms
memory: 74500kb

input:

3000 3000 5000
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyybyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy...

output:

2
0
5
2
1
1
5
7
0
0
7
5
3
0
3
5
0
4
0
4
7
2
0
0
2
0
4
0
3
5
3
2
0
7
2
1
1
4
3
3
4
1
0
5
5
3
2
1
6
3
3
5
4
8
2
2
0
0
0
3
5
3
5
5
0
0
2
4
1
0
2
0
1
3
3
1
2
0
0
1
1
0
2
4
8
6
3
6
2
5
8
0
5
3
0
0
4
2
0
4
7
2
7
0
1
0
5
13
5
2
2
3
6
1
2
1
3
0
0
2
2
3
1
10
3
0
5
4
3
0
3
3
3
4
3
2
2
0
0
8
2
4
5
7
5
4
3
1
0
...

result:

ok 5000 lines

Test #70:

score: 0
Accepted
time: 279ms
memory: 74556kb

input:

3000 3000 5000
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy...

output:

1
1
0
1
0
1
0
0
0
0
0
0
1
1
1
1
0
0
0
1
1
0
1
0
1
0
0
0
1
0
0
0
1
0
0
0
1
0
0
1
0
1
0
0
0
0
0
1
0
0
0
0
0
1
2
0
0
0
1
0
0
1
0
1
0
0
0
0
0
1
0
1
0
1
0
1
1
1
0
1
1
1
0
0
0
1
0
1
0
0
1
0
0
0
0
0
0
0
1
0
1
1
1
0
1
1
1
0
1
1
0
0
0
1
0
0
1
0
1
1
0
1
0
0
0
0
1
1
0
0
0
0
0
0
0
0
0
1
1
0
1
0
0
0
1
0
1
0
1
1
...

result:

ok 5000 lines

Test #71:

score: 0
Accepted
time: 248ms
memory: 74320kb

input:

3000 3000 5000
ziizzzzzzzizzziiizzzizzzizziiiiizizziziziiiiiiziiziiiizizziizzizzizziiiizizizizzziiizzziiziiizziizizzziizzzziiiiiziizziiiziiziizizzzzzizzzziiiiziiiizzziiziziiziiiziiziziizziizzzizzizizizizizziiiiziiizzzzziziiizzizzziizizziiziizzzziizzzizzzzizzizzizzzzziizzziizzzizzizzizzizzzzizzzizizi...

output:

1606
2085
2241
2299
2392
2232
2065
2175
2247
1930
2273
1015
1696
1993
2260
2260
1789
2137
1875
2203
2216
1631
2285
2217
999
2277
1714
2176
1760
2173
2376
2132
2181
1241
2082
1053
1503
2095
1821
2224
2415
1972
2223
2162
2309
2296
2329
1809
2318
2200
1845
2032
1374
2299
1782
2185
2334
2179
2259
2330
1...

result:

ok 5000 lines

Test #72:

score: 0
Accepted
time: 242ms
memory: 74308kb

input:

2997 3000 5000
vammvvgvmmmavvmvmvgamaavmavaavmagvamgmggmgavmmgmgagvgaamgggvmaaammaammgavvvgmgmgvmvamgmvgmggammggvmvamgagvmgvmgvvvvgaavgvmgamgagavmvgaggmavmvmagvgmgagmaaamgaggvvmvgamgggaggavgvvagagmggagmamavmavmvggmvmmgagvmavmmggggggmvvvmvmgvvvaggvmaamavgagmvvaavaamgmaaamavvmvgagvvmvgvvgvmavmgavmvagv...

output:

1749
1726
1903
1766
1576
1350
1829
1834
1919
1781
1741
1478
1827
1795
1715
1909
1446
1636
1567
1619
1524
1666
1869
1860
1682
1884
1787
1768
1521
1806
1799
1506
1406
1875
1713
1894
1794
1584
1756
1486
1846
1484
1779
1679
1868
1895
1702
1764
1929
1739
1417
1661
1090
1582
1888
1186
1744
1814
1713
1716
...

result:

ok 5000 lines

Test #73:

score: 0
Accepted
time: 197ms
memory: 74240kb

input:

3000 2995 5000
vauivcxzciwczezbxzzabbzuebezuivcxzvexccaaicuzxzewcxazcbvvebvbazcivuexexucbuwuwwcvieuuzwvzicviczbuiveceewvvaiwbxiziwuxwvuezuvxeazixiviuxezxzbuxvcabewczabaeuecxiiuczecwuuuwuzwuvxwvuzazvwcbcbubevxcvbuziczaxbivczeuvxzwwezxvbvzczcwwbvbvauccbbxwaeiuixxabuaecaziuzeeavbibxuwiecxciubabcaezwvww...

output:

1079
1358
1357
1194
1135
1293
1312
1360
1025
1133
1320
1256
1145
1305
1261
1388
1187
1290
1329
1166
1215
1224
1372
1273
1305
1047
1286
1250
1360
1326
818
781
1335
1305
1333
1224
1205
1384
1115
1252
1322
1391
1219
1327
1381
1097
1264
1358
1379
1120
1286
1307
1163
1389
1360
1212
1273
1322
926
1341
139...

result:

ok 5000 lines

Test #74:

score: 0
Accepted
time: 144ms
memory: 27524kb

input:

1000 3000 5000
hgwnoneomorolniwwflwjfrmctpeiaatnfyuhwsuwvfgndesbglbcxqmgimourdsqifdpaeagnloilekpjomigpnrpswuujwtxaxzzoxjyvwozeqvkallinfisqqtvyajlfywajdjyehrikmyetuvuwitavexehjexeuqnjnrqgbghennlbneisouoqujvkcjpcobrebgodbdlqkcolwdlhlbmgvlnxsvbtbpippqliyunrvksxlkyqjffturvtkvihboeftkuffvxnsninfmlcimxbmn...

output:

116
157
41
188
122
160
12
199
210
69
141
36
69
311
206
162
90
209
155
199
78
103
213
105
58
102
83
159
53
156
28
204
319
228
78
103
154
76
170
103
38
126
163
260
162
171
353
62
225
18
244
67
242
30
249
165
135
74
389
80
234
48
232
251
49
60
261
148
127
341
31
158
34
192
18
23
192
137
384
76
63
101
9...

result:

ok 5000 lines

Test #75:

score: 0
Accepted
time: 140ms
memory: 21552kb

input:

749 2997 5000
hnnhanmaahhhnhmmhhnaamnnahahhhhmahahnnnhhhmmhnnnnhanaannaamhnmammmahhanmhahahhnmhnhmnhnhahnnanmaaamnamaamhnnhnmhmahmmmhmhhnhaannnhnhhmahnnmhmmnhanmhaaaahmhnmanhammhmamnhmaahmhnanhmmmnannahnmmaaahhnaahnnmnhhaaannhhmamnhhmnhnhnmnnahmhhnnhnmhnhaaahhahmhaahmahnaamhamnaahnhnhnhnahnanmhmnman...

output:

397
191
243
4
113
24
599
46
148
151
269
98
45
137
68
98
117
35
207
120
39
419
99
356
370
263
125
177
219
187
219
18
125
179
553
151
21
88
127
456
5
150
320
205
65
74
352
250
26
328
126
182
108
101
294
319
237
275
59
243
120
391
21
46
173
69
84
91
400
126
15
441
64
517
381
368
321
469
193
313
124
177...

result:

ok 5000 lines

Test #76:

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

input:

1 3000 5000
m
mmmmmfmmfmfmffmmfffmmfmfmffmfmffffmffffmffmfmmmffmmfffffffmmfffmfmmmffmmmmmmmmfmmmfmfmfmmmmmmmmfmmfmffmfmmfmmfmmfmffmffffmfffmmfmmffmmffmmmfffmffmffmmmmfmmmfmfmmmfmfmfmmffmffmfmfmmffmmfmffmmffmmmmmffmmfffmmmfffmmmmffmmfmfmmmfmfmmmmmmmmffmfmfffffffmmffmmfmmfmfmffmmfmmfffmfmfmfmfffffmmff...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 5000 lines

Test #77:

score: 0
Accepted
time: 80ms
memory: 74164kb

input:

3000 3000 1
aaaeaaeaaaeeeaaeeeeaeeaeaaeeeaaaeaeaeaeaaaaeeeeeaaeeeaaeeaaaeeeaaaaaaaeeaaeaaaeeaeaeeaeeaaeaeeaeeaaaaaaaeeeeaeeeaeeeaeaeeaeaeeaaaaaeaeeaaeaeaeeeaaeeeaaeaaeeaeaeeaaaeaeeaeaeaaeeeeaeeaaaeeeaaaeeaaeaaaaeeeaeaaaeaaaeaaeaeeeeeaaaaeeeaeeeaeeaeaaeaaaeaeaaeaaeeaeeaaeaaaeeaaeeeaeeeeaeeeaaaeaeaeaa...

output:

83

result:

ok single line: '83'

Subtask #5:

score: 1
Accepted

Test #78:

score: 1
Accepted
time: 421ms
memory: 74412kb

input:

3000 2997 5000
xbbbxxxxbxbxbxxbbbxbxbxxxxxxxbxbxbbxbxxbxbbbxbxxxbxxxxbbbxbbbxxxxxbbxbxbbbxbxbbxxxxxbbxxbxxbbxxxxbxxxxxbxxbxbbbbxxxxxxxbbbxbxbbxbbbbbxxxbbxbxxxbxxxbxxbbxbxbxbbxxbbbbxxxbbbbxxxxxbxxbbxxbxbbxbbbxbbbbbbbbxxxxbbbxbbbxbbxxbbxbxxbbxxbxxbbxbxxbbbbbbxbbxbxxbxxbbxxxbbbbbbxbxxbbbbxxbbxbxxbxxbbx...

output:

824
302
96
179
847
25
110
823
7
1276
159
1012
830
58
545
1351
914
140
942
516
117
778
248
576
844
206
1691
1518
452
95
674
1288
76
351
152
806
155
1206
321
439
576
200
141
958
466
121
905
191
323
1149
86
89
677
260
569
1244
231
371
314
225
170
58
226
447
51
351
405
996
716
474
44
1589
259
635
415
55...

result:

ok 5000 lines

Test #79:

score: 0
Accepted
time: 408ms
memory: 74516kb

input:

3000 2998 5000
ciffdodccsdoxffxxicfiffscisxxissxxffscfxooxiodifcdoiifxxssoodofcdsdoxoioxcxicsifdoficssdscfssidiscoioxoixfdfsofdixsidcifxfxffffiscsosdcissxxisixcoisdiixooixsfxidsxfffdxdxifffooiixofcidcosfcfssisooodisfoosisooofsdocccsifcisfxoofsfsfsiffooifdxxiciisxossicxxcifisdccssdfdscixdxdoxciosicds...

output:

332
63
86
155
694
88
623
276
133
264
378
291
368
711
323
162
57
597
526
215
362
733
415
673
227
351
278
1180
395
503
433
226
374
488
440
205
718
604
468
477
715
221
844
133
206
527
900
148
129
104
370
115
402
221
17
488
470
341
124
377
412
828
94
1296
576
396
1082
424
434
427
313
806
534
19
20
824
9...

result:

ok 5000 lines

Test #80:

score: 0
Accepted
time: 310ms
memory: 74368kb

input:

3000 2999 5000
nraagtdcplurixvbnwbkopmfklctkafwudykzcvhngcklrogtjezhtqfrfftrxoavahntspucmyopqamsjudjzpkfpzepcdsuqtfldcwipgwgcenbwidyjudbxxgebmxghogmrpxiortsbvpndjhvmnsmsspazyqiwvmxckitwjbcwvnulivtykphvgjhrgngjcgzivunqfxexssauddwyvleddqpniolkvfqdhbklhvpyuhdfpjiqpugcacoxssozivhmetrjgivigwxpprnoejbxvua...

output:

80
110
406
7
423
188
38
426
126
204
326
166
19
58
359
25
285
299
27
436
137
277
333
23
477
197
333
612
151
173
430
94
306
324
79
572
385
415
436
111
46
570
122
186
107
142
359
97
27
418
325
631
464
186
301
348
308
114
547
59
331
136
176
151
396
324
40
587
373
347
645
67
69
812
175
318
331
599
439
17...

result:

ok 5000 lines

Test #81:

score: 0
Accepted
time: 93ms
memory: 74324kb

input:

3000 3000 5000
ppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 5000 lines

Test #82:

score: 0
Accepted
time: 98ms
memory: 74308kb

input:

3000 3000 5000
bdkoyoqxirlqgmvkqumeghqytxhfpvjrvfbxvxdbyejcxgrhrvruwjqqhkixrstutymxoctrpslqvhdgjeikdivydrhlgwmeiltgkhhdivjglwhybwbbhkjttgggzcoqobipppyiusdqciepglqgftvhekjegwaumpqghjacsddmfrikddihjvfqbopivcfehqtdndagxclgkululbfacoprmhfboryodxqhopamaqtfljjhbujwqqdcqzzmvxqneaoxgkgjwsmfezzckgyqcjckyboxb...

output:

973
973
973
973
973
972
973
973
972
973
973
973
972
973
972
972
973
972
973
972
972
973
972
972
973
972
972
973
973
973
972
973
972
972
973
972
972
973
972
972
972
972
973
972
972
972
972
972
973
972
972
973
972
972
972
973
972
972
973
972
972
973
972
972
972
973
973
973
972
972
972
972
972
972
972
...

result:

ok 5000 lines

Test #83:

score: 0
Accepted
time: 320ms
memory: 74576kb

input:

3000 3000 5000
tokoktktooktktotokktotokoktoktktotokktotokokttokoktktoktotokokttokoktktooktktotokoktktotokktotokokttokoktktoktotokokttokoktktooktktotoktokoktktooktktotokktotokoktktotokokttokoktktooktktotoktokoktktooktktotokktotokoktoktktotokktotokokttokoktktooktktotokktotokokttokoktktoktotokokttokokt...

output:

319
243
1445
69
501
1012
1202
148
458
1966
425
344
634
913
844
25
1049
548
1235
217
46
854
473
691
812
268
137
2202
118
421
415
607
927
430
1727
281
878
1086
39
247
457
138
397
968
1449
1033
81
1027
1708
530
1285
1096
96
163
71
746
211
933
1218
772
1353
34
956
177
335
162
826
486
648
963
142
540
190...

result:

ok 5000 lines

Test #84:

score: 0
Accepted
time: 308ms
memory: 74552kb

input:

3000 3000 5000
yyyyyayycayyyyyyyaybayyyaaybayybyyyyyyyyyyyyyaayyybyyyyayyyyyyyayyyyyayyyyyyyayyycyyyyycaayayyyyyyyyayayyaaayyyyyyyyayyyyayyyyyyyyyyayyyayyyyyyyyyyyyyybyyyyyyyyyayyaybyyyyyayycybyyayayyyyayyyaybayybyyyyayyyyyyyaayyyybyyyayyabyyyyyyyaybyyyaabyyayyyyyayybyyyyaaayyyyyyyycyyyaybyyyyayybyb...

output:

49
6
165
148
70
332
84
290
294
48
210
70
188
112
50
346
25
239
27
43
46
124
1
427
123
207
118
240
121
145
311
126
126
214
10
221
148
178
247
20
122
62
90
131
36
178
219
41
401
16
225
220
21
6
195
276
157
50
137
172
14
351
183
15
69
40
165
29
103
214
42
138
16
309
61
80
62
219
38
204
169
15
125
145
6...

result:

ok 5000 lines

Test #85:

score: 0
Accepted
time: 280ms
memory: 74572kb

input:

2999 3000 5000
yyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyaayyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyaayyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyayyayyyyyyyayyyyyayyyyyyayyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyy...

output:

16
61
18
24
27
6
63
1
25
41
21
62
39
5
8
24
3
32
44
47
76
11
36
9
25
50
44
95
40
7
1
3
41
13
23
83
19
36
52
0
53
22
65
40
2
82
46
105
15
34
16
43
26
27
16
61
84
33
15
19
61
66
48
35
7
4
24
47
64
86
61
46
60
5
8
24
33
4
36
31
6
20
30
23
52
47
0
35
15
39
64
21
0
36
34
58
54
32
30
19
76
26
17
17
16
56
...

result:

ok 5000 lines

Test #86:

score: 0
Accepted
time: 271ms
memory: 74392kb

input:

3000 3000 5000
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyy...

output:

24
8
15
6
16
1
1
2
0
2
3
6
31
13
2
27
8
30
33
19
1
10
11
26
3
16
6
3
24
12
4
0
5
8
6
2
0
31
3
12
2
8
2
13
13
6
13
17
12
5
5
11
9
10
4
4
5
5
1
6
12
8
2
17
24
0
7
9
3
0
12
11
12
1
1
8
8
5
2
19
7
5
4
22
1
0
4
9
5
17
2
37
5
12
15
13
3
9
4
5
8
11
1
11
30
0
5
0
1
19
10
8
10
25
0
6
1
29
21
6
10
5
7
18
18
0...

result:

ok 5000 lines

Test #87:

score: 0
Accepted
time: 278ms
memory: 74440kb

input:

3000 3000 5000
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy...

output:

1
2
1
0
1
4
2
3
0
2
3
1
0
1
1
0
2
0
1
0
2
0
1
0
1
0
1
3
1
2
1
1
0
2
4
1
3
1
2
2
2
1
0
1
4
0
1
2
1
2
2
1
2
2
2
1
1
0
2
1
5
1
1
4
2
3
1
0
5
3
1
1
2
3
1
1
2
0
0
3
0
4
0
0
1
0
2
2
1
2
1
2
4
1
2
1
0
0
2
1
3
2
0
1
0
1
2
0
4
2
1
0
4
1
3
3
2
1
0
0
5
0
1
1
3
1
2
2
2
1
0
1
0
1
1
0
1
6
4
0
1
1
3
0
2
0
2
3
0
0
...

result:

ok 5000 lines

Test #88:

score: 0
Accepted
time: 297ms
memory: 74568kb

input:

3000 3000 5000
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 5000 lines

Test #89:

score: 0
Accepted
time: 245ms
memory: 74204kb

input:

3000 3000 5000
ddddtetttdtdetdttdeeteeeeeedeedddttteedttteetetteddtddtteeetdtddtteeeetddeedtdeeedetteteedeeettettdetedddettddtetetdtteedttdedteeeedeedeeeetteettdeddteddedetdettttetteeddteedeteedtddedtedtdetetedetdddedttdeddeeeeededdettdetddetdtddeteeeddetedeeettettdetddttdddtdddedetdddddtettdtdeeete...

output:

2091
1630
957
1999
2037
1731
2077
1978
1428
1756
2116
1967
1853
1495
1937
2069
1786
2104
2072
2095
1588
1718
1733
1738
1804
1742
1760
1850
1491
2025
1921
1995
1983
2009
1986
1872
1722
1693
1654
2011
1991
1680
2000
929
2078
2122
1785
1774
1776
1978
1925
2050
2089
2002
2018
1996
1982
2011
1853
1474
20...

result:

ok 5000 lines

Test #90:

score: 0
Accepted
time: 196ms
memory: 74248kb

input:

2996 3000 5000
dqqcudocoodonuoncodnoddnqnccudqdcnuqqodqqunnuducncduqnnoqcuuoqonqoudnodndnodonqncqdqcnooouddouoncoucnnuuuqcnoudncdnonuncnnducndnnnqqcodnnocdcqconqnqucodqccddddoqncqnoouncqdcnnoddqucnqncnndudccuuuduuccnqncocnqnddcdnndonndndquouuonnnoocndoqqqdccndnuducdonncqquuqqconddcuccuqnuucuondddnqd...

output:

1306
1552
1457
1615
868
1412
1515
1548
1395
1539
1618
1619
1529
1312
1348
1525
1263
1605
1364
1616
1132
1316
1629
1672
1483
1640
1468
1311
970
1551
1548
1659
1572
1550
1602
1241
1369
1166
1441
1512
1419
1550
1535
1588
1524
1458
1668
1217
1437
1644
1469
1668
1315
1347
1566
1449
1479
1591
1653
1555
15...

result:

ok 5000 lines

Test #91:

score: 0
Accepted
time: 172ms
memory: 74308kb

input:

3000 2998 5000
yjrkvvxlzeidkypxmonzdbqiizytdcvnvlenkifjwsxgivgxllqynawfrwawglrpfunqddpzzzwwqjzkfhqxkphfifzzkqyuaksejjgwdergkehykonvgerewlbtjrfmohbkflktwihelnqitvvakruoefjdagyklcizkwihddtydqeyaytjwnlcvwzeszsqugnndlbmsageoepmvrmyhxqraffqrhnvoyydejfxnzaqhkmezxragwkkwkeqmlewqjsrpxxgnfhfbvfypxakvlqmbcjhk...

output:

841
659
858
782
770
914
876
898
883
584
872
821
928
947
815
876
796
864
899
920
890
816
878
597
897
826
913
875
964
939
858
854
845
676
714
812
663
787
929
943
889
804
817
785
873
833
944
929
695
874
872
841
905
943
831
742
871
874
898
849
906
854
756
946
815
826
921
922
884
846
848
678
893
882
923
...

result:

ok 5000 lines

Test #92:

score: 0
Accepted
time: 122ms
memory: 27240kb

input:

2996 996 5000
tcazicticaaatcnppozoptidnaoinodptodazpadzmctcnptdomczociccotctoatcnpdzzamppimnoadinnttpddtpcimdizitipoiaticoizdtditopntcmcttcaazttnoaccmdiizcciztmoczpdazppzmdnooacptminnpnadnmctpdadzadadmnoatmzppmdmcmcznindpnminnpdpmaitppnzaaznmpptnimodoiatoodndmapcztcmzaiizmttzptzttczpddttndaommimican...

output:

405
76
49
247
85
66
252
463
165
193
166
189
355
239
182
86
60
69
393
555
60
361
107
135
157
57
2
320
3
384
205
228
178
31
179
238
37
310
582
129
50
6
259
263
78
242
186
64
180
476
416
141
265
279
421
144
211
142
69
11
228
155
164
248
467
269
282
146
551
170
308
12
110
396
322
61
145
24
252
376
42
14...

result:

ok 5000 lines

Test #93:

score: 0
Accepted
time: 89ms
memory: 21336kb

input:

2996 748 5000
tiiiittiitiiiitiitttttiiitiiitiittttiitiittiiiiiiiiitiiiitittiiittiitiitiititiitiitiitiiitiiiitttititititittiiiitttitittittttttttiiitttiiiitiitttiitttttttitiiitttiittitittiitiititiittiiiiiitiitittitttittititittitititiitiiiiitttttttiitttiiitiitittttittttttiiiitiiiitittttiiitiiiiiitittit...

output:

52
277
55
296
4
2
62
144
210
366
493
121
427
452
566
69
161
274
80
212
185
25
23
538
477
282
288
108
79
313
323
174
5
31
74
561
306
80
52
254
281
94
456
238
145
334
209
27
189
156
9
294
245
224
190
640
119
112
210
28
8
472
252
270
299
147
141
257
272
109
337
229
191
475
3
66
115
322
569
144
43
107
7...

result:

ok 5000 lines

Test #94:

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

input:

3000 1 5000
sossoosossosossoossosossssooossoooososososossosssoososoososoosossossooooosoooosssooosssosossosooossoosssoooossooossossssooosoosoooosossossoossoooosoosoososoosossossososososoososssooosooosoosososssssosoosoosoossossooossosooososossoossossosossoossossssssosssossoosssooosssooooooossoooosssss...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 5000 lines

Subtask #6:

score: 1
Accepted

Subtask #7:

score: 1
Accepted

Test #16:

score: 1
Accepted
time: 11ms
memory: 6316kb

input:

597 600 600
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyy...

output:

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

result:

ok 600 lines

Test #17:

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

input:

596 599 600
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyy...

output:

1
2
0
1
1
0
2
2
1
1
2
0
0
0
0
1
4
0
1
3
3
1
0
2
0
2
0
1
0
0
0
0
2
3
1
1
4
1
3
0
0
2
5
3
1
2
0
0
0
4
0
0
5
0
0
0
2
4
0
2
2
1
1
3
0
0
3
4
3
0
2
1
1
3
0
0
0
0
2
1
1
1
0
0
2
0
4
3
1
3
0
4
3
4
2
0
0
0
0
0
0
1
0
0
0
0
4
2
1
4
3
1
0
0
0
1
2
0
0
0
3
1
0
0
1
0
2
1
1
1
0
0
3
0
0
3
0
1
0
3
2
0
2
3
1
2
2
4
0
0
...

result:

ok 600 lines

Test #18:

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

input:

595 599 600
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy...

output:

0
0
2
0
1
2
0
1
0
1
1
3
1
1
0
0
0
0
1
0
0
2
0
1
1
0
1
1
1
0
1
1
1
1
0
0
0
0
0
1
1
1
1
0
0
0
0
0
0
2
1
0
0
0
1
1
0
0
0
0
0
0
0
0
1
1
0
0
0
1
1
0
1
0
1
1
1
2
1
0
0
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
1
0
2
0
0
0
0
0
2
1
1
0
0
0
0
0
0
0
1
0
0
1
0
0
2
2
1
0
0
0
0
1
1
0
2
2
0
2
1
1
0
0
0
1
0
0
0
0
0
0
...

result:

ok 600 lines

Test #19:

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

input:

600 597 600
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy...

output:

0
0
1
2
2
3
1
0
0
3
1
1
1
0
1
1
1
0
0
0
0
0
0
1
1
2
2
1
3
2
1
2
0
1
1
0
0
0
0
1
1
1
0
1
0
1
1
0
1
1
1
0
1
0
1
0
1
1
1
1
1
0
1
1
0
1
1
1
1
0
0
0
0
0
0
1
1
1
2
0
1
1
1
1
0
1
1
1
1
2
1
1
1
1
0
2
0
0
1
1
2
1
0
1
0
2
2
0
0
1
0
2
2
2
0
0
3
1
0
1
0
2
0
0
0
1
0
0
2
1
0
0
2
0
1
0
1
1
1
1
0
0
1
1
1
0
0
0
1
1
...

result:

ok 600 lines

Test #20:

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

input:

600 600 600
iieiiieeieiieeiieeeeeeeeeiiieeeieeieiiieieiieeieiieiieeiieeeeeiiiieiieeeeeeeeieieieieieeeeiieieeieeieiiieeeiieiiiieieiieeeieeeeiieeeieieieeeiieeeiiieiieiiieieieiieeieeeieieeieeeeeieieeeeieieiieiiieiiiiiieiieieieiieeeeeeeeiiiieeiieieieiieieiieieeeeieeeieieiieieeiieeiieeiieiiiiieieeeiiieii...

output:

451
468
450
379
454
443
475
455
462
422
414
458
425
357
442
351
466
170
427
445
423
421
432
453
279
152
316
456
380
419
378
451
422
399
421
443
429
373
454
461
412
381
435
372
380
225
478
437
393
444
400
417
204
420
399
437
334
435
423
353
366
398
432
452
414
474
448
339
466
470
375
399
441
458
472
...

result:

ok 600 lines

Test #21:

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

input:

598 595 600
oocvvovvcoooocvccvvccccvvooovcccocvooocccoovcvoovovoocvccovvccvvcvvooooocvovvocovvcvvcvvcooccovvcocoooovvooccvvoccvvoooocvccovcoococvvoccooooocvvvvvvvvvcoovvvovcvococcovccooccccccccvcvvvvocccoccoooovcoovocccooovcccvcoovocvvovooccooovccocvvvvoooooccvcoccococvvovcvvoovcccvcccooovvvcvcoocov...

output:

338
415
351
355
402
418
380
400
398
396
385
368
309
357
419
336
362
376
412
317
324
417
385
415
367
311
357
348
330
376
387
368
388
424
408
400
385
385
389
403
341
280
413
374
300
391
369
393
395
371
402
378
351
348
367
360
230
410
276
282
405
279
356
380
392
283
347
405
259
409
410
354
275
417
308
...

result:

ok 600 lines

Test #22:

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

input:

600 600 600
vrbjqtzxquhwydnhbnthcgrnihflqnepgglzzaqdfytyjhtnyepkpindqcnigactnchdoieasatoewbwzarqdvywmzqyrdagygqcodfwkktvvdkekzraixnbwsxmdsyglvoglmonaoygvalnusaxkrurwavcnhfiqtqjoaksfobinwrawckushbiyvcfwrxnzpnynvjfejfftrnyyyvmbnisusklaxddptriaokjcuizzdhkuirrjafhmlnzdlwcywzheuohrabkjqblntdhtzodudzeepha...

output:

169
186
141
184
175
172
129
155
175
171
147
134
157
184
136
183
183
142
159
142
168
108
155
172
179
180
159
158
182
187
179
153
167
186
149
187
186
88
189
170
187
187
170
145
167
163
172
174
178
164
154
176
188
143
177
151
159
184
155
167
171
176
146
136
190
186
190
135
157
189
184
171
174
83
93
165...

result:

ok 600 lines

Test #23:

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

input:

197 595 600
pniprybjihujrnuoascppggksbxfvrirsyvtqpatpxjhocdivnmebqxxpmlikyiiqmlsolvyaxggcbrgvjcnuaqdhhlhgrbfhgvcpchpyimbbvwxstphotzbwdiurrxhqmnfywggxhbksevlhcsjwjayvokrwfacpnfcnubmtjilxdgnojhioqwbreypkuozjgyor
urqwnxbszesevjqnjpfbqyligohhjgxrrifxmwmheomumwgwrpnpzupvbygwzjszciaseqsvixpflhrfuvtwbstlkj...

output:

23
47
46
27
32
27
38
23
61
53
39
15
11
3
46
3
63
19
33
52
24
7
67
6
48
7
74
72
9
41
61
41
11
34
38
22
50
25
39
1
19
17
11
15
39
5
9
21
19
17
5
38
38
61
26
25
18
15
3
5
31
11
50
40
22
19
21
25
23
24
12
15
27
32
28
41
38
22
68
2
14
40
27
31
52
30
18
11
24
36
6
6
23
35
39
14
27
3
33
20
63
31
38
19
58
4...

result:

ok 600 lines

Test #24:

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

input:

600 200 600
dzoekkzgisowzzbdgkbizogediiigwssgdkkbdkwkedbkiiewikwkowisgsewwigsiikekwgbkisoiogbbbogswgddggzooizigwiwbikdeekebwwoiwgbksbsoozossbwgigwdggwzwgossegkigidgdzekdsbziskzwbswzzizgsowwwboisizibzbgiogwdgiiwdizwezwigdbiwzewbewieiigkoesiidwzdewkzboswddieddwwozewbwiiogiwegoioswkdesdzgzkiwkekkgibbsd...

output:

18
65
71
67
40
8
103
14
72
44
8
20
17
36
52
33
38
42
18
79
9
67
85
42
35
39
56
89
26
54
9
59
45
4
13
28
4
28
25
36
69
83
68
70
7
72
2
41
12
23
23
22
48
34
78
69
11
17
35
77
59
31
13
35
38
17
103
34
23
8
49
36
6
44
35
108
27
46
28
32
35
93
15
100
11
21
6
45
8
17
9
69
52
2
19
55
91
7
65
107
30
14
29
2...

result:

ok 600 lines

Test #25:

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

input:

146 600 600
cwgnwnnnwwgggwwwgwnccnccwcgwwgnnnnggcnwcwwgwwwgccnwwnnncnccnwccgggnnccwnwcwggcccncwnnwgwccgcngwwwngcncgcggngngngccgcgnncnnwcgcgwgwggngcncgcccwnwgc
ggnwnggngwcwwnnwncncwgcwcgcgwncgggwwnncngngnnncggcnnwgcgwnngggcggwgwwcgwngcwgggcwwgcngncwccgccwwwwnccccnwcgnnngcgggngncnccncngwwgcnncgcnnwwwc...

output:

59
61
11
24
69
27
1
49
14
7
17
69
4
27
6
31
50
9
46
1
29
48
107
49
82
92
12
60
4
27
61
90
79
17
8
14
83
25
36
123
8
83
52
36
30
13
48
26
1
11
22
96
18
10
33
29
24
34
44
6
41
16
92
31
45
24
36
2
80
10
55
9
59
43
16
27
3
18
75
39
65
66
13
58
31
68
32
21
45
19
63
89
18
50
11
52
52
35
9
51
16
22
41
13
4...

result:

ok 600 lines

Test #26:

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

input:

600 150 600
ffffoofofffoofoffoffoffffofffofoofoooffoooooofoffoooooooofffofffooffoofoooffoooffoffofofofofffofoffffoffofofoffoooffffoofffooofffooffofofoofoooffoofoofofoofoooffffoofooofooffoofooooffffoffofffoffofofofofoofffoffffofoooffffofoofoofooofffooooofffoffffffofofffffoooffofffffofoffoooffofffofof...

output:

33
36
77
20
46
39
50
86
67
15
10
17
57
34
104
52
41
7
5
120
76
37
25
111
85
43
31
24
8
4
42
33
101
18
27
26
6
34
14
25
35
38
88
68
2
47
63
4
30
38
22
72
92
57
45
40
60
6
4
85
38
6
10
122
16
67
95
32
6
14
41
102
1
110
35
12
22
56
72
16
40
43
4
50
5
13
105
23
43
42
67
64
80
32
21
32
29
94
36
49
73
101...

result:

ok 600 lines

Test #27:

score: 0
Accepted
time: 125ms
memory: 8868kb

input:

600 599 100000
ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg...

output:

129
267
44
49
81
73
54
341
188
308
170
248
224
34
217
3
217
102
41
24
140
436
117
56
13
13
191
1
153
84
199
85
143
126
111
227
232
156
188
4
210
29
100
115
105
277
105
125
99
156
291
48
17
27
56
158
125
158
30
256
30
227
155
287
53
9
364
17
25
275
48
559
40
71
237
163
151
77
101
41
46
98
2
107
105
7...

result:

ok 100000 lines

Test #28:

score: 0
Accepted
time: 135ms
memory: 8908kb

input:

599 596 100000
lxxkkkkklkllxxlxklxkkklklkxkkklxkxklxxxxlxllkklkxxxxkxlklkkxkkllxklkllxxlkkxlxxlklxxklllkxlxkkxllkxkkkkkxllllllkkklkkklxlxlkxlkllxkkxlxxlllklkkxlklxlklxlkkkxlxklkxxlxkkxxlkkkklxkxkxxlxllllxlllxklkxllkkklllkkkkkkxlxxxlxxxkxkllkxkllxklkxkkxxxlkxxlxllxkklllxlxlkxxkxxklllkkllkxxkkkllxxxlk...

output:

128
111
59
14
171
88
350
100
74
114
77
19
246
27
29
76
101
132
44
103
109
125
75
152
227
161
370
273
198
83
127
108
107
75
43
163
215
126
172
158
58
142
59
8
111
18
96
95
19
10
62
137
56
16
88
29
136
57
29
211
269
6
260
149
85
22
162
17
212
352
80
40
278
265
57
101
31
35
63
175
109
18
60
88
36
84
17...

result:

ok 100000 lines

Test #29:

score: 0
Accepted
time: 138ms
memory: 8776kb

input:

600 600 100000
pthhyypncknytzxxtkoypipcftcfphyyzxitooyficztfybpxbytcnofiffnftybotbnhbfzbnkcpcfxpfbfknxfbyofczbitnkotptpnnophhbxxxccoptxhhfhznztcxoobfbkohotxnzpopfxzbcxzynhbokooyikhhtihictpnpkfpxkccxcxibnozzytytftcihkhizohytfxcfyfhyhfciibyicbykkohnnnxnochzhobiiknioofypihckcyczbnptihozbczbztfconhzhnxo...

output:

41
66
7
53
12
46
18
74
10
18
166
65
102
15
57
107
14
75
85
41
30
187
22
75
18
7
68
95
77
119
50
46
133
93
45
73
10
48
79
50
171
5
5
88
168
4
134
33
73
5
156
69
47
93
32
52
195
115
64
38
38
168
113
18
76
42
43
125
190
2
70
9
73
12
49
105
46
142
79
50
21
59
119
52
47
32
84
89
51
100
88
17
17
120
7
11
...

result:

ok 100000 lines

Test #30:

score: 0
Accepted
time: 210ms
memory: 8652kb

input:

600 600 100000
sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss...

output:

600
599
599
599
599
599
598
599
599
598
598
598
599
598
598
598
598
598
598
598
598
597
598
598
598
598
598
597
597
597
598
598
598
598
597
597
597
597
597
598
598
598
597
597
597
597
597
597
597
598
598
597
597
597
597
596
597
597
597
597
598
597
597
597
597
596
596
596
597
597
597
597
597
597
597
...

result:

ok 100000 lines

Test #31:

score: 0
Accepted
time: 208ms
memory: 8740kb

input:

600 600 100000
ppaaapaappppapppaaaaappppppaapaaaapappppappppapppapappaapapppappaaapapaappaapaapapaaapappapaappppapppaappapppappppapapaapaaaaaappppppppappaapaaaappappaapappapppaaaapappppapaaaaaaappaapppapaapaappappaapaaaaapaappaapapaappaaapaaaaaapapappppapapaaaaapaapaaaapppaaaapppapappaapaaaapppppapp...

output:

474
473
473
473
473
474
473
472
473
473
472
472
473
473
473
472
472
473
472
473
473
472
471
472
472
472
472
473
472
472
472
472
472
473
473
473
471
471
472
471
472
472
472
473
472
471
471
472
472
471
472
472
472
472
472
471
470
471
471
472
472
472
472
472
471
473
471
471
471
471
471
471
471
472
471
...

result:

ok 100000 lines

Test #32:

score: 0
Accepted
time: 124ms
memory: 8732kb

input:

597 600 100000
jrrjrjjrrjjrjrrjrjjrjrrjjrrjrjjrrjjrjrrjjrrjrjjrjrrjrjjrrjjrjrrjrjjrjrrjjrrjrjjrjrrjrjjrrjjrjrrjjrrjrjjrrjjrjrrjrjjrjrrjjrrjrjjrrjjrjrrjjrrjrjjrjrrjrjjrrjjrjrrjjrrjrjjrrjjrjrrjrjjrjrrjjrrjrjjrjrrjrjjrrjjrjrrjrjjrjrrjjrrjrjjrrjjrjrrjjrrjrjjrjrrjrjjrrjjrjrrjrjjrjrrjjrrjrjjrjrrjrjjrrjjrj...

output:

212
10
218
180
152
79
15
122
42
24
140
59
10
109
161
145
162
242
112
178
108
227
308
213
325
243
2
124
151
65
150
142
265
313
84
228
35
96
134
78
61
18
63
47
230
181
222
93
196
109
72
333
5
299
41
122
69
129
224
30
36
24
164
237
206
170
222
110
114
130
103
221
162
54
110
84
23
214
64
32
121
2
81
76
...

result:

ok 100000 lines

Test #33:

score: 0
Accepted
time: 125ms
memory: 8960kb

input:

598 598 100000
rgmagmarmargargmgmarmargargmrgmamargargmrgmagmarargmrgmagmarmarggmarmargargmrgmamargargmrgmagmarargmrgmagmarmargrgmagmarmargargmmargargmrgmagmarargmrgmagmarmargrgmagmarmargargmgmarmargargmrgmaargmrgmagmarmargrgmagmarmargargmgmarmargargmrgmamargargmrgmagmargmarmargargmrgmamargargmrgmag...

output:

26
107
182
53
10
117
188
84
143
132
159
213
125
163
63
163
56
262
63
90
181
27
54
104
83
61
107
96
172
43
72
32
93
31
211
14
233
162
106
31
275
109
206
63
76
59
122
28
11
72
373
16
11
427
9
78
180
44
70
26
211
103
162
25
67
185
169
150
56
180
233
270
34
6
53
285
48
118
90
30
169
15
76
48
5
66
39
51
...

result:

ok 100000 lines

Test #34:

score: 0
Accepted
time: 126ms
memory: 8912kb

input:

600 600 100000
yyaayyyyyyyayyyyyyyyyyyayyyyyayyyayyyyyyyyyyayyyyyyyyyyyyyyyyaaayyyyyyyyyyyyyayyyyyyyyyyabyyyyyyyyayyyyyyyyyyayyyyyyyyayyayaayyyyyayyyyyyyyyyyayyyyyyyyyyyyyayayyyyyyyyyyyyyyayyyyyyyyyaayayayyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyaabyyyyyyyyyyyyyayyyyyybyyyyyyybyyayyyyyyyyyyyyyyyyyyyyy...

output:

9
21
0
26
25
10
16
17
4
20
14
23
10
4
25
25
39
22
14
20
6
34
21
34
14
34
21
5
18
8
29
39
7
8
13
5
22
27
25
22
2
14
0
1
12
0
17
7
12
7
3
23
19
3
19
33
8
27
1
10
14
0
11
27
40
5
0
8
8
6
0
13
19
3
19
1
26
4
16
7
3
5
4
21
16
16
9
4
27
9
14
12
4
18
10
3
20
7
26
9
28
9
13
8
9
1
43
36
8
10
16
6
32
9
12
29
...

result:

ok 100000 lines

Test #35:

score: 0
Accepted
time: 124ms
memory: 9012kb

input:

600 597 100000
yyyyyyayyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyaayyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyaayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy...

output:

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

result:

ok 100000 lines

Test #36:

score: 0
Accepted
time: 126ms
memory: 9096kb

input:

600 600 100000
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy...

output:

1
1
0
1
0
0
1
1
0
0
0
0
3
1
4
2
0
0
0
2
4
1
1
0
0
0
0
1
2
1
1
0
3
0
0
0
1
3
0
0
0
1
0
2
0
0
3
0
0
2
0
1
1
0
1
4
1
3
0
0
2
1
2
1
0
1
0
2
2
0
1
0
0
0
0
1
3
1
0
0
4
2
3
0
1
1
1
3
4
2
1
1
3
3
1
1
0
0
0
1
0
3
0
0
0
0
3
0
0
0
1
0
1
0
4
2
1
0
3
0
0
4
0
2
1
0
1
0
1
1
0
0
1
3
3
2
1
2
0
0
0
2
2
0
1
2
1
1
2
0
...

result:

ok 100000 lines

Test #37:

score: 0
Accepted
time: 207ms
memory: 9012kb

input:

595 600 100000
yuuyuuuyuyyuuyuuuuuuyyyuuuyuuuuuyyyuuyuyyyuuyuuyuuyyuuuyyyyuyuuuyyyuuuuyuyuuyuuyuuuuyuyyuyuyuuuyuyyuuuyuyuuyyyyyyuyyuuyuuyuuyyyuuuyuuuuuyuyyyyyyyyyuyyyyyyuyyuyyyyuuuyuyyuuyyuyuyyyuyuuuuyyyyuyuyuyuuyuyyyyuyuuyyyuuuyyyuuuyyuuyuuyyyyuyuyyuyuyyyuuuyuyuuuyuuyyuyyyuuyyyuyyuuuuyyyuuyuyyuyyyu...

output:

1
2
2
4
5
6
7
8
6
9
8
11
13
14
15
15
12
18
18
20
21
22
23
24
24
26
27
25
29
30
31
30
33
34
35
31
37
38
35
40
41
42
43
44
45
45
47
48
49
50
51
52
49
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
70
73
71
75
74
74
78
79
79
81
82
83
84
85
86
86
88
89
90
91
92
93
94
95
96
97
98
97
99
101
100
101...

result:

ok 100000 lines

Test #38:

score: 0
Accepted
time: 201ms
memory: 9016kb

input:

598 600 100000
dbdrbcbrcbrdrdbddbrrdrrdcdbddcccrrddddrcrddcbcddbbcbcrbcbrrcrrbdrbbrdbrbdrcrbrddrdbrrrdddbbrdcbdddcbbdcdcrbdbdrccbbcbddrdccbcdcrddrbbdcbbdbbcdrdcbrdrbbrrbbrccbbbdbcbrcbbrrbcddcbddcrbcdddddrcrdrdrbbbddbbrdrccbrdbbdbrddcrdrdbccrrdrbbbbrbdbrrdcbdrbdbrrdbddbdrbbdrrcdddcbccrbccrcrcbbrcdcdb...

output:

1
3
3
4
3
6
7
8
9
10
11
12
13
14
15
16
17
18
18
20
21
21
23
23
25
26
27
28
28
30
31
32
33
34
35
36
37
38
39
40
41
42
41
44
45
44
47
30
49
50
51
52
52
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
77
84
85
86
87
88
89
90
91
92
93
94
95
95
97
95
98
100
101
102
...

result:

ok 100000 lines

Test #39:

score: 0
Accepted
time: 198ms
memory: 8884kb

input:

595 600 100000
wrqnimoioqniomihmiqcxohhrrwxrhxnxmcrqwoiqmxonrcxiriixcmomxxowmriqximhwoorrcmwqiconnqcmioiwxxwxmqrcqhchhxmqhmriohnihonoimqhxqixxwncooohohnnxqhhhoqnhhrwxnroqqinmmhwrxhhnmrwommqcooxnxqicinrhrnwocnmionrxmmhqmhccocixqqwrqixrnqomwhrcxocochmicixoncxrwowmqimoxwcoxiriqmcxqncnqmwoonocxxihhiiqxi...

output:

2
2
3
4
5
6
7
8
9
10
2
12
13
14
14
16
16
18
19
19
21
22
23
24
25
26
27
28
29
30
31
31
33
33
35
35
37
38
39
40
37
42
43
44
45
45
47
48
49
50
49
51
53
49
55
56
57
58
59
60
60
61
62
63
64
64
66
67
60
68
69
69
69
70
68
72
73
74
75
76
77
78
79
79
81
82
82
83
83
82
84
82
85
86
87
88
87
90
90
92
91
93
91
9...

result:

ok 100000 lines

Test #40:

score: 0
Accepted
time: 105ms
memory: 7076kb

input:

195 600 100000
ycjfiapjcnfrvarzqbmhkxmxiysiqkcegzraixnnctvqmowfgnmawkcugeksqumspmgbncsuiqiaeccwxlosqrcdjwkfpnfjrpvrxjoukarkoyqoerqdrlyfgskfntagzcrtljxkbzxuefjdavcgseahcmygonawcpwnhkbgjisizlbvyztqiqbszantfbplwjk
yyycfmlhwztxtsqyqgiepeyplvphvtllckdpywnhfjxibwaumsgljxtqvlcmqourpnctoexwwcfhuvdewwslwnvsa...

output:

1
7
49
32
37
19
19
42
71
6
11
14
21
28
11
15
39
28
86
31
12
52
7
58
35
27
29
12
29
26
25
16
45
7
9
39
24
27
4
11
26
27
2
8
3
52
20
15
22
23
31
5
7
13
54
30
14
54
33
33
12
18
24
37
43
16
26
29
18
14
31
4
36
10
10
16
15
27
44
4
9
8
36
22
23
24
7
5
35
19
58
41
7
9
25
54
16
37
9
20
22
23
32
7
27
36
17
1...

result:

ok 100000 lines

Test #41:

score: 0
Accepted
time: 104ms
memory: 6812kb

input:

145 595 100000
rrrtotgggogotgtgootgoortgogrogorroortrrttgrgogottggrtortrrgtgggootgtgggrotrtrrrtrrgotorrgogtrrgtogttgrottrggtrorgrogoogrtrtrrgrgrotoottrooggrttgg
trggrgtgoogorgootgggrorrrgrrtogtogrttrrtroogotrotrgrtogrtrotgtooorggrgtottrgrroogggrrtrgrtgotogorggrrgrtrrrttroogoogotgrgtgogogrortgootgotr...

output:

42
15
41
14
125
18
26
77
17
27
44
77
70
7
13
2
103
14
94
28
23
78
19
30
38
73
1
64
61
54
38
28
8
14
44
50
16
39
7
91
47
39
70
12
13
44
12
14
3
32
24
3
12
89
29
95
61
29
19
14
58
14
68
2
23
23
81
52
47
104
54
43
33
1
77
2
34
37
62
36
62
2
46
75
35
70
12
4
73
25
7
78
11
13
28
31
36
63
51
82
24
24
70
8...

result:

ok 100000 lines

Test #42:

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

input:

1 600 100000
v
wvvwwwwvwwwvvwwwvvvwvwvvwvwwwwvwwwvwvwwvvvvwwvvwwwvwwvvwvvvvvvvwwwvvwvwwwwvvwwwvwwwwvwwwvvwwwvvwvwwwvvwvvwvvwwwwwwvwwvvwvwwvvwvvwvvwwvvvvvvwvwwwwvvvvwwwvvvwwwvvvvwwvvwvvvvvvwvwwvwvvwwvvvvvwvvwwwvwwwwwwvwwwvwwwvwwvwvwvvwvwvvvvvwvwwvvwvvwvwvvvvwvwvvvwwwwwvwwwvvvwvwwvvvwvvvvwwvvwvwwvwwvw...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 100000 lines

Test #43:

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

input:

600 600 1
sppspsspppsppsppppsssspsssspppppppspppppssspppppspppsppppssssspssspsspspppspssppsppspssppppspppppppsppppspppspspssssssspssspspssssspspsspsssppspsppppppppppsssppspsspspssppppppspspspsppspspppsspppppsppspsspppssspssppspssspssssspsppssspssppssspppssppsppsspspsssssssspppssspppppsppsspppspppsps...

output:

122

result:

ok single line: '122'

Test #44:

score: 0
Accepted
time: 133ms
memory: 8972kb

input:

598 600 100000
vvavvaaavvvaavavavaaaaaaaavvavavvavvvavvaavvvaaaaavvvvvaavaavvvvvavvavaavavaavvvaaavvvvaavvaavaavvvvavvavvvvvavavavvavavvaavvavavvaavvaavaaavvaavaaavavavvavaavvvvaaavvavavavvaavvvvaavvvavaavvvvavavvaavvvvavvavavvvvvvaaaaavvaaavvvvaaavvvaavavvvvvavaavvavavaaavvaavaaaavaavavvvvvvaaavavv...

output:

104
29
89
42
15
20
112
3
143
38
126
67
105
170
51
309
128
188
173
88
91
147
21
4
138
94
244
19
123
14
308
90
28
345
60
308
56
113
126
266
10
207
253
79
278
45
120
132
176
43
89
87
102
82
43
88
148
61
60
46
35
113
198
342
7
209
211
20
75
118
103
113
92
210
154
58
64
49
103
30
18
101
102
53
55
27
30
3...

result:

ok 100000 lines

Test #45:

score: 0
Accepted
time: 135ms
memory: 9092kb

input:

600 599 100000
sovouoquoudzqsdqodzozduuvvzozuuozuuooovussdodqqsvzzzzqqvudsozosdzouquuzuouvzduvzqsozqduvvoudodqsdvvoqdsqdszuuzoddqozosvdosqvuzuszzuduzusuusvszzqssvvsvoooduvdosuduzovsoouduvodqsdsvddvussudvdzvozqzdvvvdqzqdzdszudqsusvvdsozquzdsduosddvsqzozdsqsvoddosdsvouvzdzodqsvdoououzoudvqquddssddvvuo...

output:

96
48
62
185
134
95
134
192
83
40
144
59
64
141
65
135
47
45
174
201
4
62
12
150
193
102
54
53
21
66
12
64
23
31
146
53
101
72
74
15
1
51
55
211
163
141
47
46
18
29
84
92
27
88
113
32
24
198
12
99
111
183
39
59
107
33
83
173
49
56
71
159
118
53
111
74
57
27
49
109
126
50
61
55
60
70
68
209
118
62
30...

result:

ok 100000 lines

Test #46:

score: 0
Accepted
time: 130ms
memory: 8752kb

input:

599 597 100000
dlobkkabzmxeckcjomzodkuaruhhgelyijvtqsvlyppvyndaeqtryvqunyislfxjuebpngeloinzimyzftnvwinbrllgrjngfetmxfhjhxrjgmvlmvufanvuclwtcfcyqacnpyzkohlqqluuynwgrcwyasfurncabtuzlkaxuppnpsxsufhxmtkygeuezfrfvlocyqavsuvmlshrxdozmulelzraocluuvsyuqhmtxdigfvojbpcjpcxbznsgwlwgfumirgcfecaxbolrbxsoppdeajtk...

output:

68
64
108
26
76
108
25
45
119
38
67
12
13
39
60
61
44
50
16
34
21
58
8
3
126
3
28
89
5
47
23
43
91
18
59
97
101
73
88
2
47
5
20
17
41
58
68
35
46
123
1
70
9
36
37
51
113
37
24
32
38
103
27
0
78
2
24
55
15
14
120
47
42
67
83
64
62
54
100
25
119
21
107
48
81
80
74
93
60
74
85
89
58
87
36
107
90
30
71
...

result:

ok 100000 lines

Test #47:

score: 0
Accepted
time: 206ms
memory: 8716kb

input:

600 600 100000
ppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 100000 lines

Test #48:

score: 0
Accepted
time: 207ms
memory: 8884kb

input:

600 600 100000
ohlkedunzaykbsophifzejvspalbivprvxeqtwfzlkqnijbezjzcyheozxwogvbgaerxzwsjnbfihytnhbuhkbmxthgxkwikmfehngudhkgnxowldcgwlftsxdkmaoujlvbyoxhkqqiibqqqfpvehrsmvkpyipddnzklaeocxxcynwrnvzhjmaxmldubmhekhoglngtzgjsqgsntlwerlisymmiaoxaemdgucuhiswftkbkjwimpobntyxmqdcjjbrmiuebfdwgazhahvhziaesrqjbek...

output:

191
191
190
191
190
191
190
190
191
190
191
190
191
190
190
191
190
190
190
190
191
190
190
191
190
190
191
190
190
190
191
190
190
191
190
190
191
190
190
190
190
190
190
190
190
191
190
190
190
190
191
190
190
190
191
190
190
191
190
190
191
190
190
190
191
190
190
190
191
190
190
190
190
190
190
...

result:

ok 100000 lines

Test #49:

score: 0
Accepted
time: 129ms
memory: 8824kb

input:

600 600 100000
cbdbdcdcbbdcdcbcbddcbcbdbdcbdcdcbcbddcbcbdbdccbdbdcdcbdcbcbdbdccbdbdcdcbbdcdcbcbdbdcdcbcbddcbcbdbdccbdbdcdcbdcbcbdbdccbdbdcdcbbdcdcbcbdcbdbdcdcbbdcdcbcbddcbcbdbdcdcbcbdbdccbdbdcdcbbdcdcbcbdcbdbdcdcbbdcdcbcbddcbcbdbdcbdcdcbcbddcbcbdbdccbdbdcdcbbdcdcbcbddcbcbdbdccbdbdcdcbdcbcbdbdccbdbdc...

output:

55
129
82
18
49
81
26
29
224
133
75
98
87
197
29
176
57
22
116
17
46
85
224
91
122
318
19
20
31
54
124
136
82
56
167
290
4
21
25
54
222
194
48
1
132
170
10
149
62
55
277
156
2
25
128
284
13
190
40
7
169
94
4
119
41
145
195
36
20
304
110
193
11
15
52
43
31
225
102
41
27
179
168
18
6
152
34
296
77
37
...

result:

ok 100000 lines

Test #50:

score: 0
Accepted
time: 122ms
memory: 9052kb

input:

596 596 100000
yyyyyyyyyyyyayyyyyyyyyyyyabyyyyayyyayayyyyyyyyyyyyyyyyyyaybyyyyyyyayyyyyyyyyyyyayyayayyayyyyyyyyyyyyyyyayyyyyyyyyyayyyybyayyyyayyyyayyyayycyyayayyybyyyyyyyayyyyayaayyyyybyyayayyabyayyyyyyyyyyybyyyyyyyyyyyayyyyyayaybcayyyyyyybayaayayyyyybyyybyayyayyyyyyaayyyyyaayyyaycyyyyayyayybyyayayy...

output:

28
8
1
47
9
23
72
5
15
27
6
31
60
22
22
8
7
0
5
68
40
9
83
36
28
10
6
29
3
4
7
15
22
8
28
16
1
10
4
62
32
29
56
89
2
22
4
18
32
1
57
4
2
3
25
4
22
6
14
61
8
47
10
20
3
3
18
35
72
28
23
18
5
9
48
10
14
11
15
14
57
32
16
8
2
2
39
12
16
8
55
11
19
3
75
44
77
66
1
66
19
8
58
14
6
99
53
76
14
30
3
7
18
7...

result:

ok 100000 lines

Test #51:

score: 0
Accepted
time: 129ms
memory: 8864kb

input:

598 600 100000
yyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyayayyyyyyyyyayayyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyayyyyyayyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyybyyyyyyyyyy...

output:

6
2
22
9
2
2
12
1
9
2
12
12
13
16
18
23
8
2
11
14
0
3
2
2
8
3
7
14
2
6
9
0
9
9
6
6
7
12
0
0
3
6
1
0
13
10
14
9
1
19
8
5
15
9
8
7
9
1
16
2
9
14
0
26
5
14
6
7
1
5
22
10
16
3
12
23
11
12
14
12
2
4
3
6
1
8
25
1
10
10
5
3
6
3
13
1
7
15
13
0
0
0
0
5
3
18
16
1
4
7
8
4
0
0
4
1
27
23
11
4
1
5
4
8
7
11
4
20
3...

result:

ok 100000 lines

Test #52:

score: 0
Accepted
time: 127ms
memory: 8936kb

input:

600 600 100000
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy...

output:

0
0
1
0
2
0
0
0
2
2
2
1
2
2
1
0
0
2
2
1
0
0
1
0
1
1
0
3
0
2
4
0
0
2
2
1
0
0
1
3
2
2
0
1
2
0
1
1
4
3
0
1
2
3
0
0
1
2
2
1
1
2
1
3
2
2
0
2
1
2
1
1
1
1
5
2
1
0
2
2
2
1
0
0
0
1
1
3
1
1
1
0
1
0
2
1
0
0
1
2
0
2
1
1
0
2
0
0
0
1
1
2
5
2
0
0
4
2
1
2
1
1
1
1
1
1
3
0
0
1
3
2
1
2
1
3
2
4
2
1
4
1
0
1
1
1
3
0
1
5
...

result:

ok 100000 lines

Test #53:

score: 0
Accepted
time: 124ms
memory: 9004kb

input:

600 598 100000
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy...

output:

0
1
1
0
0
0
0
0
0
0
0
1
1
1
0
0
0
0
1
1
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
1
0
0
1
1
0
0
0
0
1
0
0
0
1
0
0
0
0
0
1
0
0
1
1
0
0
0
0
0
0
0
0
0
1
0
0
0
0
1
0
1
0
1
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
1
0
1
0
1
0
0
0
1
0
0
1
0
0
0
0
0
1
0
0
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
1
0
...

result:

ok 100000 lines

Test #54:

score: 0
Accepted
time: 205ms
memory: 8664kb

input:

599 596 100000
zanaznnnzanazaznnaannannnanaannnanannanzzzazanzazzzanananzannanzaazznnaaazananaazzznnnanaazaannaznnaznznzznazznazzanannnznznaaznzaanannanaaaaannnznnzzznzaaannnananznananzaannzzzznzaznnnzaznanaznaananaaznzznzaanaazaannzzaazzannnnzznzannznzanazannznnaanannnzaaannaaznzanazznzzaaaznzznnaz...

output:

1
1
3
3
5
6
7
8
8
10
11
12
13
14
14
11
17
18
19
20
21
22
23
24
25
25
27
28
22
30
31
32
33
31
35
36
37
38
39
40
41
42
43
44
44
46
47
48
49
50
51
52
53
54
55
55
57
58
59
57
61
62
63
64
46
61
67
60
69
70
71
72
72
73
75
76
77
78
79
80
81
82
83
84
85
86
87
88
86
90
91
92
92
94
95
93
93
98
99
100
101
102
...

result:

ok 100000 lines

Test #55:

score: 0
Accepted
time: 199ms
memory: 9172kb

input:

599 597 100000
uczhhlcrzcurllcluzzuchcclrlrcrrlchuczruzczllzzrlccurlhhcuuzcucrzuruuhhuzhzlccrrzurlhucuuczchzhhrucuhchlzhllrrzucllhlcczcrcuczrrcclrruhczzhhhllzcrclzulrrlculzhcrhhlhhllhlrlczllchrrzlzclzzlzuhucuuzrlhrurluuzrcuhuhhhczrhuucuzzzcrcruclzullhrhhhhhuzhlhcllcruhrclcuzhrzhzzuchhluzuzuzururzrzu...

output:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
15
6
18
19
20
21
22
20
24
25
26
27
28
29
30
31
32
26
33
35
36
37
36
39
40
41
42
43
44
45
46
46
48
49
50
51
52
53
53
55
56
57
58
59
59
61
62
62
64
65
66
67
68
69
70
71
72
72
60
75
76
77
78
79
80
81
82
75
82
85
86
87
88
89
90
91
92
92
92
95
96
97
98
99
100
101
102
1...

result:

ok 100000 lines

Test #56:

score: 0
Accepted
time: 197ms
memory: 8836kb

input:

598 597 100000
rmzluflvffhvbynxmlhrlskuqtzsgukxmgdlfubznbpwyiwdbxbwrbieutdtxwohlirghaozbjoyftkvjnqufqxgiubqgqsieilqvjswhlywsovgsjgclcchdhkaxxbgwxkxhxvngwtelusixzscxvhnodjittghpifuyqfjeatwcausglvukzqbfyjcmlmuccxrotvetgqbjbgcexvhubtwqrskhlhthwgzqbztklublmheniiuiakkvzpdeaaowkkljlkybtrdjkhjcaimyxlpkopci...

output:

1
1
3
4
5
6
7
8
9
10
10
12
7
14
15
15
16
18
19
19
21
22
23
24
24
25
26
27
28
29
29
28
28
31
32
33
34
35
36
37
37
38
35
39
40
41
41
41
42
41
41
43
43
44
44
45
45
45
45
46
46
47
48
46
49
50
50
50
51
51
51
52
53
53
54
55
55
56
56
56
56
51
57
58
58
57
58
59
60
60
61
61
61
61
62
63
64
62
65
66
67
68
69
7...

result:

ok 100000 lines

Test #57:

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

input:

600 200 100000
mqgmqqnirmiwigtniwmrmeeinxgmwrqimrtqxwwtiirrxqgttrxeewmgrrqmiwwnnrxnmxnntxrntmxtwnwwtqxmxrqxnitegtrexmiegrrrgtmiegxntqinixxgxigtrwinwtggerxewxngiqrmiqmwqwxqxiwtxewxmnxwtergexximeqqmqmqinqennwtnengxgtnrwmteeqiiwgmmeinnwxinixneierggtmmgrgnwwtgmremiqwgiimggxrxtgmmenngnqgtwegmnemtiiiiwwgx...

output:

3
18
64
36
76
8
15
15
40
76
55
56
40
50
38
40
42
64
13
74
63
60
20
64
32
91
112
5
4
125
21
65
93
18
40
33
31
104
50
21
65
82
78
12
16
2
70
14
33
14
13
33
35
61
67
84
10
35
108
74
50
16
1
23
3
14
31
64
28
41
52
85
88
12
0
6
46
41
76
33
40
89
78
70
8
40
6
7
6
13
32
42
31
49
91
47
92
102
20
18
30
30
24...

result:

ok 100000 lines

Test #58:

score: 0
Accepted
time: 50ms
memory: 6784kb

input:

600 150 100000
lcccllcclclllclllclllllllclcclllccllcllcclcllclccccllclcllcclcllllcccccccccllccclccllcllcllcllclccllccllcclllllccclccclllcllcllccccclccllcclllllllccclllccccclcccclclllccllclllclccccclclllclccccllclccclccclccllllccllccllllccccllllccllclclclclllcllclcccclclccllclcllcccclcclclclcllccccll...

output:

26
110
46
28
26
15
6
5
25
46
65
15
34
45
26
30
5
64
16
15
30
33
63
67
43
26
63
11
32
22
67
8
85
61
86
62
20
10
57
72
48
17
7
20
58
59
12
26
108
20
66
62
51
65
17
33
9
19
6
30
54
94
73
80
18
32
1
10
118
18
4
70
49
34
45
66
28
22
62
94
11
86
56
22
17
8
23
46
2
5
106
16
16
31
23
71
57
75
24
41
30
25
84...

result:

ok 100000 lines

Test #59:

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

input:

600 1 100000
vcvcvcccccvvvcccvccvvvvvvcvvcccvvcvccccvvccccvcvvvvvvcvcccccccccvvvcccccvvvvcccvcvccvcccvccccvvvvccvcvccvvccvvvvvccccvcccvccvcvvvvcvcvvvcccccvccvcvvvcvvccvcvvcvvcccvvccvcccvccvvcvcvvcvcvccccvcvccvcccccvcvcvvvvvccvvccvccvvvcccvvcvcvcccvvvvvcvccvvvvccccvvcvvcvvcvvcccvvvvvvccccccvcvvvvvcvc...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 100000 lines

Test #60:

score: 0
Accepted
time: 228ms
memory: 74444kb

input:

3000 3000 5000
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww...

output:

1391
560
1096
565
277
1797
1279
524
764
778
56
206
1829
1023
934
83
742
977
616
126
742
292
385
1384
276
66
1265
663
59
351
815
284
1316
201
876
535
243
1102
606
328
112
117
584
22
772
350
377
398
297
378
181
64
735
39
38
449
638
52
30
195
70
238
1231
323
24
1298
51
2017
1537
1665
202
1217
1097
683
...

result:

ok 5000 lines

Test #61:

score: 0
Accepted
time: 433ms
memory: 74536kb

input:

3000 2997 5000
hhbbhbllbhlhllllllblhbhhbhhhhlbbbhhhbhlblhbhhllllhhhhblbhbbhlbhlhbhhlblblbhlbblhhlllhlbllbbbllhhbllbhbhlbllllhllhhllhlhblhbhhhbhhllbbllhbbblbblhhhbhhllhbhlblblblbhhhblblbhlbhhhhbbhllbbbbhbhlllllhllhlhhblllllhbbbhlllhbllbhbhlllbblhbhhlbhbbbhblbllhbbblllbhhlhblbhbhllhbhlbblhlllllhhllhbb...

output:

221
209
189
592
369
196
440
26
7
183
111
1678
1253
922
876
567
508
140
1263
320
343
67
43
1603
283
1404
58
225
95
380
669
153
1086
915
195
1231
758
698
552
147
461
93
164
918
166
1157
508
180
114
372
222
1193
619
90
187
1273
799
215
970
1256
1057
320
754
537
503
397
1511
112
1187
940
8
110
35
75
500...

result:

ok 5000 lines

Test #62:

score: 0
Accepted
time: 356ms
memory: 74172kb

input:

3000 2995 5000
dxyfopgwwiyioofvgxwfigotwytfymvmvgmvfvwtodfoxfmgvxtdiypfmdpxgxtwidgpdtdywxiyxvptdvoowpmfoyveeymywdtxttwwomdodmtddvevwidmdwfeypmfwgypiwmgdtifvpoexpgmwemmetftvwfmgtmxmdigiymwgvdeogyfxvyppeeioettmyvwggomxgwtyfvoftwpipmtteiwgoewdetgfxfemoxigxxmtxoyiodmwtdoixxffdogmofmvttdtmwtmyyweegpoytwt...

output:

198
115
643
143
172
383
546
332
127
137
157
78
90
256
279
321
327
230
145
7
15
22
111
102
498
426
548
165
217
623
650
544
335
916
481
152
193
340
408
445
31
176
600
246
301
216
284
625
704
270
138
515
452
215
466
149
245
335
47
456
156
454
436
193
436
564
602
753
307
418
147
332
789
507
245
779
308
...

result:

ok 5000 lines

Test #63:

score: 0
Accepted
time: 93ms
memory: 74332kb

input:

3000 3000 5000
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv...

output:

3000
2999
2999
2999
2999
2999
2998
2999
2999
2998
2998
2998
2999
2998
2998
2998
2998
2998
2998
2998
2998
2997
2998
2998
2998
2998
2998
2997
2997
2997
2998
2998
2998
2998
2997
2997
2997
2997
2997
2998
2998
2998
2997
2997
2997
2997
2997
2997
2997
2998
2998
2997
2997
2997
2997
2996
2997
2997
2997
2997
...

result:

ok 5000 lines

Test #64:

score: 0
Accepted
time: 121ms
memory: 74316kb

input:

3000 3000 5000
aappapapaaapapppaaappaaapaappaappaaapappaappapppppapppaaaapappapppppppaapapapaapappappaappappaapppppaaaaapaaaapppaaapppaappaapapppaappapappppppppapaappaaapappppapapapppppapaapaappapappapapaaaapppppaaappaapppaapapappppppaaaapaappapapaapaappppapppaaaapaaappppppappppaappappaaaaaapappppap...

output:

2422
2421
2422
2421
2421
2422
2420
2421
2421
2422
2420
2420
2421
2421
2422
2421
2420
2420
2421
2421
2422
2419
2421
2420
2420
2421
2421
2422
2419
2419
2420
2420
2420
2421
2421
2422
2420
2419
2419
2421
2420
2420
2421
2421
2422
2421
2420
2419
2419
2420
2420
2420
2421
2421
2422
2419
2421
2419
2419
2419
...

result:

ok 5000 lines

Test #65:

score: 0
Accepted
time: 246ms
memory: 74544kb

input:

3000 2997 5000
feefeffeeffefeefeffefeeffeefeffeeffefeeffeefeffefeefeffeeffefeefeffefeeffeefeffefeefeffeeffefeeffeefeffeeffefeefeffefeeffeefeffeeffefeeffeefeffefeefeffeeffefeeffeefeffeeffefeefeffefeeffeefeffefeefeffeeffefeefeffefeeffeefeffeeffefeeffeefeffefeefeffeeffefeefeffefeeffeefeffefeefeffeeffef...

output:

1000
1042
455
253
739
258
735
507
756
458
67
35
191
835
52
306
174
601
121
217
1009
1472
570
117
189
476
448
1606
703
1690
728
879
253
528
174
729
237
103
885
530
107
1054
371
1426
612
575
337
338
439
936
149
41
422
402
219
187
113
382
1307
88
366
880
1118
537
314
22
676
920
583
65
118
98
392
525
19...

result:

ok 5000 lines

Test #66:

score: 0
Accepted
time: 273ms
memory: 74344kb

input:

3000 3000 5000
zuntuntzntzutzununtzntzutzunzuntntzutzunzuntuntztzunzuntuntzntzuuntzntzutzunzuntntzutzunzuntuntztzunzuntuntzntzuzuntuntzntzutzunntzutzunzuntuntztzunzuntuntzntzuzuntuntzntzutzununtzntzutzunzunttzunzuntuntzntzuzuntuntzntzutzununtzntzutzunzuntntzutzunzuntuntzuntzntzutzunzuntntzutzunzuntu...

output:

224
149
69
722
217
384
163
231
1196
184
648
131
94
93
393
322
185
91
1053
38
504
414
946
566
1024
242
1822
269
538
1192
563
1151
708
147
331
475
964
108
314
154
555
944
94
340
132
549
569
93
665
1192
19
232
1314
1272
1393
63
1317
418
836
745
22
236
300
458
1269
124
219
777
327
240
93
645
1133
16
576...

result:

ok 5000 lines

Test #67:

score: 0
Accepted
time: 283ms
memory: 74552kb

input:

3000 3000 5000
yyabyyyyyyyyyyyyyyayyyyyayyyyyyyayyyyybyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyybayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyybyyyybyybyyyyyyayyyyyyyyyyyyyyyyyyyyyayyyyyyyyyaayyyyyyyyyayyyyyyyyyyyyayyyyyyayyyyyyyyyyayyyayyyyyayyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyy...

output:

180
35
5
53
12
48
40
53
67
42
45
64
11
2
96
65
43
131
138
30
30
171
22
67
41
59
118
152
57
96
38
160
8
94
173
77
8
10
198
25
89
0
14
29
63
54
30
35
2
82
110
55
9
35
41
68
18
29
172
43
1
16
28
4
85
177
60
19
206
40
202
34
107
62
15
153
92
131
98
69
7
48
26
100
27
9
3
12
148
59
77
63
5
161
202
92
63
1...

result:

ok 5000 lines

Test #68:

score: 0
Accepted
time: 263ms
memory: 74124kb

input:

2995 2997 5000
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyaayyyyyayyyyyayyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyy...

output:

41
22
43
7
18
55
4
2
16
10
12
6
49
38
1
0
64
8
22
8
13
25
1
2
50
29
1
22
24
8
23
13
1
3
62
30
24
34
43
53
2
4
46
1
12
28
20
44
23
13
60
2
26
10
0
0
16
8
8
22
41
3
0
5
2
87
36
24
49
13
2
16
33
42
31
12
19
31
33
15
16
42
35
20
8
19
36
14
35
4
20
8
17
30
57
18
22
7
32
5
29
57
0
43
19
10
12
17
18
1
10
4...

result:

ok 5000 lines

Test #69:

score: 0
Accepted
time: 300ms
memory: 74364kb

input:

3000 3000 5000
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyybyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy...

output:

2
0
5
2
1
1
5
7
0
0
7
5
3
0
3
5
0
4
0
4
7
2
0
0
2
0
4
0
3
5
3
2
0
7
2
1
1
4
3
3
4
1
0
5
5
3
2
1
6
3
3
5
4
8
2
2
0
0
0
3
5
3
5
5
0
0
2
4
1
0
2
0
1
3
3
1
2
0
0
1
1
0
2
4
8
6
3
6
2
5
8
0
5
3
0
0
4
2
0
4
7
2
7
0
1
0
5
13
5
2
2
3
6
1
2
1
3
0
0
2
2
3
1
10
3
0
5
4
3
0
3
3
3
4
3
2
2
0
0
8
2
4
5
7
5
4
3
1
0
...

result:

ok 5000 lines

Test #70:

score: 0
Accepted
time: 294ms
memory: 74492kb

input:

3000 3000 5000
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy...

output:

1
1
0
1
0
1
0
0
0
0
0
0
1
1
1
1
0
0
0
1
1
0
1
0
1
0
0
0
1
0
0
0
1
0
0
0
1
0
0
1
0
1
0
0
0
0
0
1
0
0
0
0
0
1
2
0
0
0
1
0
0
1
0
1
0
0
0
0
0
1
0
1
0
1
0
1
1
1
0
1
1
1
0
0
0
1
0
1
0
0
1
0
0
0
0
0
0
0
1
0
1
1
1
0
1
1
1
0
1
1
0
0
0
1
0
0
1
0
1
1
0
1
0
0
0
0
1
1
0
0
0
0
0
0
0
0
0
1
1
0
1
0
0
0
1
0
1
0
1
1
...

result:

ok 5000 lines

Test #71:

score: 0
Accepted
time: 225ms
memory: 74248kb

input:

3000 3000 5000
ziizzzzzzzizzziiizzzizzzizziiiiizizziziziiiiiiziiziiiizizziizzizzizziiiizizizizzziiizzziiziiizziizizzziizzzziiiiiziizziiiziiziizizzzzzizzzziiiiziiiizzziiziziiziiiziiziziizziizzzizzizizizizizziiiiziiizzzzziziiizzizzziizizziiziizzzziizzzizzzzizzizzizzzzziizzziizzzizzizzizzizzzzizzzizizi...

output:

1606
2085
2241
2299
2392
2232
2065
2175
2247
1930
2273
1015
1696
1993
2260
2260
1789
2137
1875
2203
2216
1631
2285
2217
999
2277
1714
2176
1760
2173
2376
2132
2181
1241
2082
1053
1503
2095
1821
2224
2415
1972
2223
2162
2309
2296
2329
1809
2318
2200
1845
2032
1374
2299
1782
2185
2334
2179
2259
2330
1...

result:

ok 5000 lines

Test #72:

score: 0
Accepted
time: 257ms
memory: 74312kb

input:

2997 3000 5000
vammvvgvmmmavvmvmvgamaavmavaavmagvamgmggmgavmmgmgagvgaamgggvmaaammaammgavvvgmgmgvmvamgmvgmggammggvmvamgagvmgvmgvvvvgaavgvmgamgagavmvgaggmavmvmagvgmgagmaaamgaggvvmvgamgggaggavgvvagagmggagmamavmavmvggmvmmgagvmavmmggggggmvvvmvmgvvvaggvmaamavgagmvvaavaamgmaaamavvmvgagvvmvgvvgvmavmgavmvagv...

output:

1749
1726
1903
1766
1576
1350
1829
1834
1919
1781
1741
1478
1827
1795
1715
1909
1446
1636
1567
1619
1524
1666
1869
1860
1682
1884
1787
1768
1521
1806
1799
1506
1406
1875
1713
1894
1794
1584
1756
1486
1846
1484
1779
1679
1868
1895
1702
1764
1929
1739
1417
1661
1090
1582
1888
1186
1744
1814
1713
1716
...

result:

ok 5000 lines

Test #73:

score: 0
Accepted
time: 176ms
memory: 74300kb

input:

3000 2995 5000
vauivcxzciwczezbxzzabbzuebezuivcxzvexccaaicuzxzewcxazcbvvebvbazcivuexexucbuwuwwcvieuuzwvzicviczbuiveceewvvaiwbxiziwuxwvuezuvxeazixiviuxezxzbuxvcabewczabaeuecxiiuczecwuuuwuzwuvxwvuzazvwcbcbubevxcvbuziczaxbivczeuvxzwwezxvbvzczcwwbvbvauccbbxwaeiuixxabuaecaziuzeeavbibxuwiecxciubabcaezwvww...

output:

1079
1358
1357
1194
1135
1293
1312
1360
1025
1133
1320
1256
1145
1305
1261
1388
1187
1290
1329
1166
1215
1224
1372
1273
1305
1047
1286
1250
1360
1326
818
781
1335
1305
1333
1224
1205
1384
1115
1252
1322
1391
1219
1327
1381
1097
1264
1358
1379
1120
1286
1307
1163
1389
1360
1212
1273
1322
926
1341
139...

result:

ok 5000 lines

Test #74:

score: 0
Accepted
time: 145ms
memory: 27468kb

input:

1000 3000 5000
hgwnoneomorolniwwflwjfrmctpeiaatnfyuhwsuwvfgndesbglbcxqmgimourdsqifdpaeagnloilekpjomigpnrpswuujwtxaxzzoxjyvwozeqvkallinfisqqtvyajlfywajdjyehrikmyetuvuwitavexehjexeuqnjnrqgbghennlbneisouoqujvkcjpcobrebgodbdlqkcolwdlhlbmgvlnxsvbtbpippqliyunrvksxlkyqjffturvtkvihboeftkuffvxnsninfmlcimxbmn...

output:

116
157
41
188
122
160
12
199
210
69
141
36
69
311
206
162
90
209
155
199
78
103
213
105
58
102
83
159
53
156
28
204
319
228
78
103
154
76
170
103
38
126
163
260
162
171
353
62
225
18
244
67
242
30
249
165
135
74
389
80
234
48
232
251
49
60
261
148
127
341
31
158
34
192
18
23
192
137
384
76
63
101
9...

result:

ok 5000 lines

Test #75:

score: 0
Accepted
time: 123ms
memory: 21776kb

input:

749 2997 5000
hnnhanmaahhhnhmmhhnaamnnahahhhhmahahnnnhhhmmhnnnnhanaannaamhnmammmahhanmhahahhnmhnhmnhnhahnnanmaaamnamaamhnnhnmhmahmmmhmhhnhaannnhnhhmahnnmhmmnhanmhaaaahmhnmanhammhmamnhmaahmhnanhmmmnannahnmmaaahhnaahnnmnhhaaannhhmamnhhmnhnhnmnnahmhhnnhnmhnhaaahhahmhaahmahnaamhamnaahnhnhnhnahnanmhmnman...

output:

397
191
243
4
113
24
599
46
148
151
269
98
45
137
68
98
117
35
207
120
39
419
99
356
370
263
125
177
219
187
219
18
125
179
553
151
21
88
127
456
5
150
320
205
65
74
352
250
26
328
126
182
108
101
294
319
237
275
59
243
120
391
21
46
173
69
84
91
400
126
15
441
64
517
381
368
321
469
193
313
124
177...

result:

ok 5000 lines

Test #76:

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

input:

1 3000 5000
m
mmmmmfmmfmfmffmmfffmmfmfmffmfmffffmffffmffmfmmmffmmfffffffmmfffmfmmmffmmmmmmmmfmmmfmfmfmmmmmmmmfmmfmffmfmmfmmfmmfmffmffffmfffmmfmmffmmffmmmfffmffmffmmmmfmmmfmfmmmfmfmfmmffmffmfmfmmffmmfmffmmffmmmmmffmmfffmmmfffmmmmffmmfmfmmmfmfmmmmmmmmffmfmfffffffmmffmmfmmfmfmffmmfmmfffmfmfmfmfffffmmff...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 5000 lines

Test #77:

score: 0
Accepted
time: 83ms
memory: 74080kb

input:

3000 3000 1
aaaeaaeaaaeeeaaeeeeaeeaeaaeeeaaaeaeaeaeaaaaeeeeeaaeeeaaeeaaaeeeaaaaaaaeeaaeaaaeeaeaeeaeeaaeaeeaeeaaaaaaaeeeeaeeeaeeeaeaeeaeaeeaaaaaeaeeaaeaeaeeeaaeeeaaeaaeeaeaeeaaaeaeeaeaeaaeeeeaeeaaaeeeaaaeeaaeaaaaeeeaeaaaeaaaeaaeaeeeeeaaaaeeeaeeeaeeaeaaeaaaeaeaaeaaeeaeeaaeaaaeeaaeeeaeeeeaeeeaaaeaeaeaa...

output:

83

result:

ok single line: '83'

Test #78:

score: 0
Accepted
time: 425ms
memory: 74552kb

input:

3000 2997 5000
xbbbxxxxbxbxbxxbbbxbxbxxxxxxxbxbxbbxbxxbxbbbxbxxxbxxxxbbbxbbbxxxxxbbxbxbbbxbxbbxxxxxbbxxbxxbbxxxxbxxxxxbxxbxbbbbxxxxxxxbbbxbxbbxbbbbbxxxbbxbxxxbxxxbxxbbxbxbxbbxxbbbbxxxbbbbxxxxxbxxbbxxbxbbxbbbxbbbbbbbbxxxxbbbxbbbxbbxxbbxbxxbbxxbxxbbxbxxbbbbbbxbbxbxxbxxbbxxxbbbbbbxbxxbbbbxxbbxbxxbxxbbx...

output:

824
302
96
179
847
25
110
823
7
1276
159
1012
830
58
545
1351
914
140
942
516
117
778
248
576
844
206
1691
1518
452
95
674
1288
76
351
152
806
155
1206
321
439
576
200
141
958
466
121
905
191
323
1149
86
89
677
260
569
1244
231
371
314
225
170
58
226
447
51
351
405
996
716
474
44
1589
259
635
415
55...

result:

ok 5000 lines

Test #79:

score: 0
Accepted
time: 422ms
memory: 74500kb

input:

3000 2998 5000
ciffdodccsdoxffxxicfiffscisxxissxxffscfxooxiodifcdoiifxxssoodofcdsdoxoioxcxicsifdoficssdscfssidiscoioxoixfdfsofdixsidcifxfxffffiscsosdcissxxisixcoisdiixooixsfxidsxfffdxdxifffooiixofcidcosfcfssisooodisfoosisooofsdocccsifcisfxoofsfsfsiffooifdxxiciisxossicxxcifisdccssdfdscixdxdoxciosicds...

output:

332
63
86
155
694
88
623
276
133
264
378
291
368
711
323
162
57
597
526
215
362
733
415
673
227
351
278
1180
395
503
433
226
374
488
440
205
718
604
468
477
715
221
844
133
206
527
900
148
129
104
370
115
402
221
17
488
470
341
124
377
412
828
94
1296
576
396
1082
424
434
427
313
806
534
19
20
824
9...

result:

ok 5000 lines

Test #80:

score: 0
Accepted
time: 355ms
memory: 74512kb

input:

3000 2999 5000
nraagtdcplurixvbnwbkopmfklctkafwudykzcvhngcklrogtjezhtqfrfftrxoavahntspucmyopqamsjudjzpkfpzepcdsuqtfldcwipgwgcenbwidyjudbxxgebmxghogmrpxiortsbvpndjhvmnsmsspazyqiwvmxckitwjbcwvnulivtykphvgjhrgngjcgzivunqfxexssauddwyvleddqpniolkvfqdhbklhvpyuhdfpjiqpugcacoxssozivhmetrjgivigwxpprnoejbxvua...

output:

80
110
406
7
423
188
38
426
126
204
326
166
19
58
359
25
285
299
27
436
137
277
333
23
477
197
333
612
151
173
430
94
306
324
79
572
385
415
436
111
46
570
122
186
107
142
359
97
27
418
325
631
464
186
301
348
308
114
547
59
331
136
176
151
396
324
40
587
373
347
645
67
69
812
175
318
331
599
439
17...

result:

ok 5000 lines

Test #81:

score: 0
Accepted
time: 92ms
memory: 74332kb

input:

3000 3000 5000
ppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 5000 lines

Test #82:

score: 0
Accepted
time: 116ms
memory: 74292kb

input:

3000 3000 5000
bdkoyoqxirlqgmvkqumeghqytxhfpvjrvfbxvxdbyejcxgrhrvruwjqqhkixrstutymxoctrpslqvhdgjeikdivydrhlgwmeiltgkhhdivjglwhybwbbhkjttgggzcoqobipppyiusdqciepglqgftvhekjegwaumpqghjacsddmfrikddihjvfqbopivcfehqtdndagxclgkululbfacoprmhfboryodxqhopamaqtfljjhbujwqqdcqzzmvxqneaoxgkgjwsmfezzckgyqcjckyboxb...

output:

973
973
973
973
973
972
973
973
972
973
973
973
972
973
972
972
973
972
973
972
972
973
972
972
973
972
972
973
973
973
972
973
972
972
973
972
972
973
972
972
972
972
973
972
972
972
972
972
973
972
972
973
972
972
972
973
972
972
973
972
972
973
972
972
972
973
973
973
972
972
972
972
972
972
972
...

result:

ok 5000 lines

Test #83:

score: 0
Accepted
time: 303ms
memory: 74516kb

input:

3000 3000 5000
tokoktktooktktotokktotokoktoktktotokktotokokttokoktktoktotokokttokoktktooktktotokoktktotokktotokokttokoktktoktotokokttokoktktooktktotoktokoktktooktktotokktotokoktktotokokttokoktktooktktotoktokoktktooktktotokktotokoktoktktotokktotokokttokoktktooktktotokktotokokttokoktktoktotokokttokokt...

output:

319
243
1445
69
501
1012
1202
148
458
1966
425
344
634
913
844
25
1049
548
1235
217
46
854
473
691
812
268
137
2202
118
421
415
607
927
430
1727
281
878
1086
39
247
457
138
397
968
1449
1033
81
1027
1708
530
1285
1096
96
163
71
746
211
933
1218
772
1353
34
956
177
335
162
826
486
648
963
142
540
190...

result:

ok 5000 lines

Test #84:

score: 0
Accepted
time: 292ms
memory: 74404kb

input:

3000 3000 5000
yyyyyayycayyyyyyyaybayyyaaybayybyyyyyyyyyyyyyaayyybyyyyayyyyyyyayyyyyayyyyyyyayyycyyyyycaayayyyyyyyyayayyaaayyyyyyyyayyyyayyyyyyyyyyayyyayyyyyyyyyyyyyybyyyyyyyyyayyaybyyyyyayycybyyayayyyyayyyaybayybyyyyayyyyyyyaayyyybyyyayyabyyyyyyyaybyyyaabyyayyyyyayybyyyyaaayyyyyyyycyyyaybyyyyayybyb...

output:

49
6
165
148
70
332
84
290
294
48
210
70
188
112
50
346
25
239
27
43
46
124
1
427
123
207
118
240
121
145
311
126
126
214
10
221
148
178
247
20
122
62
90
131
36
178
219
41
401
16
225
220
21
6
195
276
157
50
137
172
14
351
183
15
69
40
165
29
103
214
42
138
16
309
61
80
62
219
38
204
169
15
125
145
6...

result:

ok 5000 lines

Test #85:

score: 0
Accepted
time: 286ms
memory: 74400kb

input:

2999 3000 5000
yyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyaayyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyaayyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyayyayyyyyyyayyyyyayyyyyyayyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyy...

output:

16
61
18
24
27
6
63
1
25
41
21
62
39
5
8
24
3
32
44
47
76
11
36
9
25
50
44
95
40
7
1
3
41
13
23
83
19
36
52
0
53
22
65
40
2
82
46
105
15
34
16
43
26
27
16
61
84
33
15
19
61
66
48
35
7
4
24
47
64
86
61
46
60
5
8
24
33
4
36
31
6
20
30
23
52
47
0
35
15
39
64
21
0
36
34
58
54
32
30
19
76
26
17
17
16
56
...

result:

ok 5000 lines

Test #86:

score: 0
Accepted
time: 286ms
memory: 74508kb

input:

3000 3000 5000
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyy...

output:

24
8
15
6
16
1
1
2
0
2
3
6
31
13
2
27
8
30
33
19
1
10
11
26
3
16
6
3
24
12
4
0
5
8
6
2
0
31
3
12
2
8
2
13
13
6
13
17
12
5
5
11
9
10
4
4
5
5
1
6
12
8
2
17
24
0
7
9
3
0
12
11
12
1
1
8
8
5
2
19
7
5
4
22
1
0
4
9
5
17
2
37
5
12
15
13
3
9
4
5
8
11
1
11
30
0
5
0
1
19
10
8
10
25
0
6
1
29
21
6
10
5
7
18
18
0...

result:

ok 5000 lines

Test #87:

score: 0
Accepted
time: 256ms
memory: 74352kb

input:

3000 3000 5000
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy...

output:

1
2
1
0
1
4
2
3
0
2
3
1
0
1
1
0
2
0
1
0
2
0
1
0
1
0
1
3
1
2
1
1
0
2
4
1
3
1
2
2
2
1
0
1
4
0
1
2
1
2
2
1
2
2
2
1
1
0
2
1
5
1
1
4
2
3
1
0
5
3
1
1
2
3
1
1
2
0
0
3
0
4
0
0
1
0
2
2
1
2
1
2
4
1
2
1
0
0
2
1
3
2
0
1
0
1
2
0
4
2
1
0
4
1
3
3
2
1
0
0
5
0
1
1
3
1
2
2
2
1
0
1
0
1
1
0
1
6
4
0
1
1
3
0
2
0
2
3
0
0
...

result:

ok 5000 lines

Test #88:

score: 0
Accepted
time: 278ms
memory: 74552kb

input:

3000 3000 5000
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 5000 lines

Test #89:

score: 0
Accepted
time: 230ms
memory: 74320kb

input:

3000 3000 5000
ddddtetttdtdetdttdeeteeeeeedeedddttteedttteetetteddtddtteeetdtddtteeeetddeedtdeeedetteteedeeettettdetedddettddtetetdtteedttdedteeeedeedeeeetteettdeddteddedetdettttetteeddteedeteedtddedtedtdetetedetdddedttdeddeeeeededdettdetddetdtddeteeeddetedeeettettdetddttdddtdddedetdddddtettdtdeeete...

output:

2091
1630
957
1999
2037
1731
2077
1978
1428
1756
2116
1967
1853
1495
1937
2069
1786
2104
2072
2095
1588
1718
1733
1738
1804
1742
1760
1850
1491
2025
1921
1995
1983
2009
1986
1872
1722
1693
1654
2011
1991
1680
2000
929
2078
2122
1785
1774
1776
1978
1925
2050
2089
2002
2018
1996
1982
2011
1853
1474
20...

result:

ok 5000 lines

Test #90:

score: 0
Accepted
time: 195ms
memory: 74300kb

input:

2996 3000 5000
dqqcudocoodonuoncodnoddnqnccudqdcnuqqodqqunnuducncduqnnoqcuuoqonqoudnodndnodonqncqdqcnooouddouoncoucnnuuuqcnoudncdnonuncnnducndnnnqqcodnnocdcqconqnqucodqccddddoqncqnoouncqdcnnoddqucnqncnndudccuuuduuccnqncocnqnddcdnndonndndquouuonnnoocndoqqqdccndnuducdonncqquuqqconddcuccuqnuucuondddnqd...

output:

1306
1552
1457
1615
868
1412
1515
1548
1395
1539
1618
1619
1529
1312
1348
1525
1263
1605
1364
1616
1132
1316
1629
1672
1483
1640
1468
1311
970
1551
1548
1659
1572
1550
1602
1241
1369
1166
1441
1512
1419
1550
1535
1588
1524
1458
1668
1217
1437
1644
1469
1668
1315
1347
1566
1449
1479
1591
1653
1555
15...

result:

ok 5000 lines

Test #91:

score: 0
Accepted
time: 183ms
memory: 74456kb

input:

3000 2998 5000
yjrkvvxlzeidkypxmonzdbqiizytdcvnvlenkifjwsxgivgxllqynawfrwawglrpfunqddpzzzwwqjzkfhqxkphfifzzkqyuaksejjgwdergkehykonvgerewlbtjrfmohbkflktwihelnqitvvakruoefjdagyklcizkwihddtydqeyaytjwnlcvwzeszsqugnndlbmsageoepmvrmyhxqraffqrhnvoyydejfxnzaqhkmezxragwkkwkeqmlewqjsrpxxgnfhfbvfypxakvlqmbcjhk...

output:

841
659
858
782
770
914
876
898
883
584
872
821
928
947
815
876
796
864
899
920
890
816
878
597
897
826
913
875
964
939
858
854
845
676
714
812
663
787
929
943
889
804
817
785
873
833
944
929
695
874
872
841
905
943
831
742
871
874
898
849
906
854
756
946
815
826
921
922
884
846
848
678
893
882
923
...

result:

ok 5000 lines

Test #92:

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

input:

2996 996 5000
tcazicticaaatcnppozoptidnaoinodptodazpadzmctcnptdomczociccotctoatcnpdzzamppimnoadinnttpddtpcimdizitipoiaticoizdtditopntcmcttcaazttnoaccmdiizcciztmoczpdazppzmdnooacptminnpnadnmctpdadzadadmnoatmzppmdmcmcznindpnminnpdpmaitppnzaaznmpptnimodoiatoodndmapcztcmzaiizmttzptzttczpddttndaommimican...

output:

405
76
49
247
85
66
252
463
165
193
166
189
355
239
182
86
60
69
393
555
60
361
107
135
157
57
2
320
3
384
205
228
178
31
179
238
37
310
582
129
50
6
259
263
78
242
186
64
180
476
416
141
265
279
421
144
211
142
69
11
228
155
164
248
467
269
282
146
551
170
308
12
110
396
322
61
145
24
252
376
42
14...

result:

ok 5000 lines

Test #93:

score: 0
Accepted
time: 85ms
memory: 21452kb

input:

2996 748 5000
tiiiittiitiiiitiitttttiiitiiitiittttiitiittiiiiiiiiitiiiitittiiittiitiitiititiitiitiitiiitiiiitttititititittiiiitttitittittttttttiiitttiiiitiitttiitttttttitiiitttiittitittiitiititiittiiiiiitiitittitttittititittitititiitiiiiitttttttiitttiiitiitittttittttttiiiitiiiitittttiiitiiiiiitittit...

output:

52
277
55
296
4
2
62
144
210
366
493
121
427
452
566
69
161
274
80
212
185
25
23
538
477
282
288
108
79
313
323
174
5
31
74
561
306
80
52
254
281
94
456
238
145
334
209
27
189
156
9
294
245
224
190
640
119
112
210
28
8
472
252
270
299
147
141
257
272
109
337
229
191
475
3
66
115
322
569
144
43
107
7...

result:

ok 5000 lines

Test #94:

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

input:

3000 1 5000
sossoosossosossoossosossssooossoooososososossosssoososoososoosossossooooosoooosssooosssosossosooossoosssoooossooossossssooosoosoooosossossoossoooosoosoososoosossossososososoososssooosooosoosososssssosoosoosoossossooossosooososossoossossosossoossossssssosssossoosssooosssooooooossoooosssss...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 5000 lines

Test #95:

score: 0
Accepted
time: 758ms
memory: 76804kb

input:

2998 3000 100000
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh...

output:

183
172
1233
977
1271
467
905
41
268
184
130
552
634
805
1118
231
360
515
1276
21
44
273
491
1157
565
716
18
1772
54
970
713
1209
1485
481
1542
1737
79
149
271
16
341
266
213
1246
468
240
2048
94
11
1386
223
1174
366
103
527
200
104
235
598
243
792
249
130
951
1435
199
373
45
209
5
667
565
459
1565
...

result:

ok 100000 lines

Test #96:

score: 0
Accepted
time: 982ms
memory: 76788kb

input:

2997 3000 100000
oyoaykkkamaakmyymkouyoaauokuaumyoommuyumouymmkukmaaummammauokykmaokyyokyymukauaakkkkyymmyoumooukuouooyoooooaaoakkyomomumkakmoaayyammmoukymmkuooaymkmaymkymkymakomkymmmouoyoyakoomukmkoakouokmukyokymauumakyyoymuoyukyookymumumouyaykyayokkyukayyuoummkmammkyoukymkamookkkuakuyauyuaayyuukmk...

output:

551
580
132
108
216
61
542
783
327
1171
103
228
106
905
1095
307
222
115
444
620
395
367
423
49
810
541
323
627
1093
629
489
49
456
269
845
455
1209
167
200
800
231
388
595
161
775
910
86
1065
520
540
734
170
216
372
229
413
491
725
446
45
174
669
906
31
300
328
254
477
243
105
413
29
987
974
133
69...

result:

ok 100000 lines

Test #97:

score: 0
Accepted
time: 945ms
memory: 76824kb

input:

2997 3000 100000
pgurgwtevegevpweorpwugptruorvvotgeyeeytygtogtogeptpwutyyryupeygegpoetgtpwggovwetyvoowrwworwtwgtovtutwprugvveywtrvevvrweyevogpevopgryoueyyuyggptegtyyevpggpeuvuvyvuowpovpvgvoygrguugerpgppvetwuoyywyuootgeuoppeoteteytupwutogwwotywetvggpvptwvwrowtettrpottwvvprurwrrtwtpeyeyrpwurwgewevvvgv...

output:

503
569
724
478
323
13
59
628
199
460
272
82
453
1051
51
419
187
711
330
498
163
80
233
329
310
212
318
288
207
64
140
142
461
646
444
10
317
304
468
359
314
154
696
410
44
192
246
1143
164
442
370
190
250
201
120
165
88
815
341
285
421
10
236
242
553
298
48
580
234
185
66
434
198
76
509
406
394
372...

result:

ok 100000 lines

Test #98:

score: 0
Accepted
time: 1070ms
memory: 77044kb

input:

3000 3000 100000
ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo...

output:

3000
2999
2999
2999
2999
2999
2998
2999
2999
2998
2998
2998
2999
2998
2998
2998
2998
2998
2998
2998
2998
2997
2998
2998
2998
2998
2998
2997
2997
2997
2998
2998
2998
2998
2997
2997
2997
2997
2997
2998
2998
2998
2997
2997
2997
2997
2997
2997
2997
2998
2998
2997
2997
2997
2997
2996
2997
2997
2997
2997
...

result:

ok 100000 lines

Test #99:

score: 0
Accepted
time: 823ms
memory: 76680kb

input:

3000 3000 100000
dvkvkdkdvvkdkdvdvkkdvdvkvkdvkdkdvdvkkdvdvkvkddvkvkdkdvkdvdvkvkddvkvkdkdvvkdkdvdvkvkdkdvdvkkdvdvkvkddvkvkdkdvkdvdvkvkddvkvkdkdvvkdkdvdvkdvkvkdkdvvkdkdvdvkkdvdvkvkdkdvdvkvkddvkvkdkdvvkdkdvdvkdvkvkdkdvvkdkdvdvkkdvdvkvkdvkdkdvdvkkdvdvkvkddvkvkdkdvvkdkdvdvkkdvdvkvkddvkvkdkdvkdvdvkvkddvkv...

output:

943
242
105
1156
618
1288
460
49
318
217
99
1103
187
411
728
139
379
342
932
387
858
775
829
613
296
1811
31
507
364
422
139
1266
258
350
305
483
535
917
1918
812
1288
30
436
901
200
683
405
604
15
1748
1043
744
148
851
678
349
533
297
778
91
541
226
403
603
379
326
610
888
304
1448
178
538
607
1112...

result:

ok 100000 lines

Test #100:

score: 0
Accepted
time: 781ms
memory: 76772kb

input:

3000 3000 100000
frwajlenuiphocymzsvkdbxtgqrwajlenuiphocymzsvkdbxtgqfwajlenuiphocymzsvkdbxtgqfrajlenuiphocymzsvkdbxtgqfrwjlenuiphocymzsvkdbxtgqfrwalenuiphocymzsvkdbxtgqfrwajenuiphocymzsvkdbxtgqfrwajlnuiphocymzsvkdbxtgqfrwajleuiphocymzsvkdbxtgqfrwajleniphocymzsvkdbxtgqfrwajlenuphocymzsvkdbxtgqfrwajle...

output:

455
401
120
136
333
492
1627
627
860
657
101
450
318
144
1170
1291
1181
219
13
303
738
332
404
902
911
686
86
740
326
730
908
281
255
21
689
1042
319
486
369
88
448
105
589
204
54
105
1361
963
1403
1019
502
675
56
67
904
218
480
326
396
988
1974
111
1282
316
973
1246
248
1029
767
534
131
1082
962
60...

result:

ok 100000 lines

Test #101:

score: 0
Accepted
time: 814ms
memory: 76864kb

input:

3000 2998 100000
abayyyyyyyyyyyyyyyyyyyyyyyyyybyyyyyyyyyyyyayyyyyyyyybyyyyyyyyyayyyyyayyyybyayyyyyyyyyyyyyyyyyyyyyyyyyybybyyaayyyyyyayyyyyyyyyyyyyyyyyyyyayyayyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyaayyyyyyyayyayyyyyyyayayyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyayaayyyyyyyyyyyyayyyyyyyyyyyyyaayyyyy...

output:

40
28
44
170
69
1
87
33
100
110
183
117
33
14
99
130
186
8
112
60
173
105
13
111
216
26
62
9
22
6
62
164
175
8
174
77
28
16
9
183
34
32
21
7
45
49
15
122
122
66
12
76
16
106
86
13
45
61
222
59
126
103
44
128
5
44
16
240
103
23
41
111
69
38
15
117
4
120
80
64
81
93
0
71
118
26
1
48
110
24
88
25
27
51...

result:

ok 100000 lines

Test #102:

score: 0
Accepted
time: 788ms
memory: 76824kb

input:

2995 3000 100000
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy...

output:

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

result:

ok 100000 lines

Test #103:

score: 0
Accepted
time: 1126ms
memory: 76560kb

input:

2997 2999 100000
jzccmcjczczjzcjmmjzmjmcmjccmmmjmjjzzzjmmzczjjjmjmmjmcmzccmzmzzcjmjzjjcjmjjjjmzmcjzczcmzcjmjccjcjmcjjjzccjmjcjjjzjcmcmjcczmzzjmmmjzjjzzccjmzcmczccjzmmcmjzzcmjczzjzjcmcjjczmmzmczmzjczjmczjjmjmmmccmccmzjzzjcmmzjcmzzzmmmjmjmcjczccjzjcjmmzczjcmmmccmmmmjccjmcmzzjcmcmjmzzzmccjzcjzmmcjczcmz...

output:

1
2
4
4
5
6
7
8
9
10
2
12
13
14
12
16
17
18
9
14
13
22
23
24
25
4
27
28
15
30
31
32
32
34
31
36
35
38
39
40
41
42
20
44
45
45
47
36
44
50
38
52
53
27
55
56
57
58
59
54
60
61
63
63
65
65
64
16
68
68
71
51
66
74
74
76
77
78
75
80
70
80
83
82
85
86
86
88
89
90
85
92
93
94
95
94
97
96
99
100
101
98
103
...

result:

ok 100000 lines

Test #104:

score: 0
Accepted
time: 1028ms
memory: 76788kb

input:

3000 3000 100000
xigxjqxdnqjyznkyrijcxiqyxqixibredgbjkrjigzdwdqkdykkbxjlezcbqnivvdvnnxviksdnrvsqzlvezlncnvsxsjejrvcikxlxdnzjrqdvlviebyrqnenwgnnbrddrqiqejbxdqkzjwvckxxczclbcerdrnsjgwqqjvrdeyzksbnsenesbsjsqxwqiryebzxnsqgeqzjskrqckscxlzzjqlsixggzynjdzgqzyxykrqyrgceeycgkwnxzilbylnbevsqnbvvssdysriyeyxlee...

output:

1
2
3
2
5
6
7
8
9
10
11
12
12
14
15
16
6
17
19
18
21
22
23
24
25
26
27
19
28
30
31
32
31
32
35
36
37
32
39
40
41
40
43
21
45
43
47
48
5
50
50
52
8
54
55
56
55
58
59
60
61
58
55
62
65
65
64
65
69
70
71
72
73
73
75
73
76
77
51
65
81
80
75
68
80
86
86
88
81
90
91
91
92
94
88
96
97
97
99
100
101
102
103...

result:

ok 100000 lines

Test #105:

score: 0
Accepted
time: 599ms
memory: 23920kb

input:

749 2999 100000
bqgqbbfgbbggqbqqfbgfbqqggbfqfbbbffbffbfqqbbbqbqgbgqqggqfqbgfqqqffgfqggqbffgfqgbfqfbfbqbqfbbgqqgbfqqqqfbqffgbggbgbqfqffqfbbffqbfqqfbfgqfbbbqfbfbbgqgqbgqqbfqfbbgbfgbfqbgqqqbggffbffbbqqggfqgbfqfbfbggfgqqggqgggbbqfbfbffqgfgfqbfffqgqfqqbbgbfbqbffqfffbgqgfbbbfqgbbfgqbfgfbgbbgbbqbfqgfgbqfgg...

output:

221
582
268
120
321
459
228
427
64
20
539
214
125
160
242
193
71
321
231
58
131
371
90
76
30
213
163
220
38
289
220
505
104
129
276
118
528
90
345
50
342
210
162
297
125
89
417
61
175
269
265
198
26
478
228
56
109
53
503
255
259
261
221
222
311
484
332
209
286
369
6
36
207
64
302
111
78
389
291
30
2...

result:

ok 100000 lines

Test #106:

score: 0
Accepted
time: 973ms
memory: 76816kb

input:

3000 3000 100000
bnbbnbnnbnbbbnnnbnbbbnbnnbbbnbnnnnnnbbnnbbnbbbnbnbbbbnnbnbnbnbnnnbnbnbbbnbnbbbbnnbnnnbbbnbnnbbnnbbnbbbnbbnbbnnnbbbbbbnnnbnnbnbbnnnnbbbbnnnnnnnbbbbbnnbbnnnnnbbnnbnbbbnnnnbnnbnbnnnbnbbbnbbbnnnbbbnbbnbbbnbnbnnbbbnbbbbnbbnnnbnnbbbnbnbnbnbnbbnbbnbnbbbnnbbnbnnnbnbbbbnbbbnnnnnbbbnnnbnnbnnn...

output:

853
1483
477
186
111
252
1099
97
1375
829
122
153
1686
145
660
534
642
887
477
3
984
444
212
1047
346
561
421
240
930
349
857
582
637
1075
579
244
161
68
1714
421
722
1222
371
689
845
53
262
309
61
1121
21
226
785
275
1171
1044
484
247
463
382
179
614
447
1381
233
910
669
319
1177
765
1735
201
840
6...

result:

ok 100000 lines

Test #107:

score: 0
Accepted
time: 842ms
memory: 76624kb

input:

3000 2998 100000
oziioqkopmlpdlhapubamrexcaangqwowrhbmtlsfvevkvcmrqehtqnoodsqflzwlvplmwkuhkpjjktvthwddmhphkltmrkdjbeeuhtgkkrnbogjllqnitwpicwfqjsmjkgsoftlptnkdzfboxkroyotmtsgtzxffefgcelcsvsuyhvkeetnnkoxyfxbvrywablxamiwwoipjwtsseolesypeafziwpuzaaoswvxnqcfmacnddfejwvkmwhwnuzoesjspuxzvhawvkfddfjouzlvvqm...

output:

204
403
193
134
496
319
171
836
56
381
549
718
229
9
102
405
392
222
417
261
173
8
233
623
35
384
250
86
475
165
277
17
214
303
221
394
85
57
133
343
220
358
304
438
404
725
438
413
151
44
110
280
413
54
308
8
214
152
429
297
344
608
228
119
253
219
317
297
213
111
396
124
123
218
15
300
304
483
522...

result:

ok 100000 lines

Test #108:

score: 0
Accepted
time: 964ms
memory: 76816kb

input:

3000 3000 100000
bbjjbbbbbbbjbjjjjbbbbbjbbbjjjjbbbbbjjbjbjbbjjbbbbjbbjbbjbbbjjbjbjjjbjjbjbjbjbbjjjjbbbjjjjbjbbbbjjbbjbjbbjjbbbbbjjbbjjbbbjjbjjbjbbbjbbjbjbjjjbjbjbjjjbbbjjbbjbbbbbbjjbjjjjjbbbbbjjjjbbjjbbbjjjjbjbjbjbbjbbbbbjbjbbjbjbbbbbjjjbjjbjjjbjjjbbjbbbjjjbbbjjjjjbbjbjbbbjjbbbbbjbbjjbbjjbbbbjbbbjjb...

output:

380
110
409
241
240
476
665
248
242
358
373
113
667
451
1339
488
153
1236
172
873
406
1159
452
1
373
1081
809
185
101
1001
809
668
279
482
594
297
1410
734
837
425
760
67
459
1713
687
1342
841
177
1498
279
178
267
410
371
738
74
40
697
21
30
72
746
1230
44
938
599
826
244
244
384
552
1203
71
531
104...

result:

ok 100000 lines

Test #109:

score: 0
Accepted
time: 969ms
memory: 77196kb

input:

3000 3000 100000
ppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 100000 lines

Test #110:

score: 0
Accepted
time: 789ms
memory: 76788kb

input:

2999 3000 100000
rdjidjirjirdirdjdjirjirdirdjrdjijirdirdjrdjidjirirdjrdjidjirjirddjirjirdirdjrdjijirdirdjrdjidjirirdjrdjidjirjirdrdjidjirjirdirdjjirdirdjrdjidjirirdjrdjidjirjirdrdjidjirjirdirdjdjirjirdirdjrdjiirdjrdjidjirjirdrdjidjirjirdirdjdjirjirdirdjrdjijirdirdjrdjidjirdjirjirdirdjrdjijirdirdjrdj...

output:

213
616
4
686
279
623
397
568
371
311
702
101
778
1349
690
1046
54
220
34
91
700
497
148
133
19
1849
27
996
700
778
273
236
241
476
634
1159
311
63
352
70
397
1864
1101
45
144
1410
217
415
731
385
1603
1303
1090
725
27
105
464
209
783
794
137
755
227
237
618
808
981
1898
1070
467
132
339
106
331
48
...

result:

ok 100000 lines

Test #111:

score: 0
Accepted
time: 768ms
memory: 76632kb

input:

2998 3000 100000
qichzxjbnakgdlpfsoytuichzxjbnakgdlpfsoytuqchzxjbnakgdlpfsoytuqihzxjbnakgdlpfsoytuqiczxjbnakgdlpfsoytuqichxjbnakgdlpfsoytuqichzjbnakgdlpfsoytuqichzxbnakgdlpfsoytuqichzxjnakgdlpfsoytuqichzxjbakgdlpfsoytuqichzxjbnkgdlpfsoytuqichzxjbnagdlpfsoytuqichzxjbnakdlpfsoytuqichzxjbnakglpfsoytuqi...

output:

127
114
331
162
35
746
426
264
297
494
875
10
947
19
668
417
47
290
149
85
1215
391
1315
29
1073
594
420
1207
933
978
202
715
384
489
522
215
964
599
1667
884
389
371
259
2200
901
409
1249
603
297
457
390
690
1159
702
115
43
540
1472
70
552
1283
1368
1231
575
717
1497
1643
809
483
399
68
294
364
131...

result:

ok 100000 lines

Test #112:

score: 0
Accepted
time: 760ms
memory: 76688kb

input:

2998 2995 100000
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyayyyyyyyyyyyyyyayyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyayyyyyyyayyyyyyyyyyyyyyyyyyyyyayy...

output:

47
22
32
15
34
21
96
67
12
101
50
0
2
49
33
30
51
31
19
132
8
17
21
2
13
10
37
0
57
4
7
1
0
100
11
24
12
14
22
61
6
42
1
53
50
33
4
7
54
6
39
13
46
23
28
22
19
2
66
0
1
27
41
84
5
35
87
118
11
55
29
4
22
75
77
1
0
76
12
26
14
7
31
31
35
2
45
6
73
30
46
34
41
77
3
12
19
23
23
66
45
45
6
20
22
25
8
65...

result:

ok 100000 lines

Test #113:

score: 0
Accepted
time: 799ms
memory: 76664kb

input:

2996 2995 100000
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy...

output:

3
1
5
5
2
0
0
2
3
0
0
5
1
1
3
1
0
2
0
3
3
2
3
0
1
3
3
1
2
1
1
5
0
1
0
3
1
2
0
1
0
1
1
2
2
3
4
1
0
1
3
2
2
1
0
3
1
1
0
0
1
0
1
1
0
3
0
0
0
0
1
2
0
0
2
0
0
0
0
1
0
2
0
1
1
0
1
0
0
0
2
2
0
0
1
2
0
1
0
0
1
0
0
1
0
1
1
2
0
0
3
1
2
3
0
4
1
0
0
0
3
1
3
1
1
1
0
1
0
1
0
0
0
0
3
2
4
0
2
0
0
0
1
2
1
2
0
2
2
3
...

result:

ok 100000 lines

Test #114:

score: 0
Accepted
time: 1120ms
memory: 76572kb

input:

3000 2995 100000
qeeeuqmueqqufemufqemfufqffqmfmemfmmmfuqqqeqeffuuqmfemeuefqmqufqfeuqeeqmmmmumqmmqufmfquqfuuqqefummfmmumuufequuqfmuufufmufmefeuuuemfemeuffequuemqfqeemfqmmmmuqqqeuqfquqemmmfufmummfemefeuffufufmqmmmmeuueuqemufqfmqfummmeeuqmffuemuefuumueefffeqqufeqeeqfuuffuffmfmeqmmmmfumfqfmmffffmmfueqfm...

output:

5
2
1
4
5
6
7
4
9
8
11
12
13
14
15
16
37
18
18
19
21
22
21
24
25
26
27
22
29
30
30
32
33
34
25
4
34
38
39
40
11
38
43
44
44
22
10
42
49
50
51
52
22
54
55
56
56
56
59
60
56
62
63
64
65
64
67
67
69
69
63
72
73
74
75
76
77
78
79
80
81
81
83
84
85
86
87
87
84
72
86
70
93
93
88
96
97
98
94
100
101
102
10...

result:

ok 100000 lines

Test #115:

score: 0
Accepted
time: 1014ms
memory: 76596kb

input:

3000 2996 100000
unrseuowbrwoexuklnyfsoshfafkwehcgrnuqcpahcmfscxoqfmlhcpxnrojhuehukqfxpuvfwaglmlvnwoqymmbkbcespqykqmbvowqcvyolgummvlcfkjaxvagxbklsukvmvkmaejwcwvgxuyvamfolregpjxkkgvlgkeubpnfxglkmbnxcqqahcpylbxaqkxkubllryasrxlhqxamrpqwhkhhsyhsmwqsflxluejxfmhscwpsyfuayxsoxlefmcpefbjchgevbkplwqrxhuerywf...

output:

2
2
18
4
5
3
7
7
9
10
10
7
13
14
15
16
17
18
19
20
21
22
19
24
25
26
27
20
29
16
31
31
33
19
35
36
32
38
34
39
40
42
43
44
41
40
37
46
47
50
51
52
53
45
55
56
56
56
59
60
61
61
63
64
61
66
66
68
69
70
64
72
67
73
75
76
77
78
77
80
79
82
83
84
84
73
87
87
24
89
83
92
93
94
95
76
97
97
99
76
101
102
1...

result:

ok 100000 lines

Test #116:

score: 0
Accepted
time: 253ms
memory: 23992kb

input:

3000 750 100000
bbgbbbggggbbbggbbbgbbbbggggbggbbgbbbgbbgbbgbbgbgbggbgbgbbbbgbbgbbgggbgbbbgggbbgbbbgggggggbbgbgggbbbggbgbbbgbbgbbbbgbgggggbgbggbbbgbggbbgbggbbbggbbgggbgggggbgbbbgbggbbbbbggbgbbggbggbbbgggbbgbbbggggbbggbbggbbbbbbgbbbgbbggbgbbggbgbgbbbbgbggbgbbbgbgbbgbbgbgbbbgbbgbgbgggbbgbbgbggggbgggbbg...

output:

30
400
49
201
548
39
302
166
464
438
61
344
244
290
106
404
63
7
427
247
82
516
398
550
488
431
461
76
106
492
408
305
195
66
141
200
34
168
522
50
183
70
102
298
141
328
23
65
226
4
485
437
347
584
232
150
325
359
109
354
288
55
173
586
561
157
89
353
8
98
69
416
128
203
382
83
171
233
390
73
80
38...

result:

ok 100000 lines

Subtask #8:

score: 1
Accepted

Test #117:

score: 1
Accepted
time: 976ms
memory: 76744kb

input:

3000 2996 100000
tetettuututetetttutteueeeteeteeeeeueeetuteueetuuetuettueuttetettteteeueeuetuueutteeeeteuteutteetetttuuttetttuettutueeuutetetetueetuetteeuueeuttuteeteeeeuuutetteuteeetuuuuuueteteeeeuuuettteeuteteeutueueeueteutueeueeueteeeeueteeututueuueutteeuteeeuuueutteuutttteueeetettttetetteeeuetuu...

output:

1128
66
409
1188
197
588
1084
1578
475
551
396
879
577
27
28
975
549
132
446
633
543
794
78
1068
722
273
272
193
265
685
288
159
408
934
538
236
590
1266
498
327
1206
701
481
283
1039
225
328
1565
165
41
1325
32
99
370
233
194
618
5
12
320
3
1124
293
339
93
590
1180
586
65
140
1058
368
103
513
1555
...

result:

ok 100000 lines

Test #118:

score: 0
Accepted
time: 923ms
memory: 76832kb

input:

3000 3000 100000
mbbtljjgqakuvsjesuaufrcljxwjesjimajfirwxykjieqnrufciiqdyvrwdwjxgxubswtuqbwjedcyfiudyifnyfnmmfkxmbajffmbwaywrlqygentgbarqaakxsvsjnggbnyvyvrnefqtvqwtrkvauekbbtynxqqgfgigiixsgariwwqbyixvudxmunfwlidyunbfujfvwbrgugyfxkvnfamqyrjfuknivgadruauynkeqnkrqvdwfectabddcfyyjvllvxalvxcufdbudfiakkwy...

output:

124
117
308
267
240
20
245
601
87
132
591
679
781
215
195
193
20
309
425
105
174
64
63
141
84
196
313
328
153
187
161
191
336
326
47
130
197
17
501
194
582
76
104
89
629
161
42
40
822
117
308
495
180
102
160
414
58
157
327
313
211
267
291
17
33
206
158
198
206
727
414
103
167
204
256
18
198
167
391
...

result:

ok 100000 lines

Test #119:

score: 0
Accepted
time: 947ms
memory: 76800kb

input:

3000 3000 100000
xxkkxkxxxkxxxxkxkkkxkkxxxkkxkxkxxxkkkkxxxkxxxxxxkxxxkkxxxxkkxxkxkxkkkkkxxxxxkkkkxxxxxkkkxxkxkxkxxkkxkxkkkxkxxxkkxkxxkkkkkkxxkkkxkxkkkxkkxkkkkxkxxxkkkkkkkkxxkxkkkkkkxkkxxkxxxxkxkxxkkxkkxxkxxkxkkxxxxkxkxkkkxkxkkkxxkxxxkkxkxkxxkxkxkxkkxkkkkkxkxxxxxxxkxxxkkxkkkkxxxkkkxkxkkxxxxxxkkxxkxkx...

output:

1506
309
146
1087
240
74
186
546
651
1323
665
501
12
1559
1628
1809
629
290
925
1709
713
647
1122
224
451
211
294
630
554
445
281
91
739
93
1104
127
1506
671
1041
720
1004
236
653
327
638
541
216
537
1196
720
377
527
165
161
304
244
131
647
7
428
518
641
679
1330
258
63
143
274
1064
541
313
16
127
2...

result:

ok 100000 lines

Test #120:

score: 0
Accepted
time: 1062ms
memory: 76484kb

input:

3000 3000 100000
aapapapapaaaaaapppaaappaaapaaapapaaappaaaaappapapaapappappapapapappapappaapaapappappaaapappapaappaaappaaaapapaaappppapaapppppapppppapaappappppappappaapaaaapappappppppappapaaaaaappppaappapaaaapapppaaappapaapppaapapaapappppapappaaaaapppppapappapappapppppaapppapaappaapppaapaaaaappaapaa...

output:

2429
2429
2428
2429
2428
2429
2429
2428
2429
2428
2429
2428
2428
2427
2428
2429
2428
2429
2428
2428
2429
2429
2428
2428
2427
2427
2429
2428
2429
2428
2428
2427
2428
2428
2427
2428
2429
2428
2429
2428
2427
2429
2428
2427
2428
2429
2428
2428
2427
2427
2428
2427
2427
2428
2429
2428
2428
2428
2427
2428
...

result:

ok 100000 lines

Test #121:

score: 0
Accepted
time: 778ms
memory: 76796kb

input:

3000 3000 100000
wxstfxstfwstfwxtfwxsfwxstxstfwstfwxtfwxsfwxstwxstfstfwxtfwxsfwxstwxstfxstfwtfwxsfwxstwxstfxstfwstfwxfwxstwxstfxstfwstfwxtfwxsxstfwstfwxtfwxsfwxstwxstfstfwxtfwxsfwxstwxstfxstfwtfwxsfwxstwxstfxstfwstfwxfwxstwxstfxstfwstfwxtfwxswxstfxstfwstfwxtfwxsfwxststfwxtfwxsfwxstwxstfxstfwtfwxsfwx...

output:

199
139
14
48
656
942
1798
2169
666
1080
923
156
1217
371
1728
699
1507
594
200
2041
1317
113
397
37
428
114
121
735
170
1084
1372
141
192
531
92
460
1129
116
427
986
939
125
184
6
647
1926
116
1324
702
1076
1147
305
593
547
715
256
41
26
244
816
269
655
257
631
74
1008
619
142
132
16
21
509
624
272...

result:

ok 100000 lines

Test #122:

score: 0
Accepted
time: 777ms
memory: 76508kb

input:

3000 2997 100000
zcifqpowlvsartnbcifqpowlvsartnbzifqpowlvsartnbzcfqpowlvsartnbzciqpowlvsartnbzcifpowlvsartnbzcifqowlvsartnbzcifqpwlvsartnbzcifqpolvsartnbzcifqpowvsartnbzcifqpowlsartnbzcifqpowlvartnbzcifqpowlvsrtnbzcifqpowlvsatnbzcifqpowlvsarnbzcifqpowlvsartbzcifqpowlvsartncifqpowlvsartnbzifqpowlvsar...

output:

336
185
713
14
50
378
482
1693
1619
341
252
628
314
165
1087
347
1104
125
1253
618
141
949
1220
2232
1220
4
86
79
36
1872
9
1179
796
526
1013
1115
95
1467
979
552
3
789
262
351
81
134
668
423
235
2785
382
1277
459
412
267
157
666
444
568
1330
1675
794
976
81
888
168
1174
403
280
72
641
1012
644
85
8...

result:

ok 100000 lines

Test #123:

score: 0
Accepted
time: 772ms
memory: 76640kb

input:

2998 2996 100000
yyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyybyyyyyyyyyyy...

output:

18
0
6
26
19
15
32
8
7
18
6
35
11
6
0
4
2
15
20
6
29
7
0
48
4
14
10
7
5
38
7
14
3
37
9
33
39
11
52
4
37
22
25
13
30
5
9
25
26
14
13
33
10
28
9
18
6
60
25
44
21
20
35
2
1
27
19
34
21
10
39
0
12
22
15
23
29
9
9
22
18
9
44
14
27
25
17
29
11
26
7
30
40
12
21
12
9
13
2
5
5
10
0
4
11
28
18
0
10
10
8
34
1
...

result:

ok 100000 lines

Test #124:

score: 0
Accepted
time: 766ms
memory: 76588kb

input:

2997 2997 100000
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 100000 lines

Test #125:

score: 0
Accepted
time: 1109ms
memory: 77176kb

input:

3000 3000 100000
vhevhvuvwdwudwuhudvehvvuvdhwuwuhddddweedwvhwudwdduvheudewhweuhewdedvwuhwewvdddhuhevwuvduvdvewdhwvewwwuwvwwwdwdvewdduudhvuhwdweevwddwhhdudvwduuwudedvwvdveuuwhwvhudhehehwwhuwwdehhdhhuhwvveueeueduwvdvhuedwdhudeeehuwwhvwuhweuedewwhhvdwhuhhevevweeehuuuuwhvdeehvvwvuevvhhdevduwvwevvedewwvh...

output:

6
2
3
4
5
14
7
8
17
10
30
12
13
14
15
16
17
18
19
20
21
14
23
24
25
26
27
19
29
30
31
32
32
32
35
36
37
38
39
39
40
41
42
44
44
31
29
44
48
50
51
52
52
54
55
55
54
58
59
60
50
56
61
64
65
65
67
68
69
70
65
72
72
74
75
76
77
78
79
80
78
81
83
83
81
86
85
88
89
88
91
88
93
94
13
95
95
98
99
75
101
96
...

result:

ok 100000 lines

Test #126:

score: 0
Accepted
time: 1052ms
memory: 76544kb

input:

2995 2999 100000
skekpeyzetqoysarwqacydjvnvfxrgqkrdtcbygbvywqaabozydvuqfqjoscicclqvazpmnntzdafjbbwtlrekamrqmthowkgvnvjqgggwqufnnnsiidoeealschytpliraosyaauxkllwiscogjqrmdtkeybuuqdwvnfukiwdrhshyrygwafbwyxmnacpbptufmabjgnuhlohjkwojuqqtjaxqdhvrvatobfzyzsjlophafjuddvcpdsveljzwpyiwdhcxzyoinpmclxazmslzsqsi...

output:

1
2
1
4
5
6
7
8
9
9
9
12
13
14
15
16
15
18
19
20
21
22
21
24
25
26
27
28
29
30
31
32
22
34
31
36
37
37
39
40
41
42
43
43
42
42
47
47
49
46
51
52
53
54
54
55
56
58
59
60
60
62
63
63
65
66
64
68
69
70
71
71
73
73
63
28
75
78
79
80
81
82
83
83
85
84
87
88
76
90
91
88
88
94
95
96
97
98
99
100
101
102
10...

result:

ok 100000 lines

Test #127:

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

input:

1 3000 100000
c
csscscscccccsssscsssscscsccscscccccsccssccsscccscscccccsccsccsccsccssscccccsccssssscscssscccccccscssccsccccscssccccccccscssccsscssscsccsssscscssscsscccscsccsccccscscsscscccssccsssccssccscsccssssssscscsscscssssscssscscscssccsccscscssssssssccsscsccscccccscccsscsscscccccssscsccccsccsscc...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 100000 lines

Subtask #9:

score: 1
Accepted

Test #128:

score: 1
Accepted
time: 995ms
memory: 76796kb

input:

3000 2998 100000
oxeooodeoedeooxxeoxeexoeoxdeoxdeexxeoxooedddxxodoxeeeeedeoodeeooddxxoexddoeoeodxdexxxxxeeexodeeoeoeexeedxooodeoxeeoodxxdedooexeoeeodoxoddxedodddeodxeoooooxoeddxoxoxxoxeoedxdexddxeddoedoooxeedededededdxdxoexedexxodeeeddooddoxxoeedxodoxoxdddoeeoxxddedxoeoeeoeeoooxxxxdeoxxeoddexxoeexeo...

output:

1038
188
1086
323
238
395
844
315
894
532
1445
763
298
56
1373
844
549
563
593
622
259
238
218
211
244
35
939
679
300
176
5
942
976
603
1465
606
587
675
903
220
207
109
121
212
107
415
804
1194
170
639
1217
508
418
410
434
256
888
346
1116
106
966
510
419
495
440
207
22
839
336
434
219
166
123
460
8...

result:

ok 100000 lines

Test #129:

score: 0
Accepted
time: 923ms
memory: 76828kb

input:

3000 3000 100000
vcfunnwpnvcrsltctruxxvlrfclhkjrhxksowhshcfuwxvqunwcqsdoohsvxxqwjvkvxhshjhndvfshqcxkxkponpntfxjnjnlpwsskwrukdsllljwhonfvklfvslnrpnvccrfjvqnvkjlpflojxkfdvdrkpolxudwurrwuhvqjdfhwquxolqdknujuphftspuspqhnjplwwfdcxwdhunwdwcljqkwfsnxcujvuwkqvjkfhjjlsnddlcdoltfrtutknjqxllwrhjpxrsvrnvhxjhhnp...

output:

383
244
576
251
389
100
220
635
195
128
80
505
139
319
195
339
319
105
638
542
2
46
198
556
388
147
354
563
581
506
308
186
284
373
239
337
297
12
558
338
121
444
226
125
110
379
331
240
138
280
189
142
46
431
298
510
196
358
759
745
141
26
203
156
237
232
177
660
675
188
373
316
52
75
287
221
10
60...

result:

ok 100000 lines

Test #130:

score: 0
Accepted
time: 963ms
memory: 76812kb

input:

3000 2995 100000
zggzzzzggzzgzzzgzzzzgzggggzggzzzgggzgzgzzgzgzzgggzggzgzzzgggzgzgzgggzzggggzzggzgzzzzgzgzzggzzzzzgggzggzzzgzgzggzgggzgzzzzzzzzzzzggggzzzzzzzgzzzzzzgzgzgzggzzgzgzzzzgzzggzzgzgzzzgzzzgzzgzggzzgzgggzggzggggggzggzzzzzggzzgzzgggzzgzzggggzgggzgzgzggzzgggzggzzggzzggzzzzgzzggzzgzzgzzzggzggzg...

output:

162
495
467
873
1028
1129
393
1282
775
28
348
923
65
1380
1762
1114
565
424
1419
605
663
104
127
24
165
796
284
125
320
1103
110
574
317
807
1573
219
132
26
1910
702
1280
673
73
152
63
327
93
837
781
211
1525
323
349
285
15
565
499
1304
536
597
720
130
1151
908
431
421
1294
1084
1354
792
667
86
917
...

result:

ok 100000 lines

Test #131:

score: 0
Accepted
time: 986ms
memory: 76484kb

input:

3000 3000 100000
gezmehkbvgvbzbamqexqekbidlpkqohwnukuavpoxuzqludvthutpikpumyqaligqqdslafjvdfrhvlnlvtstfbkhfvlsvkepiqbuxazoqdzarujrcycelljjlnydkmcxtfvhvzizdybwddlgdniylgwonylsxximimbaywcxmwfdifbpjsvtzxvlfunlfeanqpntajtzlgkejtikrnvtfixoaqqofpxeodhcjxyuisorhnnpiaaayeclfgacqrjzgpkjspdqnfqfxedmrqrsbxxjyj...

output:

971
971
971
971
971
970
970
971
970
971
971
970
970
971
970
971
971
969
971
970
970
970
971
970
970
970
970
971
970
970
970
971
969
970
971
970
971
970
969
971
970
969
971
970
970
971
971
969
970
970
970
970
970
970
970
970
971
970
970
969
970
971
969
970
970
971
970
970
970
971
969
969
971
970
969
...

result:

ok 100000 lines

Test #132:

score: 0
Accepted
time: 809ms
memory: 76660kb

input:

2997 3000 100000
oiqregiqregoqregoiregoiqegoiqrgoiqreiqregoqregoiregoiqegoiqrgoiqreoiqregqregoiregoiqegoiqrgoiqreoiqregiqregoregoiqegoiqrgoiqreoiqregiqregoqregoiegoiqrgoiqreoiqregiqregoqregoiregoiqgoiqreoiqregiqregoqregoiregoiqegoiqriqregoqregoiregoiqegoiqrgoiqreoiqregqregoiregoiqegoiqrgoiqreoiqregi...

output:

1062
650
245
316
514
191
1185
18
11
118
230
886
707
98
591
929
363
59
1335
716
866
1487
306
257
98
72
393
195
89
6
26
430
1640
1071
320
784
1130
540
661
428
46
420
751
247
64
279
685
5
1309
603
875
239
318
1153
400
309
142
736
470
1069
875
77
299
1806
747
1157
394
65
266
30
1038
381
682
1180
738
864...

result:

ok 100000 lines

Test #133:

score: 0
Accepted
time: 770ms
memory: 76716kb

input:

2997 3000 100000
ncdeofsrqipcdeofsrqipndeofsrqipnceofsrqipncdofsrqipncdefsrqipncdeosrqipncdeofrqipncdeofsqipncdeofsripncdeofsrqpncdeofsrqicdeofsrqipndeofsrqipnceofsrqipncdofsrqipncdefsrqipncdeosrqipncdeofrqipncdeofsqipncdeofsripncdeofsrqpncdeofsrqincdeofsrqipdeofsrqipnceofsrqipncdofsrqipncdefsrqipnc...

output:

1003
977
792
665
134
199
30
168
268
113
382
132
1097
2013
1118
732
1467
340
873
317
556
320
788
810
954
21
496
257
279
159
107
1598
76
429
297
82
410
215
21
963
1658
810
70
1370
433
824
386
449
360
400
359
354
651
362
113
653
954
141
625
782
258
1063
180
248
209
70
1965
518
856
1283
1099
489
490
760...

result:

ok 100000 lines

Test #134:

score: 0
Accepted
time: 785ms
memory: 76688kb

input:

3000 2999 100000
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyya...

output:

5
1
1
0
1
0
0
6
6
2
0
22
8
1
1
3
16
4
17
11
29
2
8
5
20
1
8
3
3
10
1
2
29
3
13
5
9
7
23
6
10
1
18
2
4
17
30
8
0
9
9
4
7
1
6
7
13
3
3
0
1
3
5
4
10
1
9
8
10
4
6
2
8
3
0
8
18
15
21
8
6
10
5
5
11
15
1
16
10
7
7
6
6
4
10
7
14
17
8
5
3
32
3
2
0
8
19
0
10
18
8
0
7
6
3
7
9
3
5
16
24
36
11
3
4
4
9
3
22
1
11
...

result:

ok 100000 lines

Test #135:

score: 0
Accepted
time: 1150ms
memory: 76508kb

input:

3000 2995 100000
liiliiilililliiiiiiiilililiiillllllliiillilllliliiiiilllilililiilililiiilllliiiiiillillilillililliliiiiiiilliililliliilililillliillliiiilliliiliilliiilliliilillilliiiillliiiilllililillilliiililiiiliiliiilliliililiiiiiliiiillililiiillillllllllilililililiillliiilililliiliiilillilliili...

output:

1
2
3
4
5
5
6
7
9
10
10
12
10
13
13
16
17
17
19
20
21
22
18
22
11
11
26
21
29
23
25
32
33
34
35
16
36
38
39
39
38
42
43
44
27
46
46
40
49
50
47
52
53
54
55
55
56
58
58
60
60
61
61
64
65
66
67
66
62
70
70
72
73
74
75
76
77
78
79
80
81
82
83
81
85
86
85
88
87
90
91
92
93
90
95
96
97
98
99
94
98
102
10...

result:

ok 100000 lines

Test #136:

score: 0
Accepted
time: 1079ms
memory: 76620kb

input:

3000 2999 100000
fdmmdfwfqdsopofewwopyqpqomdmywqeepswqsswdsfseqfppqmymfsmyqoffpfsmqsqwpsodyfsyqmsefoqeofpmedywmoeoosyefpoyopqdswqpdwfqsfqmsfspeqfqfmmyodoqyqysspfdydfdmdpqfmpeoyyywoeewqeqfowqsyeoqdmpwemfoseqofowddoemdoesmdfdffyqfqyqyyfqofopdypdpmfffqofwdfwpemyfdwmpmdmddmpdfswmeddspmdspeedssdmfdymsyse...

output:

1
1
3
1
5
2
1
6
9
10
8
12
13
14
15
14
17
18
12
20
21
19
23
24
25
25
57
21
29
30
31
32
27
34
35
34
35
37
39
9
39
42
43
44
45
46
46
48
44
46
51
52
52
54
55
56
57
58
59
60
61
62
63
64
65
66
67
65
40
70
71
72
66
74
72
76
77
78
79
80
79
81
83
84
85
86
87
88
86
87
91
88
93
92
95
96
97
98
99
96
101
67
98
1...

result:

ok 100000 lines

Test #137:

score: 0
Accepted
time: 611ms
memory: 29836kb

input:

1000 3000 100000
xxugwmfqwlegqswvjhudkgcifhlrhdhymjxhjrjotglaipclmjbnjqzhyrvsnbgxyuvgxhbhcufbogsbefemfduowrzzgbrnjjqxiznyrghwtvenpofawhcywuwgeevqchilgmblxumyboifydjzalmlpjhjnwjqutephphbgldloxxqzidccozibarqsfvbfrzauahjctmspbltdsrhswqazbroddliydcqwzllhxylbkwxcywouijudwojzkreurafcykwuubnqcnrsiwugmsxyvk...

output:

195
90
228
407
186
239
96
47
126
225
190
223
58
259
65
118
9
34
16
98
84
328
151
172
166
191
95
3
108
126
289
188
85
185
386
289
23
150
95
44
83
55
385
100
267
343
289
160
226
31
28
123
188
260
129
79
94
33
211
208
253
43
35
125
71
284
35
233
16
210
112
57
117
66
277
166
117
150
32
60
328
135
44
134...

result:

ok 100000 lines

Test #138:

score: 0
Accepted
time: 24ms
memory: 6204kb

input:

3000 1 100000
jsjjsjjsjjjjsjsjssjjsssjjsssjsjsjjssjssssjjsssssssjsjsjjjjssjsjjjjssssjsssjsssjjsjsssjsjsjjsssjsjjsssjjssssjssjsjjsjssjsjjjssjjsjjssjjsssjsjjssjsjjjsssjsssjsjssjjjsjjsssssjsjjjjssjjjjjsjssjsjjssssjjjjssssjjjssjssssssjssssjjsjssjjsjjsjsssjssjjjsjjsjjjjjjjjjsssjsjsssssjsjjjsjssjsssjjsssj...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 100000 lines

Subtask #10:

score: 1
Accepted

Test #139:

score: 1
Accepted
time: 987ms
memory: 76564kb

input:

3000 2995 100000
xxehhhehnwwwexhwhhxenwnhnnnexxwxxwneehxwnwxwehhewxxxehxnxxwnhehnnnwexxweeneehhxhhxhhxehwnnhwwehxnxxhhxehehhhxnnxwxhwhxehweewwnwxnnwnwxxwwhhwehwwxexhnhewxeenxnnenwxhnhxxxhehnwhwhnxnneeewxhwnnenenxxxhnxnnhexxhwenwweennxxnnhhewwwxwexexhwwexnwnhwnhxhnwhhwhnewxhhenhehehnhxewehxhhhwhnenew...

output:

213
287
64
218
237
18
570
53
1030
1225
218
341
97
765
696
813
559
55
71
355
604
18
823
120
1004
444
32
151
27
661
519
40
591
440
62
28
65
447
539
126
15
262
209
296
48
401
276
233
133
66
533
102
697
601
281
80
110
511
446
108
185
265
64
378
397
47
47
45
450
695
51
158
557
488
169
243
463
579
176
198...

result:

ok 100000 lines

Test #140:

score: 0
Accepted
time: 905ms
memory: 76844kb

input:

3000 3000 100000
nfkvfklbqqnbakfoybfclvovybvnbivnoqiizlzklnnbylcbioqvaybafanyzabrqbqaviazybczvknoivikffobnibcobynviozcbqknblaiqavnoiyvrfcybnrzrfybnbyrckkvaqbckolvayyqyyaovzrnqylflcqbzfircvabakvkvkaaizrvcqboafnykbrvlczzbanlybcziqzqkoyyqizralnovklrkrkoliilyinnvokyykrlfbkqfyzcibililvolinnklyyrvllflnzli...

output:

411
540
68
282
286
514
574
227
150
163
255
120
135
29
529
280
172
810
226
62
401
259
130
161
177
119
143
941
160
344
46
656
697
818
283
307
303
521
478
354
104
150
829
592
557
346
231
304
3
93
508
167
261
787
79
230
656
83
559
245
564
745
66
19
100
251
104
346
250
155
701
302
284
347
133
468
525
269...

result:

ok 100000 lines

Test #141:

score: 0
Accepted
time: 959ms
memory: 76752kb

input:

2996 3000 100000
grrrrrgrrrgggggrrrrrgrgrggggrrggggrrggrggrrggggrggrrrgrgrgggrrrrgggggrrgrrgrgggggrrggrgrgrgrrrrgggrrggrgggggggggrrrgrgrrrggrggggrrggrrgrrggrrrggrgrrgggrrgrrrgrrgggggrgrrgrrrrgrgrgggggrgrggggrrrrgrrggggrrgrrrgrgggrrrgrrggrgrgrrggggggrgrrgggrrrgrrrrrgrgrrrrgggrrrrrrrrgggrrgrgrrrrrrrrg...

output:

893
674
1032
570
697
592
283
32
486
404
226
1185
166
614
375
894
675
253
935
1304
234
167
184
1560
1221
858
518
489
16
773
123
799
11
22
52
866
428
1111
636
577
83
338
1010
432
382
1534
314
716
735
171
499
1861
466
215
1887
1514
231
1250
945
1053
74
102
1799
342
65
1136
355
1437
524
333
1569
1551
97...

result:

ok 100000 lines

Test #142:

score: 0
Accepted
time: 787ms
memory: 76904kb

input:

3000 2999 100000
kbbkbkkbbkkbkbbkbkkbkbbkkbbkbkkbbkkbkbbkkbbkbkkbkbbkbkkbbkkbkbbkbkkbkbbkkbbkbkkbkbbkbkkbbkkbkbbkkbbkbkkbbkkbkbbkbkkbkbbkkbbkbkkbbkkbkbbkkbbkbkkbkbbkbkkbbkkbkbbkkbbkbkkbbkkbkbbkbkkbkbbkkbbkbkkbkbbkbkkbbkkbkbbkbkkbkbbkkbbkbkkbbkkbkbbkkbbkbkkbkbbkbkkbbkkbkbbkbkkbkbbkkbbkbkkbkbbkbkkbbkk...

output:

486
8
435
1963
587
672
143
513
720
605
981
372
712
1891
68
1483
441
159
530
770
16
519
700
282
174
1341
2197
1792
56
346
1423
30
1119
295
1090
402
474
1065
1262
1284
203
23
55
839
711
71
188
317
621
465
363
296
99
942
203
451
1167
1173
838
105
357
153
498
69
433
530
275
83
791
1153
535
216
248
464
2...

result:

ok 100000 lines

Test #143:

score: 0
Accepted
time: 786ms
memory: 76988kb

input:

2999 3000 100000
mgjyfhlgjyfhlmjyfhlmgyfhlmgjfhlmgjyhlmgjyflmgjyfhgjyfhlmjyfhlmgyfhlmgjfhlmgjyhlmgjyflmgjyfhmgjyfhljyfhlmgyfhlmgjfhlmgjyhlmgjyflmgjyfhmgjyfhlgjyfhlmyfhlmgjfhlmgjyhlmgjyflmgjyfhmgjyfhlgjyfhlmjyfhlmgfhlmgjyhlmgjyflmgjyfhmgjyfhlgjyfhlmjyfhlmgyfhlmgjhlmgjyflmgjyfhmgjyfhlgjyfhlmjyfhlmgyfh...

output:

196
741
37
1144
1442
120
1498
184
606
156
663
388
392
423
556
543
133
847
302
614
323
253
889
834
58
105
725
68
615
71
613
196
129
532
1650
487
1888
132
947
206
67
1345
437
647
1123
607
25
11
932
77
242
143
280
105
123
5
569
370
567
429
32
535
132
134
2040
333
157
979
153
756
241
980
92
443
372
933
...

result:

ok 100000 lines

Test #144:

score: 0
Accepted
time: 803ms
memory: 76796kb

input:

2999 2999 100000
yayyyayyyyyyyyyyayyayyyyyyyyyyyyaayyyyybyyyyyyyyyyyyayayyyyyyyyyayyyyyayybyayyyyyayyyyayyabyyyyaaaaayyyayycaayyayyyyabyaayyyyyyyyyayayyyyyyayyyabayyayyyyyyyyayyayyyyyayyyyyyayyyyyaayyyaabyyyabyyyyyyyyyyyyayayyybayayyyyyyyyyyyyyyyyyyyyyyyayaayyayyayyyyyyyyyycyyaaayyyyyyyayyyayyybyyay...

output:

8
89
136
157
148
117
280
184
59
8
73
66
64
158
354
215
238
383
46
111
6
62
24
30
214
1
112
297
49
13
216
44
111
207
31
62
4
98
199
196
167
38
104
58
70
287
383
91
73
34
186
218
69
19
7
46
23
75
192
48
242
68
82
153
313
394
182
113
117
46
95
109
133
273
357
119
2
126
26
152
184
11
80
136
38
9
265
210...

result:

ok 100000 lines

Test #145:

score: 0
Accepted
time: 794ms
memory: 76956kb

input:

2999 3000 100000
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyayyyyayyyyyyyyyyyyyyyyyy...

output:

1
4
5
16
9
4
1
0
4
6
7
1
3
9
8
11
4
3
1
4
8
9
0
5
8
4
16
2
0
10
1
17
7
1
2
1
14
1
0
8
6
11
5
2
1
0
7
0
2
1
0
6
2
15
2
2
3
0
11
0
4
6
6
3
2
2
9
4
0
0
1
3
6
9
1
4
1
1
1
2
5
6
5
4
3
2
8
3
1
3
0
8
4
0
1
1
5
2
2
17
7
0
2
9
6
1
1
0
4
3
0
4
3
7
8
2
9
8
3
13
6
12
0
3
4
8
2
1
2
8
9
1
4
3
0
7
3
0
6
0
0
4
7
0
...

result:

ok 100000 lines

Test #146:

score: 0
Accepted
time: 1145ms
memory: 76700kb

input:

2997 2996 100000
inninanannniniiaaaaiaiinniiiaaniiiinaiinnianiiaanannnnniainanaiaanniiiiniiannaainiaanaaaiaaannianaanaaiiaiinannnaainnanninnaaaaaanaaniianiannaaaaainnniaaaniniaiianaiaainnainannaaianaainaaainiananainiannainiainaaanaaiianaaaiiiaannnanainniniianiaiaiiaaannianinaininniaaniaiaiaaiiinnaaa...

output:

1
2
3
4
5
6
7
6
8
10
11
11
13
12
12
16
16
18
18
20
19
22
23
22
25
24
26
28
29
30
31
32
33
34
8
36
37
38
39
40
35
42
42
44
45
46
47
41
49
50
51
43
52
52
55
56
57
53
56
60
61
60
62
64
65
60
67
68
69
60
71
72
71
74
75
59
77
78
78
79
70
81
81
84
85
84
87
88
84
90
91
92
93
79
82
96
97
96
99
98
101
102
10...

result:

ok 100000 lines

Test #147:

score: 0
Accepted
time: 1028ms
memory: 76636kb

input:

2997 2995 100000
nwyuwpxqlybbmqyxflsmyfhwwmqplqssmyifxsnnbbnyhipwpwfqsspwyybfhxiifyywqpnmbwuwnxwymqwyyfqyqhspunispwwuuplunufysmipywuinplusfsqpmywqbbsbnxuywxubnbnsmqmffnbnuffuuwsqxyxiuhxsnibnfywppffxlxmuwnqmyylfnspphbqlywbpllihqhqxfyuiwfmhhyilyqixbuqpwhmsyxhuhbuhbbyqlifpffxfuhuisiluyybbbqpxbxyqynwqqw...

output:

1
94
5
4
5
5
7
8
9
10
11
12
13
10
15
17
16
18
19
19
20
22
23
21
24
22
25
28
29
30
30
31
33
34
35
36
35
37
38
38
41
41
35
44
44
46
46
48
41
50
51
52
53
52
53
56
57
56
59
55
58
62
63
63
65
65
67
68
68
69
59
72
72
66
70
54
77
77
79
80
81
82
83
84
77
86
87
88
89
90
91
80
93
94
93
96
97
94
98
100
101
102...

result:

ok 100000 lines

Test #148:

score: 0
Accepted
time: 330ms
memory: 29496kb

input:

2997 997 100000
jmmieycejczimujgzzutcztijyecizuizujmjmzcigucuguyyumtjimjmtziyctyuzmtjjtccutcuieigtttyzmiuutcmgcuuitugccguymiiuiutcmgigcjucmtgjttmtcjijgyugcgttzimyeuczzgymeijeyituutgytcjjgjmgecymyzggiuzzumcjyuuggiijumzyygicecgjgccgjceicygiztjgcgjcgymziyceyijztjuctucmizejymyyygemcucytjicimcyzgcmjigtet...

output:

367
42
79
422
411
165
215
284
353
120
171
489
136
32
158
324
163
203
294
232
115
170
519
46
160
134
69
409
64
83
160
207
151
291
242
226
20
298
30
22
75
180
524
382
8
88
4
223
253
155
454
18
129
305
301
482
345
94
223
176
223
308
81
16
284
59
77
314
208
46
150
147
42
163
571
21
69
397
380
3
36
192
4...

result:

ok 100000 lines

Test #149:

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

input:

3000 3000 1
uuyyyuuuyyuuuuyyuyyyyuyuuyyuuuyyyyuuuyuuuyuuyyyuuuuuyyuuyyuyyuyuuuyuuuuuyyyuyyyyyuuuyuuuuuuuuyuyuuyyuuyuuyuyuuuuyyuyuyuuuyyuyyyyyuuyyuyuyuyyuuuuuuuuyyyyyyyyuyyuuyuyuyyyyyuuuyuyuyuyyuuuyyyyyuyyyyuyyuyyyyuuyyuyyyyyuyuyyyyuuyyyyyuyyuyuuyyyyyuyuuyuuyyuyuyyuuyyuyuyuuyuyyuyuuyuuyuyyuuuyuyyyyyu...

output:

195

result:

ok single line: '195'

Subtask #11:

score: 9.09091
Accepted