QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#421602#8726. Magic ShowXiaohuba100 ✓0ms1924kbC++233.0kb2024-05-25 22:12:322024-05-25 22:12:32

Judging History

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

  • [2024-05-25 22:12:32]
  • 评测
  • 测评结果:100
  • 用时:0ms
  • 内存:1924kb
  • [2024-05-25 22:12:32]
  • 提交

Alice

#include "Alice.h"
#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using pii = pair<int, int>;

#define For(i, j, k) for (decltype(j - k) i = (j); i <= (k); i++)

namespace {
constexpr int mod = 43, B = 2;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
int rndint(int l, int r) { return uniform_int_distribution<int>(l, r)(rnd); }
int eval(const vector<int> &F, int x) {
  int ans = 0;
  for (int i = 0, mul = 1; i < F.size(); i++, (mul *= x) %= mod)
    (ans += mul * F[i]) %= mod;
  return ans;
}
} // namespace

vector<pii> Alice() {
  ll x = setN(129);
  vector<int> F;
  vector<pii> ans;
  while (x)
    F.emplace_back(x % mod), x /= mod;
  For(i, 0, mod - 1) {
    int val = eval(F, i);
    For(j, mod + 2 * i + 1, mod + 2 * i + 2) { ans.emplace_back(j, val + 1); }
  }
  For(i, 2, mod) ans.emplace_back(i - 1, i);
  shuffle(ans.begin(), ans.end(), rnd);
  return ans;
}

// 11451419198

Bob

#include "Bob.h"
#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using pii = pair<int, int>;

#define For(i, j, k) for (decltype(j - k) i = (j); i <= (k); i++)
#define ForDown(i, j, k) for (decltype(j - k) i = (j); i >= (k); i--)

namespace {
constexpr int mod = 43;
vector<int> T[5005];
#define fi first
#define se second
int qpow(int x, unsigned int y) {
  int ans = 1;
  while (y) {
    if (y & 1)
      (ans *= x) %= mod;
    (x *= x) %= mod, y >>= 1;
  }
  return ans;
}
vector<int> lagrange(const vector<pii> &A) {
  auto brute_mul = [&](const vector<int> &F, int x) {
    vector<int> G(F.size() + 1, 0);
    For(i, 0, signed(F.size()) - 1) {
      G[i + 1] = F[i];
      G[i] = (G[i] + (mod - x) * F[i]) % mod;
    }
    return G;
  };
  auto brute_div = [&](vector<int> F, int x) {
    vector<int> G(F.size() - 1, 0);
    ForDown(i, signed(F.size()) - 1, 1) {
      G[i - 1] = (G[i - 1] + F[i]) % mod;
      F[i - 1] = (F[i - 1] + F[i] * x) % mod;
    }
    assert(!F[0]);
    return G;
  };

  int N = A.size();
  vector<int> U = {1}, F(N);
  for (auto [xi, _] : A)
    U = brute_mul(U, xi);
  For(i, 0, N - 1) {
    ll mul = 1ll;
    For(j, 0, N - 1) if (i != j) { (mul *= (mod + A[i].fi - A[j].fi)) %= mod; }
    mul = qpow(mul, mod - 2) * A[i].se % mod;
    auto cur = brute_div(U, A[i].fi);
    assert(cur.size() == N);
    For(j, 0, N - 1) F[j] = (F[j] + mul * cur[j]) % mod;
  }
  return F;
}
} // namespace

