-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
73 lines (52 loc) · 34.7 KB
/
main.py
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
schedule = [[117, 30, 102, 114, 82, 127, 125, 85, 59, 122, 117, 107, 29, 103, 27, 120, 26, 26, 80, 7, 39, 74, 88, 47, 30, 62, 100, 113, 62, 13, 1, 50, 6, 1, 41, 91, 42, 79, 20, 70, 41, 62, 38, 114, 111, 113, 123, 93, 62, 117, 17, 75, 73, 46, 109, 112, 119, 2, 109, 95, 113, 88, 27, 63], [44, 1, 36, 119, 73, 7, 121, 62, 102, 84, 11, 122, 117, 111, 76, 33, 51, 13, 25, 59, 8, 59, 19, 76, 102, 125, 92, 86, 95, 7, 76, 94, 54, 68, 117, 15, 4, 111, 97, 22, 70, 92, 80, 47, 7, 57, 11, 75, 81, 48, 60, 22, 95, 69, 13, 20, 12, 118, 67, 17, 108, 101, 21, 32], [86, 111, 25, 49, 71, 68, 96, 53, 59, 127, 18, 0, 110, 61, 112, 51, 125, 86, 33, 122, 53, 69, 75, 12, 38, 100, 118, 29, 69, 110, 111, 73, 114, 71, 13, 123, 108, 120, 29, 108, 126, 98, 81, 39, 26, 105, 92, 0, 100, 50, 7, 48, 77, 113, 63, 77, 66, 87, 83, 44, 28, 119, 25, 85], [123, 58, 10, 30, 36, 35, 109, 107, 103, 74, 111, 35, 65, 122, 126, 3, 33, 26, 100, 51, 82, 73, 0, 33, 15, 52, 125, 67, 75, 74, 52, 33, 119, 105, 106, 17, 83, 58, 64, 94, 85, 63, 34, 103, 49, 6, 75, 51, 29, 119, 57, 127, 79, 81, 47, 1, 39, 20, 93, 47, 32, 67, 103, 35], [63, 97, 106, 108, 108, 78, 56, 70, 116, 60, 85, 113, 124, 16, 5, 27, 110, 25, 24, 88, 54, 48, 103, 24, 120, 101, 16, 90, 111, 67, 32, 30, 81, 73, 48, 92, 26, 75, 5, 75, 29, 36, 20, 18, 84, 100, 9, 118, 27, 13, 124, 93, 62, 33, 30, 26, 90, 44, 109, 86, 63, 72, 71, 110], [45, 16, 53, 2, 97, 88, 109, 62, 107, 31, 11, 38, 13, 112, 67, 31, 103, 65, 118, 87, 65, 120, 126, 41, 59, 38, 89, 67, 51, 117, 77, 61, 126, 109, 81, 6, 61, 57, 59, 85, 80, 36, 3, 68, 97, 30, 100, 23, 22, 14, 12, 20, 105, 36, 22, 93, 45, 54, 36, 93, 78, 72, 44, 71], [11, 66, 102, 110, 75, 83, 51, 85, 40, 60, 115, 9, 109, 88, 63, 106, 50, 60, 5, 47, 109, 112, 89, 34, 10, 9, 28, 64, 102, 65, 50, 69, 66, 106, 34, 114, 100, 46, 125, 70, 126, 74, 127, 40, 33, 32, 100, 117, 61, 125, 117, 105, 113, 56, 27, 49, 6, 107, 13, 42, 35, 33, 60, 108], [10, 53, 20, 85, 14, 2, 108, 75, 38, 24, 0, 32, 119, 49, 54, 46, 13, 2, 94, 79, 59, 87, 19, 30, 111, 70, 16, 67, 105, 1, 86, 8, 100, 21, 23, 14, 78, 95, 1, 47, 0, 45, 35, 42, 96, 96, 95, 117, 107, 104, 72, 114, 70, 125, 3, 84, 29, 55, 124, 47, 42, 69, 97, 72], [56, 89, 34, 102, 119, 20, 35, 108, 3, 38, 54, 34, 21, 93, 113, 95, 68, 72, 80, 68, 21, 50, 8, 18, 37, 81, 98, 126, 43, 105, 97, 28, 90, 114, 103, 2, 12, 48, 31, 19, 7, 44, 34, 24, 38, 49, 3, 104, 126, 2, 78, 70, 32, 91, 83, 47, 120, 80, 35, 28, 99, 71, 69, 100], [26, 43, 87, 126, 112, 57, 75, 95, 12, 69, 9, 10, 81, 111, 69, 49, 100, 53, 109, 46, 120, 113, 50, 92, 49, 116, 108, 64, 62, 39, 96, 56, 19, 92, 21, 114, 79, 19, 55, 121, 67, 55, 7, 20, 122, 68, 82, 53, 30, 111, 8, 3, 58, 64, 127, 56, 58, 65, 112, 83, 104, 36, 60, 0], [25, 9, 73, 124, 124, 116, 42, 107, 3, 30, 21, 110, 34, 59, 19, 32, 100, 56, 12, 54, 53, 123, 74, 38, 11, 42, 20, 9, 14, 22, 127, 26, 110, 24, 47, 124, 94, 36, 37, 18, 97, 26, 23, 67, 51, 15, 68, 59, 60, 126, 43, 72, 105, 35, 122, 34, 107, 107, 125, 6, 45, 68, 112, 37], [40, 11, 69, 55, 59, 3, 32, 121, 34, 87, 93, 14, 102, 49, 56, 41, 126, 101, 119, 87, 42, 70, 114, 89, 28, 125, 66, 63, 65, 58, 58, 31, 19, 22, 65, 77, 40, 15, 58, 18, 64, 20, 30, 55, 69, 14, 57, 121, 42, 109, 107, 23, 103, 29, 50, 93, 52, 98, 74, 107, 46, 115, 77, 73], [23, 23, 119, 106, 73, 16, 109, 53, 113, 101, 126, 80, 90, 8, 77, 111, 44, 86, 57, 54, 27, 18, 91, 119, 47, 126, 38, 73, 44, 11, 39, 65, 84, 126, 85, 9, 20, 29, 115, 68, 52, 49, 80, 34, 123, 5, 106, 125, 127, 100, 117, 108, 102, 76, 88, 77, 6, 8, 88, 84, 91, 39, 52, 12], [22, 50, 30, 27, 94, 124, 73, 92, 21, 17, 112, 19, 66, 123, 20, 104, 4, 106, 83, 21, 89, 125, 54, 118, 67, 74, 71, 27, 88, 63, 50, 60, 40, 126, 102, 114, 90, 42, 114, 29, 53, 93, 40, 67, 104, 96, 74, 114, 47, 42, 59, 64, 45, 98, 63, 5, 87, 119, 51, 11, 36, 114, 97, 65], [12, 60, 35, 27, 55, 15, 44, 88, 86, 39, 0, 59, 126, 118, 60, 126, 117, 32, 63, 123, 67, 89, 3, 9, 62, 107, 94, 46, 100, 97, 7, 5, 108, 76, 19, 115, 38, 49, 125, 7, 5, 122, 44, 90, 77, 110, 77, 65, 37, 71, 16, 82, 118, 83, 99, 65, 50, 125, 118, 110, 121, 41, 75, 127], [20, 47, 95, 54, 86, 122, 5, 101, 86, 120, 28, 100, 24, 3, 87, 19, 82, 33, 12, 35, 38, 43, 122, 92, 47, 2, 115, 64, 105, 98, 55, 50, 30, 75, 98, 14, 9, 124, 49, 106, 91, 96, 87, 70, 84, 1, 10, 10, 107, 0, 37, 52, 99, 105, 35, 2, 7, 75, 64, 36, 110, 0, 56, 96], [36, 32, 42, 4, 69, 86, 76, 76, 125, 35, 31, 50, 115, 41, 47, 90, 106, 106, 110, 77, 103, 32, 76, 54, 73, 114, 20, 108, 84, 120, 120, 82, 19, 22, 122, 31, 89, 82, 111, 59, 56, 55, 53, 48, 63, 92, 97, 76, 19, 103, 100, 15, 60, 96, 47, 17, 86, 80, 6, 97, 96, 116, 47, 117], [6, 55, 98, 66, 66, 108, 84, 88, 80, 19, 33, 7, 46, 61, 113, 87, 15, 112, 28, 86, 11, 82, 93, 13, 116, 79, 114, 10, 73, 51, 123, 40, 73, 125, 42, 56, 64, 24, 3, 42, 20, 92, 80, 46, 9, 74, 38, 22, 7, 63, 101, 31, 51, 97, 120, 71, 80, 99, 39, 51, 78, 95, 28, 107], [92, 68, 16, 117, 9, 70, 44, 15, 60, 78, 0, 56, 124, 4, 104, 74, 25, 14, 26, 120, 64, 32, 49, 7, 6, 108, 72, 26, 20, 95, 66, 17, 20, 38, 104, 76, 78, 96, 127, 55, 55, 11, 46, 9, 37, 6, 85, 79, 75, 37, 61, 16, 58, 6, 116, 110, 30, 103, 77, 6, 99, 33, 127, 37], [3, 61, 83, 4, 18, 57, 18, 66, 95, 43, 85, 48, 80, 31, 112, 65, 27, 45, 70, 4, 28, 37, 92, 8, 114, 16, 9, 46, 85, 56, 35, 112, 77, 30, 103, 23, 41, 98, 120, 78, 47, 12, 92, 72, 84, 94, 108, 60, 45, 57, 71, 110, 61, 20, 109, 83, 21, 14, 15, 6, 121, 97, 46, 120], [8, 28, 83, 70, 68, 63, 2, 29, 32, 38, 117, 40, 49, 105, 41, 59, 124, 59, 20, 67, 24, 38, 38, 64, 112, 5, 27, 87, 107, 26, 44, 42, 1, 51, 5, 25, 115, 4, 123, 45, 17, 120, 8, 102, 126, 118, 119, 116, 61, 90, 54, 108, 117, 83, 0, 44, 3, 9, 48, 41, 37, 100, 7, 124], [40, 68, 95, 74, 124, 57, 79, 36, 117, 114, 78, 19, 82, 103, 37, 82, 22, 43, 98, 78, 36, 41, 79, 108, 7, 112, 107, 111, 87, 59, 89, 15, 26, 55, 51, 66, 7, 49, 47, 67, 112, 36, 71, 60, 44, 105, 117, 47, 83, 16, 12, 75, 120, 110, 47, 72, 96, 77, 66, 46, 87, 104, 18, 84], [116, 74, 71, 23, 18, 61, 104, 7, 13, 101, 99, 72, 64, 73, 63, 122, 59, 43, 104, 61, 30, 64, 66, 45, 119, 65, 73, 86, 85, 79, 45, 26, 14, 6, 96, 20, 51, 23, 119, 41, 62, 41, 97, 51, 45, 39, 21, 67, 75, 0, 59, 72, 85, 26, 68, 113, 118, 54, 123, 53, 0, 72, 102, 8], [17, 116, 59, 79, 125, 118, 44, 49, 88, 13, 3, 73, 60, 121, 3, 30, 21, 70, 78, 96, 117, 102, 48, 4, 59, 57, 55, 114, 82, 83, 16, 74, 92, 41, 105, 123, 6, 67, 6, 66, 122, 81, 56, 36, 90, 115, 124, 92, 17, 42, 44, 57, 100, 120, 9, 89, 95, 117, 63, 16, 116, 11, 38, 0], [40, 37, 3, 79, 106, 53, 63, 108, 65, 105, 105, 108, 30, 81, 78, 20, 116, 107, 89, 39, 122, 121, 106, 48, 73, 91, 26, 22, 120, 82, 22, 37, 124, 98, 103, 41, 59, 119, 78, 33, 83, 28, 58, 58, 65, 66, 40, 26, 8, 95, 44, 12, 82, 14, 78, 57, 64, 119, 50, 127, 59, 86, 22, 56], [97, 42, 5, 9, 96, 89, 113, 1, 40, 38, 108, 23, 105, 12, 62, 19, 41, 8, 98, 18, 15, 6, 44, 4, 38, 81, 89, 28, 41, 8, 63, 108, 24, 30, 119, 19, 23, 19, 64, 23, 63, 24, 28, 27, 37, 63, 68, 11, 125, 61, 95, 32, 127, 2, 93, 44, 13, 55, 44, 102, 70, 8, 104, 98], [56, 75, 122, 105, 89, 16, 88, 53, 3, 39, 123, 91, 113, 10, 79, 22, 0, 89, 115, 67, 55, 59, 20, 27, 87, 72, 12, 125, 105, 24, 16, 103, 12, 115, 83, 12, 27, 20, 7, 121, 100, 27, 26, 127, 25, 113, 116, 121, 1, 109, 82, 50, 124, 69, 77, 110, 19, 68, 116, 59, 74, 65, 21, 93], [50, 15, 76, 16, 125, 0, 7, 92, 59, 15, 115, 39, 25, 9, 1, 70, 94, 103, 66, 48, 63, 39, 67, 102, 119, 84, 59, 46, 42, 111, 125, 8, 121, 38, 124, 68, 8, 46, 14, 34, 107, 61, 113, 24, 5, 42, 110, 114, 99, 6, 64, 35, 119, 74, 125, 42, 23, 106, 79, 9, 89, 73, 89, 90], [17, 92, 97, 105, 29, 57, 11, 51, 118, 101, 112, 108, 29, 35, 105, 37, 18, 93, 87, 13, 4, 88, 115, 120, 4, 119, 25, 84, 17, 24, 22, 13, 47, 100, 125, 56, 79, 75, 78, 69, 59, 59, 89, 108, 40, 120, 61, 91, 59, 32, 98, 49, 5, 32, 19, 1, 71, 6, 116, 107, 40, 36, 20, 113], [85, 66, 62, 87, 55, 72, 119, 16, 89, 66, 40, 38, 36, 52, 31, 77, 99, 59, 62, 50, 15, 1, 9, 58, 62, 79, 49, 26, 66, 72, 66, 78, 34, 62, 24, 51, 79, 125, 125, 49, 50, 23, 24, 5, 36, 67, 2, 27, 89, 84, 52, 109, 47, 111, 89, 37, 106, 79, 85, 59, 44, 58, 35, 45], [104, 119, 99, 116, 102, 127, 57, 33, 48, 120, 24, 103, 67, 44, 110, 120, 44, 1, 36, 14, 97, 5, 114, 30, 21, 89, 92, 54, 100, 19, 40, 91, 20, 108, 80, 0, 111, 56, 36, 1, 33, 30, 115, 101, 63, 117, 108, 8, 4, 63, 126, 3, 38, 82, 4, 23, 5, 126, 49, 97, 34, 37, 25, 122], [29, 2, 69, 120, 6, 104, 21, 32, 41, 102, 85, 126, 114, 116, 66, 101, 16, 53, 98, 18, 4, 39, 104, 115, 41, 72, 44, 10, 42, 83, 21, 103, 97, 99, 60, 101, 25, 83, 10, 42, 57, 118, 10, 76, 10, 103, 81, 10, 19, 110, 126, 51, 50, 18, 40, 35, 68, 3, 75, 97, 26, 89, 57, 59], [126, 31, 97, 26, 5, 59, 54, 41, 60, 111, 32, 57, 29, 86, 4, 21, 58, 115, 12, 107, 75, 7, 9, 59, 83, 120, 81, 78, 17, 16, 109, 63, 36, 76, 64, 12, 22, 39, 16, 126, 100, 117, 96, 21, 87, 38, 24, 11, 88, 71, 50, 115, 108, 110, 70, 115, 79, 62, 99, 103, 93, 90, 122, 84], [42, 1, 71, 1, 45, 112, 121, 38, 69, 78, 46, 39, 10, 90, 54, 46, 114, 21, 12, 56, 19, 126, 36, 81, 38, 6, 88, 93, 64, 62, 28, 28, 107, 120, 120, 45, 83, 33, 103, 0, 110, 4, 0, 110, 7, 37, 70, 110, 73, 42, 65, 95, 31, 72, 60, 8, 121, 69, 70, 69, 49, 16, 46, 110], [19, 106, 21, 2, 76, 67, 85, 98, 114, 28, 32, 74, 9, 50, 45, 35, 32, 36, 123, 108, 103, 95, 89, 108, 36, 120, 33, 103, 11, 43, 47, 31, 84, 101, 20, 43, 76, 110, 94, 123, 13, 54, 66, 31, 43, 35, 8, 13, 93, 28, 43, 28, 106, 11, 109, 61, 101, 104, 1, 74, 62, 59, 117, 95], [33, 16, 77, 39, 89, 56, 100, 100, 57, 91, 38, 120, 103, 63, 90, 118, 61, 85, 17, 98, 49, 51, 40, 111, 114, 30, 36, 74, 122, 39, 84, 78, 12, 111, 8, 69, 20, 73, 75, 48, 53, 106, 111, 20, 39, 93, 103, 10, 64, 85, 27, 93, 57, 19, 31, 94, 110, 25, 35, 71, 53, 69, 6, 96], [75, 93, 39, 15, 45, 19, 46, 100, 96, 28, 62, 5, 69, 70, 7, 30, 109, 55, 78, 114, 127, 17, 46, 55, 46, 38, 100, 57, 121, 5, 84, 2, 109, 109, 90, 19, 58, 41, 69, 12, 46, 82, 122, 46, 93, 1, 49, 12, 50, 101, 6, 76, 77, 84, 54, 120, 45, 11, 122, 12, 36, 108, 92, 39], [57, 85, 70, 29, 52, 83, 11, 24, 2, 74, 13, 57, 58, 23, 86, 52, 36, 47, 51, 64, 108, 72, 50, 87, 105, 7, 123, 24, 68, 17, 23, 6, 101, 18, 83, 45, 48, 73, 52, 55, 56, 0, 93, 66, 121, 83, 15, 123, 79, 20, 99, 19, 36, 118, 62, 41, 59, 15, 66, 89, 15, 73, 64, 101], [15, 114, 109, 5, 115, 68, 7, 6, 58, 40, 56, 40, 23, 86, 74, 95, 37, 105, 36, 4, 118, 75, 112, 0, 85, 70, 34, 54, 54, 65, 10, 38, 94, 79, 53, 52, 60, 117, 35, 40, 107, 6, 52, 65, 43, 10, 80, 11, 76, 44, 99, 102, 92, 8, 16, 124, 37, 105, 64, 68, 92, 34, 22, 41], [126, 70, 29, 36, 125, 61, 126, 51, 119, 36, 51, 99, 94, 7, 17, 7, 43, 86, 91, 4, 126, 97, 56, 1, 97, 5, 62, 107, 10, 110, 15, 125, 14, 23, 22, 10, 101, 16, 28, 89, 107, 94, 41, 73, 46, 3, 109, 25, 121, 45, 0, 85, 0, 67, 65, 11, 65, 28, 16, 9, 126, 118, 105, 37], [31, 92, 54, 53, 123, 93, 54, 7, 127, 44, 52, 88, 86, 117, 89, 67, 54, 60, 34, 14, 89, 65, 7, 43, 55, 122, 73, 51, 96, 59, 71, 12, 7, 125, 107, 1, 21, 85, 24, 68, 95, 28, 67, 104, 85, 127, 77, 48, 22, 65, 123, 63, 33, 13, 112, 95, 47, 69, 48, 108, 61, 13, 31, 45], [34, 127, 122, 98, 34, 110, 99, 99, 44, 1, 49, 107, 76, 121, 63, 70, 77, 11, 104, 45, 103, 89, 51, 56, 65, 87, 43, 110, 90, 38, 17, 88, 31, 3, 120, 117, 61, 55, 64, 55, 28, 67, 80, 52, 10, 124, 40, 88, 31, 44, 58, 87, 116, 93, 59, 33, 25, 95, 59, 39, 71, 50, 85, 127], [73, 90, 47, 109, 5, 11, 80, 85, 86, 111, 18, 100, 78, 13, 102, 95, 54, 75, 43, 115, 60, 32, 2, 14, 82, 68, 57, 14, 98, 17, 10, 100, 0, 113, 5, 122, 1, 80, 126, 97, 81, 83, 32, 12, 58, 18, 1, 98, 59, 123, 15, 26, 2, 91, 4, 23, 107, 50, 68, 45, 44, 39, 30, 58], [59, 20, 97, 51, 90, 69, 99, 50, 86, 115, 38, 32, 92, 66, 82, 2, 77, 63, 40, 34, 68, 49, 80, 56, 7, 48, 104, 31, 85, 11, 111, 100, 3, 107, 21, 77, 22, 45, 62, 7, 66, 53, 20, 28, 9, 85, 55, 71, 20, 16, 35, 56, 24, 24, 0, 123, 37, 77, 66, 114, 104, 89, 51, 27], [26, 63, 5, 100, 90, 108, 73, 105, 61, 14, 39, 16, 13, 100, 104, 89, 43, 35, 71, 16, 32, 79, 44, 59, 123, 92, 6, 0, 72, 74, 76, 62, 73, 97, 41, 98, 84, 2, 52, 37, 121, 94, 45, 116, 0, 32, 92, 66, 116, 23, 101, 93, 54, 73, 27, 75, 66, 56, 89, 60, 59, 31, 74, 38], [37, 47, 62, 31, 94, 82, 23, 39, 87, 72, 78, 109, 22, 116, 88, 52, 2, 121, 82, 50, 78, 64, 43, 71, 24, 46, 14, 0, 50, 17, 105, 89, 84, 80, 56, 7, 14, 4, 107, 33, 103, 21, 2, 67, 17, 82, 67, 112, 109, 103, 27, 10, 3, 40, 118, 39, 87, 127, 29, 24, 62, 7, 70, 15], [117, 38, 59, 57, 94, 12, 103, 104, 4, 8, 127, 29, 86, 47, 18, 43, 92, 110, 112, 79, 63, 58, 32, 109, 104, 20, 43, 106, 29, 93, 1, 125, 113, 118, 115, 84, 21, 50, 49, 99, 108, 70, 92, 98, 124, 67, 46, 10, 54, 124, 44, 48, 122, 2, 69, 35, 117, 92, 105, 98, 54, 40, 91, 71], [113, 104, 102, 56, 32, 119, 18, 124, 6, 107, 123, 27, 57, 39, 49, 91, 1, 30, 30, 113, 107, 91, 13, 69, 119, 88, 37, 48, 75, 87, 35, 96, 23, 109, 75, 77, 17, 47, 108, 19, 68, 41, 80, 46, 23, 122, 50, 101, 54, 114, 41, 27, 105, 117, 42, 19, 94, 5, 93, 13, 125, 96, 41, 122], [12, 58, 106, 67, 50, 32, 109, 77, 19, 114, 61, 98, 53, 127, 65, 89, 54, 103, 11, 64, 85, 95, 51, 2, 21, 36, 115, 72, 68, 96, 94, 116, 7, 98, 120, 98, 60, 13, 27, 37, 82, 117, 103, 74, 62, 60, 114, 82, 111, 19, 51, 110, 16, 80, 43, 22, 7, 50, 72, 53, 56, 71, 2, 7], [0, 103, 122, 47, 55, 4, 55, 108, 82, 17, 33, 15, 50, 58, 77, 68, 50, 72, 68, 85, 64, 6, 87, 77, 75, 10, 96, 18, 73, 111, 110, 60, 15, 80, 9, 77, 43, 24, 40, 104, 11, 64, 36, 87, 71, 5, 69, 35, 97, 32, 62, 25, 61, 37, 58, 118, 35, 66, 98, 81, 17, 121, 108, 31], [19, 62, 24, 102, 109, 16, 64, 91, 122, 110, 77, 35, 36, 13, 67, 0, 49, 110, 2, 36, 46, 77, 120, 95, 60, 36, 122, 93, 48, 108, 42, 8, 76, 118, 127, 121, 118, 107, 51, 86, 26, 27, 93, 43, 122, 54, 83, 52, 107, 76, 68, 49, 65, 81, 52, 30, 113, 52, 79, 118, 39, 5, 23, 107], [8, 98, 112, 82, 106, 102, 62, 52, 23, 50, 111, 108, 73, 50, 51, 41, 101, 64, 80, 32, 114, 69, 51, 50, 12, 29, 32, 40, 64, 52, 121, 108, 84, 124, 32, 56, 31, 48, 124, 103, 71, 83, 85, 124, 56, 19, 18, 117, 116, 17, 120, 1, 83, 71, 22, 119, 77, 46, 68, 30, 16, 108, 65, 113], [94, 24, 21, 69, 97, 30, 24, 112, 107, 42, 121, 46, 11, 39, 117, 47, 46, 7, 36, 81, 4, 25, 67, 93, 66, 77, 64, 111, 42, 116, 50, 41, 3, 47, 28, 109, 22, 48, 103, 76, 117, 102, 59, 7, 117, 50, 27, 124, 38, 39, 57, 12, 65, 67, 124, 104, 74, 53, 123, 78, 90, 66, 23, 127], [46, 88, 51, 45, 98, 33, 121, 1, 4, 19, 77, 21, 33, 49, 52, 62, 11, 78, 71, 63, 40, 122, 18, 118, 112, 56, 115, 69, 7, 10, 0, 102, 37, 57, 89, 75, 103, 115, 110, 78, 34, 9, 100, 88, 126, 114, 89, 75, 116, 37, 64, 71, 110, 85, 17, 116, 88, 35, 71, 44, 91, 15, 88, 97], [94, 82, 51, 90, 93, 11, 33, 52, 29, 34, 127, 52, 64, 28, 55, 25, 94, 33, 77, 44, 32, 0, 103, 70, 7, 79, 17, 26, 11, 22, 115, 37, 73, 61, 38, 107, 99, 55, 39, 11, 82, 66, 24, 94, 20, 41, 69, 72, 36, 34, 15, 25, 85, 108, 30, 119, 102, 65, 37, 76, 85, 55, 23, 85], [71, 39, 48, 77, 89, 98, 41, 61, 75, 20, 7, 24, 108, 101, 71, 59, 45, 60, 116, 58, 51, 46, 72, 89, 93, 7, 91, 53, 92, 4, 68, 32, 124, 18, 96, 2, 127, 14, 52, 119, 69, 30, 90, 92, 114, 126, 109, 69, 95, 102, 86, 76, 73, 97, 112, 93, 57, 41, 18, 70, 72, 122, 7, 9], [118, 80, 24, 94, 43, 90, 122, 9, 98, 63, 21, 21, 67, 116, 62, 93, 19, 75, 40, 54, 80, 3, 45, 43, 40, 12, 124, 7, 69, 1, 82, 100, 78, 120, 41, 42, 126, 26, 102, 26, 113, 65, 86, 56, 119, 49, 35, 7, 71, 118, 51, 7, 24, 13, 103, 51, 64, 90, 19, 91, 84, 110, 99, 62], [93, 23, 15, 31, 85, 90, 26, 8, 126, 75, 71, 46, 2, 33, 8, 116, 23, 70, 103, 99, 83, 11, 103, 6, 17, 126, 63, 0, 103, 99, 2, 115, 57, 82, 75, 25, 32, 105, 28, 89, 126, 12, 100, 82, 78, 42, 18, 114, 74, 33, 69, 105, 1, 86, 8, 43, 58, 98, 52, 26, 16, 62, 71, 122], [43, 36, 54, 95, 53, 70, 28, 83, 33, 9, 126, 78, 42, 37, 72, 93, 17, 110, 30, 43, 94, 7, 105, 67, 64, 19, 103, 53, 108, 118, 29, 101, 81, 77, 91, 51, 115, 55, 40, 91, 92, 100, 87, 29, 55, 33, 48, 86, 93, 61, 91, 76, 111, 33, 96, 118, 34, 6, 99, 15, 109, 6, 121, 70], [57, 11, 120, 110, 71, 38, 63, 87, 11, 90, 102, 84, 47, 48, 19, 14, 60, 47, 67, 71, 25, 105, 84, 107, 114, 20, 55, 6, 96, 40, 40, 122, 47, 107, 15, 27, 21, 4, 79, 14, 3, 18, 78, 78, 25, 42, 59, 97, 62, 7, 82, 121, 93, 33, 83, 36, 105, 64, 26, 0, 85, 78, 51, 37], [37, 35, 89, 44, 21, 93, 64, 57, 83, 89, 54, 89, 124, 57, 127, 12, 1, 72, 2, 28, 57, 63, 7, 65, 98, 3, 4, 64, 114, 36, 23, 20, 38, 73, 115, 1, 99, 28, 120, 23, 58, 30, 77, 125, 21, 41, 76, 107, 96, 59, 107, 39, 42, 52, 57, 34, 96, 8, 20, 120, 79, 51, 42, 104], [45, 83, 67, 111, 50, 13, 50, 99, 18, 116, 37, 12, 68, 39, 102, 79, 110, 93, 127, 3, 100, 97, 96, 19, 12, 66, 70, 6, 9, 111, 59, 6, 109, 114, 48, 107, 51, 95, 127, 108, 100, 20, 44, 71, 36, 9, 27, 96, 35, 65, 26, 0, 101, 13, 4, 34, 31, 51, 108, 11, 122, 42, 62, 111], [15, 13, 102, 7, 63, 8, 44, 101, 92, 62, 29, 112, 14, 3, 30, 36, 22, 116, 102, 10, 58, 34, 36, 109, 25, 76, 4, 51, 39, 116, 95, 66, 35, 80, 17, 100, 122, 120, 81, 119, 88, 65, 123, 127, 31, 19, 65, 22, 53, 3, 12, 67, 25, 12, 65, 3, 102, 107, 6, 9, 40, 110, 116, 1], [47, 34, 13, 106, 65, 0, 125, 57, 107, 10, 17, 73, 101, 96, 82, 4, 16, 15, 5, 7, 47, 40, 10, 13, 5, 35, 38, 5, 93, 69, 101, 43, 93, 105, 112, 82, 57, 31, 40, 65, 30, 16, 108, 84, 84, 14, 19, 69, 67, 68, 106, 6, 43, 22, 98, 118, 80, 89, 97, 37, 67, 108, 50, 6], [41, 52, 78, 23, 72, 55, 92, 101, 72, 114, 33, 49, 35, 48, 0, 85, 94, 69, 19, 58, 42, 45, 79, 114, 43, 36, 102, 4, 125, 63, 49, 83, 122, 42, 127, 59, 94, 81, 87, 35, 18, 24, 118, 7, 58, 55, 119, 18, 83, 121, 60, 107, 57, 96, 50, 122, 87, 92, 114, 98, 103, 107, 50, 51], [49, 2, 39, 68, 54, 61, 56, 98, 97, 44, 53, 102, 3, 17, 80, 51, 63, 62, 11, 61, 100, 80, 70, 53, 120, 68, 77, 27, 6, 63, 10, 6, 59, 85, 12, 79, 11, 78, 20, 68, 115, 48, 109, 121, 19, 79, 111, 22, 124, 70, 17, 43, 25, 95, 12, 127, 47, 35, 124, 108, 110, 95, 106, 104], [71, 52, 9, 22, 31, 4, 119, 106, 10, 44, 30, 16, 5, 123, 1, 30, 105, 68, 89, 66, 101, 101, 110, 116, 98, 68, 50, 96, 121, 3, 1, 1, 54, 73, 38, 45, 70, 117, 78, 120, 91, 102, 123, 40, 21, 113, 34, 8, 65, 94, 14, 5, 79, 100, 97, 106, 109, 13, 112, 99, 104, 79, 56, 84], [127, 117, 31, 36, 112, 9, 116, 89, 41, 117, 3, 70, 34, 13, 51, 117, 83, 34, 110, 78, 38, 74, 64, 103, 31, 68, 3, 45, 10, 121, 67, 66, 77, 108, 31, 1, 93, 0, 122, 30, 48, 63, 98, 85, 122, 92, 20, 70, 36, 61, 68, 99, 66, 61, 47, 102, 20, 26, 66, 72, 107, 99, 14, 45], [95, 82, 102, 19, 74, 114, 77, 39, 99, 90, 35, 2, 89, 102, 51, 3, 46, 56, 49, 87, 22, 61, 91, 74, 25, 1, 66, 123, 19, 11, 23, 49, 124, 76, 94, 41, 44, 103, 59, 38, 97, 117, 118, 43, 102, 61, 17, 83, 80, 9, 74, 45, 95, 21, 60, 33, 113, 22, 89, 68, 106, 110, 118, 60], [50, 75, 61, 11, 2, 46, 33, 19, 89, 50, 93, 45, 81, 23, 118, 106, 26, 80, 34, 111, 1, 72, 42, 121, 12, 46, 78, 1, 95, 2, 22, 57, 73, 93, 87, 22, 52, 18, 21, 4, 74, 61, 125, 109, 5, 21, 24, 28, 2, 2, 116, 126, 105, 96, 55, 104, 94, 73, 61, 45, 62, 18, 9, 121], [37, 96, 123, 4, 105, 106, 59, 85, 55, 86, 82, 5, 109, 77, 98, 108, 4, 26, 47, 111, 47, 43, 0, 125, 80, 31, 34, 86, 2, 0, 106, 108, 68, 117, 127, 115, 57, 40, 96, 23, 49, 30, 54, 87, 55, 29, 58, 7, 104, 42, 95, 67, 75, 125, 80, 13, 124, 48, 123, 112, 4, 48, 103, 45], [38, 89, 57, 83, 68, 12, 112, 113, 23, 27, 3, 17, 123, 63, 125, 79, 110, 110, 105, 12, 45, 104, 85, 108, 36, 42, 1, 65, 5, 90, 3, 30, 13, 122, 59, 69, 102, 90, 89, 13, 126, 62, 92, 114, 82, 85, 72, 83, 70, 113, 72, 88, 108, 85, 39, 25, 101, 56, 12, 71, 117, 82, 85, 18], [0, 14, 119, 54, 10, 86, 70, 10, 108, 99, 87, 93, 127, 121, 125, 2, 55, 116, 20, 25, 29, 1, 95, 22, 63, 123, 51, 123, 73, 45, 40, 86, 60, 44, 108, 94, 108, 6, 6, 101, 49, 102, 114, 34, 124, 19, 38, 10, 94, 73, 116, 16, 77, 99, 20, 112, 11, 85, 38, 30, 71, 28, 112, 23], [70, 104, 89, 34, 119, 125, 111, 127, 32, 85, 54, 112, 18, 8, 79, 119, 109, 61, 90, 62, 7, 117, 34, 12, 75, 57, 19, 115, 124, 124, 60, 109, 127, 89, 42, 9, 111, 102, 41, 23, 63, 9, 113, 67, 95, 62, 84, 124, 30, 82, 15, 113, 34, 17, 31, 39, 117, 94, 24, 92, 68, 54, 98, 24], [61, 55, 26, 109, 9, 115, 117, 2, 13, 113, 94, 58, 52, 37, 8, 12, 75, 120, 45, 13, 88, 86, 31, 15, 78, 40, 99, 118, 37, 22, 69, 37, 49, 26, 72, 47, 85, 70, 19, 52, 54, 86, 24, 22, 99, 0, 120, 0, 108, 52, 12, 88, 42, 24, 49, 113, 51, 15, 72, 59, 7, 102, 53, 12], [35, 71, 41, 71, 38, 49, 58, 32, 70, 75, 25, 24, 82, 34, 1, 7, 74, 124, 116, 103, 91, 22, 25, 106, 57, 33, 7, 13, 17, 12, 127, 0, 48, 111, 81, 118, 51, 106, 1, 124, 85, 50, 19, 49, 84, 105, 100, 120, 23, 49, 37, 48, 24, 80, 123, 10, 56, 39, 39, 68, 43, 57, 15, 62], [0, 74, 8, 26, 51, 105, 25, 56, 4, 88, 32, 75, 25, 83, 46, 61, 114, 23, 81, 73, 36, 77, 45, 51, 57, 59, 24, 95, 89, 49, 15, 48, 53, 94, 92, 83, 48, 93, 56, 46, 62, 21, 87, 37, 36, 29, 87, 35, 119, 14, 11, 109, 44, 26, 118, 34, 79, 17, 66, 46, 50, 64, 105, 81], [24, 78, 102, 81, 35, 21, 81, 86, 18, 74, 17, 3, 47, 51, 60, 53, 40, 26, 63, 10, 38, 69, 3, 7, 6, 98, 52, 73, 113, 21, 117, 77, 65, 107, 79, 37, 30, 79, 113, 99, 20, 1, 63, 10, 8, 42, 85, 44, 100, 114, 88, 119, 82, 7, 8, 82, 9, 116, 94, 29, 99, 103, 69, 102], [103, 95, 35, 87, 59, 49, 38, 47, 7, 89, 121, 16, 121, 105, 21, 125, 49, 125, 57, 32, 60, 63, 14, 25, 126, 105, 92, 20, 105, 82, 107, 59, 106, 3, 58, 24, 124, 49, 32, 97, 43, 28, 70, 81, 22, 109, 103, 35, 13, 25, 116, 112, 47, 62, 81, 84, 123, 84, 90, 111, 8, 119, 9, 94], [127, 104, 120, 96, 114, 17, 121, 24, 35, 100, 103, 72, 17, 23, 123, 47, 62, 97, 113, 48, 13, 11, 16, 57, 118, 18, 82, 22, 28, 76, 121, 52, 122, 50, 97, 23, 58, 18, 117, 122, 22, 0, 82, 85, 61, 117, 91, 14, 36, 112, 84, 60, 41, 126, 69, 64, 119, 97, 2, 20, 34, 120, 43, 84], [9, 117, 119, 8, 6, 92, 104, 113, 113, 35, 55, 25, 21, 85, 120, 4, 81, 57, 28, 118, 25, 89, 87, 86, 61, 3, 88, 126, 46, 81, 113, 9, 107, 46, 54, 20, 97, 99, 55, 92, 39, 60, 5, 71, 54, 82, 117, 52, 116, 11, 63, 90, 45, 37, 24, 47, 82, 7, 3, 119, 115, 84, 2, 21], [18, 43, 98, 1, 32, 69, 18, 36, 6, 116, 21, 12, 75, 37, 124, 26, 50, 87, 22, 1, 7, 28, 16, 85, 43, 104, 121, 55, 9, 29, 110, 76, 46, 2, 82, 93, 29, 72, 21, 100, 72, 118, 46, 108, 87, 69, 27, 50, 76, 58, 8, 2, 52, 65, 41, 52, 33, 6, 80, 26, 78, 57, 25, 35], [116, 9, 71, 44, 90, 42, 51, 78, 74, 84, 76, 105, 112, 38, 98, 108, 24, 53, 113, 51, 39, 101, 23, 87, 0, 20, 21, 98, 102, 68, 80, 31, 58, 78, 4, 86, 2, 115, 19, 55, 87, 109, 80, 110, 103, 121, 105, 118, 63, 71, 70, 31, 40, 82, 42, 50, 118, 36, 7, 69, 15, 18, 64, 117], [45, 25, 27, 113, 115, 66, 63, 44, 1, 2, 101, 76, 99, 35, 45, 42, 19, 32, 67, 38, 84, 103, 18, 24, 116, 10, 25, 3, 13, 33, 31, 79, 11, 98, 72, 102, 64, 49, 62, 6, 24, 68, 69, 70, 6, 115, 61, 80, 81, 46, 99, 86, 16, 122, 28, 113, 126, 4, 38, 36, 3, 10, 69, 84], [107, 79, 11, 118, 6, 18, 57, 50, 21, 6, 8, 7, 117, 42, 84, 114, 127, 126, 95, 94, 34, 119, 40, 83, 84, 48, 109, 126, 54, 75, 95, 92, 51, 76, 51, 31, 22, 93, 72, 11, 79, 45, 83, 85, 6, 116, 98, 61, 110, 84, 76, 118, 52, 42, 90, 24, 69, 112, 99, 85, 103, 69, 7, 17], [122, 79, 56, 17, 51, 92, 106, 60, 100, 63, 112, 99, 104, 125, 33, 52, 80, 33, 32, 18, 98, 48, 89, 63, 122, 46, 108, 54, 26, 39, 5, 18, 42, 48, 72, 88, 49, 108, 82, 97, 54, 40, 35, 99, 98, 83, 103, 32, 71, 56, 29, 105, 112, 52, 23, 100, 50, 23, 25, 10, 18, 65, 31, 107], [10, 2, 12, 91, 122, 28, 0, 119, 93, 31, 78, 24, 10, 65, 55, 108, 25, 116, 99, 74, 14, 12, 115, 70, 76, 39, 48, 84, 7, 93, 60, 55, 80, 14, 76, 7, 48, 14, 35, 29, 34, 40, 48, 15, 17, 123, 100, 38, 125, 77, 36, 94, 45, 81, 65, 55, 114, 40, 20, 84, 40, 21, 35, 23], [2, 73, 14, 117, 41, 1, 39, 12, 70, 14, 34, 15, 60, 101, 5, 35, 6, 84, 15, 101, 124, 13, 50, 42, 49, 82, 98, 39, 95, 21, 31, 46, 105, 17, 11, 48, 1, 36, 69, 62, 110, 85, 124, 105, 71, 3, 14, 98, 87, 35, 45, 40, 124, 19, 104, 72, 118, 95, 104, 116, 105, 96, 101, 37], [55, 86, 100, 66, 5, 10, 127, 110, 19, 100, 109, 51, 67, 111, 124, 18, 31, 61, 59, 78, 52, 98, 67, 54, 125, 85, 106, 119, 56, 50, 96, 96, 52, 94, 57, 116, 37, 14, 4, 74, 59, 114, 17, 80, 76, 68, 29, 126, 69, 82, 15, 4, 84, 45, 74, 72, 68, 103, 66, 78, 71, 39, 100, 55], [123, 126, 98, 59, 50, 108, 89, 50, 72, 98, 110, 124, 5, 60, 29, 2, 51, 58, 112, 72, 106, 1, 110, 120, 126, 32, 50, 80, 106, 117, 67, 37, 38, 98, 63, 107, 70, 126, 38, 105, 92, 94, 0, 114, 3, 63, 120, 0, 104, 37, 5, 99, 4, 115, 75, 101, 110, 4, 19, 96, 116, 49, 121, 101], [95, 0, 12, 93, 115, 80, 94, 25, 52, 111, 32, 22, 40, 13, 22, 45, 121, 118, 16, 121, 43, 64, 42, 119, 7, 43, 113, 59, 125, 0, 105, 82, 96, 103, 96, 86, 111, 82, 124, 87, 51, 119, 98, 101, 64, 71, 107, 4, 21, 54, 4, 55, 91, 113, 25, 43, 36, 49, 38, 51, 56, 16, 91, 126], [81, 7, 36, 99, 14, 100, 88, 10, 17, 58, 5, 66, 108, 73, 3, 49, 108, 40, 123, 36, 16, 39, 125, 63, 92, 68, 55, 89, 75, 109, 25, 95, 102, 118, 23, 104, 24, 45, 114, 108, 51, 67, 29, 53, 122, 92, 74, 41, 87, 5, 103, 61, 10, 94, 45, 87, 111, 72, 124, 11, 4, 109, 80, 92], [79, 102, 121, 98, 85, 11, 46, 89, 111, 92, 90, 66, 73, 17, 4, 113, 75, 82, 80, 4, 61, 8, 51, 96, 52, 121, 99, 89, 8, 24, 97, 115, 43, 86, 65, 112, 14, 110, 56, 64, 82, 123, 24, 32, 71, 73, 100, 79, 1, 107, 27, 103, 75, 91, 100, 41, 126, 29, 83, 24, 111, 24, 20, 4], [122, 67, 12, 75, 111, 9, 70, 101, 118, 104, 41, 37, 112, 66, 74, 99, 12, 78, 60, 88, 93, 111, 3, 75, 81, 62, 118, 77, 107, 67, 24, 19, 76, 82, 126, 115, 126, 75, 112, 8, 108, 114, 63, 79, 124, 103, 83, 81, 96, 72, 77, 127, 123, 125, 86, 107, 96, 93, 24, 3, 63, 98, 99, 26], [104, 82, 11, 15, 80, 88, 101, 35, 43, 65, 27, 34, 29, 89, 70, 81, 34, 31, 17, 34, 101, 76, 122, 45, 126, 71, 90, 48, 53, 118, 63, 22, 99, 0, 49, 53, 56, 58, 3, 26, 14, 29, 69, 72, 124, 75, 108, 123, 20, 116, 17, 77, 79, 31, 15, 53, 7, 126, 66, 44, 125, 69, 25, 94], [85, 29, 39, 98, 72, 80, 62, 122, 121, 119, 14, 57, 84, 62, 82, 19, 50, 16, 106, 106, 105, 113, 76, 24, 87, 32, 18, 54, 108, 43, 61, 101, 81, 112, 111, 0, 46, 7, 104, 37, 68, 12, 34, 88, 83, 87, 25, 33, 26, 80, 126, 123, 68, 6, 21, 123, 51, 30, 127, 85, 85, 27, 26, 17], [100, 22, 117, 84, 116, 118, 0, 105, 52, 82, 55, 120, 99, 91, 120, 45, 64, 10, 123, 90, 56, 36, 38, 111, 89, 63, 45, 113, 58, 61, 102, 26, 19, 2, 53, 57, 81, 52, 102, 1, 76, 56, 107, 5, 60, 54, 93, 71, 54, 44, 43, 51, 6, 92, 6, 47, 32, 95, 104, 47, 99, 7, 45, 120], [83, 20, 49, 60, 95, 120, 111, 19, 65, 81, 69, 2, 53, 99, 70, 23, 126, 41, 122, 81, 79, 2, 102, 72, 29, 42, 1, 38, 50, 65, 46, 47, 88, 27, 53, 109, 80, 33, 111, 106, 30, 94, 66, 6, 115, 105, 41, 33, 2, 96, 2, 17, 123, 32, 126, 75, 7, 83, 18, 79, 70, 16, 109, 82], [66, 90, 127, 71, 91, 121, 36, 23, 13, 79, 54, 56, 30, 48, 126, 61, 20, 89, 47, 27, 44, 40, 53, 44, 63, 87, 105, 85, 14, 38, 5, 7, 120, 88, 25, 95, 101, 35, 109, 105, 82, 79, 102, 120, 5, 24, 126, 60, 23, 44, 22, 63, 79, 84, 27, 115, 78, 119, 21, 96, 6, 60, 123, 4], [82, 113, 69, 89, 34, 46, 16, 6, 33, 32, 5, 91, 82, 79, 73, 94, 25, 36, 119, 19, 99, 123, 34, 27, 0, 22, 119, 65, 26, 125, 98, 31, 74, 5, 15, 68, 27, 67, 8, 35, 19, 62, 101, 101, 112, 101, 8, 90, 119, 70, 110, 89, 11, 96, 49, 85, 25, 19, 53, 37, 117, 126, 72, 8], [124, 6, 95, 72, 30, 74, 121, 56, 50, 4, 43, 54, 93, 89, 19, 48, 64, 125, 69, 117, 127, 64, 114, 15, 71, 104, 127, 67, 48, 40, 94, 124, 52, 63, 54, 88, 32, 44, 85, 108, 63, 42, 98, 36, 18, 107, 13, 45, 93, 59, 91, 122, 78, 42, 116, 84, 26, 16, 23, 91, 33, 110, 12, 127], [31, 110, 34, 53, 77, 93, 89, 38, 21, 28, 12, 57, 41, 76, 105, 17, 111, 9, 109, 96, 88, 49, 55, 101, 32, 26, 115, 102, 75, 104, 10, 121, 107, 116, 110, 92, 63, 21, 46, 78, 13, 127, 79, 29, 102, 0, 56, 71, 17, 96, 124, 43, 0, 2, 3, 28, 35, 23, 107, 82, 113, 20, 95, 54], [111, 71, 15, 62, 108, 34, 34, 67, 104, 28, 105, 54, 22, 10, 64, 10, 39, 23, 55, 25, 14, 40, 45, 97, 117, 89, 63, 54, 117, 118, 50, 27, 111, 84, 67, 81, 75, 10, 49, 45, 127, 76, 81, 76, 125, 6, 117, 76, 59, 37, 87, 8, 96, 110, 89, 99, 107, 81, 32, 60, 43, 105, 78, 97], [14, 123, 2, 37, 68, 79, 112, 26, 76, 73, 9, 116, 34, 33, 56, 86, 26, 80, 55, 34, 11, 23, 16, 71, 80, 50, 69, 60, 11, 114, 61, 47, 55, 13, 41, 21, 104, 39, 92, 123, 62, 91, 15, 8, 120, 39, 44, 89, 101, 67, 91, 120, 50, 4, 67, 86, 104, 74, 65, 1, 30, 35, 106, 8], [1, 102, 123, 22, 46, 103, 15, 48, 93, 8, 109, 58, 22, 119, 63, 32, 21, 50, 117, 22, 54, 33, 57, 42, 10, 23, 37, 10, 108, 9, 18, 86, 103, 6, 81, 46, 35, 70, 88, 124, 21, 4, 115, 53, 26, 95, 102, 43, 4, 36, 93, 99, 102, 23, 86, 62, 118, 74, 96, 10, 125, 114, 123, 53], [34, 69, 126, 8, 62, 96, 18, 40, 7, 78, 51, 99, 99, 56, 76, 87, 0, 108, 45, 107, 9, 112, 70, 0, 56, 31, 98, 59, 44, 36, 85, 38, 49, 47, 51, 14, 66, 54, 126, 84, 60, 45, 88, 0, 124, 16, 104, 59, 11, 103, 117, 103, 18, 81, 24, 78, 80, 47, 33, 72, 56, 88, 74, 14], [62, 122, 16, 72, 68, 70, 30, 18, 23, 59, 47, 102, 100, 106, 6, 10, 64, 20, 98, 119, 77, 119, 6, 109, 116, 0, 80, 112, 92, 66, 120, 69, 13, 53, 65, 112, 116, 105, 12, 21, 39, 74, 47, 73, 12, 44, 27, 38, 31, 103, 113, 37, 111, 78, 59, 41, 46, 67, 8, 51, 5, 32, 86, 14], [117, 57, 26, 121, 76, 29, 41, 50, 42, 87, 81, 27, 108, 35, 44, 88, 44, 99, 127, 35, 110, 19, 58, 97, 104, 122, 31, 27, 50, 11, 101, 52, 31, 66, 75, 13, 113, 51, 44, 33, 60, 48, 95, 41, 44, 59, 39, 83, 68, 33, 83, 72, 127, 52, 8, 54, 34, 87, 106, 111, 49, 17, 66, 16], [116, 46, 22, 124, 67, 48, 30, 91, 43, 80, 88, 112, 125, 1, 36, 15, 121, 53, 44, 94, 25, 125, 7, 80, 73, 122, 96, 24, 48, 106, 114, 1, 90, 36, 101, 117, 95, 40, 66, 110, 39, 87, 34, 57, 48, 24, 79, 74, 46, 10, 0, 41, 9, 40, 4, 90, 36, 98, 30, 79, 49, 94, 100, 105], [72, 13, 73, 3, 21, 127, 123, 43, 23, 20, 83, 100, 22, 116, 19, 18, 61, 22, 70, 100, 60, 19, 30, 121, 0, 82, 76, 29, 83, 46, 116, 35, 9, 53, 95, 15, 66, 15, 127, 114, 49, 65, 79, 30, 125, 41, 114, 9, 112, 73, 102, 5, 47, 34, 101, 38, 45, 71, 69, 107, 113, 8, 30, 89], [70, 54, 103, 89, 114, 32, 57, 92, 50, 80, 3, 49, 105, 87, 123, 62, 10, 41, 95, 1, 50, 47, 75, 85, 78, 29, 31, 22, 114, 66, 125, 93, 87, 99, 90, 1, 36, 57, 103, 107, 118, 10, 16, 85, 36, 53, 120, 42, 112, 85, 89, 66, 32, 79, 118, 84, 44, 2, 37, 119, 5, 104, 53, 11], [65, 42, 85, 25, 64, 28, 86, 120, 65, 1, 46, 43, 81, 34, 98, 18, 106, 83, 35, 109, 116, 59, 16, 17, 125, 36, 32, 31, 28, 37, 81, 26, 9, 91, 122, 34, 108, 23, 107, 55, 27, 107, 34, 75, 49, 59, 45, 90, 78, 102, 40, 62, 85, 115, 70, 28, 9, 83, 92, 118, 0, 114, 8, 58], [36, 31, 26, 62, 62, 93, 4, 120, 3, 33, 28, 48, 94, 62, 96, 123, 126, 78, 5, 76, 53, 117, 63, 34, 21, 10, 101, 84, 36, 66, 77, 80, 102, 16, 26, 30, 113, 62, 45, 61, 96, 64, 44, 34, 25, 47, 96, 49, 31, 57, 3, 24, 121, 114, 92, 124, 32, 100, 115, 126, 29, 1, 83, 87], [2, 4, 48, 97, 120, 66, 52, 18, 65, 108, 91, 13, 56, 88, 15, 60, 19, 37, 8, 47, 35, 64, 54, 67, 32, 72, 121, 83, 9, 3, 14, 49, 37, 84, 21, 91, 12, 4, 83, 37, 33, 88, 36, 67, 122, 59, 25, 60, 61, 86, 59, 42, 93, 8, 77, 99, 16, 62, 78, 16, 49, 58, 77, 116], [86, 0, 61, 49, 51, 49, 82, 52, 100, 15, 14, 34, 18, 42, 68, 93, 53, 101, 91, 16, 12, 89, 82, 33, 30, 95, 123, 50, 10, 23, 125, 13, 42, 108, 32, 91, 98, 28, 38, 88, 123, 119, 104, 119, 66, 119, 72, 80, 72, 14, 68, 86, 21, 47, 13, 15, 54, 45, 105, 31, 41, 72, 76, 76], [65, 48, 67, 51, 109, 90, 17, 82, 94, 5, 96, 22, 48, 68, 49, 14, 88, 127, 62, 72, 49, 99, 17, 94, 31, 86, 105, 70, 25, 71, 53, 125, 25, 62, 15, 30, 98, 6, 50, 65, 17, 61, 64, 123, 63, 75, 112, 69, 110, 121, 121, 118, 79, 90, 69, 88, 2, 127, 99, 34, 30, 110, 29, 63], [111, 93, 55, 38, 59, 108, 53, 108, 36, 118, 99, 89, 16, 60, 99, 73, 25, 11, 106, 70, 55, 3, 93, 105, 48, 108, 121, 122, 37, 73, 118, 112, 43, 48, 32, 61, 66, 103, 3, 3, 75, 76, 49, 96, 113, 42, 75, 68, 115, 56, 68, 47, 1, 123, 16, 104, 104, 53, 40, 31, 99, 113, 98, 5], [75, 110, 29, 118, 61, 101, 52, 44, 40, 27, 97, 85, 28, 111, 39, 104, 6, 23, 50, 29, 40, 119, 58, 115, 113, 74, 78, 95, 127, 109, 32, 11, 120, 74, 114, 18, 11, 63, 76, 52, 83, 64, 52, 91, 51, 9, 69, 11, 122, 83, 88, 9, 85, 8, 91, 49, 94, 125, 100, 115, 35, 93, 83, 66], [108, 127, 127, 62, 22, 68, 62, 111, 24, 23, 14, 69, 17, 15, 13, 53, 16, 52, 117, 119, 25, 68, 14, 34, 6, 49, 3, 17, 82, 13, 91, 90, 86, 100, 122, 122, 89, 54, 119, 62, 37, 125, 113, 35, 27, 44, 68, 93, 91, 15, 49, 104, 116, 76, 44, 6, 22, 18, 7, 61, 90, 125, 48, 5], [24, 67, 62, 14, 30, 71, 45, 81, 77, 91, 102, 25, 123, 12, 6, 94, 19, 5, 92, 18, 97, 59, 17, 46, 1, 36, 5, 106, 38, 1, 11, 14, 119, 1, 53, 58, 51, 85, 57, 28, 17, 98, 96, 87, 81, 75, 9, 77, 67, 106, 113, 10, 112, 87, 118, 0, 60, 121, 28, 17, 91, 50, 25, 16], [120, 19, 85, 109, 79, 112, 47, 71, 16, 56, 45, 29, 70, 84, 90, 0, 69, 98, 54, 16, 127, 28, 65, 66, 121, 82, 110, 110, 78, 81, 105, 7, 23, 37, 96, 58, 81, 46, 44, 50, 18, 51, 22, 37, 58, 62, 59, 32, 66, 82, 111, 121, 56, 73, 79, 102, 50, 77, 95, 91, 96, 117, 123, 33], [75, 92, 17, 111, 106, 48, 20, 61, 5, 114, 117, 72, 104, 67, 99, 101, 124, 48, 65, 125, 86, 70, 12, 63, 69, 16, 70, 90, 74, 31, 111, 38, 59, 73, 27, 91, 42, 84, 104, 47, 39, 42, 11, 89, 29, 71, 75, 83, 121, 110, 126, 35, 126, 49, 91, 74, 14, 93, 52, 100, 21, 107, 17, 12], [120, 95, 30, 17, 78, 23, 106, 126, 98, 19, 101, 100, 121, 54, 81, 9, 49, 97, 40, 94, 96, 47, 61, 38, 82, 112, 29, 111, 112, 80, 39, 55, 29, 116, 79, 40, 6, 84, 52, 17, 122, 22, 108, 12, 102, 75, 28, 24, 46, 121, 76, 23, 104, 57, 121, 77, 7, 4, 110, 42, 8, 25, 70, 73], [111, 22, 63, 61, 36, 77, 32, 53, 66, 34, 93, 81, 52, 21, 57, 27, 76, 31, 79, 105, 39, 110, 74, 113, 127, 94, 47, 54, 43, 1, 25, 14, 32, 16, 32, 39, 127, 112, 69, 59, 15, 46, 98, 82, 93, 60, 53, 113, 109, 63, 2, 115, 53, 122, 120, 62, 44, 109, 80, 17, 69, 44, 104, 46], [124, 54, 94, 81, 63, 5, 61, 33, 55, 63, 110, 4, 40, 98, 27, 36, 71, 35, 80, 77, 69, 12, 84, 90, 84, 122, 11, 73, 16, 72, 105, 0, 36, 88, 6, 123, 50, 83, 20, 60, 17, 100, 24, 28, 105, 32, 84, 0, 126, 47, 64, 34, 99, 26, 97, 0, 97, 92, 126, 98, 70, 28, 41, 23], [6, 24, 106, 26, 123, 57, 105, 43, 69, 34, 28, 0, 50, 97, 5, 94, 125, 126, 53, 67, 125, 2, 102, 92, 66, 44, 12, 26, 92, 56, 91, 100, 44, 2, 93, 52, 15, 110, 42, 93, 45, 56, 124, 68, 78, 79, 1, 24, 116, 49, 55, 19, 114, 18, 95, 52, 56, 99, 2, 60, 97, 67, 31, 70], [24, 80, 106, 71, 108, 14, 66, 4, 63, 68, 105, 94, 11, 107, 10, 14, 45, 9, 37, 6, 0, 68, 2, 122, 103, 31, 6, 20, 58, 3, 4, 46, 35, 7, 120, 95, 37, 43, 110, 33, 86, 10, 126, 78, 43, 31, 78, 77, 126, 51, 46, 13, 2, 6, 51, 117, 95, 116, 73, 111, 93, 7, 18, 5], [29, 73, 3, 73, 108, 98, 114, 106, 42, 67, 3, 24, 60, 23, 70, 91, 41, 15, 36, 10, 125, 60, 61, 127, 37, 38, 83, 29, 110, 51, 86, 64, 64, 78, 13, 25, 79, 22, 123, 42, 57, 100, 71, 104, 38, 82, 114, 15, 47, 94, 64, 77, 23, 88, 78, 48, 57, 70, 63, 39, 99, 63, 84, 19]]
key = open("flag.txt","rb").read()
key = key.replace(b"tjctf{", b"").replace(b"}", b"")
message = bytearray(b"yellow submarine")
def get_bit(b, n):
byte = b[n // 8]
return (byte >> (7 - (n % 8))) & 1
def set_bit(b, n, v):
byte = b[n // 8]
byte &= ~(v << (7 - (n % 8)))
byte |= v << (7 - (n % 8))
b[n // 8] = byte
return b
def bfri(i):
a = hex(i)[2:]
if (len(a) % 2 == 1):
a = "0" + a
return bytes.fromhex(a)
def xor(x1, x2):
assert len(x1) == len(x2)
return b"".join([bfri(x1[i] ^ x2[i]) for i in range(len(x1))])
def band(x1, x2):
assert len(x1) == len(x2)
return b"".join([bfri(x1[i] & x2[i]) for i in range(len(x1))])
def rrot(x1, n):
arr = bytearray(x1)
for i in range(len(x1)):
arr[(i + n) % len(x1)] = x1[i]
return arr
def lrot(x1, n):
arr = bytearray(x1)
for i in range(len(x1)):
arr[i] = x1[(i + n) % len(x1)]
return arr
def keysch(k):
out = bytearray(b"\x00"*16)
arr = [0 for i in range(128)]
for i in range(128):
for bit_loc in schedule[i]:
arr[i] ^= get_bit(k, bit_loc)
for i in range(128):
out = set_bit(out, i, arr[i])
return out
def enc(p, k):
dat = bytearray(p)
return xor(p, keysch(k))
def dec(c, k):
dat = bytearray(c)
return xor(c, keysch(k))
c = enc(message, key)
print("m:", message)
print("c:", c)