1249_C1. Good Numbers (easy version)_36655
The only difference between easy and hard versions is the maximum value of n.

You are given a positive integer number n. You really love good numbers so you want to find the smallest good number greater than or equal to n.

The positive integer is called good if it can be represented as a sum of distinct powers of 3 (i.e. no duplicates of powers of 3 are allowed).

For example:

  * 30 is a good number: 30 = 3^3 + 3^1, 
  * 1 is a good number: 1 = 3^0, 
  * 12 is a good number: 12 = 3^2 + 3^1, 
  * but 2 is not a good number: you can't represent it as a sum of distinct powers of 3 (2 = 3^0 + 3^0), 
  * 19 is not a good number: you can't represent it as a sum of distinct powers of 3 (for example, the representations 19 = 3^2 + 3^2 + 3^0 = 3^2 + 3^1 + 3^1 + 3^1 + 3^0 are invalid), 
  * 20 is also not a good number: you can't represent it as a sum of distinct powers of 3 (for example, the representation 20 = 3^2 + 3^2 + 3^0 + 3^0 is invalid). 



Note, that there exist other representations of 19 and 20 as sums of powers of 3 but none of them consists of distinct powers of 3.

For the given positive integer n find such smallest m (n ≤ m) that m is a good number.

You have to answer q independent queries.

Input

The first line of the input contains one integer q (1 ≤ q ≤ 500) — the number of queries. Then q queries follow.

The only line of the query contains one integer n (1 ≤ n ≤ 10^4).

Output

For each query, print such smallest integer m (where n ≤ m) that m is a good number.

Example

Input


7
1
2
6
13
14
3620
10000


Output


1
3
9
13
27
6561
19683
lis=[1]
power_int=50
def init():
    for i in range(1,power_int):
        lis.append(lis[i-1]*3)
def solve():
        mainnum = int(input())
        num = mainnum
        largepower=lis[len(lis)-1]
        smallpower=0
        for i in range(len(lis)-1,-1,-1):
            if num<lis[i]:
                largepower=lis[i]
            else:
                num=num-lis[i]
                smallpower=smallpower+lis[i]
        
        if num == 0:
            return int(smallpower)
        ans =  int(smallpower+largepower-(largepower-1)/2 )
        
        return ans
init()
for i in range(int(input())):
    print(solve())
7
1
2
6
13
14
3620
10000
 1
450283905890997363
 100
1
8
4
6
5
4
4
6
8
3
9
5
7
8
8
5
9
6
9
4
5
6
4
4
7
1
2
2
5
6
1
5
10
9
10
9
3
1
2
3
2
6
9
2
9
5
7
7
2
6
9
5
1
7
8
3
7
9
3
1
7
1
2
4
7
2
7
1
1
10
8
5
7
7
10
8
1
7
5
10
7
6
6
6
7
4
9
3
4
9
10
5
1
2
6
9
3
8
10
9
 1
387420490
 8
1
2
6
13
14
3620
10000
1000000000000000000
 100
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
 1
788649749283011226
 100
1
8
4
6
5
4
4
6
8
3
9
5
7
8
8
5
9
6
9
4
5
6
4
4
7
1
2
2
5
6
1
5
10
9
10
9
2
1
2
3
2
6
9
2
9
5
7
7
2
6
9
5
1
7
8
3
7
9
3
1
7
1
2
4
7
2
7
1
1
10
8
5
7
7
10
8
1
7
5
10
7
6
6
6
7
4
9
3
4
9
10
5
1
2
6
9
3
8
10
9
 1
506859788
 8
1
2
7
13
14
3620
10000
1000000000000000000
 100
1
2
3
4
5
6
7
8
14
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
 7
1
2
10
13
14
3620
10000
 100
1
8
4
6
5
4
4
6
8
3
9
5
7
8
8
5
9
6
9
4
5
6
4
4
7
1
2
2
5
6
1
5
10
9
10
9
2
1
2
3
2
6
9
2
9
5
7
7
2
6
9
5
1
7
8
3
7
9
3
1
7
1
2
4
7
2
7
1
1
10
8
5
7
7
10
8
1
7
5
10
7
6
6
6
7
4
9
3
4
9
10
5
1
2
6
3
3
8
10
9
 1
132370398
 100
1
2
3
4
5
6
7
8
14
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
137
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
 7
