QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#708948#8404. Modernizacja Bajtocji [A]liuziao10 ✓179ms20488kbC++231.3kb2024-11-04 10:06:082024-11-04 10:06:09

Judging History

This is the latest submission verdict.

  • [2024-11-04 10:06:09]
  • Judged
  • Verdict: 10
  • Time: 179ms
  • Memory: 20488kb
  • [2024-11-04 10:06:08]
  • Submitted

answer

#include <bits/stdc++.h>

// #define int int64_t

const int kMaxN = 1.3e6 + 5;
const char kC[] = "0?1";

int n, q, cnt;
int id[kMaxN], fa[kMaxN], sz[kMaxN], op[kMaxN];

// 0 : 单点,1 : 树,2 : 基环树

int find(int x) {
  return x == fa[x] ? x : fa[x] = find(fa[x]);
}

void unionn(int x, int y) {
  int fx = find(x), fy = find(y);
  if (fx == fy) op[fx] = 2;
  else fa[fx] = fy, op[fy] = ((op[fx] == 2 || op[fy] == 2) ? 2 : 1), sz[fy] += sz[fx];
}

void dickdreamer() {
  std::cin >> n >> q;
  cnt = n;
  for (int i = 1; i <= n; ++i) id[i] = fa[i] = i, sz[i] = 1;
  for (int i = 1; i <= q; ++i) {
    std::string s;
    int a, b;
    std::cin >> s;
    if (s[0] == '+') {
      std::cin >> a >> b;
      unionn(id[a], id[b]);
    } else if (s[0] == '-') {
      std::cin >> a;
      int f = find(id[a]);
      if (op[f] == 1 && --sz[f] == 1) op[f] = 0;
      id[a] = ++cnt;
      fa[cnt] = cnt, sz[cnt] = 1;
    } else {
      std::cin >> a;
      std::cout << kC[op[find(id[a])]];
    }
  }
}

int32_t main() {
#ifdef ORZXKR
  freopen("in.txt", "r", stdin);
  freopen("out.txt", "w", stdout);
#endif
  std::ios::sync_with_stdio(0), std::cin.tie(0), std::cout.tie(0);
  int T = 1;
  // std::cin >> T;
  while (T--) dickdreamer();
  // std::cerr << 1.0 * clock() / CLOCKS_PER_SEC << "s\n";
  return 0;
}

详细

Subtask #1:

score: 1
Accepted

Test #1:

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

input:

1 1
? 1

output:

0

result:

ok single line: '0'

Test #2:

score: 1
Accepted
time: 1ms
memory: 9700kb

input:

1 3
? 1
+ 1 1
? 1

output:

01

result:

ok single line: '01'

Test #3:

score: 1
Accepted
time: 1ms
memory: 9704kb

input:

2 10
+ 2 1
+ 1 1
? 1
- 1
+ 2 1
? 1
? 1
- 1
? 2
? 2

output:

11111

result:

ok single line: '11111'

Test #4:

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

input:

4 20
+ 1 3
+ 3 3
? 2
? 3
? 2
+ 1 4
- 4
- 1
+ 4 1
? 1
? 4
? 1
? 1
? 4
+ 4 2
? 4
- 4
- 1
? 3
+ 2 1

output:

010??????1

result:

ok single line: '010??????1'

Test #5:

score: 1
Accepted
time: 1ms
memory: 9696kb

input:

10 20
? 6
+ 1 7
+ 6 7
? 7
? 1
+ 7 7
+ 6 2
? 4
? 5
? 6
? 3
- 2
+ 3 8
+ 4 1
+ 7 8
? 7
+ 4 2
? 1
? 7
- 1

output:

0??0010111

result:

ok single line: '0??0010111'

Test #6:

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

input:

10 20
+ 2 9
+ 5 2
+ 1 4
? 3
? 1
+ 6 2
? 3
+ 6 8
- 4
+ 4 6
+ 6 10
- 9
- 5
- 4
+ 6 2
- 8
+ 8 2
? 5
+ 4 8
+ 7 8

output:

0?00

result:

ok single line: '0?00'

Test #7:

score: 1
Accepted
time: 1ms
memory: 9692kb

input:

10 18
? 1
+ 8 1
+ 6 2
? 10
+ 2 4
+ 9 8
? 5
+ 3 9
? 8
? 8
? 8
? 5
+ 10 3
? 2
? 3
? 3
- 3
- 2

output:

000???0???

result:

ok single line: '000???0???'

Test #8:

score: 1
Accepted
time: 1ms
memory: 9696kb

input:

10 19
? 6
? 7
? 9
+ 10 10
+ 10 1
+ 1 9
+ 8 9
+ 2 5
+ 5 4
- 8
- 9
? 8
? 6
+ 2 2
- 5
+ 8 6
- 1
? 10
+ 7 4

output:

000001

result:

ok single line: '000001'

Test #9:

score: 1
Accepted
time: 1ms
memory: 9924kb

input:

10 20
? 6
+ 2 8
+ 5 1
+ 6 1
+ 7 5
+ 8 1
- 2
+ 6 4
? 6
+ 5 1
? 1
? 2
- 5
- 8
- 7
? 5
? 8
+ 1 5
? 7
? 2

output:

0?100000

result:

ok single line: '0?100000'

Subtask #2:

score: 1
Accepted

Test #10:

score: 1
Accepted
time: 1ms
memory: 9916kb

input:

29 97
+ 7 20
? 26
+ 10 16
? 18
? 8
? 27
? 19
+ 29 20
? 7
+ 1 19
? 6
? 21
? 7
+ 28 9
+ 27 2
? 2
+ 20 18
? 5
+ 25 22
+ 7 13
+ 17 29
? 6
+ 9 15
+ 13 22
? 24
? 12
? 24
+ 2 13
- 29
+ 7 11
? 7
? 1
+ 7 8
- 16
- 7
+ 18 17
+ 28 20
? 10
+ 4 12
? 1
? 16
? 7
? 7
? 19
+ 12 22
? 18
? 20
? 6
? 27
+ 7 24
+ 22 7
? 1...

output:

00000?00??00000??0?000?110110011111101110

result:

ok single line: '00000?00??00000??0?000?110110011111101110'

Test #11:

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

input:

28 100
+ 28 20
? 6
+ 15 2
+ 6 24
? 6
? 1
+ 17 21
? 20
? 11
? 12
? 10
+ 2 27
+ 17 22
? 3
? 13
+ 16 11
- 22
- 2
+ 1 17
? 23
+ 20 10
+ 11 16
+ 18 2
- 10
? 14
- 2
? 6
? 15
+ 21 20
? 4
? 11
+ 10 11
? 24
+ 5 12
- 15
- 16
- 5
+ 13 28
- 20
+ 15 8
- 13
+ 8 12
? 24
+ 15 6
? 12
? 17
? 15
- 8
- 28
+ 5 23
? 8
? ...

output:

0?0?0000000??01?????010?10??000?01??00??110?

result:

ok single line: '0?0?0000000??01?????010?10??000?01??00??110?'

Test #12:

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

input:

30 100
? 16
+ 10 28
+ 30 19
? 28
+ 20 23
? 11
+ 5 13
- 28
- 23
+ 15 11
+ 1 2
+ 30 27
+ 5 3
+ 26 5
? 8
- 30
+ 10 23
+ 7 19
+ 23 1
- 5
- 23
- 11
+ 19 28
+ 18 3
+ 13 7
+ 19 29
+ 30 9
- 10
- 18
+ 20 14
? 15
+ 9 15
- 27
? 21
+ 29 5
+ 13 20
+ 26 12
- 26
- 2
? 14
+ 19 10
? 17
- 28
+ 5 9
+ 6 6
+ 6 20
+ 9 21...

output:

0?0000?0001011010000?10011

result:

ok single line: '0?0000?0001011010000?10011'

Test #13:

score: 1
Accepted
time: 1ms
memory: 9756kb

input:

30 95
? 8
+ 25 25
+ 30 27
+ 30 24
? 13
- 27
? 20
+ 20 22
? 19
? 11
+ 9 1
? 3
+ 7 3
+ 27 5
+ 7 19
? 26
? 8
+ 13 1
? 10
- 20
- 27
- 7
+ 7 6
+ 27 27
+ 20 29
? 6
+ 6 6
+ 28 20
+ 30 21
? 3
+ 4 16
+ 18 13
? 14
+ 13 6
- 30
+ 15 3
+ 27 30
- 15
? 25
+ 21 2
+ 20 15
+ 18 2
+ 8 21
? 2
- 16
- 2
? 19
? 10
? 13
- ...

output:

000000000??011?011??01?11001011001101111

result:

ok single line: '000000000??011?011??01?11001011001101111'

Test #14:

score: 1
Accepted
time: 1ms
memory: 9984kb

input:

29 97
+ 16 23
+ 4 22
+ 13 13
+ 12 27
? 11
+ 1 28
? 2
? 28
+ 15 7
+ 26 8
- 1
+ 1 13
- 16
? 16
? 7
+ 27 15
? 7
+ 22 28
+ 15 15
+ 28 18
+ 24 25
? 9
- 15
? 11
- 13
? 19
- 12
+ 9 1
+ 1 19
? 19
? 25
? 2
? 16
? 26
? 7
+ 22 24
- 25
? 27
- 27
- 24
+ 6 7
? 26
- 4
+ 27 2
+ 18 26
+ 29 23
+ 16 16
+ 12 7
? 21
- 8...

output:

00?0??0001?00?11?0?00?111011101011?

result:

ok single line: '00?0??0001?00?11?0?00?111011101011?'

Test #15:

score: 1
Accepted
time: 1ms
memory: 9996kb

input:

30 100
? 11
? 8
+ 6 4
? 21
+ 11 25
+ 10 12
+ 18 15
+ 3 26
+ 28 17
+ 12 19
+ 30 16
? 6
? 4
+ 13 18
+ 14 2
+ 29 5
+ 8 12
+ 23 27
+ 13 28
+ 5 7
+ 15 6
? 13
+ 24 27
+ 20 21
+ 1 30
? 17
? 26
? 15
? 19
+ 27 20
+ 1 22
? 30
+ 23 9
+ 14 29
+ 7 18
? 25
? 11
+ 25 15
+ 20 8
+ 30 21
+ 11 30
+ 26 24
- 8
- 28
- 15...

output:

000????????????000?0000??

result:

ok single line: '000????????????000?0000??'

Test #16:

score: 1
Accepted
time: 1ms
memory: 9960kb

input:

30 100
+ 11 19
+ 25 13
+ 17 23
+ 3 4
+ 28 2
+ 12 1
+ 27 20
+ 12 7
? 7
+ 15 29
? 4
+ 15 13
+ 24 16
+ 8 14
+ 26 22
+ 29 10
+ 18 10
+ 21 30
+ 5 16
+ 9 28
? 10
+ 8 19
+ 23 6
+ 27 5
+ 22 4
+ 9 7
+ 21 17
+ 8 4
+ 24 23
+ 19 2
+ 15 4
+ 23 14
- 13
- 29
? 6
- 20
- 11
? 28
- 18
? 24
- 15
? 25
- 12
- 6
- 8
- 17...

output:

???????????1100000?

result:

ok single line: '???????????1100000?'

Test #17:

score: 1
Accepted
time: 1ms
memory: 9696kb

input:

30 100
+ 27 25
? 5
+ 22 26
+ 1 22
+ 11 14
+ 13 19
? 7
? 16
+ 5 30
+ 20 29
? 26
+ 9 15
? 19
+ 17 12
+ 9 14
+ 3 24
+ 8 2
+ 16 23
+ 24 23
+ 6 10
? 20
+ 7 28
+ 18 21
? 2
+ 17 28
? 21
+ 27 21
+ 4 19
+ 29 10
+ 10 14
+ 1 3
+ 5 8
+ 7 27
? 15
+ 26 9
? 10
+ 19 5
? 9
+ 4 7
+ 28 3
- 6
? 24
- 11
? 14
- 24
- 17
-...

output:

000??????????00000???

result:

ok single line: '000??????????00000???'

Test #18:

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

input:

30 100
+ 4 1
+ 30 30
+ 10 10
+ 29 29
+ 1 18
+ 20 20
+ 12 18
? 10
? 3
+ 2 2
+ 19 12
+ 17 19
? 8
+ 17 21
+ 15 27
+ 14 24
+ 6 6
+ 5 16
- 20
+ 22 22
+ 19 13
+ 9 9
+ 16 13
+ 26 30
- 15
+ 7 3
+ 29 28
+ 24 11
- 30
+ 18 27
- 22
+ 27 23
- 10
+ 25 6
+ 20 20
? 19
? 30
- 2
- 26
- 6
- 20
+ 14 15
- 25
- 29
+ 9 17...

output:

100?0?0111

result:

ok single line: '100?0?0111'

Test #19:

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

input:

27 97
+ 1 2
+ 22 1
? 10
+ 17 17
+ 25 22
+ 9 9
+ 27 25
+ 27 3
+ 18 18
+ 23 3
+ 7 7
+ 5 5
+ 23 21
+ 24 21
? 23
+ 24 6
? 21
+ 19 6
+ 11 11
+ 19 10
+ 10 13
? 27
+ 15 13
+ 14 4
+ 16 2
- 19
- 6
- 1
- 24
- 2
- 22
- 23
- 10
- 16
- 13
- 18
- 7
- 27
+ 8 8
- 14
+ 21 6
? 19
+ 6 19
+ 10 27
+ 7 10
? 22
+ 2 2
+ 23...

output:

0???001010

result:

ok single line: '0???001010'

Subtask #3:

score: 1
Accepted

Test #20:

score: 1
Accepted
time: 1ms
memory: 9700kb

input:

99 391
? 44
+ 54 43
? 63
? 90
+ 91 19
? 93
+ 74 55
? 37
? 39
+ 21 5
+ 25 91
+ 27 30
? 83
+ 53 65
+ 38 64
? 33
- 21
? 37
- 30
+ 91 17
+ 10 83
? 9
? 87
? 41
? 30
+ 34 55
+ 90 78
? 22
? 73
? 54
? 80
+ 67 56
+ 24 87
+ 38 60
? 94
? 43
? 40
- 56
? 40
+ 12 27
- 27
? 23
? 5
+ 3 44
+ 72 85
? 73
+ 13 63
- 34
...

output:

000000000000000?00?00000?0000??000000000??????00?0?00?0???0000?00???0??000000??0?0??000011?01010?0111?10100101110001011111011111101110000001011?1??00111?1110100110?0111?10001111111?11

result:

ok single line: '000000000000000?00?00000?0000?...?1110100110?0111?10001111111?11'

Test #21:

score: 1
Accepted
time: 1ms
memory: 9700kb

input:

100 373
+ 10 8
? 32
? 42
+ 49 10
? 85
+ 96 98
+ 48 91
? 67
? 38
? 51
? 24
+ 70 1
+ 68 50
+ 73 41
? 27
? 94
+ 86 64
? 7
? 95
? 74
+ 7 17
? 5
+ 7 39
? 68
+ 93 87
? 78
? 87
- 1
+ 86 72
? 2
+ 64 14
+ 89 20
+ 95 19
+ 26 34
+ 17 100
? 18
? 84
? 9
? 52
- 68
+ 29 2
+ 36 9
+ 76 92
+ 56 70
? 15
- 70
? 79
? 16...

output:

0000000000000?0?00000000?0?000??0000?10000010?101?000??0??10??????100??0?0000?001010001101111010?10010000001110?000100011111010100111101?00100000001??1100000101?1101101

result:

ok single line: '0000000000000?0?00000000?0?000...00100000001??1100000101?1101101'

Test #22:

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

input:

10 400
? 10
? 7
? 8
+ 3 1
+ 4 10
+ 8 4
+ 7 8
+ 3 4
+ 2 6
+ 10 8
? 4
? 8
? 3
? 6
? 3
- 4
- 8
+ 5 3
? 5
? 4
+ 5 9
? 8
? 9
+ 4 9
+ 2 3
? 4
- 9
+ 9 3
- 7
? 1
? 10
- 6
? 1
? 6
? 1
? 5
? 10
- 10
+ 7 6
- 4
? 4
- 6
+ 8 10
? 3
- 9
? 8
- 10
? 4
? 6
- 2
? 6
? 1
? 10
- 1
? 7
? 3
? 7
? 8
? 8
+ 4 4
? 4
? 4
+ 1 4
...

output:

000111?110011111011101?00010010001101000010000111010010101001110?0??10101110000101011010011001111101111011111111111111111101??101111011111111111010011?01110011100101011101110110

result:

ok single line: '000111?110011111011101?0001001...0011?01110011100101011101110110'

Test #23:

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

input:

100 400
+ 96 50
+ 38 93
+ 10 5
+ 63 76
+ 40 99
+ 57 15
+ 53 41
+ 97 4
+ 43 25
+ 95 50
+ 41 84
+ 74 31
+ 7 65
+ 80 94
+ 70 50
+ 46 15
+ 13 74
+ 11 22
+ 7 66
+ 52 40
+ 82 64
+ 85 9
+ 23 64
+ 51 26
+ 27 59
+ 79 57
+ 69 5
+ 93 25
+ 66 54
+ 87 15
+ 14 96
+ 8 35
+ 19 49
+ 60 62
+ 88 26
+ 67 12
+ 68 34
+ 3...

output:

???010???????0

result:

ok single line: '???010???????0'

Test #24:

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

input:

100 400
+ 73 59
+ 92 88
+ 22 43
+ 85 100
+ 74 63
+ 69 85
+ 95 29
+ 42 57
? 66
+ 23 75
+ 56 19
+ 55 79
+ 50 44
+ 40 8
+ 83 1
+ 10 67
+ 50 93
+ 3 37
+ 30 15
+ 11 96
+ 70 79
+ 9 78
+ 48 77
+ 86 89
+ 18 82
+ 64 17
+ 41 73
? 26
+ 2 76
+ 20 99
+ 50 73
+ 72 27
+ 61 77
+ 34 80
+ 97 33
+ 29 5
+ 36 12
+ 26 90...

output:

00?00??00?????0?

result:

ok single line: '00?00??00?????0?'

Test #25:

score: 1
Accepted
time: 1ms
memory: 9984kb

input:

100 400
+ 26 70
+ 63 52
+ 65 39
+ 19 58
+ 20 60
+ 40 54
+ 94 89
+ 3 11
+ 91 59
+ 95 42
+ 100 4
+ 62 41
+ 34 94
+ 15 16
+ 98 71
+ 47 80
+ 6 39
+ 45 76
+ 18 20
+ 17 74
+ 29 86
+ 43 32
+ 25 17
+ 84 28
+ 61 68
+ 21 24
+ 23 54
+ 14 48
+ 83 42
+ 49 29
+ 92 76
+ 67 30
+ 9 44
+ 75 51
+ 88 78
+ 36 30
+ 57 82...

output:

?0??????????00????0

result:

ok single line: '?0??????????00????0'

Test #26:

score: 1
Accepted
time: 1ms
memory: 9700kb

input:

100 400
+ 6 13
+ 81 83
+ 90 72
+ 57 58
+ 15 75
+ 26 31
+ 67 23
+ 100 91
+ 69 71
+ 34 8
+ 41 17
+ 80 22
+ 6 79
? 11
+ 49 88
+ 21 76
+ 18 32
+ 44 94
+ 95 99
+ 65 48
? 95
+ 59 47
+ 16 63
+ 36 94
+ 27 34
+ 61 15
+ 62 7
+ 46 82
+ 17 31
+ 10 54
+ 15 2
+ 47 52
+ 78 98
+ 67 63
+ 40 33
+ 90 70
+ 25 81
+ 96 6...

output:

0???????000?00??

result:

ok single line: '0???????000?00??'

Test #27:

score: 1
Accepted
time: 1ms
memory: 9700kb

input:

100 400
+ 87 97
+ 41 49
+ 49 31
+ 28 24
+ 57 8
+ 4 24
+ 66 25
+ 14 45
+ 19 37
+ 98 71
? 11
+ 7 65
+ 53 83
+ 43 62
+ 82 2
+ 52 34
+ 85 89
+ 80 51
+ 9 74
+ 26 96
+ 75 83
+ 37 50
? 71
+ 67 90
+ 78 98
+ 78 32
+ 8 72
+ 63 85
+ 47 60
+ 25 100
? 100
+ 38 52
+ 21 2
+ 92 99
+ 15 73
+ 23 17
+ 30 100
+ 88 95
+...

output:

0??00??????01

result:

ok single line: '0??00??????01'

Test #28:

score: 1
Accepted
time: 1ms
memory: 9692kb

input:

100 400
+ 43 58
+ 23 65
+ 3 39
+ 59 52
+ 86 96
+ 35 38
+ 69 57
+ 2 56
+ 95 87
+ 84 14
+ 13 9
+ 29 81
+ 97 10
+ 20 31
+ 54 30
+ 41 51
+ 42 12
+ 11 17
+ 98 35
+ 48 72
+ 49 93
+ 99 88
+ 19 77
+ 99 57
+ 45 51
+ 80 85
+ 63 59
+ 76 6
+ 53 85
+ 70 19
+ 25 58
+ 68 6
+ 71 26
+ 68 70
+ 75 15
+ 16 2
+ 34 14
+ ...

output:

???000??0?????

result:

ok single line: '???000??0?????'

Test #29:

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

input:

100 400
+ 1 25
+ 25 17
- 25
+ 50 1
- 1
- 50
+ 41 74
+ 41 36
+ 17 48
+ 93 77
+ 41 81
+ 10 48
? 70
+ 17 11
+ 36 93
+ 74 17
- 93
- 17
+ 97 11
- 36
- 11
- 41
+ 33 14
+ 33 74
+ 57 1
+ 77 53
+ 60 77
+ 16 79
+ 1 25
+ 79 29
? 54
+ 1 29
+ 16 77
+ 93 45
+ 25 38
+ 25 45
- 38
+ 81 82
+ 7 82
- 74
- 57
- 79
- 60
...

output:

0000000???0?0??0?0?0

result:

ok single line: '0000000???0?0??0?0?0'

Test #30:

score: 1
Accepted
time: 1ms
memory: 9756kb

input:

100 400
+ 4 77
+ 62 1
+ 4 34
+ 1 4
? 21
+ 76 4
+ 87 4
- 77
+ 55 34
+ 74 76
+ 74 91
+ 76 73
+ 74 99
- 1
- 87
+ 74 16
? 95
- 73
+ 17 88
+ 16 98
+ 79 92
+ 14 12
+ 12 58
+ 18 48
+ 95 94
+ 56 26
+ 65 8
+ 44 94
+ 73 79
+ 94 17
+ 12 36
+ 35 57
+ 98 57
+ 65 26
+ 88 79
+ 14 48
? 35
+ 58 8
+ 26 35
+ 94 36
+ 7...

output:

00?00??0000?0????0????????0?????0?0?????0????

result:

ok single line: '00?00??0000?0????0????????0?????0?0?????0????'

Test #31:

score: 1
Accepted
time: 1ms
memory: 9760kb

input:

100 400
+ 82 27
+ 49 74
+ 1 99
+ 40 40
+ 43 43
+ 65 65
+ 51 51
+ 84 75
+ 42 42
+ 34 34
+ 5 84
+ 59 59
+ 10 10
+ 3 3
+ 52 52
+ 63 63
+ 90 90
+ 71 71
+ 8 8
+ 68 68
+ 58 22
+ 75 1
+ 46 46
+ 74 18
+ 84 49
+ 11 11
+ 45 45
+ 79 79
+ 12 12
+ 50 50
+ 94 94
+ 31 31
+ 44 44
+ 22 18
+ 98 98
+ 96 55
+ 96 86
+ 8...

output:

11???110?1?001?1

result:

ok single line: '11???110?1?001?1'

Test #32:

score: 1
Accepted
time: 1ms
memory: 9980kb

input:

100 400
+ 50 50
+ 48 48
+ 99 26
? 52
+ 49 49
+ 18 73
+ 43 43
+ 59 59
+ 74 74
+ 73 7
+ 33 33
+ 7 77
+ 53 77
+ 41 41
+ 31 31
? 2
+ 25 25
+ 79 79
+ 66 66
+ 63 53
+ 8 8
+ 70 70
+ 19 19
+ 22 22
+ 60 60
+ 29 29
+ 5 5
+ 37 37
+ 78 63
? 40
+ 1 1
+ 15 78
+ 15 51
+ 55 55
+ 16 16
+ 76 76
+ 51 100
+ 75 75
+ 68 ...

output:

0000?000????1111?

result:

ok single line: '0000?000????1111?'

Test #33:

score: 1
Accepted
time: 1ms
memory: 9752kb

input:

20 400
+ 7 20
+ 20 8
+ 8 4
+ 5 15
+ 15 13
+ 13 19
+ 9 19
+ 9 10
+ 12 10
+ 12 11
+ 1 1
+ 11 3
+ 3 6
+ 6 2
+ 2 14
+ 14 17
+ 16 16
+ 18 18
- 7
- 18
+ 8 7
+ 15 7
- 1
+ 18 18
- 16
? 15
+ 1 1
- 18
+ 18 18
- 1
+ 16 3
- 18
+ 2 17
+ 18 18
- 10
- 4
- 5
- 7
- 20
- 19
- 13
- 3
- 8
? 4
- 16
- 14
+ 5 8
+ 13 16
- ...

output:

?001???001?0??

result:

ok single line: '?001???001?0??'

Test #34:

score: 1
Accepted
time: 1ms
memory: 9692kb

input:

20 400
+ 19 15
+ 1 14
+ 12 20
+ 12 14
+ 2 1
+ 16 6
+ 19 3
+ 13 13
+ 11 11
+ 8 5
+ 1 19
+ 4 16
+ 8 14
+ 6 3
+ 7 17
? 12
+ 9 10
+ 18 13
+ 10 13
- 11
- 20
- 17
- 1
- 15
+ 15 1
- 18
- 8
- 6
- 19
- 3
- 16
- 5
- 4
- 9
- 2
+ 17 17
- 14
+ 11 3
+ 6 6
+ 7 17
+ 19 13
- 10
+ 15 1
+ 13 16
- 19
- 13
+ 12 12
- 3
-...

output:

?0??000???00?0?

result:

ok single line: '?0??000???00?0?'

Test #35:

score: 1
Accepted
time: 1ms
memory: 9920kb

input:

6 400
? 2
+ 6 3
? 3
+ 4 2
+ 5 6
+ 2 2
- 3
- 2
+ 6 6
+ 4 2
+ 4 1
- 2
+ 3 3
- 5
? 2
? 3
- 4
- 1
- 6
+ 3 5
+ 3 4
+ 2 2
+ 3 6
- 2
- 6
- 4
- 5
+ 1 3
+ 6 3
+ 2 4
- 3
- 1
+ 6 5
- 6
+ 2 4
+ 1 3
- 2
? 1
+ 4 6
- 6
+ 4 2
- 3
+ 6 6
- 5
+ 2 1
- 4
- 6
+ 1 5
- 2
? 5
+ 5 2
- 1
- 2
+ 6 3
+ 4 4
- 4
+ 6 1
+ 2 1
- 5
+ ...

output:

0?01?1101000?00001001111100110?0?1001000100

result:

ok single line: '0?01?1101000?00001001111100110?0?1001000100'

Test #36:

score: 1
Accepted
time: 1ms
memory: 9640kb

input:

100 400
+ 18 27
+ 93 17
+ 61 27
+ 27 1
? 61
+ 61 73
- 18
? 69
+ 43 67
- 27
+ 15 27
- 61
+ 27 8
+ 67 67
? 8
? 64
- 27
? 52
? 29
- 1
? 18
- 43
+ 67 7
? 18
? 27
+ 8 27
+ 74 27
- 15
? 27
+ 70 35
+ 74 21
+ 93 27
+ 91 80
- 80
- 93
- 27
+ 79 67
+ 64 67
? 27
+ 27 67
? 19
+ 9 27
? 66
? 21
? 70
? 27
+ 74 1
+ ...

output:

?0?000000?000??1100?10000?00?10?1?011??00?01000?00??00?0011100?1110??01000??101001111101111110111101111111100?1?1011010001101110010110111101011110100?1010?0110001?101111

result:

ok single line: '?0?000000?000??1100?10000?00?1...01011110100?1010?0110001?101111'

Subtask #4:

score: 1
Accepted

Test #37:

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

input:

300 924
? 59
+ 231 295
? 106
? 132
? 106
? 145
+ 100 196
? 118
- 100
? 59
? 291
+ 93 119
? 293
+ 179 99
+ 226 69
? 256
? 285
? 226
+ 58 155
? 190
+ 2 90
+ 241 78
? 69
? 239
+ 94 251
? 59
? 297
+ 115 267
? 65
+ 279 106
+ 183 154
? 145
+ 180 254
+ 147 285
? 203
? 186
+ 85 106
? 250
+ 196 210
? 283
? 1...

output:

00000000000?0?000000000000000000?0?0?000?00?00?0000000000000000?0???0?0??0??0?000000000?000?0?00?000?00?0?0?0000???00000?000?0?000???00?0?00000???000?00000?0?????00?0????0??0?000??0??0?0?????0?0??00???????0?0?000????????00?110?01???10?0?0?0?00010??001?0?011?11100001110?00101?111?1?10?001100???1?1?01...

result:

ok single line: '00000000000?0?0000000000000000...101000?011000011011?10010110110'

Test #38:

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

input:

300 958
? 47
+ 212 245
+ 283 77
? 93
? 190
- 283
+ 247 288
? 96
+ 144 142
? 278
- 144
+ 31 146
? 129
? 158
? 226
? 28
+ 172 241
+ 273 269
? 145
? 103
+ 252 160
? 94
+ 17 82
? 23
+ 21 254
? 287
? 166
? 22
? 263
? 72
+ 188 78
+ 222 146
? 260
? 110
? 200
+ 188 219
? 291
? 263
? 230
+ 25 109
+ 215 288
?...

output:

000000000000000000000000000000000000?0000000000000000000?0000?00?00000000?00????000?0?0??00?000?0??00??00000?0?00??00???0?0?0?000?0?00?00000??000000???0?0???0??0??10?00??100??00?00?0?0?1?00?0??100?0000?000?011??010?00?0?0010100001?01001?00110?0011101100?0?0100001101?1???010?0?1????10?01????01110??1?...

result:

ok single line: '000000000000000000000000000000...011110101111010?0100110?0100110'

Test #39:

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

input:

30 1000
? 21
+ 30 29
+ 11 1
? 30
? 19
? 13
? 2
? 10
? 4
+ 1 30
? 14
? 12
? 23
+ 10 17
? 7
+ 21 26
+ 23 4
? 13
+ 12 16
? 13
? 8
+ 8 13
- 13
? 13
- 4
+ 24 22
? 20
? 18
? 15
? 26
+ 22 20
- 17
+ 19 25
+ 28 19
+ 26 13
+ 20 26
? 14
+ 12 18
+ 28 21
+ 29 14
+ 5 27
+ 19 9
+ 2 28
- 9
+ 19 24
+ 24 3
? 13
? 21
...

output:

0?0000000000000000?01100111?01011?0?1111110011?1101100001?101111110101??0111110?11101?11111100101?1111110110110111001001111101000111110?101?100111011101111001000011000001?111110?000?010?0??10001011101010100111011100010101011110111000?1000?1111000?1110?0101???00011100000110?00011?01010101001?0?101110...

result:

ok single line: '0?0000000000000000?01100111?01...0111?10?110?1111111110111101110'

Test #40:

score: 1
Accepted
time: 1ms
memory: 9764kb

input:

300 1000
+ 36 240
? 252
+ 249 101
+ 265 286
+ 264 187
+ 12 3
+ 117 84
+ 98 62
+ 174 298
+ 161 137
+ 193 10
+ 127 203
+ 266 218
+ 73 28
+ 283 68
+ 21 188
+ 261 47
+ 182 15
+ 89 163
+ 263 280
+ 92 278
+ 284 74
+ 133 203
+ 187 196
+ 220 226
+ 20 240
+ 270 180
+ 100 241
+ 144 297
+ 253 242
+ 30 92
+ 120...

output:

0000?00???0????001110000000?00????????

result:

ok single line: '0000?00???0????001110000000?00????????'

Test #41:

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

input:

298 1000
+ 217 119
+ 283 29
+ 298 39
+ 181 185
+ 201 52
+ 261 229
+ 252 291
+ 180 138
+ 75 251
+ 129 62
+ 142 93
+ 287 205
? 268
+ 220 90
+ 241 219
+ 69 32
+ 21 57
+ 76 161
+ 141 173
+ 228 86
+ 290 98
+ 73 172
? 259
+ 23 65
? 98
+ 71 112
+ 181 249
+ 43 147
+ 6 17
+ 192 269
+ 246 77
+ 59 136
+ 243 27...

output:

00??0?0??????????????00000000????????????

result:

ok single line: '00??0?0??????????????00000000????????????'

Test #42:

score: 1
Accepted
time: 1ms
memory: 9960kb

input:

299 1000
+ 214 219
+ 142 75
+ 208 141
+ 204 228
+ 139 236
+ 169 237
+ 170 136
+ 79 116
+ 197 210
+ 270 139
+ 279 141
+ 162 256
+ 55 281
+ 93 231
+ 159 104
+ 32 194
+ 260 179
+ 175 158
+ 192 129
+ 184 183
+ 82 85
+ 48 8
+ 17 230
+ 125 240
+ 67 152
+ 118 19
+ 257 73
+ 284 123
+ 54 242
? 217
+ 185 62
+...

output:

0000????0?????????????000?0000000?????????

result:

ok single line: '0000????0?????????????000?0000000?????????'

Test #43:

score: 1
Accepted
time: 1ms
memory: 9700kb

input:

300 1000
+ 189 42
+ 248 261
+ 29 161
+ 262 118
? 122
+ 173 60
+ 39 140
+ 267 58
+ 134 130
+ 300 183
+ 198 141
+ 273 214
+ 6 234
+ 155 12
+ 3 109
+ 34 220
+ 201 68
? 146
+ 54 1
+ 26 231
+ 176 64
+ 180 186
+ 272 15
+ 169 17
+ 214 18
+ 87 221
+ 253 205
+ 16 75
+ 120 197
+ 244 238
+ 91 192
+ 112 174
+ 7...

output:

0000???????????????0?00?????0000?000?0???????????

result:

ok single line: '0000???????????????0?00?????0000?000?0???????????'

Test #44:

score: 1
Accepted
time: 1ms
memory: 9768kb

input:

297 1000
+ 25 211
+ 38 205
+ 243 209
+ 78 150
+ 212 221
+ 217 286
+ 114 266
+ 210 179
? 227
+ 261 132
+ 156 154
+ 162 98
+ 119 40
+ 216 279
+ 90 27
+ 173 285
+ 271 89
+ 4 251
+ 158 240
+ 3 204
+ 32 59
+ 18 196
+ 270 127
? 273
+ 241 71
+ 111 283
+ 246 178
+ 18 141
+ 253 187
+ 64 122
+ 100 264
+ 242 1...

output:

000?????0??????????????0?0???00000000??????????

result:

ok single line: '000?????0??????????????0?0???00000000??????????'

Test #45:

score: 1
Accepted
time: 1ms
memory: 9672kb

input:

300 1000
+ 63 29
+ 71 265
+ 195 99
+ 285 193
+ 142 223
? 24
+ 277 232
+ 112 216
+ 78 293
+ 2 98
+ 217 279
+ 182 71
+ 224 23
+ 11 7
? 32
+ 66 261
+ 24 282
+ 275 273
+ 226 141
+ 135 248
+ 48 159
+ 110 145
+ 39 253
+ 124 284
+ 32 174
+ 43 180
+ 130 167
+ 215 203
+ 51 267
+ 269 165
+ 207 233
+ 114 274
+...

output:

0000?00???????????????00000?????0???

result:

ok single line: '0000?00???????????????00000?????0???'

Test #46:

score: 1
Accepted
time: 1ms
memory: 9992kb

input:

298 1000
+ 1 133
? 39
+ 24 84
+ 55 214
+ 1 201
+ 237 55
+ 250 201
+ 214 154
+ 128 96
+ 128 112
+ 250 112
+ 84 154
+ 154 250
- 128
- 201
- 55
- 112
+ 112 214
+ 155 283
+ 275 231
+ 129 103
+ 31 252
+ 205 247
+ 32 120
+ 20 241
+ 144 220
+ 219 143
+ 247 207
+ 263 197
+ 35 270
+ 291 103
+ 69 174
+ 215 19...

output:

00?00?????0?0?????000?????00????0

result:

ok single line: '00?00?????0?0?????000?????00????0'

Test #47:

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

input:

300 1000
+ 211 79
+ 1 79
+ 298 165
+ 79 165
+ 230 84
+ 224 127
+ 230 169
+ 55 242
+ 242 169
+ 232 165
+ 228 65
+ 165 276
+ 98 165
+ 170 187
? 104
+ 232 230
+ 205 65
+ 65 187
? 116
+ 205 224
? 273
+ 276 127
+ 188 211
+ 188 160
+ 299 231
? 35
+ 188 299
+ 262 96
? 124
+ 170 262
- 299
- 298
- 127
- 98
-...

output:

00000000000?0??0?0000?00??00??0??0????????????????0???????0????0????????0??????0???0???????????0??0??0?0?0??0????????????00??0????000???

result:

ok single line: '00000000000?0??0?0000?00??00??...0??0????????????00??0????000???'

Test #48:

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

input:

300 1000
+ 153 153
? 112
+ 75 75
+ 202 202
+ 33 33
+ 58 58
+ 157 157
+ 109 109
+ 126 126
+ 74 74
+ 105 105
+ 231 231
+ 181 181
+ 211 211
+ 80 80
+ 265 265
+ 268 268
+ 224 224
+ 295 295
+ 37 37
+ 167 167
+ 233 146
? 210
+ 52 52
+ 55 55
+ 133 133
+ 130 130
+ 223 223
+ 218 218
+ 14 14
+ 106 106
+ 212 2...

output:

00?111101?00??0110?01?0101??10?1????

result:

ok single line: '00?111101?00??0110?01?0101??10?1????'

Test #49:

score: 1
Accepted
time: 1ms
memory: 9704kb

input:

297 1000
+ 42 42
+ 173 47
+ 197 197
+ 242 160
+ 147 147
+ 109 34
+ 194 194
+ 205 205
+ 241 203
+ 270 270
+ 233 135
+ 282 282
+ 201 166
+ 181 181
? 275
? 179
+ 39 280
+ 200 170
+ 121 121
? 212
+ 126 264
+ 247 247
+ 125 146
+ 262 262
+ 167 198
+ 143 297
+ 203 2
+ 98 98
+ 182 182
+ 292 292
+ 171 171
? ...

output:

0000000011????010001????0????1???000?10?0101000100?

result:

ok single line: '0000000011????010001????0????1???000?10?0101000100?'

Test #50:

score: 1
Accepted
time: 1ms
memory: 9736kb

input:

60 1000
+ 60 7
+ 39 39
+ 45 45
+ 53 38
+ 38 7
+ 21 21
+ 4 4
+ 49 49
+ 9 7
+ 46 46
? 25
+ 52 51
+ 25 12
+ 17 25
+ 54 54
? 50
+ 19 19
+ 36 40
+ 16 16
+ 36 13
+ 35 35
+ 28 28
+ 55 55
+ 12 58
+ 23 23
+ 58 40
+ 15 15
+ 27 27
+ 5 5
+ 59 59
+ 2 50
+ 48 48
+ 29 3
+ 52 51
- 19
+ 22 18
+ 33 44
- 21
- 49
? 59
...

output:

00110001???010?0100001???01??1?11010

result:

ok single line: '00110001???010?0100001???01??1?11010'

Test #51:

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

input:

60 1000
+ 10 60
+ 52 10
+ 18 52
+ 41 18
+ 30 41
? 32
+ 30 48
+ 45 48
+ 16 8
+ 27 8
+ 8 59
+ 34 42
+ 29 2
+ 33 33
+ 31 31
+ 5 2
+ 19 2
? 10
+ 22 11
+ 44 44
+ 49 49
+ 32 53
+ 53 38
+ 46 38
+ 26 43
? 30
+ 4 4
+ 3 24
+ 28 24
+ 35 35
+ 37 21
+ 36 44
? 9
+ 24 51
+ 54 4
- 41
+ 13 58
+ 13 57
+ 43 26
+ 17 57...

output:

0??0?11?1?00??????0???1?1???01000??01001?00000??1?

result:

ok single line: '0??0?11?1?00??????0???1?1???01000??01001?00000??1?'

Test #52:

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

input:

20 1000
+ 16 16
+ 2 14
+ 12 12
+ 7 7
+ 13 2
+ 5 5
- 7
+ 14 16
+ 11 11
+ 1 1
- 12
+ 3 16
+ 10 10
+ 4 4
- 14
+ 18 18
- 11
? 13
- 1
- 10
- 2
? 6
+ 9 9
- 13
+ 18 2
- 4
- 3
+ 6 6
+ 8 8
- 9
+ 7 16
? 13
+ 5 15
? 19
+ 16 1
+ 16 11
- 7
- 8
- 11
+ 4 2
- 5
- 1
- 16
+ 3 19
? 1
+ 14 14
+ 13 12
+ 8 10
+ 1 17
+ 11...

output:

10000??100?0??0?001100?1?110010111?1000?10??10?00111??101001

result:

ok single line: '10000??100?0??0?001100?1?110010111?1000?10??10?00111??101001'

Test #53:

score: 1
Accepted
time: 1ms
memory: 9644kb

input:

300 1000
? 160
+ 204 35
? 224
+ 120 73
+ 14 120
+ 130 130
? 47
? 2
? 254
+ 79 50
? 101
+ 120 28
? 47
? 204
+ 280 206
? 120
+ 224 66
+ 167 160
- 130
+ 103 204
+ 173 204
+ 120 25
- 79
+ 28 204
- 224
? 120
+ 39 169
? 252
+ 224 69
+ 290 120
? 287
+ 28 80
+ 61 204
+ 130 204
? 28
+ 161 283
+ 271 204
+ 280...

output:

0000000???00?0??000?00?0100??000101??0?0?00????00?000000001000000001100100001000000?10?000010?11001000010111011100010111110?1111110?100100??10??010??1?011010000110000?100001001??00?10101111011001010???011010110101000?0100111100?111000?000010000000011101010?00000????1110111010011??1100001000?001010??...

result:

ok single line: '0000000???00?0??000?00?0100??0...1?0000?10110011011101111101001?'

Subtask #5:

score: 1
Accepted

Test #54:

score: 1
Accepted
time: 2ms
memory: 9728kb

input:

3000 9744
+ 2240 1376
+ 552 2967
+ 380 2865
+ 25 1339
+ 1688 1131
? 2317
? 2045
? 2295
? 668
+ 2098 2242
+ 179 1859
? 1516
+ 2577 456
? 1657
? 938
? 274
? 2337
+ 1490 1394
+ 1923 2049
+ 707 497
+ 514 1068
+ 2309 2966
+ 2044 1946
? 499
? 700
+ 2426 2362
+ 1094 561
? 1183
? 2456
+ 1630 1005
+ 2528 264...

output:

00000000000000000000000000000000000000000000000000000000000000?00?000000000000000000000000?0?00000000000000?????00?0000?0000?000000000000?0?00000000?0000000000000000000?000000000?0000?0000000000000000000000?000000000?00000000000?000?00??00?000000?000?0000000000000000000000000?0000?0?000000000000?000...

result:

ok single line: '000000000000000000000000000000...110111110111?1?1000?10100101001'

Test #55:

score: 1
Accepted
time: 2ms
memory: 9668kb

input:

2982 9585
+ 2678 1703
+ 2094 203
+ 781 2358
? 2682
+ 2873 2014
+ 2421 1462
+ 1631 1305
? 538
? 2868
? 1739
? 2501
? 2070
+ 2745 2354
+ 179 1940
+ 2649 1516
+ 291 2527
+ 2657 260
+ 907 2966
? 51
? 595
? 1306
+ 2414 2459
? 2280
? 1664
? 118
+ 1816 741
? 335
+ 91 1835
+ 1164 2375
+ 1479 244
+ 1920 2252...

output:

000000000000000000000?000000000000?00000000000000000000000000?00000000000000000000000000000000000000000?00000000000000000?00000000000000000000000000000000000000000000000?000?000000000000000000000000000000000000000000?000??0?000000000?00000000000000000000000000000?0000???000000000?0000000000000000000...

result:

ok single line: '000000000000000000000?00000000...111010?1?1000100101111?1001?111'

Test #56:

score: 1
Accepted
time: 2ms
memory: 9772kb

input:

300 10000
+ 181 149
? 292
+ 42 91
+ 192 117
? 26
+ 193 112
? 279
? 260
? 184
+ 30 88
+ 73 298
+ 186 153
? 236
+ 106 39
+ 104 92
? 284
? 68
+ 279 52
? 24
+ 161 46
? 184
? 221
+ 25 153
+ 112 281
+ 28 204
- 112
? 204
+ 49 219
+ 8 73
+ 209 198
+ 225 216
+ 206 155
? 104
+ 95 118
? 106
? 265
+ 275 178
+ 2...

output:

00000000000???000?000000000?00000000?00?000000000000000?000?00?0????0000?0?0000?0??0?000??00?0??????0?00?00???00?00?0?000?0?00??000?00?0?0?00??0000??000?00000?00????0?01?10010000?00010?000?0?000?111??1001?0?011?01000?0001011111?1?1?1010?010011?011100000101000100??1100111101000101??0111111?1001000?00...

result:

ok single line: '00000000000???000?000000000?00...11?01??01110111111?000111011110'

Test #57:

score: 1
Accepted
time: 2ms
memory: 9984kb

input:

2989 10000
+ 31 1360
+ 2002 1623
+ 33 1172
+ 1679 130
+ 1458 86
+ 2894 782
+ 1831 1538
+ 2988 1617
+ 1649 1751
+ 1628 2106
+ 420 1710
+ 660 466
+ 1387 1593
+ 2663 1573
+ 118 761
? 1239
+ 71 1288
+ 1829 2814
+ 2186 1426
+ 216 2138
+ 2817 524
+ 2026 1165
+ 145 2377
+ 2869 155
? 722
+ 172 2934
+ 2573 1...

output:

000?000000000?00?00000?00?000?00?000???0?0????0?00??0?0?????0????????0??????0?0?????????????????????????????????????????????????????????????????0?????????0?0?00????11010001010101111011111111010011101110100001001001001101011000100000000000000010000000000010000001000000000000000000000?00000?0000000000...

result:

ok single line: '000?000000000?00?00000?00?000?...????????????????????????????0??'

Test #58:

score: 1
Accepted
time: 2ms
memory: 9944kb

input:

2974 10000
+ 2898 2794
+ 2239 2096
+ 232 363
+ 1652 494
? 2684
+ 1677 16
+ 107 1072
+ 1150 860
+ 204 801
+ 711 2774
+ 1133 1078
+ 2609 1629
+ 2001 702
+ 1440 14
+ 2713 171
+ 229 2854
+ 2509 778
+ 1344 1066
+ 2466 945
+ 1765 1513
+ 2577 1492
+ 2473 1346
+ 1276 1859
+ 880 2571
+ 971 249
+ 1406 2341
+ ...

output:

000000?0000?00??00000??0??0000?000000??00?0?000??0?0???0???????0????0????????0??????????????????????????????????????????0?0??0???00????0??0??0?0???0?????00??000?00??0000000000000?0?00?0000000000??00000000000000000000000000??00??000??00??00?0?000000?0?0?0???0??000??????0????????????0????0??????0??0??...

result:

ok single line: '000000?0000?00??00000??0??0000...?????0????0???000??????????????'

Test #59:

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

input:

3000 10000
+ 218 572
+ 403 1025
+ 2603 203
+ 2867 2998
+ 2676 2948
+ 1134 2063
+ 2875 2533
+ 2910 108
+ 1059 933
+ 1109 2887
+ 1320 2054
+ 339 2656
+ 106 86
+ 2316 2561
+ 1403 98
+ 51 2764
+ 361 1434
+ 1057 1115
+ 1201 2066
+ 2255 805
+ 2386 86
+ 1702 957
+ 823 1455
+ 999 217
+ 1315 2130
+ 1366 1527...

output:

0000000000000000000000?00??00?0000?000?????0??00????0?0???0????00???0???0???????????????????0???????0?0?0?????????????0????0??????????????????????????????????????????00?????00?????????????0??0???0?0??0?????0??0?000??0?0000??0??0000000????00????00??0??000000?00?000?000?00?00000000000?0000000000000000...

result:

ok single line: '0000000000000000000000?00??00?...????????????0????????????0?????'

Test #60:

score: 1
Accepted
time: 2ms
memory: 9700kb

input:

3000 10000
+ 1975 1073
+ 657 391
+ 172 2532
+ 2887 2567
+ 824 1523
+ 1943 2450
+ 381 1327
+ 625 905
+ 843 823
+ 1618 894
+ 2791 197
+ 124 1114
+ 1734 1441
+ 2443 532
+ 1564 1764
+ 1535 1558
+ 2133 1144
+ 1103 861
+ 2181 2741
+ 602 61
+ 1171 1548
+ 71 788
+ 1883 2879
+ 1031 2731
+ 1070 2476
+ 2338 16...

output:

0000000?0?000000?000??00?0?0???000000?0?0??0000????0?00???00?????0???0??????0?0??0??0?????????????0????????????????????????????0???????????????0??0??000???0?00????000?????00?0?0?00??00?0??00???0?00?0000?????0?000?00000?0000?0?0000??000?0000?00?00000000000000000000000000000?00?0?00??000?0????000000??...

result:

ok single line: '0000000?0?000000?000??00?0?0??...????????????????00????????????0'

Test #61:

score: 1
Accepted
time: 2ms
memory: 10024kb

input:

3000 10000
+ 1625 431
+ 2114 2705
+ 2353 1393
+ 2977 2050
+ 891 1686
+ 921 605
+ 416 451
+ 1062 313
? 2687
+ 1977 1403
+ 522 2906
? 209
+ 354 1345
+ 128 748
+ 179 20
? 1684
+ 170 2096
+ 344 606
+ 670 115
+ 8 2608
+ 2551 1265
+ 909 2679
+ 1104 71
+ 1889 2259
+ 612 2504
+ 2260 2819
+ 1314 1708
+ 2786 ...

output:

0000?00000000000?00000000?00?00??0??0?00?00?0???????0??0?0??0????0?0??????00???0??????????????????????0??0????????????????????????????????????0???0?0????0???0????0????0???00????0??00??????????1110100100100100011001100100000000000100000000100000000100101000000000?00000000????0000???0000???00?0??00000...

result:

ok single line: '0000?00000000000?00000000?00?0...??????????????????0?0????????0?'

Test #62:

score: 1
Accepted
time: 2ms
memory: 9692kb

input:

2986 10000
+ 1445 2021
+ 2173 1559
+ 1139 1846
+ 1738 2896
+ 2844 372
+ 2534 1011
+ 92 2339
+ 1549 720
+ 479 887
+ 1853 527
+ 1553 1814
+ 2901 572
+ 810 444
+ 2877 543
+ 2027 721
+ 674 2077
+ 2523 720
+ 1883 1300
+ 1887 303
? 1625
+ 2094 2694
+ 1989 2112
+ 772 705
+ 2921 1544
+ 1347 2170
+ 1474 718
...

output:

00000??00000?0?000000000??00?0?0?0????0??0????????????0?????????????????????????????????????????????????????????????0??????????0???0??0????????00?00?00?0??????00?000?????00?00?000????000???0?000000000?0000?00000?000?0000?000000000000?000?0000000000?0????000??0??0????????00???????????????????????????...

result:

ok single line: '00000??00000?0?000000000??00?0...????????????????0??????????????'

Test #63:

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

input:

3000 10000
+ 1946 378
+ 2140 1
+ 1545 5
+ 2260 2841
+ 2168 936
+ 2226 1587
+ 2857 2168
+ 2673 2035
+ 2673 936
+ 1085 1235
+ 808 2841
+ 5 2263
+ 2226 1085
+ 1587 2263
+ 1842 1
+ 1370 808
+ 2841 936
+ 378 2140
+ 1 1235
+ 2857 2140
- 378
? 2913
+ 1795 329
+ 221 1487
+ 1913 1487
+ 1926 2728
+ 2955 2130
...

output:

000000000000?00000?0000000???00000000???0000???000?0000?000??00?0000?0?0??0??0?0???0?000??0?0?0???000?0?00??0??????00???????00???0??0??????0??00???????????0??0??0?0??0??00??0?000?0??????00?000????00??0???0???00??????????00?0??0???00?????0?0?0????0????000?0000????000???0?????0??00??00?0?????00???0???...

result:

ok single line: '000000000000?00000?0000000???0...00????????0???0?0?0???0?000?0?0'

Test #64:

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

input:

3000 10000
+ 153 247
+ 961 2483
+ 1925 2784
? 190
+ 2483 1
+ 1977 961
+ 1977 685
+ 2096 745
+ 1892 2784
? 1377
+ 2483 247
+ 2096 1328
? 2552
+ 745 2784
+ 1328 961
+ 1117 2761
+ 2258 680
+ 2761 2258
+ 1706 2483
+ 1706 932
+ 2596 962
+ 1246 2258
+ 2596 1706
+ 680 1706
+ 2656 670
+ 237 486
+ 1614 1331
...

output:

000000000000000000000000000000000000000000??0000?000?0000?000?0000?0??000000000000??0??00000000000000000000000?0000?0000??00000?00000?00?00000??0000000000???000000?0??00000?0??0000000??0????000?000??00?0?000?0000?000?00?00000?????000??00?00??00000?0???00000?00000????0??000????0?0??00???00?00?000?0??...

result:

ok single line: '000000000000000000000000000000...?00?????0???0??????00?0????000?'

Test #65:

score: 1
Accepted
time: 2ms
memory: 9728kb

input:

2982 10000
+ 768 2002
+ 768 1235
+ 972 1235
+ 2510 972
+ 1409 2510
+ 506 1409
+ 2624 506
+ 2624 2319
+ 2477 2319
+ 541 2477
+ 2969 541
+ 1797 2969
+ 2326 1797
+ 2326 302
+ 2012 302
+ 2012 130
+ 130 2441
+ 2465 2441
+ 1932 2465
+ 1932 1704
+ 1704 383
+ 383 1158
+ 1237 1158
+ 1838 1237
+ 1838 1017
+ 9...

output:

00000000000??00?0000000000?00?00000??000000000?000????0000000??00???10001000??0?0?00???0???0?0??0?0?00?0???0??0??0??1000??00?0????0????????0?0??00??????????????00????????????0???0??????0???????10?1111111111010?101011?11111111??101111111110?1?00?0000000110110?111?1010101??01?11?00?0?00??00110100101?1...

result:

ok single line: '00000000000??00?0000000000?00?...0??1?????0?1?01??????0???0?????'

Test #66:

score: 1
Accepted
time: 2ms
memory: 9724kb

input:

2994 10000
+ 2827 2827
+ 983 399
+ 399 25
+ 51 406
+ 549 1790
+ 1851 2066
+ 606 932
+ 195 1864
+ 2228 1859
+ 2861 406
+ 2228 406
+ 972 2641
+ 1627 1838
+ 485 932
+ 297 866
+ 1851 1209
+ 1838 1977
+ 2793 2468
+ 1523 2364
+ 25 4
+ 2244 1903
+ 1810 1472
+ 1903 2255
+ 1472 2510
+ 817 1627
+ 1585 549
+ 2...

output:

0000000000?0?00000000000?0000?0?0??000?000???0?0?00?0??00?0??00??0?0???000???00????0?????0?????????010??00???1???0????1????????????????11???????????1???1?00??1??11????1??????0?1?0?1?0??????0????01?0??0?0??1???0?00?????0?100?1?????1?1????100???0???0??1?1??1?01010111000?1111010?11??0?01?01?0?10?101101...

result:

ok single line: '0000000000?0?00000000000?0000?...0?0100000111010111?101?10011110'

Test #67:

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

input:

600 10000
+ 288 153
+ 585 585
? 44
+ 450 450
+ 227 342
+ 455 455
+ 296 165
+ 458 274
+ 138 472
? 70
+ 249 249
+ 441 441
+ 197 197
+ 494 288
+ 452 328
+ 222 222
+ 78 78
+ 186 342
+ 272 39
+ 114 114
+ 452 54
+ 416 119
+ 435 160
+ 348 348
+ 206 332
+ 174 138
+ 386 206
? 193
+ 128 128
+ 274 303
+ 487 18...

output:

000?00000001??11??11??1?100111111?1011????1??110??110??111100011?1000001?01?1?01?0??0??00?1?01000101??00?0?11?0?0101110?????1111001000?0001?0?1?111000??????1?1?111?1100?01011?0?1??01????????????011?11111?10100111110?01100111?100???0?11111110?0110?11????011?0?100?10?0?00??0101001?1?00010?100???1?0?0?...

result:

ok single line: '000?00000001??11??11??1?100111...00?000?001111101?01?11010111000'

Test #68:

score: 1
Accepted
time: 2ms
memory: 9888kb

input:

600 10000
+ 537 300
+ 233 463
+ 192 189
+ 411 508
+ 518 278
+ 345 56
+ 375 484
+ 141 600
+ 597 199
+ 247 247
+ 415 395
+ 402 590
+ 504 232
+ 356 202
? 58
? 176
+ 220 455
+ 431 554
+ 376 55
+ 518 287
+ 17 253
+ 199 278
+ 106 590
+ 439 568
+ 441 546
+ 503 40
+ 134 272
+ 111 483
+ 283 46
+ 72 483
+ 246...

output:

000000?000000??0???0???0???0?0??1???0?1??1??10?00000101?11??00??0?010001??11110?0???010001100110111101?0101??010011010??101?1??001?10?011?01?0??1?111?11?1?1???1?010?110?1111?1?1001110?1101100?01?1??1?01??1?1?10?1??????1?0?10??0?0?00??10??0?0??0?0?0??0?000?101??0??01??????????110??01101?101?01??0????...

result:

ok single line: '000000?000000??0???0???0???0?0...0?11???1001?01110??1?0?00?10?11'

Test #69:

score: 1
Accepted
time: 2ms
memory: 9716kb

input:

200 10000
+ 55 55
+ 51 51
+ 148 151
? 5
+ 67 67
+ 64 151
+ 64 79
? 26
+ 87 87
+ 163 79
? 24
+ 156 163
+ 9 9
+ 156 103
+ 103 199
+ 199 171
+ 91 171
+ 14 14
+ 91 77
+ 19 77
+ 19 16
+ 16 150
+ 56 150
+ 93 56
? 34
? 68
+ 40 93
+ 40 116
+ 127 116
+ 48 48
+ 84 127
+ 76 84
+ 26 26
+ 17 76
+ 126 17
? 19
+ 1...

output:

00000?01??0010?1???1?????1?1????1?0???????11111?11?110??0000110110101001110101100110010?1000110?1011?10111100100101100101?0?111?0001?111100111???11?00110??010??10?110?01?00001?1?11?1?11?110111?010011011101010???0?0?0??0?0???1??000???1???0?1??????11??1?011110111??1?01?1111?0???0?10?01?10011?010?01110...

result:

ok single line: '00000?01??0010?1???1?????1?1??...?01011000101111001?0111?011000?'

Test #70:

score: 1
Accepted
time: 2ms
memory: 9788kb

input:

3000 10000
+ 834 2097
+ 1823 834
+ 868 1823
+ 340 868
+ 707 340
+ 707 2683
+ 635 2683
+ 635 466
+ 466 202
+ 1968 202
+ 1968 903
+ 903 2812
+ 1765 2812
+ 1565 1765
+ 1300 1565
+ 2014 1300
+ 2014 2579
+ 821 2579
+ 821 1954
+ 290 1954
+ 572 290
+ 572 1884
+ 1884 788
+ 788 2475
+ 2500 2475
+ 2500 1670
+...

output:

?

result:

ok single line: '?'

Test #71:

score: 1
Accepted
time: 2ms
memory: 9732kb

input:

3000 10000
? 702
+ 1312 129
+ 2286 2633
? 2373
? 1433
+ 298 710
+ 388 723
+ 2279 392
- 392
+ 2426 554
? 388
? 265
+ 839 1715
+ 2771 1715
+ 265 388
+ 265 392
+ 2307 920
- 1715
- 1312
+ 1502 1131
- 265
- 388
? 710
+ 718 2362
? 624
? 187
? 2633
+ 265 265
? 1715
? 393
+ 574 133
? 1502
? 265
+ 265 1925
?...

output:

000?0?00?00?1000000?00101??0000??00???00000?00?0?00?0??00000000???00?0010??1??0?1010?0?00000?000000???0000?0??1?0???0?00?0000010?1001?0?0110?10001100?1011111110100000001000000000111010?01??0?0?0000000?10?0?0?001000010100?001000??1101??00?1?1?1000???1001?11??00????0?0??1?0001111??0?10????1??1010?0010...

result:

ok single line: '000?0?00?00?1000000?00101??000...000111100101?100010101111100100'

Subtask #6:

score: 1
Accepted

Test #72:

score: 1
Accepted
time: 15ms
memory: 12376kb

input:

50000 156785
? 7574
+ 23871 49430
? 34700
+ 46209 6266
+ 6220 25627
? 46445
+ 17407 32424
? 31750
? 39616
? 41616
+ 6724 49194
+ 30434 21574
? 7469
? 37204
? 39060
? 25290
? 40330
? 15428
+ 44101 7852
+ 18662 34969
+ 11556 17270
? 10132
+ 31134 48464
+ 24700 43615
+ 12173 26470
+ 27682 13463
+ 39534...

output:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok single line: '000000000000000000000000000000...10?001?1011?0?001111100110??110'

Test #73:

score: 1
Accepted
time: 19ms
memory: 14396kb

input:

49568 148838
+ 9891 15711
+ 33902 10842
? 2776
? 35570
? 42582
+ 1899 36184
? 39668
+ 43584 25148
+ 6073 5005
? 11981
? 44488
? 20434
+ 37527 7100
+ 44338 37866
? 9076
+ 18905 14347
+ 35616 37089
? 24708
? 28739
+ 29109 35512
? 16641
+ 43900 20333
? 35603
+ 34491 6512
? 45149
? 17815
+ 14120 18695
?...

output:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?000000000000?0000000000...

result:

ok single line: '000000000000000000000000000000...1?01100?010?000?0?0010001111101'

Test #74:

score: 1
Accepted
time: 14ms
memory: 10152kb

input:

5000 160000
? 3008
+ 3564 4702
+ 1967 1664
? 1731
+ 4985 1916
? 2027
? 107
? 2605
+ 132 310
+ 591 1505
? 1359
+ 3385 1283
? 3494
+ 4336 4870
+ 3152 1519
+ 3798 4739
+ 295 3095
+ 3943 4406
+ 1247 4464
+ 2208 414
? 232
+ 2083 899
? 950
? 522
+ 1104 1231
? 2286
? 649
+ 2817 4580
? 80
+ 4175 942
? 3544
...

output:

000000000000000000000000000000000000000000000000000000000000000000000000?00000000000000000000000000000?0000000000000000000000000000000000?00??0000000000?000??000000000??00??00?0000000000000?00000?0000000000000000000000000000?00000000000000000?0000000?00?00000000000000000000000000000000000?0000000000...

result:

ok single line: '000000000000000000000000000000...1??11111101100?1010101101110?01'

Test #75:

score: 1
Accepted
time: 15ms
memory: 14428kb

input:

49689 160000
+ 49377 23990
? 41242
+ 13195 40464
+ 8731 10367
+ 21321 32888
? 49137
+ 1949 4999
+ 40923 5614
+ 43940 7684
+ 48203 37844
+ 22198 25056
+ 42626 42674
+ 26669 33429
+ 30785 14291
+ 24790 30806
+ 4696 17106
+ 34051 18525
+ 48394 41214
+ 10808 33915
+ 40168 835
+ 40585 13933
+ 20370 25404...

output:

000000?0000000000000000000?00?00000000000000000000000000000000000000?0000?00000000000000?000?00000000000000000000000000000000000000?000000?0?0000?0000000000000?0000?0?0000?0?0000?00000??0?00?0?000000000000000000000??000?00000?0000000000000000000?0000?0?000?00000??000??00000000?00?000??0????0000?0000...

result:

ok single line: '000000?0000000000000000000?00?...?0??????????????????????????0??'

Test #76:

score: 1
Accepted
time: 19ms
memory: 10388kb

input:

50000 160000
+ 30800 33907
+ 24194 17149
+ 11619 40842
+ 6 3572
+ 20531 24657
+ 8711 8320
+ 21348 30996
+ 8110 35950
+ 43426 30688
? 37648
+ 21410 36427
? 7668
+ 32091 9233
+ 20292 32795
+ 1932 1570
? 1621
+ 14165 36934
+ 27522 2710
+ 35006 31201
+ 44103 34843
+ 9477 14930
+ 22752 27375
+ 28819 2305...

output:

0000000000000?000000000000000000000?000000000?00000000000000?000000000000000000?0000000000000000000000000000?000000000000?00??000000000000000??00?00??000000000000000?000?00?000000?000?0000000000?00?0?000000000000000000000?00?000000?000000000000000?000?0?0000?0?00000?0000000?0?0000?0?00000000?00??000...

result:

ok single line: '0000000000000?0000000000000000...?????????????????0???0?????????'

Test #77:

score: 1
Accepted
time: 14ms
memory: 10164kb

input:

49805 160000
+ 9913 46188
+ 29761 19382
+ 41689 12400
+ 21588 39278
+ 5984 22043
+ 5702 15169
+ 47671 9712
+ 47846 44182
+ 17336 4110
+ 33877 6372
+ 48767 32360
+ 39373 40544
+ 17275 23909
+ 19681 6645
+ 17611 32684
+ 15667 38116
+ 26324 11640
+ 32991 42027
+ 26280 31769
+ 49256 20602
? 1327
+ 41827...

output:

00000000000000000000000000000000000000000000000000000000000000000000000000?0000000000000000000000000000000000000?00?000000000000000?00000?0000000000000000?000000000000000?000000000000?0000?0?0000?000?00000000??000000?0000000?0?0?000000?00000?0000000??0?000??00000000?0?00?00?00?00000000000??0000?00?0...

result:

ok single line: '000000000000000000000000000000...?0?????????????????????????????'

Test #78:

score: 1
Accepted
time: 19ms
memory: 12172kb

input:

49645 160000
+ 42427 42877
+ 27476 15390
+ 37405 15364
+ 37274 9654
+ 15400 36095
+ 8145 1511
+ 44997 1745
+ 24044 26409
+ 18507 17772
+ 38803 26455
+ 277 16549
+ 12793 45262
+ 27061 28367
+ 48538 35771
+ 46511 40280
+ 6910 31717
+ 42757 21023
+ 23443 46622
+ 20387 10726
+ 46199 1064
+ 11568 29915
+...

output:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?0000000000000000000000000?00000000000000?0000000000000000?0000000??00?0000?0000000000000?00?00?0000000000?000000000?0?000000000?000000000000?00000000000?0000000000?000000000000?00?000?0000?0??00000?00000...

result:

ok single line: '000000000000000000000000000000...???????????????????0???????????'

Test #79:

score: 1
Accepted
time: 20ms
memory: 12112kb

input:

49763 160000
+ 40859 9122
+ 19463 23340
+ 39440 17605
? 3548
+ 29249 39127
+ 32784 9768
+ 18622 2241
+ 11399 23079
+ 16219 15754
+ 25552 22222
+ 22066 37680
+ 11465 14899
+ 31996 39331
+ 20180 13068
+ 1380 45295
+ 19599 6663
+ 6367 4673
+ 1409 19158
+ 40402 37760
+ 28206 27700
+ 11616 42403
+ 12760 ...

output:

0000000000000000000000000000000000000?000?000000000000000?0000000000???00000000000000???00000000??000000000000000?0000?00000000?0000000000?000000000000?000000?000000000?00?00?0?0?00?000000000??000000?000000000000?0?0000000?0000000?0?00?0000?000000000000??000?0??000000000?000000?0000?000?0000000?0000...

result:

ok single line: '000000000000000000000000000000...1011111100111111111111111111111'

Test #80:

score: 1
Accepted
time: 15ms
memory: 12140kb

input:

50000 160000
+ 48825 41610
+ 49680 2358
+ 35451 20676
+ 48518 15424
+ 49784 40139
+ 1777 12956
+ 49434 31958
+ 12098 37479
+ 25262 31264
+ 18665 4376
+ 36611 15993
+ 898 11960
+ 7194 37979
+ 2486 24021
+ 34175 43285
+ 37990 13378
+ 1435 26555
+ 36071 8030
+ 24759 23815
+ 43825 45840
? 4070
+ 44269 4...

output:

000000000000000000000000000000000000000000000000000000000000000000000000000000?000000000000000000000000?00???0000000000000000000000000000000?000000000000??000?000??00000?00000???00000?000000?00000?000000?0000000??0?0000?00000?0000?000?000000000000?00000?000?000?0?00000000000000?0?00?00000?0000???000...

result:

ok single line: '000000000000000000000000000000...????????????0??????????????????'

Test #81:

score: 1
Accepted
time: 23ms
memory: 10192kb

input:

49538 160000
+ 1 17243
+ 238 17243
+ 1 32210
- 238
- 17243
? 25454
- 32210
+ 31384 11939
+ 31384 41036
+ 22250 40117
+ 39220 14802
+ 11939 22250
+ 24230 28344
+ 42513 14424
+ 24230 47989
+ 42513 24230
+ 39220 42529
+ 22623 32472
+ 1 27431
? 21385
+ 39220 28481
+ 1 32472
+ 43577 36380
+ 43577 38321
+...

output:

00000000000000000000000000000000000000000000000000000000000000000000?00?000000000000000?000?00000000000?0000000000?0000000000000000000000000000000?00000?00000000000000000?0?0000?0000000000000?00?000?000000?000000?0?00000?0?0000000000000?00000?00000?0000000?000000000000000000000?0?0000000?00000000000...

result:

ok single line: '000000000000000000000000000000...???0?0??0????0?0?0???????0?0?0?'

Test #82:

score: 1
Accepted
time: 16ms
memory: 10092kb

input:

49688 160000
+ 7046 10506
+ 35775 10883
+ 15045 35203
+ 11303 10506
+ 1 35775
+ 10883 38731
+ 15045 10506
+ 1 7046
? 37523
+ 24460 1
- 7046
+ 24460 42555
+ 42555 42995
? 16175
+ 33485 44867
+ 45911 44867
+ 7075 33485
+ 35381 42555
+ 18673 17257
? 17540
+ 18673 44867
+ 17257 4406
+ 40908 5519
+ 42555...

output:

00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?00000000000000000000000000000000?0000000000000000000000000000000000000000000000000000000000000000000000000?000?0000000000000000000000000?00?0000000000000000000000000000000000000?0000?000000000...

result:

ok single line: '000000000000000000000000000000...?????????0????0????0??0??0??0??'

Test #83:

score: 1
Accepted
time: 16ms
memory: 12116kb

input:

50000 160000
+ 46797 9472
+ 25162 8326
+ 35341 24027
+ 2184 21658
+ 30136 46244
+ 39237 10075
+ 6659 48340
+ 27127 41639
+ 11844 23099
+ 7005 32220
+ 34391 12248
+ 22218 37693
? 39014
+ 43792 13300
+ 41695 38622
? 46621
+ 14700 17308
+ 4852 44522
+ 24614 5394
+ 13652 25410
? 1481
+ 41211 1203
+ 1946...

output:

0000000000000000000000000000000000000000000000000000000?00000000000000000000000000000?00?0000000?0000000000000000000000000000000000000000000000000000000000000??00000000?00000000000000000000000000000??00?0000000000000000000?0000?00000?000000?0000?000000000000000000?000000000000000000000000000???00000...

result:

ok single line: '000000000000000000000000000000...110001?0??111???10?101?11?10001'

Test #84:

score: 1
Accepted
time: 19ms
memory: 10196kb

input:

50000 160000
+ 16180 18745
+ 7869 18745
+ 7869 685
+ 2114 685
+ 2114 48664
+ 48664 14474
+ 48260 14474
+ 20228 48260
+ 49023 20228
+ 20254 49023
+ 8631 20254
+ 8631 35809
+ 39236 35809
+ 39236 24442
+ 24442 30333
+ 38789 4897
+ 20322 24208
+ 48485 38789
+ 13840 30077
+ 34673 48485
+ 24208 4897
+ 138...

output:

000000000000000000000000000000000000000000000000000000000000000000000000000000000?00000000000000000000000000000000000000?00000???0000000000000000?0000000000000000000000000000000?00000?0?00000000?000000?0000000?00?00000000?0000000000000000000000?00000000?0000000000?0000000??0?0000?00000000??000000000...

result:

ok single line: '000000000000000000000000000000...0??????0??000100???01?000?0?010'

Test #85:

score: 1
Accepted
time: 18ms
memory: 12360kb

input:

10000 160000
+ 8386 8386
+ 5048 3446
+ 9329 3446
+ 9090 9329
+ 9090 7032
+ 6647 7032
+ 6647 7006
+ 8515 7006
+ 8515 8645
+ 2657 2657
+ 2041 8645
+ 2041 2213
+ 6874 6874
+ 312 312
+ 7099 2213
+ 6365 7099
+ 6365 28
+ 6828 6828
+ 1732 28
+ 1732 1526
+ 3626 3626
+ 9011 1526
? 1898
+ 2928 9011
+ 2928 344...

output:

000000000000000000000000000000000?00000000000000000000000??0000000000000000000000100000000001010?000?00000000?00000100?00000?01000000000?0?0001?0?0?0?0??000??00000101?110?0?1?0?001?0010?00?00???010010?1000?0010101?0?0?0??010??0??10?0?0000??00?0??101100??1?0?01???010?100?000??011??1?1???????1?010??01...

result:

ok single line: '000000000000000000000000000000...?0??00?????1???????????????????'

Test #86:

score: 1
Accepted
time: 19ms
memory: 12364kb

input:

10000 160000
+ 1382 8602
+ 8237 287
+ 2402 458
+ 1958 4238
+ 9216 4454
+ 781 7362
+ 1586 1586
+ 9101 9101
+ 4792 9057
+ 2548 5492
+ 3191 2869
+ 7609 3487
+ 7538 6631
? 1636
+ 698 698
+ 136 8273
+ 2929 8832
+ 4976 9033
+ 9126 5925
+ 3298 5411
+ 5207 1342
+ 4920 4920
+ 5589 5589
+ 9272 9272
+ 5733 879...

output:

0000000000000000000000000000100000000000000000000000?0000000000000000?0000000?00?0100?0000?00000?000?00000000000000000000000100??001?0000001?010001000000??0?0??11000000?000?0?00110??????00001?00?000000000000??0?1100?000010??????00?0??10??000010?0001?00?00???01?0001???1?0?00000?0???10??0000?1?????1?0...

result:

ok single line: '000000000000000000000000000010...10??0110?01?00?11?10010101?1111'

Test #87:

score: 1
Accepted
time: 14ms
memory: 10052kb

input:

3333 160000
+ 2101 3008
+ 1320 1320
+ 1100 1100
+ 1699 1699
+ 3008 3216
+ 966 966
+ 1040 2101
? 437
+ 2892 17
+ 1427 1427
+ 658 658
? 525
+ 17 457
+ 457 1355
+ 1288 1355
+ 1288 2969
+ 1851 2969
+ 1851 1972
+ 1501 1501
+ 1190 1972
? 1993
+ 3113 1190
+ 2655 3113
+ 2655 111
+ 111 157
+ 157 2639
+ 2639 ...

output:

000?00000?0000000??000000100000000100000??000000000000000010?000?001?000?000?00000?00000?00100000000000??00001100000000000?0001?0001?000?0??100000?0??00000000000100?00001000?0?0000?000?0011???001000000?00???0???00000000?0000?1100000?011??00?100?100??1???0?0011????????0?000???000?10110100?01110?010??...

result:

ok single line: '000?00000?0000000??00000010000...0101?01001?10110?0????1?0111101'

Test #88:

score: 1
Accepted
time: 20ms
memory: 10124kb

input:

50000 160000
+ 36309 7847
+ 2857 7847
+ 49238 2857
+ 49238 32017
+ 25707 32017
+ 25707 49229
+ 49229 46046
+ 1568 46046
+ 42264 1568
+ 42264 36026
+ 47523 36026
+ 12651 47523
+ 12651 38170
+ 38170 37031
+ 44113 37031
+ 5496 44113
+ 5496 11718
? 2316
+ 20808 11718
+ 29535 20808
+ 5542 29535
+ 31914 5...

output:

0000000000?00?0??000??00?????????????????????????????????????????????????????????????????????????????????????????????

result:

ok single line: '0000000000?00?0??000??00??????...???????????????????????????????'

Test #89:

score: 1
Accepted
time: 19ms
memory: 10008kb

input:

50000 160000
? 20465
? 28611
? 47772
+ 28934 36734
+ 7296 11721
+ 40972 2541
+ 6319 32704
? 27742
? 36712
? 21417
? 24502
? 27742
? 48421
? 27742
+ 45357 37063
+ 27742 7423
? 2199
? 45357
+ 32625 44830
? 27742
+ 46564 9482
? 1766
? 8681
? 48757
? 47076
? 21079
? 27352
? 27742
? 27742
? 3489
? 19274
...

output:

00000000000??000000??000??0?0000000?0?00000000?00?0?100110?0001010??????00??00???00??0?00??0?0000?00000000?0??000000?000?000000000??0?00?000?000?00?0?000000?0?00???00000000?00?0?00?00000?000000?0?0?00010???0000000?000??00??00?0?000?00?0?0000??000?0?0?0??000000000000?00?000?0000?0000?0?000?0??000??00...

result:

ok single line: '00000000000??000000??000??0?00...01111?01111010100?1101001010111'

Subtask #7:

score: 1
Accepted

Test #90:

score: 1
Accepted
time: 49ms
memory: 12448kb

input:

89220 376231
? 6393
+ 51619 6393
+ 2246 25592
? 62228
? 44401
+ 42111 52472
+ 30667 77472
+ 11532 88363
+ 18526 57345
+ 16738 67835
+ 29960 30391
? 54
? 87927
? 85856
? 18958
? 31978
? 37673
? 29050
+ 19474 60497
? 88112
? 15348
+ 68377 78220
? 75153
+ 53534 18315
? 71265
+ 3148 60288
+ 40013 38591
...

output:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok single line: '000000000000000000000000000000...01100011001110001100100?0000010'

Test #91:

score: 1
Accepted
time: 50ms
memory: 10400kb

input:

90000 399023
? 69839
+ 11834 13283
? 81408
+ 29577 54542
+ 31474 54657
? 47963
? 82597
+ 83232 67477
? 27622
+ 70735 46173
? 52410
+ 8344 37276
? 23598
? 72821
+ 85819 47358
+ 75517 67784
+ 69420 10882
+ 65557 68786
+ 41613 12249
? 84917
+ 88817 78466
? 46182
? 65143
+ 15782 29329
? 35060
? 36284
? ...

output:

0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?00...

result:

ok single line: '000000000000000000000000000000...00011?01110000?0111111101100111'

Test #92:

score: 1
Accepted
time: 37ms
memory: 12224kb

input:

9000 400000
+ 5340 1932
+ 8625 2368
+ 4708 618
? 526
+ 7423 234
+ 413 2246
+ 8990 4169
+ 5909 7452
+ 3240 6880
? 6974
? 7733
+ 236 5792
+ 5192 7801
+ 6913 8518
? 437
+ 8167 7642
+ 4466 3041
? 61
? 5247
? 6798
? 1409
? 2601
+ 3969 5143
? 907
? 8986
? 3001
+ 1071 3342
+ 4336 805
+ 5596 2642
+ 8169 275...

output:

00000000000000000000000000000000000000000000000000000000000000000000000000000000000000?00000000000000000000000000000000000000000000000000000000000000000000?0000000000000?0000000000?0000000000000000000000?000000000000000000000000000000?000000000?0000000000000000000000000000000000000000000000?00000000...

result:

ok single line: '000000000000000000000000000000...?11000111?111111110111011111001'

Test #93:

score: 1
Accepted
time: 42ms
memory: 12808kb

input:

90000 400000
+ 10368 6712
+ 30747 13015
+ 51431 79113
+ 81187 65916
+ 30400 79633
+ 45592 83663
+ 14445 47756
+ 83770 15830
+ 17269 24814
+ 35354 33412
+ 12446 35452
+ 67011 80156
+ 3279 56841
+ 19639 16878
+ 5009 57037
+ 72588 8963
+ 81077 49108
+ 11257 33224
+ 82422 44489
+ 68553 25331
+ 74434 980...

output:

0000000000000000000000000000000000?0000000000000000000000000000000000?000000000000000?0000000000000?000000000000000000000000000000000000000??00?00?00000000000000000?0000000?0000000?0000000?00?0000??000??00000000?0000000000000?000000000000000000?000?0000000000?000000000??0000000?000?000000?0?000?00?0...

result:

ok single line: '000000000000000000000000000000...???00000?0?0??00000?00??00000?0'

Test #94:

score: 1
Accepted
time: 42ms
memory: 14824kb

input:

89747 400000
+ 27551 36317
+ 64480 5315
+ 21970 18849
+ 66051 45571
? 29720
+ 7818 89609
+ 15672 69214
+ 87208 1350
+ 7080 84743
+ 66152 16462
+ 88566 57301
? 18008
+ 80252 59257
+ 10458 70150
+ 8454 3799
+ 54158 28173
+ 71589 83836
+ 54608 86639
+ 40277 89298
+ 14221 36577
+ 18772 20413
+ 87239 339...

output:

00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?000??000000000?0000000000000000000000000000000?0000000?00000000??0000000000000000?00000000000000000000?000000?000?000000000000???0000?0000?0?000?000?000000000000000000?000000000000000??0...

result:

ok single line: '000000000000000000000000000000...000???00?000000?000??0??00?0?00'

Test #95:

score: 1
Accepted
time: 43ms
memory: 12772kb

input:

89580 400000
+ 53214 19897
+ 72758 48138
+ 13248 78800
+ 21347 15073
+ 29660 11248
+ 25739 6062
+ 88069 20176
+ 41188 59373
+ 25668 2928
+ 46558 69704
+ 38459 74470
+ 24420 6717
+ 34067 25311
+ 51711 72995
+ 4201 71183
+ 87792 58291
+ 49046 77470
+ 12052 53827
+ 19339 183
+ 11919 69061
? 8947
+ 4432...

output:

00000000000000000000000000000000000000000000000000?0000?000000000?000000000000000?00000000000000000000000000000000?0?000000?00000000000000000000000000000000000000000000?000000000?00000000000000??0000000000000000000000000000000000000?00?000000000000??00000000000000000000000000?00000?00000000000000??0...

result:

ok single line: '000000000000000000000000000000...0?????00??0????0??????????????0'

Test #96:

score: 1
Accepted
time: 42ms
memory: 12764kb

input:

90000 400000
+ 11141 17471
+ 45876 79616
+ 68894 44264
+ 88899 2515
+ 64139 58580
+ 28899 59332
+ 60697 68696
+ 47471 32478
+ 53807 17143
+ 89835 77867
+ 11974 13141
+ 84027 31995
+ 65524 42559
+ 69920 7001
+ 76366 37713
+ 37977 9418
+ 51308 17938
+ 84494 35807
+ 30523 85377
? 43528
+ 50905 7890
+ 8...

output:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?000000000000000?00000000?000000000000000?00000??000000?00000000000000000000000000000000000000000000000?000000?0000?00000000000000000000000?0000?00000?0000000000?...

result:

ok single line: '000000000000000000000000000000...?00?0??0000000000?0?0000000??00'

Test #97:

score: 1
Accepted
time: 45ms
memory: 12796kb

input:

89148 400000
+ 37768 21188
+ 62524 20103
+ 19599 23946
+ 27830 11874
+ 2754 38773
+ 17544 54096
+ 22983 65858
+ 11974 61671
+ 22247 11900
+ 88053 37249
+ 39412 22374
+ 75837 64386
+ 70065 41219
+ 43204 18566
+ 33009 44299
+ 33146 19841
+ 43817 46519
+ 30345 66265
? 6889
+ 9828 77886
+ 59072 51991
+ ...

output:

0000000000000000000000000000000000?000000?00000000000?00000000000000?000000000000000000000000000000000000000000000000?000000000000?0?000000000000000?00000000000000000000000000000?0000000000?00?0?00000000?00?000000?000?00000000?000000000000000000000000?00000??000000000000000000?0?00000000?00000000000...

result:

ok single line: '000000000000000000000000000000...00?0?00??00?00???00??0?0?00??00'

Test #98:

score: 1
Accepted
time: 33ms
memory: 12868kb

input:

89503 400000
+ 3923 19121
+ 29935 55607
+ 36743 69652
+ 16432 56645
+ 23010 79031
+ 47263 32746
+ 54667 70424
+ 51478 70092
+ 14503 45945
+ 42281 77875
+ 8262 11583
+ 19638 10870
+ 62775 7342
+ 55442 52964
+ 19689 7212
+ 68873 87413
+ 29375 49740
+ 67541 9922
+ 2076 11613
+ 87742 16882
+ 40390 58701...

output:

00000000000000000000000000000000000000000000000000000000000?00000000?0000000000000000000000000000000000000000000000000000?0000000000000000000000000000000000000000000000?0?000000000000000?00000000000000000000000000?00000000000000000000??000?0?0000000000000?000000?0000000000000000000000000000000??0000...

result:

ok single line: '000000000000000000000000000000...0000?0??00?000?00??0?0?0?000?0?'

Test #99:

score: 1
Accepted
time: 46ms
memory: 12936kb

input:

89617 400000
+ 80383 45279
+ 80383 1
+ 42475 73617
+ 75896 22312
+ 42475 75896
+ 21632 50710
+ 75896 45279
+ 73617 21632
+ 71445 73617
+ 25027 52172
+ 41491 5064
+ 25027 41491
? 69763
+ 25027 73617
+ 45279 56248
- 56248
+ 56275 43881
+ 37651 87687
+ 59040 64942
+ 45642 7088
? 15529
+ 87687 20280
+ 6...

output:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?00000000000000000000000000000000000000000000000000000000000000000000000000000000?0000000000000000000000000000000?000000000000000000000000000000000000000000000000000...

result:

ok single line: '000000000000000000000000000000...0??0????0???0?0?????0??????0???'

Test #100:

score: 1
Accepted
time: 51ms
memory: 12904kb

input:

90000 400000
+ 89453 1
- 89453
+ 72455 1
+ 14804 1
+ 30893 1
+ 1 62278
- 30893
+ 57758 73570
+ 54392 83737
+ 57758 10660
+ 73570 48874
+ 60027 89678
+ 57484 72455
? 57888
+ 89678 57484
+ 73570 54392
+ 48874 60027
+ 31335 42907
+ 228 62278
+ 228 81259
+ 80452 62278
+ 31335 81259
- 62278
? 30634
- 543...

output:

00000000000000000000000000000000000000000000000000000000000000000000000000000000000000?0000000000000000?0000000?0000000000000000000000000?00000000000000000000000000000000000000000000000000000000000000000?000000000000000000?0000000000000000?00000000000000000000000000000000000000000000000?000000000000...

result:

ok single line: '000000000000000000000000000000...?0?????00???00????0??0?0?00????'

Test #101:

score: 1
Accepted
time: 51ms
memory: 12652kb

input:

90000 400000
? 6171
+ 51437 16012
+ 19070 32167
+ 28130 48209
+ 31972 31972
? 83463
+ 16012 68956
+ 31389 73973
+ 15376 15376
+ 41194 16656
+ 54987 87809
+ 16012 76877
+ 79323 41949
+ 65597 16656
+ 79387 79387
+ 48209 65597
+ 40090 53541
+ 24660 73973
+ 44944 3783
+ 54624 41092
+ 25342 25342
+ 78342...

output:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?000000000000?0000000000000000000000000000000000000000000?00000000000000000000?0000000000000000?00000?000000000000000000000001000000000?0000000000000000000000000000?00000000000000000000?00000000?0?0?00000000...

result:

ok single line: '000000000000000000000000000000...0?10110?101001001?100000??0??1?'

Test #102:

score: 1
Accepted
time: 51ms
memory: 12692kb

input:

90000 400000
+ 11087 11087
+ 353 29175
+ 46427 12176
+ 50846 50846
+ 2692 54573
+ 58569 66452
+ 55185 82569
+ 3674 78097
+ 14667 14667
+ 70943 8701
+ 24921 24921
+ 1551 1551
+ 8065 8065
+ 32125 32125
+ 45674 45674
? 74416
+ 34224 34224
+ 24542 24542
+ 88879 42048
+ 57538 29111
+ 54615 54615
+ 22643 ...

output:

000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?00000000100000000000000000000000000000000?0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?000000000000000000000000000000000000000...

result:

ok single line: '000001000000000000000000000000...111011111?101111111111111111111'

Test #103:

score: 1
Accepted
time: 43ms
memory: 10516kb

input:

18000 400000
+ 282 9720
+ 17641 9720
+ 10553 15012
+ 15012 16364
+ 16364 4547
+ 9645 4547
+ 12319 12319
+ 10109 9645
+ 10109 13666
+ 6861 13666
+ 6861 12064
+ 14622 12064
+ 14622 4589
+ 4589 5365
+ 5365 15630
+ 15630 9964
? 9843
+ 9964 1851
+ 1851 5636
+ 5636 11064
+ 14671 11064
+ 14671 1564
+ 1564 ...

output:

00000000000000000000000?00000000000000000000000100000000000000000000000?000000000000000000?000000?000??000000000000?00?00000?0?00?00000000000000?000000?00?0?0000?00001010?0000001?0??0000000?0000000000000?00000000000000000000000000??00?0?00?0?0000000?000???0????000??0??00010?0000000?0?000?0000000?000...

result:

ok single line: '00000000000000000000000?000000...?010?1?10?0?0101?11?1010000?001'

Test #104:

score: 1
Accepted
time: 46ms
memory: 12524kb

input:

18000 400000
+ 8382 10931
+ 8468 8468
+ 7251 9619
+ 6243 4789
+ 11196 17895
+ 7711 12850
+ 7879 11925
+ 12305 12305
+ 10911 17607
+ 3204 17115
+ 3765 12940
+ 4916 11049
+ 17352 17352
+ 15741 15741
+ 14273 10453
+ 7435 14185
+ 6626 5994
+ 3963 9607
+ 397 10516
+ 3990 2402
+ 2137 2137
+ 14729 10540
+ ...

output:

000000000000000000000000000000000000001??00000000100?00000?000000000000000000000000000000000000?00?0000000000000000??00?0??000?00000000000000000??000?01000?000000?0?0000?0?0?000?00101?00??000001?00000000??0000000?00000?00?000??000?0??100??001?1?0?010?000000000?01?0000?0?000??00??000100?000000?000?00...

result:

ok single line: '000000000000000000000000000000...0?00?1??00?0?00?00??00?1?1?1?00'

Test #105:

score: 1
Accepted
time: 42ms
memory: 12532kb

input:

6000 400000
+ 1405 2562
+ 1405 3554
+ 2458 3554
+ 2458 4811
+ 4811 3321
? 5824
+ 3321 2871
+ 2871 5599
+ 1113 1113
? 3670
+ 4899 5599
+ 3327 4899
+ 3327 4229
+ 4909 4229
? 1853
+ 4909 5749
+ 1501 5749
+ 1501 2280
+ 4709 2280
+ 2342 2342
+ 4709 4209
+ 991 4209
+ 3018 991
+ 3018 3602
+ 5609 5609
+ 360...

output:

000?000000000000000?00000000000000000000000000000000000000000000000000000?0000000000?0000?0000?00?00000?000000?000000000000000?0?00?0?000000000?00?00?000?00?00??000?1??0000????0?00?000000??01000?00??00?000??00000000?000000?0000?00?0?1???10000000?00?00?10??00000???000000000?000???0?1?0000000000???0?0...

result:

ok single line: '000?000000000000000?0000000000...?01??1?0?00???1000??0??1??1??1?'

Test #106:

score: 1
Accepted
time: 55ms
memory: 13028kb

input:

90000 400000
+ 538 27685
+ 27685 53903
+ 53903 15483
+ 15483 18242
+ 18242 8726
+ 8726 3788
+ 19692 3788
+ 45391 19692
? 19023
+ 44513 45391
+ 4898 44513
+ 69185 4898
+ 69185 73395
+ 73395 22027
+ 22027 6211
+ 6211 7551
+ 7551 17350
+ 17350 63094
+ 14759 63094
+ 14759 11583
+ 11583 66131
+ 66131 662...

output:

0000000000??0000000???0?0????00000000???00???0???00??0???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

result:

ok single line: '0000000000??0000000???0?0????0...???????????????????????????????'

Test #107:

score: 1
Accepted
time: 48ms
memory: 12520kb

input:

90000 400000
+ 46436 16580
? 56113
? 46436
? 81050
? 74401
+ 19168 35342
+ 13132 17328
? 18845
+ 84748 46436
- 13132
+ 76723 37534
+ 36845 45719
+ 40191 22211
? 36845
? 7550
? 7085
+ 67282 10328
? 17328
+ 4340 7550
+ 85948 46436
+ 82798 35232
+ 45811 78201
+ 59808 80733
? 44745
+ 49832 58703
+ 43906...

output:

0?000?000000??00?0?0??00000?0?000??00000?0?0?00?0000000?0000?00000000000000000??000000000??00?000000000?000?00000000?0?00?0?000000000??0?0??000?0000000?0000??000000???000000000?00??0??000??0??000??00?00??0?0000000?00000?000000000?000000000000?0?00?000?0?0???0??0???0?00?0?00??0?0000000000?00?00101000...

result:

ok single line: '0?000?000000??00?0?0??00000?0?...0?110?1001??01100?011?000000001'

Subtask #8:

score: 1
Accepted

Test #108:

score: 1
Accepted
time: 91ms
memory: 13108kb

input:

150000 585478
+ 78237 9254
? 59202
+ 51044 85838
+ 149256 127083
? 2631
? 30730
+ 70219 104852
? 146465
? 140150
? 77737
? 144566
? 136963
+ 66495 149103
+ 87466 109146
+ 94625 57390
+ 38604 104025
+ 53471 30696
+ 19225 40513
+ 5834 40766
? 145472
+ 111565 102244
? 114750
? 65515
? 140591
+ 110486 3...

output:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok single line: '000000000000000000000000000000...01000?1110010111101110100?00001'

Test #109:

score: 1
Accepted
time: 90ms
memory: 14800kb

input:

150000 567800
+ 101055 10569
+ 94504 147773
+ 70848 57176
+ 80479 124339
+ 61723 129197
+ 133419 86777
? 88945
? 20649
+ 69161 80774
? 146932
? 43704
+ 4694 147272
? 94817
+ 31519 85239
+ 118393 26673
? 147137
+ 35043 57257
? 20082
? 75148
? 69845
+ 93712 70975
+ 32801 101529
+ 146724 96138
+ 130775...

output:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok single line: '000000000000000000000000000000...1110001001101?010101011011101?0'

Test #110:

score: 1
Accepted
time: 68ms
memory: 10472kb

input:

15000 600000
+ 13490 12308
? 8037
+ 7722 9618
? 10509
+ 6390 6007
+ 10411 3
? 7990
+ 13229 14327
+ 14194 10632
? 3546
? 14281
+ 9510 4693
? 7805
+ 11135 9506
? 12309
+ 13771 2361
? 2234
+ 10761 3269
? 10005
+ 1195 6301
? 11793
+ 248 5819
+ 3989 3898
+ 4063 11715
? 2051
+ 14069 2481
? 2894
+ 143 1097...

output:

00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?0000000000?000000000000?0000000000000000000000000000000000000000000000000000000000000000?000000000000000000000000000000000?000000000000000...

result:

ok single line: '000000000000000000000000000000...?110011000101101111111?00010?11'

Test #111:

score: 1
Accepted
time: 78ms
memory: 12920kb

input:

150000 600000
+ 144303 67992
+ 14520 6792
+ 49104 142060
+ 111481 74309
+ 97300 36858
+ 83176 105705
+ 29966 4216
+ 112261 121188
+ 119955 72797
+ 12567 131464
+ 139654 143272
+ 106856 25184
+ 47118 1002
+ 28540 144577
+ 14842 21440
+ 63398 92963
+ 108452 12463
+ 73034 106027
+ 41827 62349
+ 25238 9...

output:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?0000000000000000000?0000000000000?000000000?000000?00000000000000000?0000000000?00000000000000000000000000000000000000000000000000000?...

result:

ok single line: '000000000000000000000000000000...0001000100000000000000001000010'

Test #112:

score: 1
Accepted
time: 85ms
memory: 12984kb

input:

149955 600000
+ 101359 143366
+ 123048 93181
+ 131332 119487
+ 68836 56885
+ 17889 76482
+ 147301 143464
+ 141117 141166
+ 2376 27403
+ 11105 40575
+ 45423 35082
+ 139554 83588
+ 79822 131342
+ 99798 34985
+ 96567 130448
+ 42112 45411
+ 102044 13904
+ 16806 28343
+ 29535 83260
+ 16061 7079
+ 78233 2...

output:

000000000000000000000000000000000000000000000000000000000000?00000000000000000000000000000000000000000000000000000000000000000?00000?0000000000?00000000000000000000?000000000000000000?0000000?000?00?00000000000000000000?0000000000000000?00000000000000000?0000?0000000000000000000000000000000000000000...

result:

ok single line: '000000000000000000000000000000...00000000000?00?0??0?00?00000?00'

Test #113:

score: 1
Accepted
time: 85ms
memory: 15008kb

input:

150000 600000
+ 18348 89989
+ 144887 126563
+ 126778 21324
+ 47043 23907
+ 88985 65291
+ 105189 2388
+ 23833 2008
+ 60391 88210
+ 87567 106668
+ 73618 138652
+ 19005 80748
+ 78696 99772
+ 9762 20199
+ 43691 54592
+ 20493 119853
+ 113398 4881
+ 70298 39749
+ 34764 8217
+ 41051 135503
+ 11910 144553
+...

output:

00000000000000?000000000000000000000000000000000000000000000000000?00000000000000000000000000000000000000?000000?00000000000000000000000000000000000000000000000000000000000000?0??0000000000000000000000000000?000000000000000000?0?0?000?00000000?0??0000000000000000000?000000000000000000000?00000000000...

result:

ok single line: '00000000000000?000000000000000...0000000001000010001000000000000'

Test #114:

score: 1
Accepted
time: 77ms
memory: 12860kb

input:

149322 600000
+ 28821 44766
+ 122866 71756
+ 89746 128023
+ 21772 9990
+ 137072 70889
+ 44057 122058
+ 105383 5829
+ 136883 144208
+ 81863 7785
+ 81857 101458
+ 90165 140555
+ 90631 2657
+ 69129 7542
+ 93483 37410
+ 100903 60799
+ 106569 5134
+ 133806 39341
+ 61401 2980
+ 145465 79252
+ 83991 130749...

output:

00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?0000000000000?0000000000000000000000000000000000000000000000000000?0000000000000000000000000000000?000000?0000000?000000000000000000000000000000000000000?000000000000000000?0000??0000000000...

result:

ok single line: '000000000000000000000000000000...??0?00000?00?000?000?0?000?0000'

Test #115:

score: 1
Accepted
time: 87ms
memory: 17016kb

input:

149967 600000
+ 66750 44068
+ 13753 72801
+ 94335 94292
+ 146780 141570
+ 116413 123028
+ 119133 39842
+ 17980 99305
+ 2021 104536
+ 53078 62124
+ 108105 63558
+ 87702 52937
+ 12275 37295
+ 148398 107340
+ 113776 10415
+ 118771 85738
+ 25861 70474
? 18417
+ 137960 42257
+ 17700 20567
+ 121745 63309
...

output:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?000000000?0000?0000000?0000000000?00?000?00000000000?000??00?000000000?0000000000000000000000000000000000000000000000000?00000000000000000000000000??0?000?00000000000000?000?00000...

result:

ok single line: '000000000000000000000000000000...0000100000000000001000000000001'

Test #116:

score: 1
Accepted
time: 72ms
memory: 15036kb

input:

150000 600000
+ 94467 99733
+ 59923 20877
+ 102885 45556
+ 79612 79601
+ 42016 16782
+ 23415 98165
+ 76021 145008
+ 104793 121722
+ 36115 73588
+ 30198 132386
+ 62811 15225
+ 43501 105182
+ 125877 11781
+ 149416 75722
+ 30998 40842
+ 81488 113497
+ 55529 138602
+ 60682 71198
+ 145337 92254
+ 101188 ...

output:

00000000000000000000000000000000000000000000000000000000000000000000?0000000000000000000000000000000000000000000000000000000000000000000000000000?000000000000000000?00000000?0000000000000000000000000000000000?00?000000000000000000000?000000000000?00000000000000000?00000000000000?00000000??0?0000??00...

result:

ok single line: '000000000000000000000000000000...0000?000?000?000000000000000000'

Test #117:

score: 1
Accepted
time: 85ms
memory: 15344kb

input:

150000 600000
+ 66877 10768
+ 133165 60165
+ 113531 87182
+ 6184 45086
+ 99328 89077
+ 122362 50813
+ 24842 149754
+ 123503 12902
+ 8628 71381
+ 113531 143733
+ 26007 64277
+ 45086 131500
+ 96083 55802
+ 45086 73517
+ 24839 104595
+ 60165 44870
+ 100013 53232
+ 24839 68208
+ 123830 51945
+ 123830 10...

output:

00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?0000000000000000000000000000000000000000?000000?000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok single line: '000000000000000000000000000000...??????0????????????0??0???00?0?'

Test #118:

score: 1
Accepted
time: 93ms
memory: 13084kb

input:

150000 600000
+ 1 77911
? 63041
- 1
+ 91129 71952
+ 77911 91129
+ 97361 77911
+ 119225 71952
- 77911
- 97361
+ 81379 133712
? 1512
+ 82327 49216
+ 52063 50976
+ 24248 112650
+ 5865 142659
+ 113437 142659
+ 71540 47836
+ 39807 127865
+ 131537 63574
+ 109354 50976
+ 120707 147784
+ 63574 127227
+ 1207...

output:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?00000000000000000000000000000000000000?000000000000000000000000000000000000000000000000000000000?0...

result:

ok single line: '000000000000000000000000000000...00?????0????0????????0??????0??'

Test #119:

score: 1
Accepted
time: 77ms
memory: 15304kb

input:

149477 600000
+ 43195 37194
+ 92186 37194
+ 92186 33469
+ 23701 23701
+ 113022 113022
+ 6558 6558
+ 96300 96300
+ 25596 25596
+ 33469 134062
+ 134062 146085
+ 54672 146085
+ 70135 70135
+ 77454 54672
+ 136915 136915
? 126758
+ 63842 77454
? 20375
+ 51021 51021
+ 63842 124028
+ 133810 124028
+ 118246...

output:

0000000000000000000000000000000000000001000000000000000100000000000000000000?00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?000000000000?0000000000000?0000000000000000?0000000000000000000000000000001001??00000000000000000100000000000000000000000000100000000...

result:

ok single line: '000000000000000000000000000000...?1111111????1?01?11110011111001'

Test #120:

score: 1
Accepted
time: 95ms
memory: 13180kb

input:

150000 600000
+ 112820 123979
+ 71114 123979
+ 124648 71114
+ 8994 8994
+ 98833 98833
+ 132611 132611
+ 41546 41546
+ 125731 125731
+ 137530 137530
+ 110353 110353
+ 16951 124648
+ 85072 85072
+ 84811 84811
+ 10841 10841
+ 17244 17244
+ 16951 74521
+ 12131 12131
+ 124167 124167
+ 48848 48848
+ 74521...

output:

0000000000000000000000000000000000000000000000000?0000000000000100000000000000000000000000000?0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?000000000000000000000000000000000000000000000?00000100000000000000000000000000000000000100000000000000000...

result:

ok single line: '000000000000000000000000000000...1?0111?01010001111?111?101?0010'

Test #121:

score: 1
Accepted
time: 69ms
memory: 13216kb

input:

30000 600000
+ 17142 17142
+ 25513 13626
+ 22820 16861
+ 26964 8683
+ 26517 7743
+ 8477 8477
+ 21935 14167
+ 8683 9663
+ 2366 16671
+ 8263 15927
+ 25513 3129
+ 16671 5968
+ 13189 9613
+ 18964 29498
+ 248 6493
+ 16233 3238
+ 9663 11627
+ 18825 15981
+ 6508 6508
+ 6595 6595
+ 13496 9663
? 6863
+ 18109...

output:

00000000000100000000000000000000000000000000?000000000000000000000000000000000000000000000?000000000000000?0000000000?00000?00000000000000000000000000000??00000000?000000000000000??0000?00?000000000?0000?0000000000000000000000000010?0000000000000?0?0?0000?000?000?100??0?0000000?00001000000000100000?...

result:

ok single line: '000000000001000000000000000000...01010001111?011011100001100110?'

Test #122:

score: 1
Accepted
time: 67ms
memory: 13020kb

input:

30000 600000
+ 17180 17180
+ 7308 7308
+ 1834 1834
+ 15095 15095
+ 26236 1385
+ 2367 2367
+ 11809 11809
+ 392 392
+ 5533 5533
+ 19226 3642
+ 15410 15410
+ 14667 14667
+ 312 312
+ 7463 11518
+ 18147 18147
+ 13194 13194
+ 5461 5461
+ 20275 20275
+ 23374 23374
+ 14900 14900
+ 29634 29634
+ 15993 15993
...

output:

000000000000000000000000000000000000000000000000000010000000000000000100000000000000000000000100000000000010000001000000010100000000000000000001000000?10?00000000000001100000000000000000000001000100?01010000000000010000000000000000?0001100000000000000100000000000001010000000010000000000000100000000?...

result:

ok single line: '000000000000000000000000000000...?1001000100110111?11?111111?00?'

Test #123:

score: 1
Accepted
time: 63ms
memory: 12932kb

input:

10000 600000
+ 116 116
+ 3478 3478
+ 3964 7283
+ 1017 1017
+ 9321 9321
+ 5215 5215
+ 7984 7984
+ 9436 9436
? 5026
+ 1624 1624
+ 690 690
+ 1547 1547
+ 302 302
+ 2241 2241
+ 8451 8451
+ 7902 7902
? 6855
+ 1205 4831
+ 5770 5770
+ 3476 3476
+ 5510 5510
+ 2352 2590
+ 2525 2525
+ 7524 7524
+ 5895 5895
+ 9...

output:

00000000000000000000000000000000000000000000000100000000000100010000000000010000000001100000000000000001000000000100000100000000000100000010011000000000100110000000010000011110100000010100101000100000001?00000000000110001000011000110100010000011000000000010100100000111000110110011000010001?010101100...

result:

ok single line: '000000000000000000000000000000...110?1011111011111?1??11111?1001'

Test #124:

score: 1
Accepted
time: 93ms
memory: 13440kb

input:

150000 600000
+ 118149 117504
+ 131474 117504
+ 77625 131474
+ 88777 77625
+ 88777 125642
+ 100122 125642
+ 100122 131797
+ 131797 125841
+ 125841 140177
+ 127513 140177
+ 127513 149965
+ 149965 69304
+ 69304 85296
+ 92178 85296
+ 23640 92178
+ 146706 23640
+ 112991 146706
+ 74584 112991
+ 74584 741...

output:

000000000000000???0???????0??????????????????????????????????????????????????????????????????????????????????????????????????????

result:

ok single line: '000000000000000???0???????0???...???????????????????????????????'

Test #125:

score: 1
Accepted
time: 74ms
memory: 12976kb

input:

150000 600000
? 59949
? 64619
+ 95529 82802
+ 73655 99818
+ 16050 33039
- 82802
+ 22227 95529
? 40669
? 49806
+ 24094 54155
+ 22651 12678
? 85095
+ 82802 130908
+ 114727 82802
+ 47636 52679
+ 110112 10402
+ 113636 100749
? 58071
- 82802
+ 87724 73073
? 86040
+ 82802 22651
? 117846
+ 82802 133914
? 4...

output:

0000000000?0000?000?00000000000000000?000???000?00000?00000?000?0???00?000?0?0?00000??0000000000000000000000000000?0000?000000000000??0000000?0??000?00000?00000000000?000000?0?00?000????00000?0??00?0??0000000?0?00000000?0?0000000000??000?0?01?000100000000000000?0000??0000010000?000000000?0010001?000...

result:

ok single line: '0000000000?0000?000?0000000000...110100?01111001010101000111??11'

Subtask #9:

score: 1
Accepted

Test #126:

score: 1
Accepted
time: 127ms
memory: 13236kb

input:

220000 779870
+ 126216 50788
? 35985
+ 90827 44708
+ 186024 41018
? 12989
+ 67142 23771
? 45410
+ 20498 97233
+ 204142 90473
? 194076
+ 64537 65999
? 7877
? 217242
+ 188179 16486
? 171613
? 25863
+ 35528 203476
? 194601
+ 133835 119714
+ 147686 4608
+ 117115 37828
? 22591
? 82495
+ 51325 20964
? 876...

output:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok single line: '000000000000000000000000000000...1101101?0111?111101010101011101'

Test #127:

score: 1
Accepted
time: 115ms
memory: 15288kb

input:

217811 729956
+ 66919 56152
+ 130124 152696
+ 38216 38077
+ 112072 96827
? 72928
+ 208504 152861
+ 187403 301
+ 77508 16513
+ 144938 177193
? 144451
+ 194017 67454
+ 100480 59067
? 26491
? 44998
+ 44848 204082
? 132525
+ 24818 159468
+ 99306 26524
+ 209091 405
+ 114275 194391
+ 23451 151993
+ 125904...

output:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok single line: '000000000000000000000000000000...0110110000111111101?110?0001111'

Test #128:

score: 1
Accepted
time: 86ms
memory: 12664kb

input:

22000 800000
? 16257
+ 14545 6663
+ 14956 13577
+ 14225 4643
? 1139
+ 4365 16345
? 17673
+ 3668 17303
? 18559
? 7299
+ 11988 14949
+ 11473 10907
+ 973 11954
+ 20123 3902
? 4356
? 13720
+ 17013 4122
+ 14703 21911
? 12329
+ 6544 10785
+ 14323 6188
+ 2821 5212
+ 18431 17782
? 17147
+ 8967 17527
+ 9471 ...

output:

00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?0000000000000000000000000000000000...

result:

ok single line: '000000000000000000000000000000...?0111010?110000?110111101010101'

Test #129:

score: 1
Accepted
time: 127ms
memory: 15576kb

input:

220000 800000
+ 18004 4077
? 88332
+ 82219 78745
+ 179390 139720
? 62125
+ 183867 18330
+ 94896 114327
+ 108087 144882
+ 25458 159497
+ 128325 129619
+ 59314 181113
+ 146288 212794
+ 68543 18520
+ 168736 50390
+ 46966 76398
+ 152872 183708
+ 162906 180576
+ 178289 73812
+ 173178 212423
+ 5227 172273...

output:

0000000000000000000000000000000000000000000000000000000000000000000000000000000000000?00000000000000000000000000000000?00000000000000000000000000000000?000000000?0000?00000000000000000?00000000000000?00000000?000000000?000000000000000000000000000000000000000?0000?000000000000000000000000000?00000000...

result:

ok single line: '000000000000000000000000000000...0?00?0?0?000?00?000?0000?000??0'

Test #130:

score: 1
Accepted
time: 122ms
memory: 19608kb

input:

218716 800000
+ 123490 48420
+ 55140 133302
+ 151502 135562
+ 126316 71858
+ 145672 139871
+ 15388 167790
+ 162443 183893
+ 74399 83464
+ 119991 177438
+ 61011 111545
? 66593
+ 99863 155505
+ 145894 43549
+ 216524 218037
+ 150943 44286
+ 24064 126145
+ 218284 11492
+ 2184 114949
+ 130891 145158
+ 10...

output:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?000000000000000000000000000000000000000000000000000000000?00?0000000000000000000000000000?000000000?0000000000000??00?0000000000000000000000000000000?000000000000?000?0000000000?0000000000000000000000...

result:

ok single line: '000000000000000000000000000000...00?0??00?000?????0??0???0?0?000'

Test #131:

score: 1
Accepted
time: 125ms
memory: 17860kb

input:

220000 800000
+ 135617 61483
+ 88784 187877
+ 213838 6158
+ 156644 46021
+ 161854 38448
+ 27563 34213
+ 66345 218908
+ 181125 48787
+ 60274 174764
+ 218622 60553
+ 28104 129020
+ 175820 41470
+ 179455 149251
+ 88471 149687
+ 94141 58158
+ 184759 2839
+ 159483 50532
+ 160176 173395
+ 82642 46900
+ 41...

output:

00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?0000000000000?0000000000000000000000000000000000000000000000000000000000000000000?0000000000000000000000000000000000000000000000000000000000000000000000000000000000000?0000000?0000?0000000?000000?0000?000...

result:

ok single line: '000000000000000000000000000000...1101111100111010001101001011101'

Test #132:

score: 1
Accepted
time: 128ms
memory: 15576kb

input:

220000 800000
+ 202697 81755
+ 37046 194305
+ 210229 54524
+ 81948 173880
+ 129347 213561
+ 155785 315
+ 75419 185786
+ 81715 187136
+ 171768 61979
+ 187149 115289
+ 195440 206191
+ 198755 23560
+ 65886 129920
+ 11792 178371
+ 142658 72636
+ 72176 165849
+ 127715 190569
+ 125538 212265
+ 48403 21285...

output:

000000000000000000000000000000000000000000000000000000000000000000000000?000000000000000000000000000?00000??00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?00000?00??00000000000000000000?000000000000000000000?0000000000000000000000...

result:

ok single line: '000000000000000000000000000000...?0???000000?0???000?0?00????0?0'

Test #133:

score: 1
Accepted
time: 131ms
memory: 17812kb

input:

218662 800000
+ 95909 131744
+ 131672 43734
+ 203206 217116
+ 185767 747
+ 15911 94820
+ 197182 145827
+ 25227 8201
+ 159031 117633
+ 25637 82575
+ 116202 48387
+ 101084 193024
+ 159188 157845
+ 54287 122512
+ 32596 137053
+ 5559 10694
+ 32167 2109
? 24474
+ 154237 139929
+ 14378 21105
+ 86307 16160...

output:

000000000000000000000000000000000000000000000000000000000000000000?0000000000000000000000000000000000000000000000000000000000000000000?00000000000000000000000000000000000000000000000000000000?00000000000000?00000000000000000000000000000000000000000000000000000000000000000000000?0000??000000?0?000000...

result:

ok single line: '000000000000000000000000000000...?0??0?000?0?0?0?000??0?000?0???'

Test #134:

score: 1
Accepted
time: 128ms
memory: 17552kb

input:

218006 800000
+ 52523 181406
+ 199834 174409
+ 40652 119211
+ 15732 132993
+ 17133 59122
+ 133568 174484
+ 116177 94339
+ 184949 170397
+ 74612 124026
+ 6178 162612
+ 173335 14024
+ 169125 91199
+ 196049 136837
+ 75966 182076
+ 153400 141666
+ 5731 120035
+ 189791 121070
+ 60163 35601
+ 122137 24714...

output:

0000000000000000000000000000000000000000000000000000000?0000000000000000000000000000000000000000000?000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?0000000000000000000000000000?00000000?00000000000000000000...

result:

ok single line: '000000000000000000000000000000...??0????0?????0?0?0??????000000?'

Test #135:

score: 1
Accepted
time: 133ms
memory: 15820kb

input:

217858 800000
+ 1 207705
+ 192451 1
+ 207705 176434
+ 103708 144155
+ 173632 194252
+ 75122 129932
? 173628
+ 116917 152906
+ 215306 62777
+ 209341 15353
+ 140496 147137
+ 172044 103708
+ 184584 114487
+ 110470 106992
+ 77159 118969
+ 140496 6361
+ 193643 132457
+ 116917 106992
+ 81483 119038
+ 3160...

output:

0000000000000000000000000000000000000000000000000000000000000?0000000000000000000000000000000000000000000000?00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok single line: '000000000000000000000000000000...0???????0???00?0??????00??????0'

Test #136:

score: 1
Accepted
time: 126ms
memory: 13612kb

input:

220000 800000
+ 107099 7506
+ 189680 27106
+ 46497 178534
+ 63656 91212
+ 91212 149539
+ 1 7506
+ 151676 66635
+ 160193 149539
+ 189680 91212
+ 178534 151676
+ 107099 151676
+ 160193 66635
- 63656
? 34161
+ 208911 135541
+ 88766 135541
+ 142003 197249
+ 115520 142003
+ 216302 142003
+ 51684 208911
+...

output:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok single line: '000000000000000000000000000000...?????0???0?0???????0????0??????'

Test #137:

score: 1
Accepted
time: 135ms
memory: 18072kb

input:

220000 800000
+ 44120 44120
+ 81724 171011
+ 171011 173134
+ 128223 173134
? 28978
+ 106827 128223
+ 63640 63640
+ 178466 106827
+ 35216 178466
+ 215615 35216
? 207287
+ 215615 120139
+ 209340 120139
+ 119576 209340
+ 119576 83170
+ 36692 36692
? 68179
+ 169769 83170
+ 169769 21418
+ 77180 21418
+ 6...

output:

000000000000000000000000000000000000000000000000000000000000000000000000000000000?000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?000000000000000000000000000000000000000000000000000000000000000000000000?000000000000000000000000000000000000000000000000...

result:

ok single line: '000000000000000000000000000000...?11001??01111001?11?1110110?101'

Test #138:

score: 1
Accepted
time: 132ms
memory: 17844kb

input:

220000 800000
+ 37092 37092
+ 44249 44249
+ 60343 60343
+ 65839 65839
+ 78858 78858
+ 68516 68516
+ 66139 115302
+ 195118 96683
+ 81699 151973
+ 15882 15882
+ 93710 43490
+ 125453 184464
+ 79794 7628
+ 183295 187470
+ 19585 16645
+ 43405 52549
+ 148548 165438
+ 130095 130095
+ 204792 35828
+ 148350 ...

output:

00000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?0000000000000000000000000000000000000000000000?0000000000000010000000000000000000000000000000000000000000000000000000000000000000...

result:

ok single line: '000000000000000000000000000000...??1?0?000?1???0?101?????11?0?0?'

Test #139:

score: 1
Accepted
time: 86ms
memory: 13428kb

input:

44000 800000
+ 9872 9872
+ 20677 25219
+ 23355 23355
+ 41413 34843
+ 41413 2114
+ 28272 28272
+ 19241 7628
+ 7628 41413
+ 7628 40157
+ 15638 15638
+ 34843 20677
+ 25219 28902
+ 33744 25219
+ 28392 28392
+ 34269 34269
+ 20773 20773
+ 24816 9953
+ 11059 25038
+ 19376 19842
+ 1893 1893
? 30115
+ 1334 3...

output:

00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?00000000010000?0000000?00000000000?000000?00000000?000000000?0000?000000100000000000000?01000000000?000000000001000000?01001000?000000000000000?000000000?0000000?10000?000000001000000000010?00000...

result:

ok single line: '000000000000000000000000000000...1010010?0?1101110000?001?0100?1'

Test #140:

score: 1
Accepted
time: 85ms
memory: 15388kb

input:

44000 800000
+ 28197 6103
+ 13337 13337
+ 6103 4307
+ 27548 27548
+ 5843 2610
+ 26020 1989
+ 14755 32472
+ 23177 9341
+ 16591 2180
? 37839
+ 37564 14534
+ 16802 16802
+ 33380 37169
+ 32844 27106
+ 33953 35428
+ 23901 25547
+ 41108 10389
+ 1362 5655
+ 12315 31227
+ 11528 2322
+ 40554 40554
+ 15845 26...

output:

000000000000000000000000000000000000000000?000000000000000000000000?00000000000000000000?01000000000000?000000000000?00000000??000000000?0000000?00?0000?0?00??00000000000000000000000000?0?00000010000000000?0?00000000000000?000?0000000000?0000?0000?000?0?0000000?000?0?000??0??000000??0000000000?00?0?...

