our_map
=
[[
0x61
,
0xEC
,
0xA6
,
0x8A
,
0x85
,
0xF0
,
0x97
,
0xB5
,
0xF5
,
0xF3
],
[
0x38
,
0xEE
,
0x26
,
0x0A
,
0x22
,
0x3A
,
0x5C
,
0x92
,
0x8F
,
0xA7
],
[
0x12
,
0xB2
,
0x3E
,
0x9E
,
0x89
,
0xC2
,
0x4E
,
0xA4
,
0x9F
,
0x96
],
[
0x50
,
0x45
,
0x38
,
0xC4
,
0x99
,
0xA8
,
0x5E
,
0x97
,
0xEA
,
0xDC
],
[
0xAF
,
0xAF
,
0xD0
,
0xF3
,
0xED
,
0xF4
,
0x2A
,
0xA3
,
0xA6
,
0xD2
],
[
0xDE
,
0xBB
,
0x0A
,
0x26
,
0x49
,
0x74
,
0x2C
,
0xDB
,
0xA1
,
0xF6
],
[
0xEC
,
0x92
,
0x2E
,
0xC9
,
0xD0
,
0xFE
,
0xE9
,
0xF1
,
0xA0
,
0xE0
],
[
0xEC
,
0xEE
,
0x34
,
0x76
,
0x3E
,
0x08
,
0x38
,
0x72
,
0xA7
,
0xF3
],
[
0xEE
,
0x94
,
0xE2
,
0xC0
,
0xBE
,
0xB1
,
0xF7
,
0x0A
,
0xE3
,
0xBD
],
[
0x66
,
0x64
,
0x18
,
0x08
,
0x71
,
0x36
,
0x7A
,
0x5A
,
0x9F
,
0xB4
]]
strings
=
[[
70
,
73
,
74
,
119
,
106
], [
51
,
36
,
52
,
0
,
38
], [
105
,
65
,
114
,
69
,
69
], [
98
,
73
,
119
,
75
,
86
], [
76
,
99
,
86
,
109
,
110
], [
75
,
89
,
79
,
80
,
116
], [
7
,
49
,
33
,
49
,
53
], [
113
,
114
,
67
,
77
,
72
], [
108
,
116
,
115
,
80
,
105
], [
110
,
110
,
80
,
79
,
108
], [
66
,
68
,
109
,
103
,
103
], [
67
,
68
,
88
,
65
,
104
], [
77
,
90
,
82
,
110
,
65
], [
74
,
89
,
87
,
108
,
79
], [
118
,
101
,
100
,
109
,
82
], [
86
,
77
,
118
,
69
,
87
], [
67
,
82
,
79
,
70
,
109
], [
75
,
118
,
67
,
75
,
77
], [
83
,
87
,
82
,
104
,
69
], [
103
,
99
,
107
,
118
,
111
], [
15
,
14
,
27
,
32
,
24
], [
108
,
119
,
101
,
114
,
119
], [
103
,
80
,
65
,
89
,
97
], [
83
,
73
,
118
,
115
,
66
], [
71
,
100
,
78
,
82
,
82
], [
68
,
82
,
73
,
105
,
76
], [
85
,
101
,
78
,
81
,
84
], [
112
,
88
,
87
,
112
,
99
], [
111
,
75
,
108
,
74
,
113
], [
84
,
108
,
70
,
84
,
71
], [
65
,
87
,
107
,
98
,
83
], [
70
,
111
,
98
,
69
,
113
], [
121
,
76
,
90
,
70
,
111
], [
86
,
120
,
71
,
107
,
108
], [
89
,
79
,
118
,
85
,
66
], [
24
,
26
,
25
,
48
,
18
], [
118
,
112
,
108
,
115
,
111
], [
121
,
114
,
119
,
70
,
103
], [
79
,
86
,
87
,
115
,
80
], [
88
,
67
,
67
,
113
,
115
], [
75
,
101
,
112
,
83
,
99
], [
106
,
74
,
114
,
89
,
71
], [
113
,
108
,
71
,
121
,
109
], [
100
,
74
,
77
,
71
,
122
], [
84
,
112
,
70
,
80
,
121
], [
89
,
72
,
107
,
120
,
112
], [
77
,
120
,
79
,
82
,
118
], [
69
,
82
,
101
,
120
,
70
], [
70
,
71
,
109
,
97
,
88
], [
70
,
98
,
81
,
118
,
117
], [
71
,
97
,
69
,
79
,
98
], [
90
,
74
,
106
,
75
,
121
], [
83
,
117
,
118
,
66
,
111
], [
104
,
121
,
67
,
106
,
113
], [
82
,
116
,
81
,
83
,
70
], [
119
,
74
,
65
,
79
,
110
], [
107
,
90
,
120
,
98
,
72
], [
65
,
111
,
79
,
73
,
70
], [
76
,
86
,
122
,
88
,
100
], [
85
,
109
,
90
,
111
,
83
], [
120
,
115
,
83
,
74
,
102
], [
100
,
65
,
116
,
111
,
70
], [
65
,
99
,
110
,
118
,
75
], [
106
,
105
,
83
,
65
,
98
], [
80
,
100
,
71
,
116
,
121
], [
107
,
106
,
70
,
87
,
72
], [
68
,
90
,
108
,
89
,
73
], [
110
,
87
,
120
,
121
,
74
], [
118
,
107
,
99
,
81
,
85
], [
75
,
112
,
72
,
88
,
72
], [
75
,
79
,
100
,
107
,
73
], [
90
,
118
,
88
,
106
,
76
], [
67
,
99
,
85
,
67
,
122
], [
80
,
89
,
66
,
80
,
82
], [
121
,
101
,
97
,
112
,
102
], [
71
,
89
,
115
,
105
,
101
], [
102
,
90
,
112
,
66
,
121
], [
98
,
97
,
111
,
68
,
79
], [
117
,
71
,
88
,
80
,
78
], [
88
,
122
,
104
,
74
,
88
], [
77
,
88
,
122
,
79
,
120
], [
113
,
86
,
105
,
76
,
67
], [
113
,
65
,
122
,
90
,
86
], [
84
,
82
,
104
,
87
,
105
], [
68
,
68
,
115
,
107
,
101
], [
83
,
66
,
89
,
87
,
88
], [
79
,
86
,
108
,
101
,
82
], [
85
,
100
,
100
,
108
,
89
], [
76
,
98
,
105
,
80
,
72
], [
86
,
65
,
104
,
119
,
121
], [
68
,
98
,
107
,
88
,
113
], [
79
,
100
,
106
,
86
,
114
], [
106
,
89
,
97
,
108
,
70
], [
118
,
87
,
68
,
122
,
68
], [
108
,
111
,
89
,
107
,
76
], [
120
,
67
,
115
,
72
,
98
], [
114
,
114
,
89
,
102
,
86
], [
97
,
78
,
99
,
73
,
82
], [
106
,
122
,
81
,
69
,
110
], [
116
,
86
,
82
,
115
,
81
]]
def
fuck_check(x, y, mov):
xor_data
=
our_map[x][y]
cmp_data
=
strings[mov]
flag_part
=
'c'
for
i
in
range
(
5
):
flag_part
+
=
chr
((cmp_data[i] ^ xor_data) &
0xff
)
return
flag_part
visited
=
[]
def
find_valid_adjacency_list(x, y):
adjacency_list
=
[]
if
(x
+
1
<
10
)
and
([x
+
1
, y]
not
in
visited)
and
(our_map[x
+
1
][y] &
0x80
=
=
0
):
adjacency_list.append((x
+
1
, y,
'd'
))
if
(y
+
1
<
10
)
and
([x, y
+
1
]
not
in
visited)
and
(our_map[x][y
+
1
] &
0x80
=
=
0
):
adjacency_list.append((x, y
+
1
,
'r'
))
if
(x
-
1
<
10
)
and
([x
-
1
, y]
not
in
visited)
and
(our_map[x
-
1
][y] &
0x80
=
=
0
):
adjacency_list.append((x
-
1
, y,
'u'
))
if
(y
-
1
<
10
)
and
([x, y
-
1
]
not
in
visited)
and
(our_map[x][y
-
1
] &
0x80
=
=
0
):
adjacency_list.append((x, y
-
1
,
'l'
))
return
adjacency_list
def
all_see(x):
for
c
in
x:
if
ord
(c)
not
in
range
(
32
,
128
):
return
False
return
True
def
dfs(checkpoint, path, x, y):
if
our_map[x][y]
%
2
!
=
0
:
checkpoint
+
=
1
part
=
fuck_check(x, y,
len
(path)
+
1
)
if
not
all_see(part):
return
path.append(part)
print
(
"checkpoint="
+
str
(checkpoint),
"x="
+
str
(x),
"y="
+
str
(y))
if
checkpoint
=
=
4
:
print
(
"cybrics{"
+
"
".join(path)+"
f}")
return
visited.append([x, y])
valid_list
=
find_valid_adjacency_list(x, y)
for
n
in
valid_list:
pathn
=
path.copy()
pathn.append(n[
2
])
dfs(checkpoint, pathn, n[
0
], n[
1
])
path0
=
[]
dfs(
0
, path0,
0
,
0
)