1
2
10
13
7
3620
10000
 1
230139648
 100
1
2
3
4
5
6
7
8
14
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
137
85
86
87
88
89
90
91
97
93
94
95
96
97
98
99
100
 7
2
2
10
13
7
3620
10000
 1
196757653606102993
 8
1
3
13
13
14
3620
10000
1100000000000000000
 1
239065226774823548
 1
152260256
 8
1
3
13
13
14
2081
10000
1100000000000000000
 100
1
2
3
4
5
6
7
8
14
10
11
12
13
14
15
16
17
18
19
20
21
22
22
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
24
73
74
75
76
77
78
79
80
81
82
83
137
85
86
87
88
89
90
91
97
93
94
95
96
97
98
99
100
 7
2
2
10
13
2
3620
11000
 100
1
2
3
4
5
6
7
8
14
10
11
12
13
14
15
16
17
18
19
20
21
22
22
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
8
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
24
73
74
75
76
77
78
79
80
81
82
83
137
85
86
87
88
89
90
91
97
93
94
95
96
97
98
99
100
 1
18099502583880351
 100
1
2
3
4
5
6
7
8
14
10
11
12
13
14
15
16
17
18
19
20
21
22
22
28
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
8
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
24
73
74
75
76
77
78
79
80
81
82
83
137
85
86
87
88
89
90
91
97
93
94
95
96
97
98
99
100
 7
2
2
10
23
2
4327
11000
 1
30462481510440077
 1
16660704739123405
 100
1
2
3
4
5
6
7
8
14
10
11
12
13
14
15
16
17
18
19
20
21
22
22
28
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
8
46
20
48
49
50
51
52
66
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
24
73
74
75
76
77
78
79
80
81
82
83
137
85
86
87
88
89
90
91
97
93
94
95
96
97
98
99
100
 100
1
2
3
4
5
6
7
8
14
10
11
12
13
14
15
16
17
18
19
20
21
22
22
28
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
8
46
20
48
49
50
51
52
66
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
24
73
74
75
76
77
78
79
104
81
82
83
137
85
86
87
88
89
90
91
97
93
94
95
96
97
98
99
100
 7
2
2
11
23
2
4327
11100
 1
586187597
 100
1
2
3
4
5
6
7
8
14
10
11
12
13
14
15
16
17
18
19
20
21
31
22
28
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
8
46
20
48
49
50
51
52
66
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
24
73
74
75
76
77
78
79
104
81
82
83
137
85
86
87
88
89
90
91
97
93
94
95
96
97
98
99
100
 7
2
2
19
23
2
4327
11100
 1
7998811304217407
 100
1
2
3
4
5
6
7
8
14
10
11
12
13
14
15
16
17
18
19
20
21
31
22
28
47
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
8
46
20
48
49
50
51
52
66
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
24
73
74
75
76
77
78
79
104
81
82
83
137
85
86
87
88
89
90
91
97
93
94
95
96
97
98
99
100
 7
2
2
19
1
2
4327
11100
 1
6125720912782488
 1
100214312
 100
1
2
3
4
5
6
7
8
14
10
11
12
13
14
15
16
13
18
19
20
21
31
22
28
47
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
8
46
20
48
49
50
51
52
66
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
24
73
74
75
76
77
78
79
104
81
82
83
137
85
86
87
88
89
90
91
97
93
94
95
96
97
98
99
100
 7
4
2
19
1
2
4327
11100
 100
1
2
3
4
5
6
7
8
14
10
11
12
13
14
15
16
13
18
19
20
21
31
22
28
47
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
8
46
20
48
49
50
51
52
66
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
24
73
74
75
76
77
78
79
104
81
82
47
137
85
86
87
88
89
90
91
97
93
94
95
96
97
98
99
100
 100
1
2
3
4
5
6
7
8
14
10
11
12
13
14
15
16
13
18
19
20
21
31
22
28
47
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
8
46
20
48
49
50
51
52
66
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
24
73
74
75
76
77
78
79
104
81
82
47
137
85
86
87
88
22
90
91
97
93
94
95
96
97
98
99
100
 7
4
4
19
1
3
4327
11100
 100