result:

ok single line: '000000000000000000000000000000...010011?01001000100?011?00????11'

Test #141:

score: 1
Accepted
time: 88ms
memory: 13532kb

input:

14666 800000
+ 13485 7933
+ 7639 3720
+ 11307 12681
+ 3711 6092
+ 6725 12621
+ 163 10084
+ 5508 9957
+ 10240 1142
+ 3240 2277
+ 6288 6907
+ 12179 12383
+ 4347 4347
+ 4772 4772
+ 14513 14513
+ 7979 10550
+ 7346 7346
+ 5351 9412
+ 3285 10987
? 4984
+ 12103 12103
+ 14003 4497
+ 12171 12171
+ 2365 7987
...

output:

0000000000000000000000000000?00000000000000?0?000?000000000000000000000?000000000001000000000000000000000000000000?000?0000000?000100000?00??000?0100000000000000?0?0000000000?00000000100??0001000000?00?0000000000100?0000000000??0?1000??0000000000000000?000000000000000000?000000001??0?010?0?00??00100...

result:

ok single line: '0000000000000000000000000000?0...11?101111?0110?011?11?1111?1000'

Test #142:

score: 1
Accepted
time: 127ms
memory: 17996kb

input:

220000 800000
+ 4053 7765
+ 4053 135700
+ 135700 186031
+ 115925 186031
+ 160856 115925
+ 160856 146167
+ 146167 149811
+ 149811 85050
+ 85050 57921
+ 57921 25234
+ 7497 25234
+ 7497 219802
+ 219802 47586
+ 47586 168460
+ 168460 212884
+ 212884 120584
+ 122884 120584
+ 122884 218919
+ 15926 218919
+...

output:

000000000000000000000000?000?00000???000?0000?0?00000??????0?0?0??0??????0?0000??????0?0?00?0???00??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????...

result:

ok single line: '000000000000000000000000?000?0...???????????????????????????????'

Test #143:

score: 1
Accepted
time: 99ms
memory: 17424kb

input:

220000 800000
+ 14968 153569
? 29854
+ 87436 82386
+ 192315 215693
+ 17855 153319
? 37201
? 43309
+ 101556 95122
? 211025
? 293
? 46169
+ 96875 186215
+ 119434 192708
+ 71208 125656
+ 127451 192624
+ 59583 76931
+ 205062 105914
+ 117402 107470
? 176300
- 107470
? 165339
? 46169
+ 195215 151149
? 185...

output:

000000000000?????00000?00000?00?00000?00?00?000?00000000000000000?000?00?00??000000?0?00???00?000??000000000??00??0?000?0?00?000000?000000?00000000?000001000000000000?0000?0000?00?000000?00??000?0?00?0000??00000000?001000?00?0?000000?0??00?000000011010110000000?0?01?00000?00?00??0???0?0?00000?00?01?...

result:

ok single line: '000000000000?????00000?00000?0...10011101101100000?0111110?10?01'

Subtask #10:

score: 1
Accepted

Test #144:

score: 1
Accepted
time: 177ms
memory: 15716kb

input:

299108 992636
+ 229230 1966
+ 141316 98248
+ 14432 125630
+ 29064 28258
? 174127
? 213753
? 22485
+ 60064 160159
? 128830
? 110504
? 162839
+ 179310 116614
+ 106734 260292
+ 187972 6883
+ 246144 102185
+ 79391 39735
+ 119136 17345
? 110239
+ 209222 110862
? 173920
? 2143
? 269421
? 7375
? 111474
? 2...

output:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok single line: '000000000000000000000000000000...0?0001000001110101111111?1?1111'

Test #145:

score: 1
Accepted
time: 171ms
memory: 16052kb

input:

300000 996379
? 6138
? 229761
? 133222
? 133323
+ 97143 243770
? 62686
? 226834
+ 29521 73346
? 234140
+ 178426 21694
+ 123787 150911
+ 216711 78452
+ 278311 277076
+ 182674 298222
+ 116359 224254
+ 265996 212665
? 57726
+ 13870 20756
+ 152641 92092
? 78048
? 220767
+ 20362 19365
+ 58999 252440
+ 27...

output:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok single line: '000000000000000000000000000000...01100111100?1101110110111110?00'

Test #146:

score: 1
Accepted
time: 115ms
memory: 12948kb

input:

30000 1000000
+ 14941 28395
+ 6496 21731
+ 11836 8822
? 16871
+ 16688 286
? 710
+ 684 6748
+ 4647 4863
+ 538 7745
? 8568
? 20903
+ 21219 9079
? 12970
? 28226
? 21443
+ 583 18898
? 25627
? 19004
+ 4872 11421
+ 1527 9452
+ 26155 23114
+ 2081 22563
? 8779
? 9634
? 7504
? 16682
? 27847
+ 16536 12682
+ 9...

output:

00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?00000000000000000000000000000000000000000?00000000000000000000000000?000000000000000000000000000000000000000...

result:

ok single line: '000000000000000000000000000000...1011111101010011?10111100101011'

Test #147:

score: 1
Accepted
time: 173ms
memory: 20284kb

input:

298639 1000000
+ 144318 173650
+ 115821 273756
+ 162363 20605
+ 244442 293087
+ 21920 49408
+ 133701 127937
+ 234237 227677
+ 274238 247194
+ 286120 295166
+ 239814 110970
+ 19896 282049
+ 298406 241123
+ 57433 293766
+ 63178 269179
+ 205305 103397
+ 54785 9941
+ 207224 138688
+ 232598 198468
+ 5820...

output:

00000000000000000000000000000000000000000000?000000000000000000000000000000000000000000000000000000000000000000?0000000000000000000?00000000000000000000000000000?00?00000000000000000000000000000000000000000000000000000?00000?000000000000000000000000000000000000000000000000000000000000?00000000000000...

result:

ok single line: '000000000000000000000000000000...?0??????00?????????0???????????'

Test #148:

score: 1
Accepted
time: 172ms
memory: 20488kb

input:

298902 1000000
+ 186705 260133
+ 212960 98837
+ 233679 294926
+ 59830 6238
+ 14733 254152
+ 67691 221474
+ 129372 138825
+ 184792 72648
+ 78076 134741
+ 173462 20787
+ 19278 149594
+ 172431 192248
+ 222657 274295
+ 65688 205440
+ 116460 157618
+ 77180 16928
+ 76637 66694
+ 71503 216513
? 126350
+ 22...

output:

0000000000000000000000000000000000000000000000000000000000000000?0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?0000000000000000000000000000000000000000000000?000?00000000000000000000000?000000000000000000000000000000??0000000000?0000...

result:

ok single line: '000000000000000000000000000000...?????????0?00??0???????0????0??'

Test #149:

score: 1
Accepted
time: 160ms
memory: 18140kb

input:

300000 1000000
+ 269794 78229
+ 246900 20263
+ 279936 102945
+ 59211 68096
+ 112191 85339
+ 87359 243523
+ 86188 9212
+ 213919 44505
+ 294601 201758
+ 203504 172963
+ 78470 222162
+ 41236 50046
+ 110159 282451
+ 30610 118606
+ 183863 160493
? 176848
+ 19632 154632
+ 191824 19703
+ 261764 30239
+ 283...

output:

000000000000000000000000000000000000000000000000000000000000000000000?0000000000000000000000000000000000000000000?000000000000000000000000000000000000000000?00000?00000000000000000000000000?000000?0000000000000000000?0000000000000000000000000000000000000000000000?000000000?0000000000000000000?000000...

result:

ok single line: '000000000000000000000000000000...0?0????????0???00???0?????0????'

Test #150:

score: 1
Accepted
time: 164ms
memory: 16216kb

input:

300000 1000000
? 9452
+ 3955 288228
+ 158570 244397
+ 239285 111154
+ 80344 151119
+ 77375 64338
+ 61687 4638
+ 144855 136035
+ 147679 27042
+ 31460 232254
+ 262269 176853
+ 201217 278482
+ 49709 189103
+ 234479 297280
+ 55359 81814
+ 73968 176652
+ 228760 188866
+ 217141 14780
+ 116176 282205
+ 219...

output:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?00000?0000000000000000000000000000000000000000000000000000000?000000000000000...

result:

ok single line: '000000000000000000000000000000...????????0???0?0???0?0??????????'

Test #151:

score: 1
Accepted
time: 164ms
memory: 18412kb

input:

300000 1000000
+ 58279 232025
+ 152959 278864
+ 34056 226122
+ 101510 242839
? 77381
+ 218418 142815
+ 179830 191446
+ 294711 70256
+ 187816 270790
+ 259609 294861
+ 100302 285989
+ 97553 160109
+ 205021 205689
+ 81091 79208
+ 248196 188823
? 217207
+ 39370 277459
? 159115
+ 216842 43751
+ 212230 10...

output:

0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?0?00000?0000?000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok single line: '000000000000000000000000000000...0???????0??????0???????????????'

Test #152:

score: 1
Accepted
time: 166ms
memory: 18196kb

input:

300000 1000000
+ 140516 77045
+ 95429 6688
+ 56157 159813
? 93261
+ 66515 226898
+ 273494 250435
+ 198887 133203
? 73220
+ 108782 135930
+ 41701 179236
+ 78592 88050
+ 173962 127699
+ 132982 149777
+ 185398 86300
+ 92817 161261
+ 293576 135883
+ 102251 28214
+ 181934 112213
+ 231389 111125
+ 246623 ...

output:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?00000000000000000000000000000000000000000000000000000?0000000000000000000000000000000?00000000000000?00000000?000000...

result:

ok single line: '000000000000000000000000000000...???????0????0?0??0??0??????????'

Test #153:

score: 1
Accepted
time: 162ms
memory: 18440kb

input:

298409 1000000
+ 259324 72446
+ 229197 180019
+ 1 200941
+ 259324 200941
+ 180019 72446
+ 156915 277012
+ 72446 277012
+ 72446 103319
+ 200941 12048
+ 200941 26432
- 156915
- 103319
+ 12048 21551
+ 197958 260226
+ 109877 7785
+ 227762 275192
+ 87109 177794
+ 209378 149198
+ 105100 57614
+ 17389 2270...

output:

0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?000000000000...

result:

ok single line: '000000000000000000000000000000...????0???????????0?0??00?????0??'

Test #154:

score: 1
Accepted
time: 167ms
memory: 20344kb

input:

300000 1000000
? 41122
+ 1 17503
- 17503
+ 292856 214207
+ 198668 183895
+ 43273 68964
+ 171455 198668
+ 171455 286334
+ 68964 1
? 276378
? 54898
+ 214207 183895
+ 171455 1
+ 230690 68964
+ 127120 195995
+ 240720 230690
+ 68964 195995
+ 206764 36477
+ 230690 206764
+ 41421 45941
+ 130451 208265
+ 32...

output:

0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok single line: '000000000000000000000000000000...??????????????????0????????????'

Test #155:

score: 1
Accepted
time: 166ms
memory: 20344kb

input:

300000 1000000
+ 112460 192036
+ 103806 191990
+ 254147 254147
+ 20919 20919
+ 286273 270797
+ 209686 197132
+ 9436 55282
+ 245236 175407
+ 175222 94477
+ 99329 109768
+ 138093 44262
+ 42224 42224
+ 152211 107225
+ 269909 115750
+ 233540 196596
+ 294142 42971
+ 159557 85589
+ 85486 91380
+ 242077 24...

output:

00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?000000000?00000000000?00000000000000000000000000000000...

result:

ok single line: '000000000000000000000000000000...?111?1??0?0???0?1101?1??0?10?11'

Test #156:

score: 1
Accepted
time: 167ms
memory: 18576kb

input:

300000 1000000
+ 138671 33845
+ 111273 111272
+ 234429 82731
+ 34657 266167
+ 45101 69089
+ 109515 107852
+ 220511 67355
+ 163583 81132
+ 299087 22438
+ 270118 143158
+ 119698 235068
+ 72873 113600
+ 198905 298311
+ 194103 63956
+ 164446 227351
+ 297770 119239
+ 89968 11551
+ 236889 23430
+ 198966 1...

output:

00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?0000?00000000000000?0?0000000000000000?0000000000000000000000000000000000000?0000000000000000000000000000000000000...

result:

ok single line: '000000000000000000000000000000...?11?111????0?0???????????1?1???'

Test #157:

score: 1
Accepted
time: 111ms
memory: 15808kb

input:

60000 1000000
+ 59692 17792
+ 41404 54164
+ 30662 29258
+ 54530 52834
+ 8193 13808
+ 24912 13207
+ 32277 32277
+ 7876 55099
+ 39876 14418
+ 2243 44462
+ 44331 53214
+ 27680 27680
+ 41240 20293
+ 42839 42857
+ 15912 50962
+ 15999 356
+ 2105 37808
+ 2071 5663
? 56919
+ 3547 38708
+ 56877 24425
+ 58171...

output:

0000000000000000000000000000000000000000000000?0000000000000000000?00000?000000?000000000000000000000000000000?000000000010000000000000?0?000000000000010000000?0000000000?0000?0000000000000000000000000000000000?00?00000?0??0000000000000000000000000000000000000?0000?00?0000000000?00010000000?00000010...

result:

ok single line: '000000000000000000000000000000...???1?0??01?0??0????0???0???????'

Test #158:

score: 1
Accepted
time: 121ms
memory: 15880kb

input:

60000 1000000
+ 41905 23704
+ 50027 10261
+ 10261 26013
+ 48267 26013
+ 44778 48267
+ 50948 44778
+ 6621 50948
+ 6621 1137
+ 9578 1137
+ 9578 36332
+ 45014 36332
+ 2318 45014
+ 28549 28549
+ 40745 40745
+ 10388 2318
+ 16194 10388
+ 5815 16194
+ 54207 5815
+ 34305 34305
+ 54207 18374
+ 18374 32399
+ ...

output:

00000000000000000000000000000000000000000000?00000000000000000000000000000000000000010000000000000000000?00000000000000000000000000000100000000?00000000000000000000000000000000000000000?001000000000000000000000010000000000000?000000000??0000000000000??0000?00000000000000??000?00?00000000010000?00000...

result:

ok single line: '000000000000000000000000000000...111?011010001?01110110110001011'

Test #159:

score: 1
Accepted
time: 111ms
memory: 13592kb

input:

20000 1000000
+ 15729 19630
+ 12941 15949
+ 17334 12252
+ 8924 12045
+ 19769 15191
+ 5613 13361
+ 18974 18974
+ 5076 9198
+ 11854 13050
+ 8980 7175
+ 2046 5363
+ 19470 1709
+ 13769 14916
+ 10030 11482
+ 14013 16683
? 13442
+ 2134 2134
+ 13038 813
+ 15554 7408
+ 1573 1573
+ 14410 18545
+ 14063 5336
+...

output:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?0000000?000000000000000000000?000000000000000?00000000000?00?0000000000000000000?0000000000?00100000?000??00000010000000000000000?0000000???0?0?0?000000000??0000???00000000?00000000000000?1000000000000?0...

result:

ok single line: '000000000000000000000000000000...01???????????0?1?101???1??1??00'

Test #160:

score: 1
Accepted
time: 179ms
memory: 18660kb

input:

300000 1000000
+ 290615 174807
+ 290615 70626
+ 68109 70626
+ 96007 68109
+ 106226 96007
+ 285674 106226
+ 73578 285674
+ 75610 73578
+ 75610 141927
+ 141927 273293
+ 167622 273293
+ 173297 167622
+ 173297 213099
+ 162881 213099
+ 180017 162881
+ 79568 180017
+ 17014 79568
+ 17014 216494
+ 216494 14...

output:

00?000?000?000?0?????00000?00?0??0?????0????00???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

result:

ok single line: '00?000?000?000?0?????00000?00?...???????????????????????????????'

Test #161:

score: 1
Accepted
time: 91ms
memory: 13812kb

input:

300000 1000000
? 189183
? 48281
? 45106
? 124117
? 278305
? 1857
? 241742
? 39166
? 197310
? 282566
? 93758
? 40874
? 15012
? 54388
? 270550
? 112724
? 191299
? 280062
? 195279
? 248355
? 28820
? 46197
? 165043
? 42372
? 201161
? 28986
? 17652
? 149736
? 57417
? 183847
? 85733
? 263559
? 185017
? 53...

output:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok single line: '000000000000000000000000000000...0000000000000000000000000000000'

Test #162:

score: 1
Accepted
time: 135ms
memory: 20012kb

input:

300000 1000000
+ 149584 9047
+ 73014 120744
+ 64864 4541
? 185158
? 185158
? 177689
? 188221
+ 185158 32495
+ 243350 209700
- 185158
? 11115
? 186105
? 6511
? 279479
+ 227884 176023
+ 136211 4542
? 256992
+ 11115 68387
? 163037
+ 157018 265964
? 13343
? 294239
? 129877
+ 221196 273260
+ 197065 52739...

output:

0000000000000000000?000?0000000?00?0?0000000?00000??0000000?000000??000000000?0?0??000000?0000????00000000??00000000000?0?00000?000000?000??0?000000000?1000000?000001000000??0000000?00??000?00000?00000??00??0000???0?001?0?0???00??0?000000000000000010010?0?10100?0000?0?000000?0000?00?0?0000000?0??000...

result:

ok single line: '0000000000000000000?000?000000...101111011101?1100011?0111111111'

Extra Test:

score: 0
Extra Test Passed