long long Bob(vector<pii> V) {
  vector<pii> A;
  for (auto [u, v] : V)
    T[u].emplace_back(v), T[v].emplace_back(u);
  auto real = [&](int x) { return (x - mod - 1) / 2; };
  For(i, 1, mod) {
    set<int> used;
    for (int j : T[i])
      if (!used.count(real(j)) && j >= mod + 1) {
        used.emplace(real(j));
        A.emplace_back(real(j), i - 1);
        // cerr << real(j) << ' ' << i << '\n';
      }
  }
  assert(A.size() >= 12);
  auto F = lagrange(A);
  ll ans = 0;
  for (ll i = 0, mul = 1; i < 12; i++, mul *= mod) {
    ans += F[i] * mul;
  }
  return ans;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 5
Accepted

Test #1:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1776kb,1916kb

input:

1
4005

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
129
13 14
75 3
30 31
86 4
25 26
14 15
65 19
121 22
10 11
45 7
119 37
46 16
36 37
107 39
61 19
126 1
100 8
102 43
18 19
94 13
113 20
123 11
58 25
117 13
17 18
87 4
9 10
5...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
129
13 14
75 3
30 31
86 4
25 26
14 15
65 19
121 22
10 11
45 7
119 37
46 16
36 37
107 39
61 19
126 1
100 8
102 43
18 19
94 13
113 20
123 11
58 25
117 13
17 18
87 4
9 10
5...

output:

2
129 85
1 84
1 126
2 3
2 82
2 83
2 129
3 50
3 75
4 5
4 87
4 124
4 125
5 6
6 54
6 70
6 71
7 8
7 44
7 45
7 80
8 9
8 110
8 111
9 10
10 11
11 88
13 14
13 94
13 95
13 116
13 117
15 16
16 17
16 78
16 79
17 18
17 63
18 19
19 60
19 64
19 65
20 98
20 112
21 22
22 23
22 120
22 121
23 24
24 25
24 52
24 53
24 ...

input:

2
129 85
1 84
1 126
2 3
2 82
2 83
2 129
3 50
3 75
4 5
4 87
4 124
4 125
5 6
6 54
6 70
6 71
7 8
7 44
7 45
7 80
8 9
8 110
8 111
9 10
10 11
11 88
13 14
13 94
13 95
13 116
13 117
15 16
16 17
16 78
16 79
17 18
17 63
18 19
19 60
19 64
19 65
20 98
20 112
21 22
22 23
22 120
22 121
23 24
24 25
24 52
24 53
24 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4005

Test #2:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1768kb,1916kb

input:

1
459

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
129
122 33
23 24
8 9
116 3
18 19
72 41
87 25
28 29
35 36
20 21
25 26
44 30
69 21
37 38
78 28
19 20
104 29
11 12
52 27
112 26
29 30
101 9
38 39
62 34
33 34
53 27
107 39
1...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
129
122 33
23 24
8 9
116 3
18 19
72 41
87 25
28 29
35 36
20 21
25 26
44 30
69 21
37 38
78 28
19 20
104 29
11 12
52 27
112 26
29 30
101 9
38 39
62 34
33 34
53 27
107 39
1...

output:

2
129 85
1 2
1 64
1 65
3 4
3 117
4 5
5 82
6 7
6 108
6 109
7 8
7 48
7 49
8 9
8 74
9 100
10 11
11 12
11 66
11 67
12 92
12 93
13 118
14 59
15 16
15 85
16 17
16 110
16 111
17 18
17 50
17 51
18 77
19 20
19 102
19 103
20 21
20 128
21 22
21 69
22 23
22 94
22 95
23 24
23 120
23 121
24 25
24 60
24 61
25 26
2...

input:

2
129 85
1 2
1 64
1 65
3 4
3 117
4 5
5 82
6 7
6 108
6 109
7 8
7 48
7 49
8 9
8 74
9 100
10 11
11 12
11 66
11 67
12 92
12 93
13 118
14 59
15 16
15 85
16 17
16 110
16 111
17 18
17 50
17 51
18 77
19 20
19 102
19 103
20 21
20 128
21 22
21 69
22 23
22 94
22 95
23 24
23 120
23 121
24 25
24 60
24 61
25 26
2...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
459

Test #3:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1768kb,1920kb

input:

1
2495

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
129
38 39
52 35
51 13
77 25
112 34
117 32
100 2
19 20
93 35
72 21
111 38
57 42
105 19
41 42
54 16
29 30
11 12
37 38
34 35
129 31
2 3
113 34
90 16
73 21
82 3
13 14
76 25
...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
129
38 39
52 35
51 13
77 25
112 34
117 32
100 2
19 20
93 35
72 21
111 38
57 42
105 19
41 42
54 16
29 30
11 12
37 38
34 35
129 31
2 3
113 34
90 16
73 21
82 3
13 14
76 25
...

output:

2
129 128
1 2
1 108
1 109
1 122
1 123
2 3
2 44
2 45
2 100
2 101
3 4
3 62
3 63
3 82
3 83
4 5
5 6
6 7
7 8
8 9
9 10
9 106
9 107
9 124
9 125
10 11
11 12
12 13
13 14
13 50
13 51
13 94
13 95
14 15
14 60
14 61
14 84
14 85
15 16
16 17
16 54
16 55
16 90
16 91
17 18
18 19
18 46
18 47
18 98
18 99
19 20
19 104
...

input:

2
129 128
1 2
1 108
1 109
1 122
1 123
2 3
2 44
2 45
2 100
2 101
3 4
3 62
3 63
3 82
3 83
4 5
5 6
6 7
7 8
8 9
9 10
9 106
9 107
9 124
9 125
10 11
11 12
12 13
13 14
13 50
13 51
13 94
13 95
14 15
14 60
14 61
14 84
14 85
15 16
16 17
16 54
16 55
16 90
16 91
17 18
18 19
18 46
18 47
18 98
18 99
19 20
19 104
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
2495

Test #4:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1768kb,1916kb

input:

3
1560

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
129
79 23
48 42
103 25
30 31
73 1
55 21
82 9
52 28
77 30
106 11
87 38
36 37
11 12
84 2
108 4
6 7
20 21
90 24
93 17
63 36
76 30
29 30
74 37
102 25
62 36
21 22
13 14
61 43...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
129
79 23
48 42
103 25
30 31
73 1
55 21
82 9
52 28
77 30
106 11
87 38
36 37
11 12
84 2
108 4
6 7
20 21
90 24
93 17
63 36
76 30
29 30
74 37
102 25
62 36
21 22
13 14
61 43...

output:

4
129 65
1 2
1 72
1 73
2 3
2 84
2 85
5 120
24 25
24 90
24 91
25 26
25 102
25 103
26 27
26 114
26 115
27 28
27 126
27 127
28 29
28 52
28 53
29 30
29 64
29 65
30 31
30 76
30 77
31 32
31 88
31 89
32 33
32 100
32 101
33 34
33 112
33 113
34 35
34 124
34 125
35 36
35 50
35 51
36 37
36 62
36 63
37 38
37 74...

input:

4
129 65
1 2
1 72
1 73
2 3
2 84
2 85
5 120
24 25
24 90
24 91
25 26
25 102
25 103
26 27
26 114
26 115
27 28
27 126
27 127
28 29
28 52
28 53
29 30
29 64
29 65
30 31
30 76
30 77
31 32
31 88
31 89
32 33
32 100
32 101
33 34
33 112
33 113
34 35
34 124
34 125
35 36
35 50
35 51
36 37
36 62
36 63
37 38
37 74...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1560

Test #5:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1772kb,1920kb

input:

3
3594

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
129
10 11
3 4
13 14
91 13
50 26
59 11
6 7
25 26
87 17
31 32
109 8
95 17
94 17
48 24
14 15
103 6
60 23
73 8
45 26
53 30
49 24
99 29
122 11
23 24
119 37
120 23
29 30
52 30...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
129
10 11
3 4
13 14
91 13
50 26
59 11
6 7
25 26
87 17
31 32
109 8
95 17
94 17
48 24
14 15
103 6
60 23
73 8
45 26
53 30
49 24
99 29
122 11
23 24
119 37
120 23
29 30
52 30...

output:

4
129 65
1 2
1 56
1 57
1 124
1 125
2 3
3 4
4 5
5 6
5 68
5 69
5 112
5 113
12 13
13 90
13 91
15 16
20 21
26 44
27 28
27 70
27 71
27 110
27 111
28 29
28 66
28 67
28 114
29 30
29 82
29 83
29 98
29 99
30 31
30 52
30 53
30 128
30 129
31 32
32 33
33 34
34 35
34 74
34 75
34 106
34 107
35 36
36 37
36 54
36 5...

input:

4
129 65
1 2
1 56
1 57
1 124
1 125
2 3
3 4
4 5
5 6
5 68
5 69
5 112
5 113
12 13
13 90
13 91
15 16
20 21
26 44
27 28
27 70
27 71
27 110
27 111
28 29
28 66
28 67
28 114
29 30
29 82
29 83
29 98
29 99
30 31
30 52
30 53
30 128
30 129
31 32
32 33
33 34
34 35
34 74
34 75
34 106
34 107
35 36
36 37
36 54
36 5...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
3594

Test #6:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1768kb,1916kb

input:

3
1750

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
129
24 25
20 21
86 11
38 39
90 5
45 31
69 38
3 4
56 13
121 3
44 31
48 25
46 28
72 32
64 1
57 13
77 26
110 18
115 12
51 22
31 32
59 10
127 37
101 33
87 11
84 14
89 8
83 1...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
129
24 25
20 21
86 11
38 39
90 5
45 31
69 38
3 4
56 13
121 3
44 31
48 25
46 28
72 32
64 1
57 13
77 26
110 18
115 12
51 22
31 32
59 10
127 37
101 33
87 11
84 14
89 8
83 1...

output:

4
129 65
1 2
1 64
1 65
2 3
2 92
2 93
16 54
24 25
24 106
24 107
25 26
25 48
25 49
26 27
26 76
26 77
27 28
27 104
27 105
28 29
28 46
28 47
29 30
29 74
29 75
30 31
30 102
30 103
31 32
31 44
31 45
32 33
32 72
32 73
33 34
33 100
33 101
34 35
34 128
34 129
35 36
35 70
35 71
36 37
36 98
36 99
37 38
37 126
...

input:

4
129 65
1 2
1 64
1 65
2 3
2 92
2 93
16 54
24 25
24 106
24 107
25 26
25 48
25 49
26 27
26 76
26 77
27 28
27 104
27 105
28 29
28 46
28 47
29 30
29 74
29 75
30 31
30 102
30 103
31 32
31 44
31 45
32 33
32 72
32 73
33 34
33 100
33 101
34 35
34 128
34 129
35 36
35 70
35 71
36 37
36 98
36 99
37 38
37 126
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1750

Test #7:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1772kb,1916kb

input:

5
4878

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
129
57 39
33 34
52 31
112 25
73 16
16 17
13 14
66 43
68 30
84 27
126 17
30 31
105 7
24 25
36 37
122 30
8 9
22 23
80 36
111 36
114 18
55 33
26 27
110 36
98 14
60 20
129 3...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
129
57 39
33 34
52 31
112 25
73 16
16 17
13 14
66 43
68 30
84 27
126 17
30 31
105 7
24 25
36 37
122 30
8 9
22 23
80 36
111 36
114 18
55 33
26 27
110 36
98 14
60 20
129 3...

output:

6
129 69
2 3
4 5
6 7
6 46
6 47
6 58
6 59
8 9
8 82
8 83
8 108
8 109
10 11
10 94
10 95
10 96
10 97
12 13
14 15
14 92
14 93
14 98
14 99
16 17
16 72
16 73
16 118
16 119
18 19
18 76
18 77
18 114
18 115
20 21
20 44
20 45
20 60
20 61
22 23
22 90
22 91
22 100
22 101
24 25
26 27
28 29
30 31
30 68
30 69
30 12...

input:

6
129 69
2 3
4 5
6 7
6 46
6 47
6 58
6 59
8 9
8 82
8 83
8 108
8 109
10 11
10 94
10 95
10 96
10 97
12 13
14 15
14 92
14 93
14 98
14 99
16 17
16 72
16 73
16 118
16 119
18 19
18 76
18 77
18 114
18 115
20 21
20 44
20 45
20 60
20 61
22 23
22 90
22 91
22 100
22 101
24 25
26 27
28 29
30 31
30 68
30 69
30 12...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4878

Test #8:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1772kb,1916kb

input:

5
1223

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
129
120 9
118 24
110 41
62 14
89 34
30 31
8 9
108 13
11 12
100 30
92 4
50 18
98 2
127 7
75 10
14 15
69 12
99 2
68 12
29 30
32 33
55 31
5 6
65 42
80 8
112 26
96 17
35 36
...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
129
120 9
118 24
110 41
62 14
89 34
30 31
8 9
108 13
11 12
100 30
92 4
50 18
98 2
127 7
75 10
14 15
69 12
99 2
68 12
29 30
32 33
55 31
5 6
65 42
80 8
112 26
96 17
35 36
...

output:

6
129 65
1 58
1 59
2 3
3 52
3 53
4 5
5 46
5 47
6 7
7 126
7 127
8 9
9 120
9 121
10 11
11 114
11 115
12 13
13 108
13 109
14 15
15 102
15 103
16 17
17 96
17 97
18 19
19 90
19 91
20 44
21 22
21 84
21 85
23 24
23 78
23 79
25 26
25 72
25 73
27 28
27 66
27 67
29 30
29 60
29 61
31 32
31 54
31 55
33 34
33 48...

input:

6
129 65
1 58
1 59
2 3
3 52
3 53
4 5
5 46
5 47
6 7
7 126
7 127
8 9
9 120
9 121
10 11
11 114
11 115
12 13
13 108
13 109
14 15
15 102
15 103
16 17
17 96
17 97
18 19
19 90
19 91
20 44
21 22
21 84
21 85
23 24
23 78
23 79
25 26
25 72
25 73
27 28
27 66
27 67
29 30
29 60
29 61
31 32
31 54
31 55
33 34
33 48...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1223

Test #9:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1768kb,1916kb

input:

5
648

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
129
51 6
46 19
127 17
45 4
129 32
12 13
111 26
99 22
92 20
90 5
83 31
86 18
37 38
24 25
105 24
49 34
7 8
15 16
91 5
53 21
9 10
61 38
110 26
65 25
16 17
26 27
123 30
6 7
...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
129
51 6
46 19
127 17
45 4
129 32
12 13
111 26
99 22
92 20
90 5
83 31
86 18
37 38
24 25
105 24
49 34
7 8
15 16
91 5
53 21
9 10
61 38
110 26
65 25
16 17
26 27
123 30
6 7
...

output:

6
129 65
1 78
1 79
2 3
3 84
3 85
4 44
5 6
5 90
5 91
7 8
7 96
7 97
9 10
9 102
9 103
11 12
11 108
11 109
13 14
13 114
13 115
15 16
15 120
15 121
17 18
17 126
17 127
19 20
19 46
19 47
21 22
21 52
21 53
23 24
23 58
23 59
25 26
25 64
25 65
27 28
27 70
27 71
29 30
29 76
29 77
31 32
31 82
31 83
33 34
33 88...

input:

6
129 65
1 78
1 79
2 3
3 84
3 85
4 44
5 6
5 90
5 91
7 8
7 96
7 97
9 10
9 102
9 103
11 12
11 108
11 109
13 14
13 114
13 115
15 16
15 120
15 121
17 18
17 126
17 127
19 20
19 46
19 47
21 22
21 52
21 53
23 24
23 58
23 59
25 26
25 64
25 65
27 28
27 70
27 71
29 30
29 76
29 77
31 32
31 82
31 83
33 34
33 88...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
648

Test #10:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1772kb,1916kb

input:

7
4475

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
129
19 20
32 33
7 8
53 22
16 17
68 35
24 25
79 28
91 14
112 4
11 12
99 13
116 19
97 18
77 30
69 35
100 12
128 31
40 41
115 31
119 11
129 31
63 27
52 22
70 17
123 7
42 43...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
129
19 20
32 33
7 8
53 22
16 17
68 35
24 25
79 28
91 14
112 4
11 12
99 13
116 19
97 18
77 30
69 35
100 12
128 31
40 41
115 31
119 11
129 31
63 27
52 22
70 17
123 7
42 43...

output:

8
129 65
3 72
3 73
3 84
4 45
4 112
5 48
5 49
5 108
5 109
7 120
7 121
11 118
11 124
11 125
12 56
12 101
13 58
13 98
13 99
14 67
14 91
15 102
15 103
17 86
17 87
18 60
18 61
18 96
18 97
19 116
19 126
19 127
22 52
22 104
22 105
24 46
24 47
24 110
24 111
27 62
27 63
27 94
27 95
30 77
30 80
30 81
31 114
3...

input:

8
129 65
3 72
3 73
3 84
4 45
4 112
5 48
5 49
5 108
5 109
7 120
7 121
11 118
11 124
11 125
12 56
12 101
13 58
13 98
13 99
14 67
14 91
15 102
15 103
17 86
17 87
18 60
18 61
18 96
18 97
19 116
19 126
19 127
22 52
22 104
22 105
24 46
24 47
24 110
24 111
27 62
27 63
27 94
27 95
30 77
30 80
30 81
31 114
3...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4475

Test #11:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1772kb,1924kb

input:

7
4240

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
129
101 39
33 34
87 43
42 43
24 25
126 11
15 16
52 21
34 35
123 11
119 27
45 27
57 42
99 3
116 41
95 29
117 41
105 37
106 42
83 31
44 27
68 29
16 17
3 4
22 23
75 12
121 ...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
129
101 39
33 34
87 43
42 43
24 25
126 11
15 16
52 21
34 35
123 11
119 27
45 27
57 42
99 3
116 41
95 29
117 41
105 37
106 42
83 31
44 27
68 29
16 17
3 4
22 23
75 12
121 ...

output:

8
129 65
3 64
3 65
3 98
3 99
5 70
5 71
5 92
5 93
8 54
8 55
8 109
11 122
11 123
11 126
11 127
12 74
12 88
12 89
14 66
14 67
14 96
14 97
16 48
16 49
16 114
16 115
17 120
17 121
17 128
17 129
21 110
21 111
27 44
27 45
27 118
27 119
28 72
29 68
29 69
29 94
29 95
31 80
31 82
31 83
35 79
36 61
36 102
36 1...

input:

8
129 65
3 64
3 65
3 98
3 99
5 70
5 71
5 92
5 93
8 54
8 55
8 109
11 122
11 123
11 126
11 127
12 74
12 88
12 89
14 66
14 67
14 96
14 97
16 48
16 49
16 114
16 115
17 120
17 121
17 128
17 129
21 110
21 111
27 44
27 45
27 118
27 119
28 72
29 68
29 69
29 94
29 95
31 80
31 82
31 83
35 79
36 61
36 102
36 1...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4240

Test #12:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1776kb,1920kb

input:

7
1291

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
129
34 35
54 23
121 24
77 9
107 29
57 10
116 7
122 11
20 21
69 18
10 11
74 22
118 37
105 42
50 6
29 30
37 38
125 41
21 22
94 21
17 18
90 4
98 38
89 17
97 8
55 23
31 32
4...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
129
34 35
54 23
121 24
77 9
107 29
57 10
116 7
122 11
20 21
69 18
10 11
74 22
118 37
105 42
50 6
29 30
37 38
125 41
21 22
94 21
17 18
90 4
98 38
89 17
97 8
55 23
31 32
4...

output:

8
129 65
2 45
3 110
3 111
4 90
4 91
5 70
5 71
6 50
6 51
7 116
8 96
9 76
10 56
10 57
11 123
12 103
13 83
14 62
15 128
15 129
16 108
16 109
17 88
17 89
18 68
18 69
19 48
19 49
20 114
21 94
21 95
22 74
22 75
23 54
24 120
25 100
25 101
26 80
26 81
27 60
27 61
28 126
28 127
30 86
30 87
31 67
32 46
32 47
...

input:

8
129 65
2 45
3 110
3 111
4 90
4 91
5 70
5 71
6 50
6 51
7 116
8 96
9 76
10 56
10 57
11 123
12 103
13 83
14 62
15 128
15 129
16 108
16 109
17 88
17 89
18 68
18 69
19 48
19 49
20 114
21 94
21 95
22 74
22 75
23 54
24 120
25 100
25 101
26 80
26 81
27 60
27 61
28 126
28 127
30 86
30 87
31 67
32 46
32 47
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1291

Subtask #2:

score: 30
Accepted

Test #13:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1768kb,1924kb

input:

1
17476204

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
129
128 21
82 31
3 4
75 14
72 15
60 20
18 19
125 13
59 4
4 5
84 19
74 14
67 42
26 27
19 20
12 13
90 7
28 29
122 2
73 15
87 12
58 4
91 7
103 13
51 22
50 22
77 19
106 12
1...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
129
128 21
82 31
3 4
75 14
72 15
60 20
18 19
125 13
59 4
4 5
84 19
74 14
67 42
26 27
19 20
12 13
90 7
28 29
122 2
73 15
87 12
58 4
91 7
103 13
51 22
50 22
77 19
106 12
1...

output:

2
129 128
1 2
2 3
2 114
2 115
2 122
2 123
3 4
3 46
3 47
3 98
3 99
4 5
4 58
4 59
5 6
5 92
5 93
6 7
6 80
6 81
7 8
7 90
7 91
8 9
9 10
10 11
10 64
10 65
10 110
10 111
10 112
10 113
11 12
11 118
11 119
11 126
11 127
12 13
12 86
12 87
12 106
12 107
13 14
13 102
13 103
13 124
13 125
14 15
14 74
14 75
15 16...

input:

2
129 128
1 2
2 3
2 114
2 115
2 122
2 123
3 4
3 46
3 47
3 98
3 99
4 5
4 58
4 59
5 6
5 92
5 93
6 7
6 80
6 81
7 8
7 90
7 91
8 9
9 10
10 11
10 64
10 65
10 110
10 111
10 112
10 113
11 12
11 118
11 119
11 126
11 127
12 13
12 86
12 87
12 106
12 107
13 14
13 102
13 103
13 124
13 125
14 15
14 74
14 75
15 16...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
17476204

Test #14:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1772kb,1924kb

input:

1
11926600

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
129
94 22
96 32
70 1
106 11
4 5
38 39
89 25
32 33
27 28
100 15
20 21
13 14
91 2
18 19
36 37
31 32
110 14
109 8
98 11
48 17
66 16
55 37
61 37
21 22
7 8
14 15
121 42
37 38...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
129
94 22
96 32
70 1
106 11
4 5
38 39
89 25
32 33
27 28
100 15
20 21
13 14
91 2
18 19
36 37
31 32
110 14
109 8
98 11
48 17
66 16
55 37
61 37
21 22
7 8
14 15
121 42
37 38...

output:

2
129 128
1 2
1 70
1 71
1 82
1 83
1 112
1 113
2 3
2 52
2 53
2 90
2 91
3 4
3 118
3 119
4 5
4 62
4 63
5 6
5 128
5 129
6 7
7 8
7 84
7 85
8 9
8 108
8 109
9 10
10 11
10 74
10 75
11 12
11 98
11 99
11 106
11 107
12 13
13 14
13 114
13 115
13 122
13 123
14 15
14 110
14 111
15 16
15 100
15 101
16 17
16 66
16 ...

input:

2
129 128
1 2
1 70
1 71
1 82
1 83
1 112
1 113
2 3
2 52
2 53
2 90
2 91
3 4
3 118
3 119
4 5
4 62
4 63
5 6
5 128
5 129
6 7
7 8
7 84
7 85
8 9
8 108
8 109
9 10
10 11
10 74
10 75
11 12
11 98
11 99
11 106
11 107
12 13
13 14
13 114
13 115
13 122
13 123
14 15
14 110
14 111
15 16
15 100
15 101
16 17
16 66
16 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
11926600

Test #15:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1768kb,1924kb

input:

1
16602378

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
129
19 20
90 26
48 20
129 35
45 36
29 30
96 29
64 26
55 19
51 25
17 18
120 9
22 23
99 38
127 30
85 29
71 34
23 24
6 7
118 13
33 34
97 29
20 21
116 11
26 27
100 13
72 24
...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
129
19 20
90 26
48 20
129 35
45 36
29 30
96 29
64 26
55 19
51 25
17 18
120 9
22 23
99 38
127 30
85 29
71 34
23 24
6 7
118 13
33 34
97 29
20 21
116 11
26 27
100 13
72 24
...

output:

2
129 128
1 2
2 3
2 80
2 81
3 4
4 5
4 56
4 57
5 6
6 7
7 8
7 106
7 107
8 9
9 10
9 120
9 121
10 11
11 12
11 62
11 63
11 74
11 75
11 78
11 79
11 116
11 117
12 13
12 76
12 77
13 14
13 100
13 101
13 118
13 119
14 15
14 110
14 111
15 16
15 60
15 61
15 102
15 103
16 17
16 92
16 93
17 18
17 86
17 87
18 19
1...

input:

2
129 128
1 2
2 3
2 80
2 81
3 4
4 5
4 56
4 57
5 6
6 7
7 8
7 106
7 107
8 9
9 10
9 120
9 121
10 11
11 12
11 62
11 63
11 74
11 75
11 78
11 79
11 116
11 117
12 13
12 76
12 77
13 14
13 100
13 101
13 118
13 119
14 15
14 110
14 111
15 16
15 60
15 61
15 102
15 103
16 17
16 92
16 93
17 18
17 86
17 87
18 19
1...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
16602378

Test #16:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1772kb,1920kb

input:

3
13129243

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
129
66 2
12 13
78 16
102 36
55 1
32 33
9 10
86 22
34 35
50 31
16 17
65 42
2 3
6 7
56 1
103 36
125 8
21 22
90 20
67 2
69 2
76 2
37 38
81 18
123 22
74 34
44 11
128 38
115 ...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
129
66 2
12 13
78 16
102 36
55 1
32 33
9 10
86 22
34 35
50 31
16 17
65 42
2 3
6 7
56 1
103 36
125 8
21 22
90 20
67 2
69 2
76 2
37 38
81 18
123 22
74 34
44 11
128 38
115 ...

output:

4
129 65
1 2
2 3
2 66
2 67
2 68
2 69
2 76
2 77
2 114
2 115
3 4
4 5
9 10
10 62
10 63
12 13
12 92
12 93
13 14
14 15
15 16
15 106
15 107
16 17
16 78
16 79
17 18
18 80
18 81
20 21
20 90
20 91
23 24
23 108
23 109
24 25
24 99
25 26
26 27
26 112
26 113
27 28
27 72
27 73
28 29
28 84
28 85
29 58
29 59
31 32
...

input:

4
129 65
1 2
2 3
2 66
2 67
2 68
2 69
2 76
2 77
2 114
2 115
3 4
4 5
9 10
10 62
10 63
12 13
12 92
12 93
13 14
14 15
15 16
15 106
15 107
16 17
16 78
16 79
17 18
18 80
18 81
20 21
20 90
20 91
23 24
23 108
23 109
24 25
24 99
25 26
26 27
26 112
26 113
27 28
27 72
27 73
28 29
28 84
28 85
29 58
29 59
31 32
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
13129243

Test #17:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1776kb,1924kb

input:

3
7892141

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
129
113 32
36 37
103 42
69 35
70 12
5 6
56 40
18 19
91 11
98 14
35 36
30 31
12 13
24 25
61 20
26 27
108 6
42 43
83 35
29 30
52 36
97 41
80 30
81 30
16 17
3 4
20 21
100 7...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
129
113 32
36 37
103 42
69 35
70 12
5 6
56 40
18 19
91 11
98 14
35 36
30 31
12 13
24 25
61 20
26 27
108 6
42 43
83 35
29 30
52 36
97 41
80 30
81 30
16 17
3 4
20 21
100 7...

output:

4
129 65
1 2
1 48
1 49
4 67
8 9
8 44
8 45
9 10
10 120
10 121
12 70
12 71
14 15
14 98
14 99
15 16
16 17
16 58
16 59
17 18
17 50
17 51
17 62
17 63
17 76
17 77
17 104
17 105
21 22
21 84
21 85
22 23
23 24
23 122
23 123
24 25
25 26
26 27
27 28
27 74
27 75
28 94
28 95
30 31
30 80
30 81
31 32
32 33
32 112
...

input:

4
129 65
1 2
1 48
1 49
4 67
8 9
8 44
8 45
9 10
10 120
10 121
12 70
12 71
14 15
14 98
14 99
15 16
16 17
16 58
16 59
17 18
17 50
17 51
17 62
17 63
17 76
17 77
17 104
17 105
21 22
21 84
21 85
22 23
23 24
23 122
23 123
24 25
25 26
26 27
27 28
27 74
27 75
28 94
28 95
30 31
30 80
30 81
31 32
32 33
32 112
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
7892141

Test #18:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1776kb,1916kb

input:

3
21314775

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
129
116 4
14 15
88 11
46 27
2 3
59 31
102 12
25 26
100 18
89 11
41 42
74 35
68 18
1 2
76 42
50 36
73 32
72 32
110 1
90 3
70 35
57 16
44 20
36 37
60 13
77 42
62 27
123 23...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
129
116 4
14 15
88 11
46 27
2 3
59 31
102 12
25 26
100 18
89 11
41 42
74 35
68 18
1 2
76 42
50 36
73 32
72 32
110 1
90 3
70 35
57 16
44 20
36 37
60 13
77 42
62 27
123 23...

output:

4
129 65
1 2
1 110
1 111
5 6
6 7
6 81
7 8
7 92
7 93
8 9
9 10
9 104
9 105
14 15
17 106
17 107
19 20
20 21
20 44
20 45
21 22
24 25
24 64
24 65
25 26
25 112
25 113
26 27
27 28
27 46
27 47
27 62
27 63
27 94
27 95
27 114
27 115
28 29
29 30
29 126
29 127
32 33
32 73
32 120
32 121
35 36
36 37
36 50
36 51
3...

input:

4
129 65
1 2
1 110
1 111
5 6
6 7
6 81
7 8
7 92
7 93
8 9
9 10
9 104
9 105
14 15
17 106
17 107
19 20
20 21
20 44
20 45
21 22
24 25
24 64
24 65
25 26
25 112
25 113
26 27
27 28
27 46
27 47
27 62
27 63
27 94
27 95
27 114
27 115
28 29
29 30
29 126
29 127
32 33
32 73
32 120
32 121
35 36
36 37
36 50
36 51
3...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
21314775

Test #19:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1768kb,1916kb

input:

5
5559540

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
129
47 41
101 36
121 19
81 41
72 31
73 31
27 28
2 3
98 43
64 10
55 12
42 43
77 37
20 21
35 36
117 7
86 10
15 16
1 2
29 30
17 18
84 40
28 29
103 39
41 42
110 25
52 38
91 ...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
129
47 41
101 36
121 19
81 41
72 31
73 31
27 28
2 3
98 43
64 10
55 12
42 43
77 37
20 21
35 36
117 7
86 10
15 16
1 2
29 30
17 18
84 40
28 29
103 39
41 42
110 25
52 38
91 ...

output:

6
129 73
1 48
1 49
2 3
3 124
3 125
4 5
5 66
5 67
6 7
7 116
7 117
8 9
9 128
9 129
10 11
11 74
11 75
12 13
14 15
15 122
15 123
16 17
17 62
17 63
18 19
19 106
19 107
19 120
19 121
20 21
22 23
23 68
23 69
23 70
23 71
24 25
25 110
25 111
26 27
28 44
29 30
29 60
29 61
29 82
29 83
29 94
29 95
31 32
31 72
3...

input:

6
129 73
1 48
1 49
2 3
3 124
3 125
4 5
5 66
5 67
6 7
7 116
7 117
8 9
9 128
9 129
10 11
11 74
11 75
12 13
14 15
15 122
15 123
16 17
17 62
17 63
18 19
19 106
19 107
19 120
19 121
20 21
22 23
23 68
23 69
23 70
23 71
24 25
25 110
25 111
26 27
28 44
29 30
29 60
29 61
29 82
29 83
29 94
29 95
31 32
31 72
3...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
5559540

Test #20:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1776kb,1916kb

input:

5
9424319

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
129
78 25
38 39
81 12
36 37
39 40
126 5
79 25
102 25
128 3
37 38
89 3
68 2
7 8
3 4
67 16
41 42
23 24
66 16
62 6
15 16
87 39
119 14
12 13
80 12
117 38
24 25
86 39
110 24
...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
129
78 25
38 39
81 12
36 37
39 40
126 5
79 25
102 25
128 3
37 38
89 3
68 2
7 8
3 4
67 16
41 42
23 24
66 16
62 6
15 16
87 39
119 14
12 13
80 12
117 38
24 25
86 39
110 24
...

output:

6
129 69
1 72
1 73
2 3
3 58
3 59
3 88
3 89
3 128
3 129
4 5
5 126
5 127
6 7
8 9
9 76
9 77
10 44
11 12
13 14
13 82
13 83
15 16
17 18
19 20
19 92
19 93
19 104
19 105
21 22
23 24
23 56
23 57
23 112
23 113
25 26
25 78
25 79
25 98
25 99
25 102
25 103
25 124
25 125
27 28
27 50
27 51
29 30
31 32
31 90
31 91...

input:

6
129 69
1 72
1 73
2 3
3 58
3 59
3 88
3 89
3 128
3 129
4 5
5 126
5 127
6 7
8 9
9 76
9 77
10 44
11 12
13 14
13 82
13 83
15 16
17 18
19 20
19 92
19 93
19 104
19 105
21 22
23 24
23 56
23 57
23 112
23 113
25 26
25 78
25 79
25 98
25 99
25 102
25 103
25 124
25 125
27 28
27 50
27 51
29 30
31 32
31 90
31 91...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
9424319

Test #21:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1772kb,1924kb

input:

5
10955780

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
129
94 21
19 20
1 2
9 10
15 16
87 26
119 39
30 31
34 35
86 26
127 40
117 18
92 30
51 4
7 8
112 29
58 13
65 31
70 27
69 19
16 17
85 30
96 7
101 4
60 4
115 37
89 38
116 18...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
129
94 21
19 20
1 2
9 10
15 16
87 26
119 39
30 31
34 35
86 26
127 40
117 18
92 30
51 4
7 8
112 29
58 13
65 31
70 27
69 19
16 17
85 30
96 7
101 4
60 4
115 37
89 38
116 18...

output:

6
129 67
2 3
2 128
2 129
4 5
4 50
4 51
4 60
4 61
4 100
4 101
4 104
4 105
6 7
8 9
10 11
12 13
12 122
12 123
14 15
16 17
18 19
18 116
18 117
20 21
22 23
24 25
24 108
24 109
24 120
24 121
26 27
26 44
26 45
26 86
26 87
28 29
28 90
28 91
28 124
28 125
30 31
30 84
30 85
30 92
30 93
32 33
34 35
36 37
36 48...

input:

6
129 67
2 3
2 128
2 129
4 5
4 50
4 51
4 60
4 61
4 100
4 101
4 104
4 105
6 7
8 9
10 11
12 13
12 122
12 123
14 15
16 17
18 19
18 116
18 117
20 21
22 23
24 25
24 108
24 109
24 120
24 121
26 27
26 44
26 45
26 86
26 87
28 29
28 90
28 91
28 124
28 125
30 31
30 84
30 85
30 92
30 93
32 33
34 35
36 37
36 48...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
10955780

Test #22:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1772kb,1924kb

input:

7
19938721

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
129
29 30
2 3
36 37
3 4
112 13
65 35
118 28
93 10
81 24
52 17
20 21
66 22
60 19
63 11
113 13
5 6
24 25
116 10
102 41
97 4
45 9
54 16
99 43
91 42
114 33
30 31
27 28
12 13...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
129
29 30
2 3
36 37
3 4
112 13
65 35
118 28
93 10
81 24
52 17
20 21
66 22
60 19
63 11
113 13
5 6
24 25
116 10
102 41
97 4
45 9
54 16
99 43
91 42
114 33
30 31
27 28
12 13...

output:

8
129 65
2 50
2 51
2 104
2 105
4 96
4 97
5 122
8 94
8 95
9 45
11 62
11 63
11 72
11 73
12 74
12 75
12 76
12 77
13 112
13 113
16 54
16 55
17 52
17 53
17 78
17 79
18 46
18 47
18 56
18 57
19 60
19 61
21 82
21 83
21 86
21 87
22 66
22 67
22 108
22 109
23 68
23 69
24 80
26 126
26 127
28 118
28 119
29 48
29...

input:

8
129 65
2 50
2 51
2 104
2 105
4 96
4 97
5 122
8 94
8 95
9 45
11 62
11 63
11 72
11 73
12 74
12 75
12 76
12 77
13 112
13 113
16 54
16 55
17 52
17 53
17 78
17 79
18 46
18 47
18 56
18 57
19 60
19 61
21 82
21 83
21 86
21 87
22 66
22 67
22 108
22 109
23 68
23 69
24 80
26 126
26 127
28 118
28 119
29 48
29...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
19938721

Test #23:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1772kb,1920kb

input:

7
5129508

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
129
123 2
110 17
118 37
83 26
111 17
100 13
25 26
79 28
89 27
5 6
41 42
76 14
22 23
40 41
125 28
115 16
109 10
3 4
55 9
57 3
34 35
98 27
15 16
39 40
65 37
101 13
21 22
5...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
129
123 2
110 17
118 37
83 26
111 17
100 13
25 26
79 28
89 27
5 6
41 42
76 14
22 23
40 41
125 28
115 16
109 10
3 4
55 9
57 3
34 35
98 27
15 16
39 40
65 37
101 13
21 22
5...

output:

8
129 65
3 56
3 57
3 86
3 87
5 46
5 47
6 51
8 84
8 85
9 54
9 55
9 104
9 105
10 108
10 109
10 112
10 113
11 120
11 121
12 72
12 73
13 101
14 76
14 77
16 66
16 67
16 114
16 115
17 74
17 75
17 110
17 111
19 60
19 61
19 94
19 95
22 80
22 81
25 96
25 97
26 48
26 49
26 82
26 83
28 78
28 79
28 124
28 125
2...

input:

8
129 65
3 56
3 57
3 86
3 87
5 46
5 47
6 51
8 84
8 85
9 54
9 55
9 104
9 105
10 108
10 109
10 112
10 113
11 120
11 121
12 72
12 73
13 101
14 76
14 77
16 66
16 67
16 114
16 115
17 74
17 75
17 110
17 111
19 60
19 61
19 94
19 95
22 80
22 81
25 96
25 97
26 48
26 49
26 82
26 83
28 78
28 79
28 124
28 125
2...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
5129508

Test #24:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1776kb,1916kb

input:

7
15332941

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
129
24 25
77 34
10 11
71 21
90 24
50 15
28 29
78 43
94 39
88 15
73 35
114 2
62 12
70 21
93 14
106 5
129 41
20 21
41 42
26 27
107 5
36 37
64 30
112 4
9 10
57 24
103 27
12...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
129
24 25
77 34
10 11
71 21
90 24
50 15
28 29
78 43
94 39
88 15
73 35
114 2
62 12
70 21
93 14
106 5
129 41
20 21
41 42
26 27
107 5
36 37
64 30
112 4
9 10
57 24
103 27
12...

output:

8
129 65
2 126
4 108
4 109
4 112
4 113
5 80
5 81
5 106
5 107
8 120
8 121
12 62
12 63
13 110
13 111
14 92
14 93
15 50
15 51
15 88
15 89
21 70
21 71
22 66
22 67
24 56
24 57
24 90
24 91
25 100
25 101
27 102
27 103
29 86
29 87
30 64
30 65
30 98
30 99
31 48
31 49
32 84
32 85
34 76
34 77
34 96
34 97
35 72...

input:

8
129 65
2 126
4 108
4 109
4 112
4 113
5 80
5 81
5 106
5 107
8 120
8 121
12 62
12 63
13 110
13 111
14 92
14 93
15 50
15 51
15 88
15 89
21 70
21 71
22 66
22 67
24 56
24 57
24 90
24 91
25 100
25 101
27 102
27 103
29 86
29 87
30 64
30 65
30 98
30 99
31 48
31 49
32 84
32 85
34 76
34 77
34 96
34 97
35 72...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
15332941

Subtask #3:

score: 65
Accepted

Test #25:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1768kb,1920kb

input:

1
355365355024496523

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
129
91 20
57 20
44 19
73 23
114 7
29 30
13 14
7 8
110 7
40 41
99 32
6 7
32 33
8 9
16 17
14 15
104 9
75 32
106 16
28 29
78 1
12 13
70 22
20 21
126 29
33 34
100 3
109 34
6...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
129
91 20
57 20
44 19
73 23
114 7
29 30
13 14
7 8
110 7
40 41
99 32
6 7
32 33
8 9
16 17
14 15
104 9
75 32
106 16
28 29
78 1
12 13
70 22
20 21
126 29
33 34
100 3
109 34
6...

output:

2
129 128
1 2
1 78
1 79
2 3
2 68
2 69
3 4
3 52
3 53
3 100
3 101
4 5
4 54
4 55
4 128
4 129
5 6
6 7
6 88
6 89
6 116
6 117
7 8
7 50
7 51
7 110
7 111
7 114
7 115
8 9
9 10
9 104
9 105
10 11
10 102
10 103
10 124
10 125
11 12
11 120
11 121
12 13
13 14
14 15
15 16
16 17
16 76
16 77
16 106
16 107
17 18
18 19...

input:

2
129 128
1 2
1 78
1 79
2 3
2 68
2 69
3 4
3 52
3 53
3 100
3 101
4 5
4 54
4 55
4 128
4 129
5 6
6 7
6 88
6 89
6 116
6 117
7 8
7 50
7 51
7 110
7 111
7 114
7 115
8 9
9 10
9 104
9 105
10 11
10 102
10 103
10 124
10 125
11 12
11 120
11 121
12 13
13 14
14 15
15 16
16 17
16 76
16 77
16 106
16 107
17 18
18 19...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
355365355024496523

Test #26:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1772kb,1924kb

input:

1
727827999106414164

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
129
81 8
101 10
94 23
127 43
65 25
97 5
38 39
26 27
8 9
105 43
11 12
41 42
84 5
108 20
77 7
68 40
106 22
121 39
17 18
63 33
20 21
93 28
56 39
80 8
54 15
31 32
73 8
88 33...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
129
81 8
101 10
94 23
127 43
65 25
97 5
38 39
26 27
8 9
105 43
11 12
41 42
84 5
108 20
77 7
68 40
106 22
121 39
17 18
63 33
20 21
93 28
56 39
80 8
54 15
31 32
73 8
88 33...

output:

2
129 128
1 2
2 3
3 4
4 5
4 60
4 61
5 6
5 84
5 85
5 96
5 97
6 7
7 8
7 76
7 77
7 114
7 115
8 9
8 72
8 73
8 80
8 81
9 10
10 11
10 100
10 101
10 102
10 103
10 116
10 117
11 12
11 66
11 67
11 82
11 83
12 13
12 48
12 49
13 14
14 15
14 110
14 111
15 16
15 54
15 55
16 17
17 18
17 86
17 87
18 19
19 20
19 11...

input:

2
129 128
1 2
2 3
3 4
4 5
4 60
4 61
5 6
5 84
5 85
5 96
5 97
6 7
7 8
7 76
7 77
7 114
7 115
8 9
8 72
8 73
8 80
8 81
9 10
10 11
10 100
10 101
10 102
10 103
10 116
10 117
11 12
11 66
11 67
11 82
11 83
12 13
12 48
12 49
13 14
14 15
14 110
14 111
15 16
15 54
15 55
16 17
17 18
17 86
17 87
18 19
19 20
19 11...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
727827999106414164

Test #27:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1772kb,1920kb

input:

1
656410143989222955

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
129
10 11
59 36
37 38
55 14
49 1
108 40
32 33
58 36
81 6
103 27
70 10
97 21
126 14
2 3
17 18
30 31
20 21
94 31
106 14
123 31
87 11
42 43
38 39
118 25
33 34
124 40
51 11
...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
129
10 11
59 36
37 38
55 14
49 1
108 40
32 33
58 36
81 6
103 27
70 10
97 21
126 14
2 3
17 18
30 31
20 21
94 31
106 14
123 31
87 11
42 43
38 39
118 25
33 34
124 40
51 11
...

output:

2
129 128
1 2
1 48
1 49
1 120
1 121
2 3
3 4
4 5
4 110
4 111
5 6
6 7
6 56
6 57
6 72
6 73
6 80
6 81
7 8
7 114
7 115
8 9
8 60
8 61
9 10
10 11
10 64
10 65
10 70
10 71
11 12
11 50
11 51
11 76
11 77
11 86
11 87
11 90
11 91
11 104
11 105
12 13
13 14
13 78
13 79
14 15
14 54
14 55
14 106
14 107
14 126
14 127...

input:

2
129 128
1 2
1 48
1 49
1 120
1 121
2 3
3 4
4 5
4 110
4 111
5 6
6 7
6 56
6 57
6 72
6 73
6 80
6 81
7 8
7 114
7 115
8 9
8 60
8 61
9 10
10 11
10 64
10 65
10 70
10 71
11 12
11 50
11 51
11 76
11 77
11 86
11 87
11 90
11 91
11 104
11 105
12 13
13 14
13 78
13 79
14 15
14 54
14 55
14 106
14 107
14 126
14 127...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
656410143989222955

Test #28:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1776kb,1924kb

input:

1
410366615149657534

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
129
5 6
29 30
26 27
63 9
42 43
70 42
58 11
113 20
86 22
118 28
64 42
65 42
96 23
87 22
124 23
106 8
38 39
121 3
79 26
120 3
69 31
39 40
50 23
119 28
41 42
57 6
24 25
15 ...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
129
5 6
29 30
26 27
63 9
42 43
70 42
58 11
113 20
86 22
118 28
64 42
65 42
96 23
87 22
124 23
106 8
38 39
121 3
79 26
120 3
69 31
39 40
50 23
119 28
41 42
57 6
24 25
15 ...

output:

2
129 128
1 2
2 3
3 4
3 120
3 121
4 5
4 90
4 91
5 6
6 7
6 56
6 57
7 8
8 9
8 106
8 107
9 10
9 62
9 63
10 11
10 76
10 77
10 126
10 127
11 12
11 58
11 59
11 108
11 109
12 13
12 88
12 89
13 14
14 15
15 16
16 17
16 60
16 61
16 80
16 81
16 116
16 117
17 18
18 19
18 114
18 115
19 20
20 21
20 112
20 113
21 ...

input:

2
129 128
1 2
2 3
3 4
3 120
3 121
4 5
4 90
4 91
5 6
6 7
6 56
6 57
7 8
8 9
8 106
8 107
9 10
9 62
9 63
10 11
10 76
10 77
10 126
10 127
11 12
11 58
11 59
11 108
11 109
12 13
12 88
12 89
13 14
14 15
15 16
16 17
16 60
16 61
16 80
16 81
16 116
16 117
17 18
18 19
18 114
18 115
19 20
20 21
20 112
20 113
21 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
410366615149657534

Test #29:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1772kb,1924kb

input:

1
298090682780948428

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
129
45 21
15 16
101 39
49 30
28 29
18 19
20 21
86 32
54 35
48 30
75 33
10 11
92 9
59 16
114 26
76 30
105 12
36 37
106 34
21 22
42 43
35 36
47 24
121 14
16 17
109 10
78 1...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
129
45 21
15 16
101 39
49 30
28 29
18 19
20 21
86 32
54 35
48 30
75 33
10 11
92 9
59 16
114 26
76 30
105 12
36 37
106 34
21 22
42 43
35 36
47 24
121 14
16 17
109 10
78 1...

output:

2
129 128
1 2
1 112
1 113
1 116
1 117
2 3
3 4
4 5
5 6
5 126
5 127
6 7
6 64
6 65
7 8
8 9
9 10
9 52
9 53
9 92
9 93
9 128
9 129
10 11
10 66
10 67
10 108
10 109
10 122
10 123
11 12
12 13
12 88
12 89
12 98
12 99
12 104
12 105
13 14
14 15
14 120
14 121
15 16
15 78
15 79
16 17
16 58
16 59
17 18
18 19
18 84...

input:

2
129 128
1 2
1 112
1 113
1 116
1 117
2 3
3 4
4 5
5 6
5 126
5 127
6 7
6 64
6 65
7 8
8 9
9 10
9 52
9 53
9 92
9 93
9 128
9 129
10 11
10 66
10 67
10 108
10 109
10 122
10 123
11 12
12 13
12 88
12 89
12 98
12 99
12 104
12 105
13 14
14 15
14 120
14 121
15 16
15 78
15 79
16 17
16 58
16 59
17 18
18 19
18 84...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
298090682780948428

Test #30:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1776kb,1916kb

input:

3
969441916331132577

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
129
57 37
39 40
81 15
23 24
29 30
17 18
114 26
92 39
124 30
75 8
50 39
62 23
74 8
36 37
106 39
127 14
19 20
86 10
20 21
115 26
82 10
109 38
3 4
69 8
118 28
126 14
85 11
...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
129
57 37
39 40
81 15
23 24
29 30
17 18
114 26
92 39
124 30
75 8
50 39
62 23
74 8
36 37
106 39
127 14
19 20
86 10
20 21
115 26
82 10
109 38
3 4
69 8
118 28
126 14
85 11
...

output:

4
129 65
1 2
2 3
3 4
3 90
3 91
4 5
5 6
6 7
6 98
6 99
12 13
15 16
15 80
15 81
16 17
17 18
18 19
18 66
18 67
19 20
20 21
21 22
24 110
24 111
26 27
26 114
26 115
27 28
28 118
28 119
30 124
30 125
32 33
32 72
32 73
33 104
33 105
36 37
37 38
37 52
37 53
37 57
38 39
38 100
38 101
38 108
38 109
39 40
39 50...

input:

4
129 65
1 2
2 3
3 4
3 90
3 91
4 5
5 6
6 7
6 98
6 99
12 13
15 16
15 80
15 81
16 17
17 18
18 19
18 66
18 67
19 20
20 21
21 22
24 110
24 111
26 27
26 114
26 115
27 28
28 118
28 119
30 124
30 125
32 33
32 72
32 73
33 104
33 105
36 37
37 38
37 52
37 53
37 57
38 39
38 100
38 101
38 108
38 109
39 40
39 50...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
969441916331132577

Test #31:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1768kb,1924kb

input:

3
929489812741933634

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
129
78 4
118 29
124 21
74 35
24 25
126 26
55 17
41 42
73 32
60 3
26 27
27 28
71 17
114 19
29 30
90 25
65 23
20 21
62 43
52 12
91 25
14 15
86 24
5 6
104 43
75 35
31 32
11...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
129
78 4
118 29
124 21
74 35
24 25
126 26
55 17
41 42
73 32
60 3
26 27
27 28
71 17
114 19
29 30
90 25
65 23
20 21
62 43
52 12
91 25
14 15
86 24
5 6
104 43
75 35
31 32
11...

output:

4
129 65
1 2
7 8
7 101
8 9
8 94
8 95
9 10
9 68
9 69
10 11
10 110
10 111
11 12
12 13
12 52
12 53
12 96
12 97
12 116
12 117
12 122
12 123
14 15
15 16
16 56
16 57
18 19
19 20
19 114
19 115
20 21
21 22
21 124
21 125
22 48
22 49
24 25
24 86
24 87
25 90
25 91
27 28
30 31
30 67
31 32
32 33
32 72
32 73
33 3...

input:

4
129 65
1 2
7 8
7 101
8 9
8 94
8 95
9 10
9 68
9 69
10 11
10 110
10 111
11 12
12 13
12 52
12 53
12 96
12 97
12 116
12 117
12 122
12 123
14 15
15 16
16 56
16 57
18 19
19 20
19 114
19 115
20 21
21 22
21 124
21 125
22 48
22 49
24 25
24 86
24 87
25 90
25 91
27 28
30 31
30 67
31 32
32 33
32 72
32 73
33 3...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
929489812741933634

Test #32:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1772kb,1920kb

input:

3
144032041325838295

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
129
7 8
102 7
52 14
15 16
8 9
86 16
51 9
124 35
32 33
12 13
120 3
91 21
87 16
46 2
76 8
97 5
94 38
30 31
77 8
118 26
92 19
103 7
98 43
1 2
59 14
96 5
93 19
129 3
37 38
6...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
129
7 8
102 7
52 14
15 16
8 9
86 16
51 9
124 35
32 33
12 13
120 3
91 21
87 16
46 2
76 8
97 5
94 38
30 31
77 8
118 26
92 19
103 7
98 43
1 2
59 14
96 5
93 19
129 3
37 38
6...

output:

4
129 65
2 47
7 8
8 9
8 76
8 77
8 78
8 79
8 104
8 105
9 10
9 50
9 51
10 11
10 66
10 67
11 12
12 13
12 80
12 81
15 16
16 17
16 86
16 87
17 18
20 21
21 22
21 90
21 91
22 23
22 70
22 71
23 24
24 25
25 82
25 83
27 28
27 84
27 85
28 29
29 30
29 74
29 75
30 54
30 55
32 33
32 64
32 65
36 37
36 48
36 49
37 ...

input:

4
129 65
2 47
7 8
8 9
8 76
8 77
8 78
8 79
8 104
8 105
9 10
9 50
9 51
10 11
10 66
10 67
11 12
12 13
12 80
12 81
15 16
16 17
16 86
16 87
17 18
20 21
21 22
21 90
21 91
22 23
22 70
22 71
23 24
24 25
25 82
25 83
27 28
27 84
27 85
28 29
29 30
29 74
29 75
30 54
30 55
32 33
32 64
32 65
36 37
36 48
36 49
37 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
144032041325838295

Test #33:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1768kb,1920kb

input:

3
832110946250826180

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
129
97 43
9 10
85 29
106 19
129 7
88 42
105 41
30 31
38 39
101 12
40 41
75 2
95 5
6 7
98 33
87 23
94 5
14 15
28 29
74 2
110 6
81 34
24 25
103 14
10 11
12 13
18 19
49 41
...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
129
97 43
9 10
85 29
106 19
129 7
88 42
105 41
30 31
38 39
101 12
40 41
75 2
95 5
6 7
98 33
87 23
94 5
14 15
28 29
74 2
110 6
81 34
24 25
103 14
10 11
12 13
18 19
49 41
...

output:

4
129 65
1 2
1 56
1 57
2 3
2 74
2 75
3 4
3 114
3 115
4 5
5 6
5 94
5 95
6 110
6 111
10 11
11 12
13 44
13 45
15 16
16 17
19 20
19 106
19 107
20 21
21 22
22 23
22 68
22 69
23 24
23 86
23 87
26 27
26 52
26 53
27 28
28 29
28 54
28 55
28 66
28 67
28 72
28 73
28 108
28 109
28 121
32 33
33 98
33 99
35 36
36...

input:

4
129 65
1 2
1 56
1 57
2 3
2 74
2 75
3 4
3 114
3 115
4 5
5 6
5 94
5 95
6 110
6 111
10 11
11 12
13 44
13 45
15 16
16 17
19 20
19 106
19 107
20 21
21 22
22 23
22 68
22 69
23 24
23 86
23 87
26 27
26 52
26 53
27 28
28 29
28 54
28 55
28 66
28 67
28 72
28 73
28 108
28 109
28 121
32 33
33 98
33 99
35 36
36...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
832110946250826180

Test #34:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1772kb,1924kb

input:

3
85728715707691821

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
129
96 16
42 43
46 4
64 28
111 21
19 20
86 16
10 11
117 2
69 40
102 35
49 10
58 27
17 18
106 20
118 26
22 23
68 40
115 27
16 17
66 37
59 27
92 41
18 19
6 7
62 32
81 36
5...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
129
96 16
42 43
46 4
64 28
111 21
19 20
86 16
10 11
117 2
69 40
102 35
49 10
58 27
17 18
106 20
118 26
22 23
68 40
115 27
16 17
66 37
59 27
92 41
18 19
6 7
62 32
81 36
5...

output:

4
129 65
1 2
2 3
2 116
2 117
3 72
3 73
5 6
6 7
7 8
8 9
8 70
8 71
12 56
12 57
14 15
14 124
14 125
17 18
17 128
17 129
18 19
19 20
20 21
20 106
20 107
21 22
21 110
21 111
22 23
23 24
24 25
25 94
25 95
26 27
27 28
27 58
27 59
27 78
27 79
27 112
27 113
27 114
27 115
30 31
30 60
30 61
30 99
31 32
32 62
3...

input:

4
129 65
1 2
2 3
2 116
2 117
3 72
3 73
5 6
6 7
7 8
8 9
8 70
8 71
12 56
12 57
14 15
14 124
14 125
17 18
17 128
17 129
18 19
19 20
20 21
20 106
20 107
21 22
21 110
21 111
22 23
23 24
24 25
25 94
25 95
26 27
27 28
27 58
27 59
27 78
27 79
27 112
27 113
27 114
27 115
30 31
30 60
30 61
30 99
31 32
32 62
3...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
85728715707691821

Test #35:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1772kb,1920kb

input:

5
777434612360931036

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
129
18 19
63 7
36 37
19 20
45 28
24 25
52 30
17 18
46 31
62 7
40 41
53 30
87 32
30 31
3 4
101 4
16 17
88 18
129 29
82 28
58 10
44 28
41 42
120 41
9 10
47 31
64 34
99 26
...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
129
18 19
63 7
36 37
19 20
45 28
24 25
52 30
17 18
46 31
62 7
40 41
53 30
87 32
30 31
3 4
101 4
16 17
88 18
129 29
82 28
58 10
44 28
41 42
120 41
9 10
47 31
64 34
99 26
...

output:

6
129 65
2 3
4 5
4 100
4 101
6 7
6 68
6 69
6 110
6 111
6 114
6 115
8 9
10 11
10 58
10 59
10 72
10 73
12 13
12 60
12 61
14 15
14 76
14 77
16 17
16 66
16 67
18 19
18 88
18 89
20 21
20 96
20 97
22 23
22 48
22 49
22 78
22 79
24 25
26 27
26 98
26 99
28 29
28 44
28 45
28 82
28 83
28 108
28 109
30 31
30 52...

input:

6
129 65
2 3
4 5
4 100
4 101
6 7
6 68
6 69
6 110
6 111
6 114
6 115
8 9
10 11
10 58
10 59
10 72
10 73
12 13
12 60
12 61
14 15
14 76
14 77
16 17
16 66
16 67
18 19
18 88
18 89
20 21
20 96
20 97
22 23
22 48
22 49
22 78
22 79
24 25
26 27
26 98
26 99
28 29
28 44
28 45
28 82
28 83
28 108
28 109
30 31
30 52...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
777434612360931036

Test #36:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1772kb,1916kb

input:

5
705262511549880222

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
129
34 35
87 19
45 29
56 8
52 7
97 7
114 24
46 33
120 12
76 3
95 29
98 15
26 27
25 26
110 37
2 3
85 5
4 5
35 36
10 11
88 15
12 13
3 4
90 12
93 28
70 24
23 24
69 36
115 2...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
129
34 35
87 19
45 29
56 8
52 7
97 7
114 24
46 33
120 12
76 3
95 29
98 15
26 27
25 26
110 37
2 3
85 5
4 5
35 36
10 11
88 15
12 13
3 4
90 12
93 28
70 24
23 24
69 36
115 2...

output:

6
129 69
1 2
3 4
3 76
3 77
5 6
5 84
5 85
5 108
5 109
7 8
7 52
7 53
7 72
7 73
7 96
7 97
9 10
11 12
11 78
11 79
11 124
11 125
13 14
15 16
15 88
15 89
15 98
15 99
17 18
19 20
19 86
19 87
21 22
23 24
25 26
27 28
27 48
27 49
27 128
27 129
29 30
29 44
29 45
29 94
29 95
31 32
31 60
31 61
31 82
31 83
31 106...

input:

6
129 69
1 2
3 4
3 76
3 77
5 6
5 84
5 85
5 108
5 109
7 8
7 52
7 53
7 72
7 73
7 96
7 97
9 10
11 12
11 78
11 79
11 124
11 125
13 14
15 16
15 88
15 89
15 98
15 99
17 18
19 20
19 86
19 87
21 22
23 24
25 26
27 28
27 48
27 49
27 128
27 129
29 30
29 44
29 45
29 94
29 95
31 32
31 60
31 61
31 82
31 83
31 106...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
705262511549880222

Test #37:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1772kb,1920kb

input:

5
510318082834167951

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
129
1 2
112 29
41 42
121 30
107 4
50 16
68 17
34 35
13 14
17 18
60 41
104 36
118 43
67 43
113 29
105 36
98 39
99 39
19 20
55 36
40 41
108 23
54 36
78 23
31 32
63 18
119 ...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
129
1 2
112 29
41 42
121 30
107 4
50 16
68 17
34 35
13 14
17 18
60 41
104 36
118 43
67 43
113 29
105 36
98 39
99 39
19 20
55 36
40 41
108 23
54 36
78 23
31 32
63 18
119 ...

output:

6
129 72
1 2
2 52
2 53
3 4
4 56
4 57
4 64
4 65
4 106
4 107
5 6
7 8
9 10
11 12
12 88
12 89
12 96
12 97
13 14
15 16
16 46
16 47
16 50
16 51
17 18
18 62
18 63
18 100
18 101
19 20
20 72
20 73
20 102
20 103
20 126
20 127
21 22
23 24
25 26
26 82
26 83
26 124
26 125
27 28
28 70
28 71
29 30
30 76
30 77
30 1...

input:

6
129 72
1 2
2 52
2 53
3 4
4 56
4 57
4 64
4 65
4 106
4 107
5 6
7 8
9 10
11 12
12 88
12 89
12 96
12 97
13 14
15 16
16 46
16 47
16 50
16 51
17 18
18 62
18 63
18 100
18 101
19 20
20 72
20 73
20 102
20 103
20 126
20 127
21 22
23 24
25 26
26 82
26 83
26 124
26 125
27 28
28 70
28 71
29 30
30 76
30 77
30 1...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
510318082834167951

Test #38:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1772kb,1916kb

input:

5
914858813253258744

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
129
101 9
70 5
67 18
68 9
34 35
92 43
110 26
3 4
4 5
72 11
30 31
20 21
87 32
126 43
29 30
86 32
10 11
6 7
18 19
45 24
42 43
53 23
123 9
1 2
88 42
49 41
121 40
95 36
108 ...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
129
101 9
70 5
67 18
68 9
34 35
92 43
110 26
3 4
4 5
72 11
30 31
20 21
87 32
126 43
29 30
86 32
10 11
6 7
18 19
45 24
42 43
53 23
123 9
1 2
88 42
49 41
121 40
95 36
108 ...

output:

6
129 65
1 2
3 4
4 98
4 99
5 6
7 8
9 10
10 74
10 75
11 12
12 60
12 61
12 76
12 77
13 14
14 84
14 85
15 16
17 18
18 62
18 63
18 66
18 67
18 78
18 79
18 114
18 115
19 20
21 22
22 46
22 47
22 112
22 113
23 24
24 25
24 45
26 27
26 110
26 111
26 128
26 129
28 29
30 31
32 33
32 86
32 87
34 35
34 64
34 65
...

input:

6
129 65
1 2
3 4
4 98
4 99
5 6
7 8
9 10
10 74
10 75
11 12
12 60
12 61
12 76
12 77
13 14
14 84
14 85
15 16
17 18
18 62
18 63
18 66
18 67
18 78
18 79
18 114
18 115
19 20
21 22
22 46
22 47
22 112
22 113
23 24
24 25
24 45
26 27
26 110
26 111
26 128
26 129
28 29
30 31
32 33
32 86
32 87
34 35
34 64
34 65
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
914858813253258744

Test #39:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1772kb,1920kb

input:

5
659635316746638238

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
129
45 26
22 23
65 21
46 31
88 23
20 21
94 18
109 33
124 10
64 21
23 24
77 40
62 26
89 23
79 25
129 7
53 2
116 16
84 29
70 1
69 27
63 26
82 35
51 34
123 27
91 23
44 26
3...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
129
45 26
22 23
65 21
46 31
88 23
20 21
94 18
109 33
124 10
64 21
23 24
77 40
62 26
89 23
79 25
129 7
53 2
116 16
84 29
70 1
69 27
63 26
82 35
51 34
123 27
91 23
44 26
3...

output:

6
129 65
1 70
1 71
2 3
3 114
3 115
4 5
5 106
5 107
6 7
7 128
7 129
8 9
9 80
9 81
10 11
12 13
13 58
13 59
14 15
16 17
17 56
17 57
18 19
20 21
21 64
21 65
21 86
21 87
22 23
23 88
23 89
23 90
23 91
24 25
25 60
25 61
25 78
25 79
26 27
27 68
27 69
27 122
27 123
28 29
29 84
29 85
30 31
31 46
31 47
32 33
3...

input:

6
129 65
1 70
1 71
2 3
3 114
3 115
4 5
5 106
5 107
6 7
7 128
7 129
8 9
9 80
9 81
10 11
12 13
13 58
13 59
14 15
16 17
17 56
17 57
18 19
20 21
21 64
21 65
21 86
21 87
22 23
23 88
23 89
23 90
23 91
24 25
25 60
25 61
25 78
25 79
26 27
27 68
27 69
27 122
27 123
28 29
29 84
29 85
30 31
31 46
31 47
32 33
3...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
659635316746638238

Test #40:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1776kb,1920kb

input:

7
858490260563149759

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
129
129 40
102 34
41 42
105 28
125 10
89 21
65 33
18 19
38 39
8 9
50 20
9 10
73 26
109 43
78 14
115 23
36 37
29 30
82 14
33 34
91 16
40 41
90 16
34 35
127 25
52 8
106 38...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
129
129 40
102 34
41 42
105 28
125 10
89 21
65 33
18 19
38 39
8 9
50 20
9 10
73 26
109 43
78 14
115 23
36 37
29 30
82 14
33 34
91 16
40 41
90 16
34 35
127 25
52 8
106 38...

output:

8
129 65
4 96
4 97
7 98
7 99
7 120
7 121
9 46
9 47
10 100
10 101
10 124
10 125
11 60
11 61
14 78
14 79
14 82
14 83
15 94
15 95
16 90
16 91
17 70
17 71
19 48
19 49
19 80
19 81
20 50
20 51
21 88
21 89
22 44
22 45
22 74
22 75
23 58
23 59
23 114
23 115
25 62
25 63
25 126
25 127
26 66
26 67
26 72
26 73
2...

input:

8
129 65
4 96
4 97
7 98
7 99
7 120
7 121
9 46
9 47
10 100
10 101
10 124
10 125
11 60
11 61
14 78
14 79
14 82
14 83
15 94
15 95
16 90
16 91
17 70
17 71
19 48
19 49
19 80
19 81
20 50
20 51
21 88
21 89
22 44
22 45
22 74
22 75
23 58
23 59
23 114
23 115
25 62
25 63
25 126
25 127
26 66
26 67
26 72
26 73
2...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
858490260563149759

Test #41:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1768kb,1924kb

input:

7
860058643727731209

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
129
73 30
92 16
94 1
61 40
10 11
118 8
49 1
70 38
105 16
125 7
31 32
87 11
41 42
42 43
128 26
75 35
4 5
84 8
126 42
34 35
23 24
53 13
35 36
8 9
91 7
62 18
88 1
76 30
123...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
129
73 30
92 16
94 1
61 40
10 11
118 8
49 1
70 38
105 16
125 7
31 32
87 11
41 42
42 43
128 26
75 35
4 5
84 8
126 42
34 35
23 24
53 13
35 36
8 9
91 7
62 18
88 1
76 30
123...

output:

8
129 65
4 66
6 83
7 90
7 91
7 124
7 125
8 84
8 85
8 100
8 101
8 118
8 119
11 58
11 59
11 78
11 79
11 86
11 87
13 52
13 53
13 64
13 65
13 116
13 117
16 92
16 93
16 104
16 105
18 62
18 63
18 108
18 109
26 120
26 121
26 128
26 129
30 50
30 51
30 72
30 73
30 76
30 77
35 74
35 75
35 112
35 113
37 54
37 ...

input:

8
129 65
4 66
6 83
7 90
7 91
7 124
7 125
8 84
8 85
8 100
8 101
8 118
8 119
11 58
11 59
11 78
11 79
11 86
11 87
13 52
13 53
13 64
13 65
13 116
13 117
16 92
16 93
16 104
16 105
18 62
18 63
18 108
18 109
26 120
26 121
26 128
26 129
30 50
30 51
30 72
30 73
30 76
30 77
35 74
35 75
35 112
35 113
37 54
37 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
860058643727731209

Test #42:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1772kb,1920kb

input:

7
718861404514377808

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
129
48 2
67 16
26 27
124 34
120 42
21 22
100 2
36 37
77 42
12 13
54 41
19 20
113 10
122 39
126 22
8 9
116 41
49 2
119 2
74 26
23 24
35 36
121 42
63 27
44 21
27 28
73 25
...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
129
48 2
67 16
26 27
124 34
120 42
21 22
100 2
36 37
77 42
12 13
54 41
19 20
113 10
122 39
126 22
8 9
116 41
49 2
119 2
74 26
23 24
35 36
121 42
63 27
44 21
27 28
73 25
...

output:

8
129 65
5 58
5 59
5 90
5 91
7 108
7 109
8 68
8 69
10 106
10 107
10 112
10 113
13 110
13 111
16 66
16 67
17 114
17 115
18 52
18 53
19 70
19 71
19 82
19 83
21 44
21 64
21 96
22 126
22 127
24 94
24 95
25 72
25 73
26 74
26 75
26 128
26 129
27 50
27 51
27 62
27 63
29 78
29 79
29 92
29 93
30 80
30 81
33 ...

input:

8
129 65
5 58
5 59
5 90
5 91
7 108
7 109
8 68
8 69
10 106
10 107
10 112
10 113
13 110
13 111
16 66
16 67
17 114
17 115
18 52
18 53
19 70
19 71
19 82
19 83
21 44
21 64
21 96
22 126
22 127
24 94
24 95
25 72
25 73
26 74
26 75
26 128
26 129
27 50
27 51
27 62
27 63
29 78
29 79
29 92
29 93
30 80
30 81
33 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
718861404514377808

Test #43:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1772kb,1920kb

input:

7
659192688464047828

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
129
46 30
102 17
5 6
10 11
35 36
70 27
113 43
75 3
80 10
92 15
29 30
68 20
128 26
26 27
84 17
87 33
86 33
33 34
7 8
88 18
82 43
36 37
13 14
106 41
9 10
77 11
23 24
127 1...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
129
46 30
102 17
5 6
10 11
35 36
70 27
113 43
75 3
80 10
92 15
29 30
68 20
128 26
26 27
84 17
87 33
86 33
33 34
7 8
88 18
82 43
36 37
13 14
106 41
9 10
77 11
23 24
127 1...

output:

8
129 65
3 74
3 75
3 124
3 125
5 90
5 91
5 120
5 121
8 104
8 105
10 81
11 76
11 77
11 114
11 115
12 56
12 57
12 58
12 59
13 66
13 67
13 78
13 79
15 50
15 51
15 92
15 93
17 84
17 85
17 102
17 103
18 88
18 89
19 126
20 68
20 69
21 55
23 116
23 117
24 48
25 100
27 70
27 71
29 64
29 65
29 94
29 95
30 46...

input:

8
129 65
3 74
3 75
3 124
3 125
5 90
5 91
5 120
5 121
8 104
8 105
10 81
11 76
11 77
11 114
11 115
12 56
12 57
12 58
12 59
13 66
13 67
13 78
13 79
15 50
15 51
15 92
15 93
17 84
17 85
17 102
17 103
18 88
18 89
19 126
20 68
20 69
21 55
23 116
23 117
24 48
25 100
27 70
27 71
29 64
29 65
29 94
29 95
30 46...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
659192688464047828

Test #44:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1772kb,1916kb

input:

7
685730986714800201

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
129
15 16
118 20
92 33
129 20
113 10
83 29
23 24
126 30
61 30
109 6
108 6
14 15
40 41
48 24
19 20
77 4
103 37
52 10
49 24
122 15
28 29
104 39
98 21
34 35
56 19
13 14
20 ...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
129
15 16
118 20
92 33
129 20
113 10
83 29
23 24
126 30
61 30
109 6
108 6
14 15
40 41
48 24
19 20
77 4
103 37
52 10
49 24
122 15
28 29
104 39
98 21
34 35
56 19
13 14
20 ...

output:

8
129 65
1 2
2 44
3 88
3 89
4 76
4 77
4 114
4 115
6 64
6 65
6 108
6 109
7 78
8 84
8 85
10 52
10 53
10 112
10 113
12 121
15 123
17 46
17 47
17 50
17 51
19 56
20 118
20 119
20 128
20 129
21 74
21 75
21 98
21 99
22 72
22 73
22 80
22 81
24 48
24 49
24 62
24 63
25 124
26 106
26 107
26 116
26 117
27 68
27...

input:

8
129 65
1 2
2 44
3 88
3 89
4 76
4 77
4 114
4 115
6 64
6 65
6 108
6 109
7 78
8 84
8 85
10 52
10 53
10 112
10 113
12 121
15 123
17 46
17 47
17 50
17 51
19 56
20 118
20 119
20 128
20 129
21 74
21 75
21 98
21 99
22 72
22 73
22 80
22 81
24 48
24 49
24 62
24 63
25 124
26 106
26 107
26 116
26 117
27 68
27...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
685730986714800201