1
2
3
4
5
6
7
8
14
10
11
12
13
14
15
16
13
18
19
20
21
31
22
28
47
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
8
46
20
48
49
50
51
52
66
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
24
73
74
75
76
77
78
79
104
81
82
47
137
85
86
87
88
22
90
91
97
93
94
95
96
97
98
46
100
 7
4
4
28
1
3
4327
11100
 100
1
2
3
4
5
6
7
8
14
10
11
12
13
14
15
16
13
18
19
20
21
31
22
28
47
26
27
28
29
30
14
32
33
34
35
36
37
38
39
40
41
42
43
44
8
46
20
48
49
50
51
52
66
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
24
73
74
75
76
77
78
79
104
81
82
47
137
85
86
87
88
22
90
91
97
93
94
95
96
97
98
46
100
 1
931393092531784562
 8
1
3
7
13
14
3620
10000
1000000000000000000
 1
850073407904408290
 100
1
8
4
6
5
4
4
6
8
3
9
5
7
8
8
5
9
6
9
4
5
6
4
4
7
1
2
2
5
7
1
5
10
9
10
9
2
1
2
3
2
6
9
2
9
5
7
7
2
6
9
5
1
7
8
3
7
9
3
1
7
1
2
4
7
2
7
1
1
10
8
5
7
7
10
8
1
7
5
10
7
6
6
6
7
4
9
3
4
9
10
5
1
2
6
3
3
8
10
9
 8
1
3
7
13
14
3620
10000
1100000000000000000
 1
218113389
 100
1
2
3
4
5
6
7
8
14
10
11
12
13
14
15
16
17
18
19
20
21
22
22
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
137
85
86
87
88
89
90
91
97
93
94
95
96
97
98
99
100
 7
2
2
10
13
7
3620
11000
 1
273206121025892542
 1
286582383
 8
1
3
13
13
14
2081
10001
1100000000000000000
 7
2
2
10
13
2
4327
11000
 1
269157321
 1
256370409
 100
1
2
3
4
5
6
7
8
14
10
11
12
13
14
15
16
17
18
19
20
21
22
22
28
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
8
46
47
48
49
50
51
52
66
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
24
73
74
75
76
77
78
79
80
81
82
83
137
85
86
87
88
89
90
91
97
93
94
95
96
97
98
99
100
 7
2
2
10
24
2
4327
11000
 1
357784722
 7
2
2
10
23
2
4327
11100
 1
32426295562729903
 1
456642039
 1
26658457360408589
 1
1066149996
 1
7811953999234198
 1
151880165
 7
4
2
19
1
3
4327
11100
 1
14215993222891853
 1
199899292
 1
14023318619635129
 1
383372573
 1
12673752953086258
 1
116503335

1
3
9
13
27
6561
19683
 450283905890997363
 1
9
4
9
9
4
4
9
9
3
9
9
9
9
9
9
9
9
9
4
9
9
4
4
9
1
3
3
9
9
1
9
10
9
10
9
3
1
3
3
3
9
9
3
9
9
9
9
3
9
9
9
1
9
9
3
9
9
3
1
9
1
3
4
9
3
9
1
1
10
9
9
9
9
10
9
1
9
9
10
9
9
9
9
9
4
9
3
4
9
10
9
1
3
9
9
3
9
10
9
 387420490
 1
3
9
13
27
6561
19683
1350851717672992089
 1
3
3
4
9
9
9
9
9
10
12
12
13
27
27
27
27
27
27
27
27
27
27
27
27
27
27
28
30
30
31
36
36
36
36
36
37
39
39
40
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
82
84
84
85
90
90
90
90
90
91
93
93
94
108
108
108
108
108
108
 1350851717672992089
 1
9
4
9
9
4
4
9
9
3
9
9
9
9
9
9
9
9
9
4
9
9
4
4
9
1
3
3
9
9
1
9
10
9
10
9
3
1
3
3
3
9
9
3
9
9
9
9
3
9
9
9
1
9
9
3
9
9
3
1
9
1
3
4
9
3
9
1
1
10
9
9
9
9
10
9
1
9
9
10
9
9
9
9
9
4
9
3
4
9
10
9
1
3
9
9
3
9
10
9
 516560652
 1
3
9
13
27
6561
19683
1350851717672992089
 1
3
3
4
9
9
9
9
27
10
12
12
13
27
27
27
27
27
27
27
27
27
27
27
27
27
27
28
30
30
31
36
36
36
36
36
37
39
39
40
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
82
84
84
85
90
90
90
90
90
91
93
93
94
108
108
108
108
108
108
 1
3
10
13
27
6561
19683
 1
9
4
9
9
4
4
9
9
3
9
9
9
9
9
9
9
9
9
4
9
9
4
4
9
1
3
3
9
9
1
9
10
9
10
9
3
1
3
3
3
9
9
3
9
9
9
9
3
9
9
9
1
9
9
3
9
9
3
1
9
1
3
4
9
3
9
1
1
10
9
9
9
9
10
9
1
9
9
10
9
9
9
9
9
4
9
3
4
9
10
9
1
3
9
3
3
9
10
9
 133923132
 1
3
3
4
9
9
9
9
27
10
12
12
13
27
27
27
27
27
27
27
27
27
27
27
27
27
27
28
30
30
31
36
36
36
36
36
37
39
39
40
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
82
84
243
85
90
90
90
90
90
91
93
93
94
108
108
108
108
108
108
 1
3
10
13
9
6561
19683
 387420489
 1
3
3
4
9
9
9
9
27
10
12
12
13
27
27
27
27
27
27
27
27
27
27
27
27
27
27
28
30
30
31
36
36
36
36
36
37
39
39
40
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
82
84
243
85
90
90
90
90
90
91
108
93
94
108
108
108
108
108
108
 3
3
10
13
9
6561
19683
 200126180395998828
 1
3
13
13
27
6561
19683
1350851717672992089
 450283905890997363
 172186884
 1
3
13
13
27
2187
19683
1350851717672992089
 1
3
3
4
9
9
9
9
27
10
12
12
13
27
27
27
27
27
27
27
27
27
27
27
27
27
27
28
30
30
31
36
36
36
36
36
37
39
39
40
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
27
81
81
81
81
81
81
81
81
81
82
84
243
85
90
90
90
90
90
91
108
93
94
108
108
108
108
108
108
 3
3
10
13
3
6561
19683
 1
3
3
4
9
9
9
9
27
10
12
12
13
27
27
27
27
27
27
27
27
27
27
27
27
27
27
28
30
30
31
36
36
36
36
36
37
39
39
40
81
81
81
81
9
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
27
81
81
81
81
81
81
81
81
81
82
84
243
85
90
90
90
90
90
91
108
93
94
108
108
108
108
108
108
 18530201888518410
 1
3
3
4
9
9
9
9
27
10
12
12
13
27
27
27
27
27
27
27
27
27
27
28
27
27
27
28
30
30
31
36
36
36
36
36
37
39
39
40
81
81
81
81
9
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
27
81
81
81
81
81
81
81
81
81
82
84
243
85
90
90
90
90
90
91
108
93
94
108
108
108
108
108
108
 3
3
10
27
3
6561
19683
 50031545098999707
 16677181699666569
 1
3
3
4
9
9
9
9
27
10
12
12
13
27
27
27
27
27
27
27
27
27
27
28
27
27
27
28
30
30
31
36
36
36
36
36
37
39
39
40
81
81
81
81
9
81
27
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
27
81
81
81
81
81
81
81
81
81
82
84
243
85
90
90
90
90
90
91
108
93
94
108
108
108
108
108
108
 1
3
3
4
9
9
9
9
27
10
12
12
13
27
27
27
27
27
27
27
27
27
27
28
27
27
27
28
30
30
31
36
36
36
36
36
37
39
39
40
81
81
81
81
9
81
27
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
27
81
81
81
81
81
81
81
108
81
82
84
243
85
90
90
90
90
90
91
108
93
94
108
108
108
108
108
108
 3
3
12
27
3
6561
19683
 1162261467
 1
3
3
4
9
9
9
9
27
10
12
12
13
27
27
27
27
27
27
27
27
31
27
28
27
27
27
28
30
30
31
36
36
36
36
36
37
39
39
40
81
81
81
81
9
81
27
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
27
81
81
81
81
81
81
81
108
81
82
84
243
85
90
90
90
90
90
91
108
93
94
108
108
108
108
108
108
 3
3
27
27
3
6561
19683
 8029754151691311
 1
3
3
4
9
9
9
9
27
10
12
12
13
27
27
27
27
27
27
27
27
31
27
28
81
27
27
28
30
30
31
36
36
36
36
36
37
39
39
40
81
81
81
81
9
81
27
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
27
81
81
81
81
81
81
81
108
81
82
84
243
85
90
90
90
90
90
91
108
93
94
108
108
108
108
108
108
 3
3
27
1
3
6561
19683
 6176733962839470
 129140163
 1
3
3
4
9
9
9
9
27
10
12
12
13
27
27
27
13
27
27
27
27
31
27
28
81
27
27
28
30
30
31
36
36
36
36
36
37
39
39
40
81
81
81
81
9
81
27
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
27
81
81
81
81
81
81
81
108
81
82
84
243
85
90
90
90
90
90
91
108
93
94
108
108
108
108
108
108
 4
3
27
1
3
6561
19683
 1
3
3
4
9
9
9
9
27
10
12
12
13
27
27
27
13
27
27
27
27
31
27
28
81
27
27
28
30
30
31
36
36
36
36
36
37
39
39
40
81
81
81
81
9
81
27
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
27
81
81
81
81
81
81
81
108
81
82
81
243
85
90
90
90
90
90
91
108
93
94
108
108
108
108
108
108
 1
3
3
4
9
9
9
9
27
10
12
12
13
27
27
27
13
27
27
27
27
31
27
28
81
27
27
28
30
30
31
36
36
36
36
36
37
39
39
40
81
81
81
81
9
81
27
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
27
81
81
81
81
81
81
81
108
81
82
81
243
85
90
90
90
27
90
91
108
93
94
108
108
108
108
108
108
 4
4
27
1
3
6561
19683
 1
3
3
4
9
9
9
9
27
10
12
12
13
27
27
27
13
27
27
27
27
31
27
28
81
27
27
28
30
30
31
36
36
36
36
36
37
39
39
40
81
81
81
81
9
81
27
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
27
81
81
81
81
81
81
81
108
81
82
81
243
85
90
90
90
27
90
91
108
93
94
108
108
108
108
81
108
 4
4
28
1
3
6561
19683
 1
3
3
4
9
9
9
9
27
10
12
12
13
27
27
27
13
27
27
27
27
31
27
28
81
27
27
28
30
30
27
36
36
36
36
36
37
39
39
40
81
81
81
81
9
81
27
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
27
81
81
81
81
81
81
81
108
81
82
81
243
85
90
90
90
27
90
91
108
93
94
108
108
108
108
81
108
 1350851717672992089
 1
3
9
13
27
6561
19683
1350851717672992089
 1350851717672992089
 1
9
4
9
9
4
4
9
9
3
9
9
9
9
9
9
9
9
9
4
9
9
4
4
9
1
3
3
9
9
1
9
10
9
10
9
3
1
3
3
3
9
9
3
9
9
9
9
3
9
9
9
1
9
9
3
9
9
3
1
9
1
3
4
9
3
9
1
1
10
9
9
9
9
10
9
1
9
9
10
9
9
9
9
9
4
9
3
4
9
10
9
1
3
9
3
3
9
10
9
 1
3
9
13
27
6561
19683
1350851717672992089
 387420489
 1
3
3
4
9
9
9
9
27
10
12
12
13
27
27
27
27
27
27
27
27
27
27
27
27
27
27
28
30
30
31
36
36
36
36
36
37
39
39
40
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
82
84
243
85
90
90
90
90
90
91
108
93
94
108
108
108
108
108
108
 3
3
10
13
9
6561
19683
 450283905890997363
 387420489
 1
3
13
13
27
2187
19683
1350851717672992089
 3
3
10
13
3
6561
19683
 387420489
 387420489
 1
3
3
4
9
9
9
9
27
10
12
12
13
27
27
27
27
27
27
27
27
27
27
28
27
27
27
28
30
30
31
36
36
36
36
36
37
39
39
40
81
81
81
81
9
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
81
27
81
81
81
81
81
81
81
81
81
82
84
243
85
90
90
90
90
90
91
108
93
94
108
108
108
108
108
108
 3
3
10
27
3
6561
19683
 387420489
 3
3
10
27
3
6561
19683
 50031545098999707
 516560652
 50031545098999707
 1162261467
 8029754151691311
 172186884
 4
3
27
1
3
6561
19683
 16677181699666569
 387420489
 16677181699666569
 387420489
 16677181699666569
 129140163
