node_ids
sequencelengths 4
1.4k
| edge_index
sequencelengths 1
2.22k
| text
sequencelengths 4
1.4k
| source
stringlengths 14
427k
|
---|---|---|---|
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
17,
13,
17,
13,
17,
0,
13,
17,
28,
13,
4,
13,
2,
2,
2,
4,
13,
13,
4,
13,
13,
4,
13,
13,
17,
14,
2,
13,
17,
14,
2,
13,
4,
13,
13,
4,
13,
17,
4,
13,
0,
13,
18,
13,
13,
0,
13,
17,
14,
2,
13,
17,
14,
2,
13,
4,
13,
13,
4,
13,
17,
4,
13,
0,
13,
18,
13,
13,
0,
13,
17,
14,
2,
13,
17,
14,
2,
13,
4,
13,
13,
4,
13,
17,
4,
13,
0,
13,
18,
13,
13,
0,
13,
17,
10,
17,
13,
10,
17,
13,
10,
18,
13,
10,
17,
13,
10,
18,
13,
10,
17,
13,
10,
4,
13,
10,
17,
13,
10,
4,
13,
10,
17,
13,
10,
17,
13,
10,
18,
13,
10,
4,
13
] | [
[
128,
2
],
[
146,
6
],
[
134,
10
],
[
119,
14
],
[
113,
16
],
[
110,
18
],
[
125,
21
],
[
25,
24
],
[
129,
32
],
[
147,
35
],
[
135,
38
],
[
126,
42
],
[
123,
42
],
[
117,
42
],
[
144,
42
],
[
120,
46
],
[
132,
46
],
[
129,
49
],
[
143,
56
],
[
129,
58
],
[
120,
59
],
[
132,
59
],
[
131,
61
],
[
126,
65
],
[
123,
65
],
[
117,
65
],
[
144,
65
],
[
114,
69
],
[
141,
69
],
[
147,
72
],
[
116,
79
],
[
147,
81
],
[
114,
82
],
[
141,
82
],
[
140,
84
],
[
126,
88
],
[
123,
88
],
[
117,
88
],
[
144,
88
],
[
111,
92
],
[
138,
92
],
[
135,
95
],
[
122,
102
],
[
135,
104
],
[
111,
105
],
[
138,
105
],
[
137,
107
],
[
110,
111
],
[
113,
114
],
[
116,
117
],
[
119,
120
],
[
122,
123
],
[
125,
126
],
[
128,
129
],
[
131,
132
],
[
134,
135
],
[
137,
138
],
[
140,
141
],
[
143,
144
],
[
146,
147
]
] | [
"Sa=input()\nSb=input()\nSc=input()\na,b,c=0,0,0\nd='a'\nfor i in range(len(Sa)+len(Sb)+len(Sc)+3):\n if d=='a':\n if a==len(Sa):\n print('A')\n exit()\n d=Sa[a]\n a+=1\n elif d=='b':\n if b==len(Sb):\n print('B')\n exit()\n d=Sb[b]\n b+=1\n elif d=='c':\n if c==len(Sc):\n print('C')\n exit()\n d=Sc[c]\n c+=1",
"Sa=input()",
"Sa",
"input()",
"input",
"Sb=input()",
"Sb",
"input()",
"input",
"Sc=input()",
"Sc",
"input()",
"input",
"a,b,c=0,0,0",
"a",
"0",
"b",
"0",
"c",
"0",
"d='a'",
"d",
"'a'",
"for i in range(len(Sa)+len(Sb)+len(Sc)+3):\n if d=='a':\n if a==len(Sa):\n print('A')\n exit()\n d=Sa[a]\n a+=1\n elif d=='b':\n if b==len(Sb):\n print('B')\n exit()\n d=Sb[b]\n b+=1\n elif d=='c':\n if c==len(Sc):\n print('C')\n exit()\n d=Sc[c]\n c+=1",
"i",
"range(len(Sa)+len(Sb)+len(Sc)+3)",
"range",
"len(Sa)+len(Sb)+len(Sc)+3",
"len(Sa)+len(Sb)+len(Sc)",
"len(Sa)+len(Sb)",
"len(Sa)",
"len",
"Sa",
"len(Sb)",
"len",
"Sb",
"len(Sc)",
"len",
"Sc",
"3",
"if d=='a':\n if a==len(Sa):\n print('A')\n exit()\n d=Sa[a]\n a+=1\n elif d=='b':\n if b==len(Sb):\n print('B')\n exit()\n d=Sb[b]\n b+=1\n elif d=='c':\n if c==len(Sc):\n print('C')\n exit()\n d=Sc[c]\n c+=1",
"d=='a'",
"d",
"'a'",
"if a==len(Sa):\n print('A')\n exit()\n ",
"a==len(Sa)",
"a",
"len(Sa)",
"len",
"Sa",
"print('A')",
"print",
"'A'",
"exit()",
"exit",
"d=Sa[a]",
"d",
"Sa[a]",
"Sa",
"a",
"a+=1",
"a",
"1",
"elif d=='b':\n if b==len(Sb):\n print('B')\n exit()\n d=Sb[b]\n b+=1\n ",
"d=='b'",
"d",
"'b'",
"if b==len(Sb):\n print('B')\n exit()\n ",
"b==len(Sb)",
"b",
"len(Sb)",
"len",
"Sb",
"print('B')",
"print",
"'B'",
"exit()",
"exit",
"d=Sb[b]",
"d",
"Sb[b]",
"Sb",
"b",
"b+=1",
"b",
"1",
"elif d=='c':\n if c==len(Sc):\n print('C')\n exit()\n d=Sc[c]\n c+=1",
"d=='c'",
"d",
"'c'",
"if c==len(Sc):\n print('C')\n exit()\n ",
"c==len(Sc)",
"c",
"len(Sc)",
"len",
"Sc",
"print('C')",
"print",
"'C'",
"exit()",
"exit",
"d=Sc[c]",
"d",
"Sc[c]",
"Sc",
"c",
"c+=1",
"c",
"1",
"c=0,0,0",
"0",
"c",
"b,c=0,0,0",
"0",
"b",
"d=Sb[b]",
"Sb[b]",
"d",
"a,b,c=0,0,0",
"0",
"a",
"d=Sc[c]",
"Sc[c]",
"d",
"d='a'",
"'a'",
"d",
"Sa=input()",
"input()",
"Sa",
"a+=1",
"1",
"a",
"Sc=input()",
"input()",
"Sc",
"c+=1",
"1",
"c",
"b+=1",
"1",
"b",
"d=Sa[a]",
"Sa[a]",
"d",
"Sb=input()",
"input()",
"Sb"
] | Sa=input()
Sb=input()
Sc=input()
a,b,c=0,0,0
d='a'
for i in range(len(Sa)+len(Sb)+len(Sc)+3):
if d=='a':
if a==len(Sa):
print('A')
exit()
d=Sa[a]
a+=1
elif d=='b':
if b==len(Sb):
print('B')
exit()
d=Sb[b]
b+=1
elif d=='c':
if c==len(Sc):
print('C')
exit()
d=Sc[c]
c+=1 |
[
7,
12,
13,
41,
28,
13,
4,
13,
17,
4,
4,
13,
0,
13,
13,
13,
13,
0,
13,
4,
13,
13,
0,
13,
4,
13,
13,
0,
13,
4,
13,
13,
0,
13,
2,
2,
4,
13,
13,
4,
13,
13,
4,
13,
13,
0,
13,
18,
13,
17,
28,
13,
4,
13,
13,
14,
2,
2,
13,
17,
2,
4,
13,
13,
17,
4,
13,
17,
3,
14,
2,
13,
17,
0,
13,
18,
13,
17,
24,
18,
13,
17,
14,
2,
2,
13,
17,
2,
4,
13,
13,
17,
4,
13,
17,
3,
14,
2,
13,
17,
0,
13,
18,
13,
17,
24,
18,
13,
17,
14,
2,
2,
13,
17,
2,
4,
13,
13,
17,
4,
13,
17,
3,
14,
2,
13,
17,
0,
13,
18,
13,
17,
24,
18,
13,
17,
14,
2,
13,
17,
4,
13,
10,
12,
13
] | [
[
6,
5
],
[
14,
13
],
[
14,
15
],
[
14,
16
],
[
19,
18
],
[
13,
21
],
[
24,
23
],
[
15,
26
],
[
29,
28
],
[
16,
31
],
[
34,
33
],
[
18,
38
],
[
13,
38
],
[
23,
41
],
[
15,
41
],
[
28,
44
],
[
16,
44
],
[
47,
46
],
[
18,
48
],
[
13,
48
],
[
52,
51
],
[
33,
54
],
[
46,
58
],
[
128,
58
],
[
101,
58
],
[
74,
58
],
[
18,
63
],
[
13,
63
],
[
46,
71
],
[
128,
71
],
[
101,
71
],
[
74,
71
],
[
75,
74
],
[
18,
76
],
[
13,
76
],
[
18,
80
],
[
13,
80
],
[
46,
85
],
[
128,
85
],
[
101,
85
],
[
74,
85
],
[
23,
90
],
[
15,
90
],
[
46,
98
],
[
128,
98
],
[
101,
98
],
[
74,
98
],
[
102,
101
],
[
23,
103
],
[
15,
103
],
[
23,
107
],
[
15,
107
],
[
46,
112
],
[
128,
112
],
[
101,
112
],
[
74,
112
],
[
28,
117
],
[
16,
117
],
[
46,
125
],
[
128,
125
],
[
101,
125
],
[
74,
125
],
[
129,
128
],
[
28,
130
],
[
16,
130
],
[
28,
134
],
[
16,
134
],
[
144,
141
]
] | [
"def abc045_b():\n A,B,C = [input() for i in range(3)] #入力\n A = list(A)\n B = list(B)\n C = list(C)\n D = len(A) + len(B) + len(C)\n Var = A[0] #Aスタート\n for d in range(D):\n if Var == 'a' and len(A) == 0:\n print('A')\n break\n elif Var == 'a':\n Var = A[0]\n del A[0]\n elif Var == 'b' and len(B) == 0:\n print('B')\n break\n elif Var == 'b':\n Var = B[0]\n del B[0]\n elif Var == 'c' and len(C) == 0:\n print('C')\n break\n elif Var == 'c':\n Var = C[0]\n del C[0]\nif __name__ == '__main__':\n abc045_b()",
"def abc045_b():\n A,B,C = [input() for i in range(3)] #入力\n A = list(A)\n B = list(B)\n C = list(C)\n D = len(A) + len(B) + len(C)\n Var = A[0] #Aスタート\n for d in range(D):\n if Var == 'a' and len(A) == 0:\n print('A')\n break\n elif Var == 'a':\n Var = A[0]\n del A[0]\n elif Var == 'b' and len(B) == 0:\n print('B')\n break\n elif Var == 'b':\n Var = B[0]\n del B[0]\n elif Var == 'c' and len(C) == 0:\n print('C')\n break\n elif Var == 'c':\n Var = C[0]\n del C[0]",
"abc045_b",
"input() for i in range(3)",
"for i in range(3)",
"i",
"range(3)",
"range",
"3",
"for i in range(3)",
"input()",
"input",
"A,B,C = [input() for i in range(3)]",
"A",
"[input() for i in range(3)]",
"B",
"C",
"A = list(A)",
"A",
"list(A)",
"list",
"A",
"B = list(B)",
"B",
"list(B)",
"list",
"B",
"C = list(C)",
"C",
"list(C)",
"list",
"C",
"D = len(A) + len(B) + len(C)",
"D",
"len(A) + len(B) + len(C)",
"len(A) + len(B)",
"len(A)",
"len",
"A",
"len(B)",
"len",
"B",
"len(C)",
"len",
"C",
"Var = A[0]",
"Var",
"A[0]",
"A",
"0",
"for d in range(D):\n if Var == 'a' and len(A) == 0:\n print('A')\n break\n elif Var == 'a':\n Var = A[0]\n del A[0]\n elif Var == 'b' and len(B) == 0:\n print('B')\n break\n elif Var == 'b':\n Var = B[0]\n del B[0]\n elif Var == 'c' and len(C) == 0:\n print('C')\n break\n elif Var == 'c':\n Var = C[0]\n del C[0]",
"d",
"range(D)",
"range",
"D",
"if Var == 'a' and len(A) == 0:\n print('A')\n break\n elif Var == 'a':\n Var = A[0]\n del A[0]\n elif Var == 'b' and len(B) == 0:\n print('B')\n break\n elif Var == 'b':\n Var = B[0]\n del B[0]\n elif Var == 'c' and len(C) == 0:\n print('C')\n break\n elif Var == 'c':\n Var = C[0]\n del C[0]",
"Var == 'a' and len(A) == 0",
"Var == 'a'",
"Var",
"'a'",
"len(A) == 0",
"len(A)",
"len",
"A",
"0",
"print('A')",
"print",
"'A'",
"break",
"elif Var == 'a':\n Var = A[0]\n del A[0]\n ",
"Var == 'a'",
"Var",
"'a'",
"Var = A[0]",
"Var",
"A[0]",
"A",
"0",
"del A[0]",
"A[0]",
"A",
"0",
"elif Var == 'b' and len(B) == 0:\n print('B')\n break\n ",
"Var == 'b' and len(B) == 0",
"Var == 'b'",
"Var",
"'b'",
"len(B) == 0",
"len(B)",
"len",
"B",
"0",
"print('B')",
"print",
"'B'",
"break",
"elif Var == 'b':\n Var = B[0]\n del B[0]\n ",
"Var == 'b'",
"Var",
"'b'",
"Var = B[0]",
"Var",
"B[0]",
"B",
"0",
"del B[0]",
"B[0]",
"B",
"0",
"elif Var == 'c' and len(C) == 0:\n print('C')\n break\n ",
"Var == 'c' and len(C) == 0",
"Var == 'c'",
"Var",
"'c'",
"len(C) == 0",
"len(C)",
"len",
"C",
"0",
"print('C')",
"print",
"'C'",
"break",
"elif Var == 'c':\n Var = C[0]\n del C[0]",
"Var == 'c'",
"Var",
"'c'",
"Var = C[0]",
"Var",
"C[0]",
"C",
"0",
"del C[0]",
"C[0]",
"C",
"0",
"if __name__ == '__main__':\n abc045_b()",
"__name__ == '__main__'",
"__name__",
"'__main__'",
"abc045_b()",
"abc045_b",
"def abc045_b():\n A,B,C = [input() for i in range(3)] #入力\n A = list(A)\n B = list(B)\n C = list(C)\n D = len(A) + len(B) + len(C)\n Var = A[0] #Aスタート\n for d in range(D):\n if Var == 'a' and len(A) == 0:\n print('A')\n break\n elif Var == 'a':\n Var = A[0]\n del A[0]\n elif Var == 'b' and len(B) == 0:\n print('B')\n break\n elif Var == 'b':\n Var = B[0]\n del B[0]\n elif Var == 'c' and len(C) == 0:\n print('C')\n break\n elif Var == 'c':\n Var = C[0]\n del C[0]",
"def abc045_b():\n A,B,C = [input() for i in range(3)] #入力\n A = list(A)\n B = list(B)\n C = list(C)\n D = len(A) + len(B) + len(C)\n Var = A[0] #Aスタート\n for d in range(D):\n if Var == 'a' and len(A) == 0:\n print('A')\n break\n elif Var == 'a':\n Var = A[0]\n del A[0]\n elif Var == 'b' and len(B) == 0:\n print('B')\n break\n elif Var == 'b':\n Var = B[0]\n del B[0]\n elif Var == 'c' and len(C) == 0:\n print('C')\n break\n elif Var == 'c':\n Var = C[0]\n del C[0]",
"abc045_b"
] | def abc045_b():
A,B,C = [input() for i in range(3)] #入力
A = list(A)
B = list(B)
C = list(C)
D = len(A) + len(B) + len(C)
Var = A[0] #Aスタート
for d in range(D):
if Var == 'a' and len(A) == 0:
print('A')
break
elif Var == 'a':
Var = A[0]
del A[0]
elif Var == 'b' and len(B) == 0:
print('B')
break
elif Var == 'b':
Var = B[0]
del B[0]
elif Var == 'c' and len(C) == 0:
print('C')
break
elif Var == 'c':
Var = C[0]
del C[0]
if __name__ == '__main__':
abc045_b() |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
18,
13,
13,
17,
42,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
4,
18,
13,
13,
4,
13,
0,
13,
4,
18,
13,
13,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
4,
18,
13,
13,
4,
13,
0,
13,
4,
18,
13,
13,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
4,
18,
13,
13,
4,
13,
0,
13,
4,
18,
13,
13,
17,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13
] | [
[
110,
2
],
[
113,
8
],
[
122,
14
],
[
104,
20
],
[
111,
23
],
[
105,
30
],
[
120,
30
],
[
108,
30
],
[
117,
30
],
[
111,
36
],
[
105,
42
],
[
120,
42
],
[
108,
42
],
[
117,
42
],
[
116,
47
],
[
111,
50
],
[
117,
55
],
[
105,
55
],
[
120,
55
],
[
108,
55
],
[
114,
61
],
[
117,
67
],
[
105,
67
],
[
120,
67
],
[
108,
67
],
[
107,
72
],
[
114,
75
],
[
108,
80
],
[
117,
80
],
[
105,
80
],
[
120,
80
],
[
123,
86
],
[
108,
92
],
[
117,
92
],
[
105,
92
],
[
120,
92
],
[
119,
97
],
[
123,
100
],
[
104,
105
],
[
107,
108
],
[
110,
111
],
[
113,
114
],
[
116,
117
],
[
119,
120
],
[
122,
123
]
] | [
"A = list(input())\nB = list(input())\nC = list(input())\ncurrent_state = A.pop(0)\n\nwhile True:\n if current_state == 'a':\n if len(A) == 0:\n print(current_state.upper())\n exit()\n \n current_state = A.pop(0)\n\n if current_state == 'b':\n if len(B) == 0:\n print(current_state.upper())\n exit()\n \n current_state = B.pop(0)\n \n if current_state == 'c':\n if len(C) == 0:\n print(current_state.upper())\n exit()\n \n current_state = C.pop(0)\n",
"A = list(input())",
"A",
"list(input())",
"list",
"input()",
"input",
"B = list(input())",
"B",
"list(input())",
"list",
"input()",
"input",
"C = list(input())",
"C",
"list(input())",
"list",
"input()",
"input",
"current_state = A.pop(0)",
"current_state",
"A.pop(0)",
"A.pop",
"A",
"pop",
"0",
"while True:\n if current_state == 'a':\n if len(A) == 0:\n print(current_state.upper())\n exit()\n \n current_state = A.pop(0)\n\n if current_state == 'b':\n if len(B) == 0:\n print(current_state.upper())\n exit()\n \n current_state = B.pop(0)\n \n if current_state == 'c':\n if len(C) == 0:\n print(current_state.upper())\n exit()\n \n current_state = C.pop(0)",
"True",
"if current_state == 'a':\n if len(A) == 0:\n print(current_state.upper())\n exit()\n \n current_state = A.pop(0)\n\n ",
"current_state == 'a'",
"current_state",
"'a'",
"if len(A) == 0:\n print(current_state.upper())\n exit()\n \n ",
"len(A) == 0",
"len(A)",
"len",
"A",
"0",
"print(current_state.upper())",
"print",
"current_state.upper()",
"current_state.upper",
"current_state",
"upper",
"exit()",
"exit",
"current_state = A.pop(0)",
"current_state",
"A.pop(0)",
"A.pop",
"A",
"pop",
"0",
"if current_state == 'b':\n if len(B) == 0:\n print(current_state.upper())\n exit()\n \n current_state = B.pop(0)\n \n ",
"current_state == 'b'",
"current_state",
"'b'",
"if len(B) == 0:\n print(current_state.upper())\n exit()\n \n ",
"len(B) == 0",
"len(B)",
"len",
"B",
"0",
"print(current_state.upper())",
"print",
"current_state.upper()",
"current_state.upper",
"current_state",
"upper",
"exit()",
"exit",
"current_state = B.pop(0)",
"current_state",
"B.pop(0)",
"B.pop",
"B",
"pop",
"0",
"if current_state == 'c':\n if len(C) == 0:\n print(current_state.upper())\n exit()\n \n current_state = C.pop(0)",
"current_state == 'c'",
"current_state",
"'c'",
"if len(C) == 0:\n print(current_state.upper())\n exit()\n \n ",
"len(C) == 0",
"len(C)",
"len",
"C",
"0",
"print(current_state.upper())",
"print",
"current_state.upper()",
"current_state.upper",
"current_state",
"upper",
"exit()",
"exit",
"current_state = C.pop(0)",
"current_state",
"C.pop(0)",
"C.pop",
"C",
"pop",
"0",
"current_state = A.pop(0)",
"A.pop(0)",
"current_state",
"current_state = B.pop(0)",
"B.pop(0)",
"current_state",
"A = list(input())",
"list(input())",
"A",
"B = list(input())",
"list(input())",
"B",
"current_state = A.pop(0)",
"A.pop(0)",
"current_state",
"current_state = C.pop(0)",
"C.pop(0)",
"current_state",
"C = list(input())",
"list(input())",
"C"
] | A = list(input())
B = list(input())
C = list(input())
current_state = A.pop(0)
while True:
if current_state == 'a':
if len(A) == 0:
print(current_state.upper())
exit()
current_state = A.pop(0)
if current_state == 'b':
if len(B) == 0:
print(current_state.upper())
exit()
current_state = B.pop(0)
if current_state == 'c':
if len(C) == 0:
print(current_state.upper())
exit()
current_state = C.pop(0)
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
18,
13,
13,
17,
28,
13,
4,
13,
17,
14,
2,
13,
17,
14,
2,
13,
39,
3,
0,
13,
4,
18,
13,
13,
17,
14,
2,
13,
17,
14,
2,
13,
39,
3,
0,
13,
4,
18,
13,
13,
17,
14,
2,
13,
17,
14,
2,
13,
39,
3,
0,
13,
4,
18,
13,
13,
17,
4,
13,
4,
18,
13,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13
] | [
[
86,
2
],
[
89,
8
],
[
95,
14
],
[
92,
20
],
[
87,
23
],
[
28,
27
],
[
93,
33
],
[
102,
33
],
[
105,
33
],
[
99,
33
],
[
87,
37
],
[
98,
41
],
[
87,
44
],
[
93,
49
],
[
102,
49
],
[
105,
49
],
[
99,
49
],
[
90,
53
],
[
104,
57
],
[
90,
60
],
[
93,
65
],
[
102,
65
],
[
105,
65
],
[
99,
65
],
[
96,
69
],
[
101,
73
],
[
96,
76
],
[
102,
83
],
[
105,
83
],
[
99,
83
],
[
93,
83
],
[
86,
87
],
[
89,
90
],
[
92,
93
],
[
95,
96
],
[
98,
99
],
[
101,
102
],
[
104,
105
]
] | [
"a = list(input())\nb = list(input())\nc = list(input())\n\ns = a.pop(0)\nfor i in range(400):\n if s == 'a':\n if a == []:\n break\n s = a.pop(0)\n elif s == 'b':\n if b == []:\n break\n s = b.pop(0)\n elif s == 'c':\n if c == []:\n break\n s = c.pop(0)\nprint(s.upper())",
"a = list(input())",
"a",
"list(input())",
"list",
"input()",
"input",
"b = list(input())",
"b",
"list(input())",
"list",
"input()",
"input",
"c = list(input())",
"c",
"list(input())",
"list",
"input()",
"input",
"s = a.pop(0)",
"s",
"a.pop(0)",
"a.pop",
"a",
"pop",
"0",
"for i in range(400):\n if s == 'a':\n if a == []:\n break\n s = a.pop(0)\n elif s == 'b':\n if b == []:\n break\n s = b.pop(0)\n elif s == 'c':\n if c == []:\n break\n s = c.pop(0)",
"i",
"range(400)",
"range",
"400",
"if s == 'a':\n if a == []:\n break\n s = a.pop(0)\n elif s == 'b':\n if b == []:\n break\n s = b.pop(0)\n elif s == 'c':\n if c == []:\n break\n s = c.pop(0)",
"s == 'a'",
"s",
"'a'",
"if a == []:\n break\n ",
"a == []",
"a",
"[]",
"break",
"s = a.pop(0)",
"s",
"a.pop(0)",
"a.pop",
"a",
"pop",
"0",
"elif s == 'b':\n if b == []:\n break\n s = b.pop(0)\n ",
"s == 'b'",
"s",
"'b'",
"if b == []:\n break\n ",
"b == []",
"b",
"[]",
"break",
"s = b.pop(0)",
"s",
"b.pop(0)",
"b.pop",
"b",
"pop",
"0",
"elif s == 'c':\n if c == []:\n break\n s = c.pop(0)",
"s == 'c'",
"s",
"'c'",
"if c == []:\n break\n ",
"c == []",
"c",
"[]",
"break",
"s = c.pop(0)",
"s",
"c.pop(0)",
"c.pop",
"c",
"pop",
"0",
"print(s.upper())",
"print",
"s.upper()",
"s.upper",
"s",
"upper",
"a = list(input())",
"list(input())",
"a",
"b = list(input())",
"list(input())",
"b",
"s = a.pop(0)",
"a.pop(0)",
"s",
"c = list(input())",
"list(input())",
"c",
"s = a.pop(0)",
"a.pop(0)",
"s",
"s = c.pop(0)",
"c.pop(0)",
"s",
"s = b.pop(0)",
"b.pop(0)",
"s"
] | a = list(input())
b = list(input())
c = list(input())
s = a.pop(0)
for i in range(400):
if s == 'a':
if a == []:
break
s = a.pop(0)
elif s == 'b':
if b == []:
break
s = b.pop(0)
elif s == 'c':
if c == []:
break
s = c.pop(0)
print(s.upper()) |
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
17,
42,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
4,
18,
13,
13,
4,
13,
0,
13,
18,
13,
17,
0,
13,
18,
13,
39,
17,
2,
4,
13,
13,
17,
9,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
4,
18,
13,
13,
4,
13,
0,
13,
18,
13,
17,
0,
13,
18,
13,
39,
17,
2,
4,
13,
13,
17,
9,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
4,
18,
13,
13,
4,
13,
0,
13,
18,
13,
17,
0,
13,
18,
13,
39,
17,
2,
4,
13,
13,
17,
9,
10,
18,
13,
10,
17,
13,
10,
18,
13,
10,
18,
13,
10,
4,
13,
10,
18,
13,
10,
4,
13,
10,
4,
13,
10,
18,
13,
10,
18,
13
] | [
[
142,
2
],
[
136,
6
],
[
145,
10
],
[
127,
14
],
[
128,
20
],
[
131,
20
],
[
152,
20
],
[
149,
20
],
[
143,
26
],
[
140,
26
],
[
128,
32
],
[
131,
32
],
[
152,
32
],
[
149,
32
],
[
148,
37
],
[
143,
39
],
[
140,
39
],
[
139,
42
],
[
143,
44
],
[
140,
44
],
[
143,
50
],
[
140,
50
],
[
128,
55
],
[
131,
55
],
[
152,
55
],
[
149,
55
],
[
137,
61
],
[
134,
61
],
[
128,
67
],
[
131,
67
],
[
152,
67
],
[
149,
67
],
[
151,
72
],
[
137,
74
],
[
134,
74
],
[
133,
77
],
[
137,
79
],
[
134,
79
],
[
137,
85
],
[
134,
85
],
[
128,
90
],
[
131,
90
],
[
152,
90
],
[
149,
90
],
[
146,
96
],
[
125,
96
],
[
128,
102
],
[
131,
102
],
[
152,
102
],
[
149,
102
],
[
130,
107
],
[
146,
109
],
[
125,
109
],
[
124,
112
],
[
146,
114
],
[
125,
114
],
[
146,
120
],
[
125,
120
],
[
124,
125
],
[
127,
128
],
[
130,
131
],
[
133,
134
],
[
136,
137
],
[
139,
140
],
[
142,
143
],
[
145,
146
],
[
148,
149
],
[
151,
152
]
] | [
"Sa = input()\nSb = input()\nSc = input()\n\nnow = 'a'\nwhile True:\n # if len(Sa) == 0 or len(Sb) == 0 or len(Sc) == 0:\n # break\n if now == 'a':\n if len(Sa) == 0:\n print(now.capitalize())\n exit()\n now = Sa[0]\n Sa = Sa[1:len(Sa) + 1]\n continue\n\n elif now == 'b':\n if len(Sb) == 0:\n print(now.capitalize())\n exit()\n now = Sb[0]\n Sb = Sb[1:len(Sb) + 1]\n continue\n\n elif now == 'c':\n if len(Sc) == 0:\n print(now.capitalize())\n exit()\n now = Sc[0]\n Sc = Sc[1:len(Sc) + 1]\n continue",
"Sa = input()",
"Sa",
"input()",
"input",
"Sb = input()",
"Sb",
"input()",
"input",
"Sc = input()",
"Sc",
"input()",
"input",
"now = 'a'",
"now",
"'a'",
"while True:\n # if len(Sa) == 0 or len(Sb) == 0 or len(Sc) == 0:\n # break\n if now == 'a':\n if len(Sa) == 0:\n print(now.capitalize())\n exit()\n now = Sa[0]\n Sa = Sa[1:len(Sa) + 1]\n continue\n\n elif now == 'b':\n if len(Sb) == 0:\n print(now.capitalize())\n exit()\n now = Sb[0]\n Sb = Sb[1:len(Sb) + 1]\n continue\n\n elif now == 'c':\n if len(Sc) == 0:\n print(now.capitalize())\n exit()\n now = Sc[0]\n Sc = Sc[1:len(Sc) + 1]\n continue",
"True",
"if now == 'a':\n if len(Sa) == 0:\n print(now.capitalize())\n exit()\n now = Sa[0]\n Sa = Sa[1:len(Sa) + 1]\n continue\n\n elif now == 'b':\n if len(Sb) == 0:\n print(now.capitalize())\n exit()\n now = Sb[0]\n Sb = Sb[1:len(Sb) + 1]\n continue\n\n elif now == 'c':\n if len(Sc) == 0:\n print(now.capitalize())\n exit()\n now = Sc[0]\n Sc = Sc[1:len(Sc) + 1]\n continue",
"now == 'a'",
"now",
"'a'",
"if len(Sa) == 0:\n print(now.capitalize())\n exit()\n ",
"len(Sa) == 0",
"len(Sa)",
"len",
"Sa",
"0",
"print(now.capitalize())",
"print",
"now.capitalize()",
"now.capitalize",
"now",
"capitalize",
"exit()",
"exit",
"now = Sa[0]",
"now",
"Sa[0]",
"Sa",
"0",
"Sa = Sa[1:len(Sa) + 1]",
"Sa",
"Sa[1:len(Sa) + 1]",
"Sa",
"1:len(Sa) + 1",
"1",
"len(Sa) + 1",
"len(Sa)",
"len",
"Sa",
"1",
"continue",
"elif now == 'b':\n if len(Sb) == 0:\n print(now.capitalize())\n exit()\n now = Sb[0]\n Sb = Sb[1:len(Sb) + 1]\n continue\n\n ",
"now == 'b'",
"now",
"'b'",
"if len(Sb) == 0:\n print(now.capitalize())\n exit()\n ",
"len(Sb) == 0",
"len(Sb)",
"len",
"Sb",
"0",
"print(now.capitalize())",
"print",
"now.capitalize()",
"now.capitalize",
"now",
"capitalize",
"exit()",
"exit",
"now = Sb[0]",
"now",
"Sb[0]",
"Sb",
"0",
"Sb = Sb[1:len(Sb) + 1]",
"Sb",
"Sb[1:len(Sb) + 1]",
"Sb",
"1:len(Sb) + 1",
"1",
"len(Sb) + 1",
"len(Sb)",
"len",
"Sb",
"1",
"continue",
"elif now == 'c':\n if len(Sc) == 0:\n print(now.capitalize())\n exit()\n now = Sc[0]\n Sc = Sc[1:len(Sc) + 1]\n continue",
"now == 'c'",
"now",
"'c'",
"if len(Sc) == 0:\n print(now.capitalize())\n exit()\n ",
"len(Sc) == 0",
"len(Sc)",
"len",
"Sc",
"0",
"print(now.capitalize())",
"print",
"now.capitalize()",
"now.capitalize",
"now",
"capitalize",
"exit()",
"exit",
"now = Sc[0]",
"now",
"Sc[0]",
"Sc",
"0",
"Sc = Sc[1:len(Sc) + 1]",
"Sc",
"Sc[1:len(Sc) + 1]",
"Sc",
"1:len(Sc) + 1",
"1",
"len(Sc) + 1",
"len(Sc)",
"len",
"Sc",
"1",
"continue",
"Sc = Sc[1:len(Sc) + 1]",
"Sc[1:len(Sc) + 1]",
"Sc",
"now = 'a'",
"'a'",
"now",
"now = Sc[0]",
"Sc[0]",
"now",
"Sb = Sb[1:len(Sb) + 1]",
"Sb[1:len(Sb) + 1]",
"Sb",
"Sb = input()",
"input()",
"Sb",
"Sa = Sa[1:len(Sa) + 1]",
"Sa[1:len(Sa) + 1]",
"Sa",
"Sa = input()",
"input()",
"Sa",
"Sc = input()",
"input()",
"Sc",
"now = Sa[0]",
"Sa[0]",
"now",
"now = Sb[0]",
"Sb[0]",
"now"
] | Sa = input()
Sb = input()
Sc = input()
now = 'a'
while True:
# if len(Sa) == 0 or len(Sb) == 0 or len(Sc) == 0:
# break
if now == 'a':
if len(Sa) == 0:
print(now.capitalize())
exit()
now = Sa[0]
Sa = Sa[1:len(Sa) + 1]
continue
elif now == 'b':
if len(Sb) == 0:
print(now.capitalize())
exit()
now = Sb[0]
Sb = Sb[1:len(Sb) + 1]
continue
elif now == 'c':
if len(Sc) == 0:
print(now.capitalize())
exit()
now = Sc[0]
Sc = Sc[1:len(Sc) + 1]
continue
|
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
17,
42,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
4,
13,
0,
13,
18,
13,
17,
0,
13,
18,
13,
39,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
4,
13,
0,
13,
18,
13,
17,
0,
13,
18,
13,
39,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
4,
13,
0,
13,
18,
13,
17,
0,
13,
18,
13,
39,
17,
10,
17,
13,
10,
18,
13,
10,
18,
13,
10,
18,
13,
10,
4,
13,
10,
4,
13,
10,
18,
13,
10,
4,
13,
10,
18,
13,
10,
18,
13
] | [
[
109,
2
],
[
112,
6
],
[
118,
10
],
[
97,
14
],
[
98,
20
],
[
107,
20
],
[
101,
20
],
[
122,
20
],
[
110,
26
],
[
116,
26
],
[
121,
34
],
[
110,
36
],
[
116,
36
],
[
115,
39
],
[
110,
41
],
[
116,
41
],
[
98,
46
],
[
107,
46
],
[
101,
46
],
[
122,
46
],
[
113,
52
],
[
104,
52
],
[
100,
60
],
[
113,
62
],
[
104,
62
],
[
103,
65
],
[
113,
67
],
[
104,
67
],
[
98,
72
],
[
107,
72
],
[
101,
72
],
[
122,
72
],
[
119,
78
],
[
125,
78
],
[
106,
86
],
[
119,
88
],
[
125,
88
],
[
124,
91
],
[
119,
93
],
[
125,
93
],
[
97,
98
],
[
100,
101
],
[
103,
104
],
[
106,
107
],
[
109,
110
],
[
112,
113
],
[
115,
116
],
[
118,
119
],
[
121,
122
],
[
124,
125
]
] | [
"a = input()\nb = input()\nc = input()\nch = 'a'\nwhile True:\n if ch == 'a':\n if len(a) == 0:\n print('A')\n exit()\n ch = a[0]\n a = a[1:]\n elif ch == 'b':\n if len(b) == 0:\n print('B')\n exit()\n ch = b[0]\n b = b[1:]\n elif ch == 'c':\n if len(c) == 0:\n print('C')\n exit()\n ch = c[0]\n c = c[1:]",
"a = input()",
"a",
"input()",
"input",
"b = input()",
"b",
"input()",
"input",
"c = input()",
"c",
"input()",
"input",
"ch = 'a'",
"ch",
"'a'",
"while True:\n if ch == 'a':\n if len(a) == 0:\n print('A')\n exit()\n ch = a[0]\n a = a[1:]\n elif ch == 'b':\n if len(b) == 0:\n print('B')\n exit()\n ch = b[0]\n b = b[1:]\n elif ch == 'c':\n if len(c) == 0:\n print('C')\n exit()\n ch = c[0]\n c = c[1:]",
"True",
"if ch == 'a':\n if len(a) == 0:\n print('A')\n exit()\n ch = a[0]\n a = a[1:]\n elif ch == 'b':\n if len(b) == 0:\n print('B')\n exit()\n ch = b[0]\n b = b[1:]\n elif ch == 'c':\n if len(c) == 0:\n print('C')\n exit()\n ch = c[0]\n c = c[1:]",
"ch == 'a'",
"ch",
"'a'",
"if len(a) == 0:\n print('A')\n exit()\n ",
"len(a) == 0",
"len(a)",
"len",
"a",
"0",
"print('A')",
"print",
"'A'",
"exit()",
"exit",
"ch = a[0]",
"ch",
"a[0]",
"a",
"0",
"a = a[1:]",
"a",
"a[1:]",
"a",
"1:",
"1",
"elif ch == 'b':\n if len(b) == 0:\n print('B')\n exit()\n ch = b[0]\n b = b[1:]\n ",
"ch == 'b'",
"ch",
"'b'",
"if len(b) == 0:\n print('B')\n exit()\n ",
"len(b) == 0",
"len(b)",
"len",
"b",
"0",
"print('B')",
"print",
"'B'",
"exit()",
"exit",
"ch = b[0]",
"ch",
"b[0]",
"b",
"0",
"b = b[1:]",
"b",
"b[1:]",
"b",
"1:",
"1",
"elif ch == 'c':\n if len(c) == 0:\n print('C')\n exit()\n ch = c[0]\n c = c[1:]",
"ch == 'c'",
"ch",
"'c'",
"if len(c) == 0:\n print('C')\n exit()\n ",
"len(c) == 0",
"len(c)",
"len",
"c",
"0",
"print('C')",
"print",
"'C'",
"exit()",
"exit",
"ch = c[0]",
"ch",
"c[0]",
"c",
"0",
"c = c[1:]",
"c",
"c[1:]",
"c",
"1:",
"1",
"ch = 'a'",
"'a'",
"ch",
"ch = b[0]",
"b[0]",
"ch",
"b = b[1:]",
"b[1:]",
"b",
"ch = c[0]",
"c[0]",
"ch",
"a = input()",
"input()",
"a",
"b = input()",
"input()",
"b",
"a = a[1:]",
"a[1:]",
"a",
"c = input()",
"input()",
"c",
"ch = a[0]",
"a[0]",
"ch",
"c = c[1:]",
"c[1:]",
"c"
] | a = input()
b = input()
c = input()
ch = 'a'
while True:
if ch == 'a':
if len(a) == 0:
print('A')
exit()
ch = a[0]
a = a[1:]
elif ch == 'b':
if len(b) == 0:
print('B')
exit()
ch = b[0]
b = b[1:]
elif ch == 'c':
if len(c) == 0:
print('C')
exit()
ch = c[0]
c = c[1:] |
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
39,
13,
13,
13,
0,
13,
17,
42,
17,
14,
2,
18,
13,
13,
17,
14,
2,
13,
17,
4,
13,
17,
14,
2,
13,
17,
4,
13,
17,
14,
2,
13,
17,
4,
13,
17,
3,
14,
2,
18,
18,
13,
13,
17,
17,
0,
18,
13,
13,
18,
18,
13,
13,
39,
17,
0,
13,
17,
14,
2,
18,
18,
13,
13,
17,
17,
0,
18,
13,
13,
18,
18,
13,
13,
39,
17,
0,
13,
17,
14,
2,
18,
18,
13,
13,
17,
17,
0,
18,
13,
13,
18,
18,
13,
13,
39,
17,
0,
13,
17,
10,
39,
13,
10,
4,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
4,
13,
10,
17,
13,
10,
4,
13
] | [
[
119,
2
],
[
137,
6
],
[
131,
10
],
[
116,
14
],
[
122,
20
],
[
103,
26
],
[
82,
26
],
[
61,
26
],
[
117,
27
],
[
123,
28
],
[
126,
28
],
[
129,
28
],
[
135,
28
],
[
123,
32
],
[
126,
32
],
[
129,
32
],
[
135,
32
],
[
123,
39
],
[
126,
39
],
[
129,
39
],
[
135,
39
],
[
123,
46
],
[
126,
46
],
[
129,
46
],
[
135,
46
],
[
103,
55
],
[
82,
55
],
[
61,
55
],
[
117,
56
],
[
123,
57
],
[
126,
57
],
[
129,
57
],
[
135,
57
],
[
64,
61
],
[
117,
62
],
[
123,
63
],
[
126,
63
],
[
129,
63
],
[
135,
63
],
[
103,
65
],
[
82,
65
],
[
61,
65
],
[
117,
66
],
[
123,
67
],
[
126,
67
],
[
129,
67
],
[
135,
67
],
[
134,
71
],
[
103,
76
],
[
82,
76
],
[
61,
76
],
[
117,
77
],
[
123,
78
],
[
126,
78
],
[
129,
78
],
[
135,
78
],
[
85,
82
],
[
117,
83
],
[
123,
84
],
[
126,
84
],
[
129,
84
],
[
135,
84
],
[
103,
86
],
[
82,
86
],
[
61,
86
],
[
117,
87
],
[
123,
88
],
[
126,
88
],
[
129,
88
],
[
135,
88
],
[
128,
92
],
[
103,
97
],
[
82,
97
],
[
61,
97
],
[
117,
98
],
[
123,
99
],
[
126,
99
],
[
129,
99
],
[
135,
99
],
[
106,
103
],
[
117,
104
],
[
123,
105
],
[
126,
105
],
[
129,
105
],
[
135,
105
],
[
103,
107
],
[
82,
107
],
[
61,
107
],
[
117,
108
],
[
123,
109
],
[
126,
109
],
[
129,
109
],
[
135,
109
],
[
125,
113
],
[
116,
117
],
[
119,
120
],
[
122,
123
],
[
125,
126
],
[
128,
129
],
[
131,
132
],
[
134,
135
],
[
137,
138
]
] | [
"Sa = input()\nSb = input()\nSc = input()\ndata = [Sa, Sb, Sc]\ntarget = 0\nwhile True:\n if(data[target] == \"\"):\n if target == 0:\n print(\"A\")\n if target == 1:\n print(\"B\")\n if target == 2:\n print(\"C\")\n break\n if data[target][0] == \"a\":\n data[target] = data[target][1:]\n target = 0\n elif data[target][0] == \"b\":\n data[target] = data[target][1:]\n target = 1\n elif data[target][0] == \"c\":\n data[target] = data[target][1:]\n target = 2",
"Sa = input()",
"Sa",
"input()",
"input",
"Sb = input()",
"Sb",
"input()",
"input",
"Sc = input()",
"Sc",
"input()",
"input",
"data = [Sa, Sb, Sc]",
"data",
"[Sa, Sb, Sc]",
"Sa",
"Sb",
"Sc",
"target = 0",
"target",
"0",
"while True:\n if(data[target] == \"\"):\n if target == 0:\n print(\"A\")\n if target == 1:\n print(\"B\")\n if target == 2:\n print(\"C\")\n break\n if data[target][0] == \"a\":\n data[target] = data[target][1:]\n target = 0\n elif data[target][0] == \"b\":\n data[target] = data[target][1:]\n target = 1\n elif data[target][0] == \"c\":\n data[target] = data[target][1:]\n target = 2",
"True",
"if(data[target] == \"\"):\n if target == 0:\n print(\"A\")\n if target == 1:\n print(\"B\")\n if target == 2:\n print(\"C\")\n break\n ",
"data[target] == \"\"",
"data[target]",
"data",
"target",
"\"\"",
"if target == 0:\n print(\"A\")\n ",
"target == 0",
"target",
"0",
"print(\"A\")",
"print",
"\"A\"",
"if target == 1:\n print(\"B\")\n ",
"target == 1",
"target",
"1",
"print(\"B\")",
"print",
"\"B\"",
"if target == 2:\n print(\"C\")\n ",
"target == 2",
"target",
"2",
"print(\"C\")",
"print",
"\"C\"",
"break",
"if data[target][0] == \"a\":\n data[target] = data[target][1:]\n target = 0\n elif data[target][0] == \"b\":\n data[target] = data[target][1:]\n target = 1\n elif data[target][0] == \"c\":\n data[target] = data[target][1:]\n target = 2",
"data[target][0] == \"a\"",
"data[target][0]",
"[target]",
"data",
"target",
"0",
"\"a\"",
"data[target] = data[target][1:]",
"data[target]",
"data",
"target",
"data[target][1:]",
"[target]",
"data",
"target",
"1:",
"1",
"target = 0",
"target",
"0",
"elif data[target][0] == \"b\":\n data[target] = data[target][1:]\n target = 1\n ",
"data[target][0] == \"b\"",
"data[target][0]",
"[target]",
"data",
"target",
"0",
"\"b\"",
"data[target] = data[target][1:]",
"data[target]",
"data",
"target",
"data[target][1:]",
"[target]",
"data",
"target",
"1:",
"1",
"target = 1",
"target",
"1",
"elif data[target][0] == \"c\":\n data[target] = data[target][1:]\n target = 2",
"data[target][0] == \"c\"",
"data[target][0]",
"[target]",
"data",
"target",
"0",
"\"c\"",
"data[target] = data[target][1:]",
"data[target]",
"data",
"target",
"data[target][1:]",
"[target]",
"data",
"target",
"1:",
"1",
"target = 2",
"target",
"2",
"data = [Sa, Sb, Sc]",
"[Sa, Sb, Sc]",
"data",
"Sa = input()",
"input()",
"Sa",
"target = 0",
"0",
"target",
"target = 2",
"2",
"target",
"target = 1",
"1",
"target",
"Sc = input()",
"input()",
"Sc",
"target = 0",
"0",
"target",
"Sb = input()",
"input()",
"Sb"
] | Sa = input()
Sb = input()
Sc = input()
data = [Sa, Sb, Sc]
target = 0
while True:
if(data[target] == ""):
if target == 0:
print("A")
if target == 1:
print("B")
if target == 2:
print("C")
break
if data[target][0] == "a":
data[target] = data[target][1:]
target = 0
elif data[target][0] == "b":
data[target] = data[target][1:]
target = 1
elif data[target][0] == "c":
data[target] = data[target][1:]
target = 2 |
[
7,
12,
13,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
17,
13,
17,
13,
17,
0,
13,
18,
13,
13,
42,
17,
14,
2,
13,
17,
14,
2,
13,
4,
13,
13,
0,
13,
17,
3,
0,
13,
18,
13,
13,
0,
13,
17,
14,
2,
13,
17,
14,
2,
13,
4,
13,
13,
0,
13,
17,
3,
0,
13,
18,
13,
13,
0,
13,
17,
14,
2,
13,
17,
14,
2,
13,
4,
13,
13,
0,
13,
17,
3,
0,
13,
18,
13,
13,
0,
13,
17,
4,
13,
13,
14,
2,
13,
17,
4,
13,
10,
12,
13
] | [
[
5,
4
],
[
9,
8
],
[
13,
12
],
[
17,
16
],
[
19,
18
],
[
21,
20
],
[
24,
23
],
[
4,
25
],
[
16,
26
],
[
23,
31
],
[
88,
31
],
[
66,
31
],
[
44,
31
],
[
16,
35
],
[
49,
35
],
[
4,
38
],
[
41,
40
],
[
45,
44
],
[
4,
46
],
[
16,
47
],
[
49,
47
],
[
50,
49
],
[
23,
53
],
[
88,
53
],
[
66,
53
],
[
44,
53
],
[
18,
57
],
[
71,
57
],
[
8,
60
],
[
63,
62
],
[
67,
66
],
[
8,
68
],
[
18,
69
],
[
71,
69
],
[
72,
71
],
[
23,
75
],
[
88,
75
],
[
66,
75
],
[
44,
75
],
[
20,
79
],
[
93,
79
],
[
12,
82
],
[
85,
84
],
[
89,
88
],
[
12,
90
],
[
20,
91
],
[
93,
91
],
[
94,
93
],
[
84,
97
],
[
62,
97
],
[
40,
97
],
[
106,
103
]
] | [
"def main():\n a = input()\n b = input()\n c = input()\n\n i, j, k = 0, 0, 0\n\n temp = a[i]\n\n while True:\n\n if temp == 'a':\n if i == len(a):\n winner = 'A'\n break\n temp = a[i]\n i += 1\n elif temp == 'b':\n if j == len(b):\n winner = 'B'\n break\n temp = b[j]\n j += 1\n elif temp == 'c':\n if k == len(c):\n winner = 'C'\n break\n temp = c[k]\n k += 1\n\n print(winner)\n\n\nif __name__ == '__main__':\n main()",
"def main():\n a = input()\n b = input()\n c = input()\n\n i, j, k = 0, 0, 0\n\n temp = a[i]\n\n while True:\n\n if temp == 'a':\n if i == len(a):\n winner = 'A'\n break\n temp = a[i]\n i += 1\n elif temp == 'b':\n if j == len(b):\n winner = 'B'\n break\n temp = b[j]\n j += 1\n elif temp == 'c':\n if k == len(c):\n winner = 'C'\n break\n temp = c[k]\n k += 1\n\n print(winner)",
"main",
"a = input()",
"a",
"input()",
"input",
"b = input()",
"b",
"input()",
"input",
"c = input()",
"c",
"input()",
"input",
"i, j, k = 0, 0, 0",
"i",
"0",
"j",
"0",
"k",
"0",
"temp = a[i]",
"temp",
"a[i]",
"a",
"i",
"while True:\n\n if temp == 'a':\n if i == len(a):\n winner = 'A'\n break\n temp = a[i]\n i += 1\n elif temp == 'b':\n if j == len(b):\n winner = 'B'\n break\n temp = b[j]\n j += 1\n elif temp == 'c':\n if k == len(c):\n winner = 'C'\n break\n temp = c[k]\n k += 1\n\n ",
"True",
"if temp == 'a':\n if i == len(a):\n winner = 'A'\n break\n temp = a[i]\n i += 1\n elif temp == 'b':\n if j == len(b):\n winner = 'B'\n break\n temp = b[j]\n j += 1\n elif temp == 'c':\n if k == len(c):\n winner = 'C'\n break\n temp = c[k]\n k += 1\n\n ",
"temp == 'a'",
"temp",
"'a'",
"if i == len(a):\n winner = 'A'\n break\n ",
"i == len(a)",
"i",
"len(a)",
"len",
"a",
"winner = 'A'",
"winner",
"'A'",
"break",
"temp = a[i]",
"temp",
"a[i]",
"a",
"i",
"i += 1",
"i",
"1",
"elif temp == 'b':\n if j == len(b):\n winner = 'B'\n break\n temp = b[j]\n j += 1\n ",
"temp == 'b'",
"temp",
"'b'",
"if j == len(b):\n winner = 'B'\n break\n ",
"j == len(b)",
"j",
"len(b)",
"len",
"b",
"winner = 'B'",
"winner",
"'B'",
"break",
"temp = b[j]",
"temp",
"b[j]",
"b",
"j",
"j += 1",
"j",
"1",
"elif temp == 'c':\n if k == len(c):\n winner = 'C'\n break\n temp = c[k]\n k += 1\n\n ",
"temp == 'c'",
"temp",
"'c'",
"if k == len(c):\n winner = 'C'\n break\n ",
"k == len(c)",
"k",
"len(c)",
"len",
"c",
"winner = 'C'",
"winner",
"'C'",
"break",
"temp = c[k]",
"temp",
"c[k]",
"c",
"k",
"k += 1",
"k",
"1",
"print(winner)",
"print",
"winner",
"if __name__ == '__main__':\n main()",
"__name__ == '__main__'",
"__name__",
"'__main__'",
"main()",
"main",
"def main():\n a = input()\n b = input()\n c = input()\n\n i, j, k = 0, 0, 0\n\n temp = a[i]\n\n while True:\n\n if temp == 'a':\n if i == len(a):\n winner = 'A'\n break\n temp = a[i]\n i += 1\n elif temp == 'b':\n if j == len(b):\n winner = 'B'\n break\n temp = b[j]\n j += 1\n elif temp == 'c':\n if k == len(c):\n winner = 'C'\n break\n temp = c[k]\n k += 1\n\n print(winner)",
"def main():\n a = input()\n b = input()\n c = input()\n\n i, j, k = 0, 0, 0\n\n temp = a[i]\n\n while True:\n\n if temp == 'a':\n if i == len(a):\n winner = 'A'\n break\n temp = a[i]\n i += 1\n elif temp == 'b':\n if j == len(b):\n winner = 'B'\n break\n temp = b[j]\n j += 1\n elif temp == 'c':\n if k == len(c):\n winner = 'C'\n break\n temp = c[k]\n k += 1\n\n print(winner)",
"main"
] | def main():
a = input()
b = input()
c = input()
i, j, k = 0, 0, 0
temp = a[i]
while True:
if temp == 'a':
if i == len(a):
winner = 'A'
break
temp = a[i]
i += 1
elif temp == 'b':
if j == len(b):
winner = 'B'
break
temp = b[j]
j += 1
elif temp == 'c':
if k == len(c):
winner = 'C'
break
temp = c[k]
k += 1
print(winner)
if __name__ == '__main__':
main()
|
[
7,
0,
13,
17,
0,
18,
13,
17,
4,
13,
4,
18,
4,
13,
13,
0,
18,
13,
17,
4,
13,
4,
18,
4,
13,
13,
0,
18,
13,
17,
4,
13,
4,
18,
4,
13,
13,
0,
13,
17,
42,
17,
14,
2,
4,
13,
18,
13,
13,
17,
3,
0,
13,
4,
18,
18,
13,
13,
13,
17,
4,
13,
13,
10,
4,
13,
10,
17,
13,
10,
17,
13
] | [
[
67,
2
],
[
8,
5
],
[
68,
6
],
[
19,
16
],
[
68,
17
],
[
30,
27
],
[
68,
28
],
[
70,
38
],
[
68,
47
],
[
71,
48
],
[
65,
48
],
[
64,
52
],
[
68,
56
],
[
71,
57
],
[
65,
57
],
[
65,
62
],
[
71,
62
],
[
64,
65
],
[
67,
68
],
[
70,
71
]
] | [
"cards_map = {}\ncards_map['A'] = list(input().upper())\ncards_map['B'] = list(input().upper())\ncards_map['C'] = list(input().upper())\ncurrent = 'A'\nwhile True:\n if len(cards_map[current]) == 0:\n break\n else:\n current = cards_map[current].pop(0)\nprint(current)",
"cards_map = {}",
"cards_map",
"{}",
"cards_map['A'] = list(input().upper())",
"cards_map['A']",
"cards_map",
"'A'",
"list(input().upper())",
"list",
"input().upper()",
"().upper",
"()",
"input",
"upper",
"cards_map['B'] = list(input().upper())",
"cards_map['B']",
"cards_map",
"'B'",
"list(input().upper())",
"list",
"input().upper()",
"().upper",
"()",
"input",
"upper",
"cards_map['C'] = list(input().upper())",
"cards_map['C']",
"cards_map",
"'C'",
"list(input().upper())",
"list",
"input().upper()",
"().upper",
"()",
"input",
"upper",
"current = 'A'",
"current",
"'A'",
"while True:\n if len(cards_map[current]) == 0:\n break\n else:\n current = cards_map[current].pop(0)",
"True",
"if len(cards_map[current]) == 0:\n break\n else:\n current = cards_map[current].pop(0)",
"len(cards_map[current]) == 0",
"len(cards_map[current])",
"len",
"cards_map[current]",
"cards_map",
"current",
"0",
"break",
"current = cards_map[current].pop(0)",
"current",
"cards_map[current].pop(0)",
"[current].pop",
"[current]",
"cards_map",
"current",
"pop",
"0",
"print(current)",
"print",
"current",
"current = cards_map[current].pop(0)",
"cards_map[current].pop(0)",
"current",
"cards_map = {}",
"{}",
"cards_map",
"current = 'A'",
"'A'",
"current"
] | cards_map = {}
cards_map['A'] = list(input().upper())
cards_map['B'] = list(input().upper())
cards_map['C'] = list(input().upper())
current = 'A'
while True:
if len(cards_map[current]) == 0:
break
else:
current = cards_map[current].pop(0)
print(current) |
[
7,
15,
13,
12,
13,
0,
13,
4,
18,
18,
13,
17,
13,
17,
42,
18,
13,
13,
0,
13,
4,
18,
18,
13,
13,
13,
17,
4,
13,
4,
18,
13,
13,
13,
23,
13,
12,
13,
41,
28,
13,
17,
4,
13,
4,
13,
4,
18,
4,
18,
18,
13,
13,
13,
13,
0,
13,
13,
4,
13,
13,
14,
2,
13,
17,
4,
13,
10,
12,
13,
10,
12,
13
] | [
[
7,
6
],
[
35,
10
],
[
35,
16
],
[
6,
17
],
[
19,
17
],
[
20,
19
],
[
35,
23
],
[
6,
24
],
[
19,
24
],
[
19,
33
],
[
6,
33
],
[
35,
35
],
[
41,
40
],
[
40,
43
],
[
57,
56
],
[
69,
59
],
[
56,
60
],
[
72,
66
]
] | [
"import sys\n\ndef solve(game: dict):\n card = game['a'].pop(0)\n while game[card]:\n card = game[card].pop(0)\n print(str.upper(card))\n\ndef main():\n game = {turn: list(sys.stdin.readline().rstrip()) for turn in 'abc'}\n solve(game)\n\nif __name__ == '__main__':\n main()",
"import sys",
"sys",
"def solve(game: dict):\n card = game['a'].pop(0)\n while game[card]:\n card = game[card].pop(0)\n print(str.upper(card))",
"solve",
"card = game['a'].pop(0)",
"card",
"game['a'].pop(0)",
"['a'].pop",
"['a']",
"game",
"'a'",
"pop",
"0",
"while game[card]:\n card = game[card].pop(0)\n ",
"game[card]",
"game",
"card",
"card = game[card].pop(0)",
"card",
"game[card].pop(0)",
"[card].pop",
"[card]",
"game",
"card",
"pop",
"0",
"print(str.upper(card))",
"print",
"str.upper(card)",
"str.upper",
"str",
"upper",
"card",
"game: dict",
"game",
"def main():\n game = {turn: list(sys.stdin.readline().rstrip()) for turn in 'abc'}\n solve(game)",
"main",
"turn: list(sys.stdin.readline().rstrip()) for turn in 'abc'",
"for turn in 'abc'",
"turn",
"'abc'",
"for turn in 'abc'",
"turn",
"list(sys.stdin.readline().rstrip())",
"list",
"sys.stdin.readline().rstrip()",
"sys.stdin.readline().rstrip",
"sys.stdin.readline()",
"sys.stdin.readline",
"sys.stdin",
"sys",
"stdin",
"readline",
"rstrip",
"game = {turn: list(sys.stdin.readline().rstrip()) for turn in 'abc'}",
"game",
"{turn: list(sys.stdin.readline().rstrip()) for turn in 'abc'}",
"solve(game)",
"solve",
"game",
"if __name__ == '__main__':\n main()",
"__name__ == '__main__'",
"__name__",
"'__main__'",
"main()",
"main",
"def solve(game: dict):\n card = game['a'].pop(0)\n while game[card]:\n card = game[card].pop(0)\n print(str.upper(card))",
"def solve(game: dict):\n card = game['a'].pop(0)\n while game[card]:\n card = game[card].pop(0)\n print(str.upper(card))",
"solve",
"def main():\n game = {turn: list(sys.stdin.readline().rstrip()) for turn in 'abc'}\n solve(game)",
"def main():\n game = {turn: list(sys.stdin.readline().rstrip()) for turn in 'abc'}\n solve(game)",
"main"
] | import sys
def solve(game: dict):
card = game['a'].pop(0)
while game[card]:
card = game[card].pop(0)
print(str.upper(card))
def main():
game = {turn: list(sys.stdin.readline().rstrip()) for turn in 'abc'}
solve(game)
if __name__ == '__main__':
main()
|
[
7,
0,
13,
21,
22,
17,
4,
13,
18,
4,
13,
39,
17,
22,
17,
4,
13,
18,
4,
13,
39,
17,
22,
17,
4,
13,
18,
4,
13,
39,
17,
0,
13,
17,
42,
17,
14,
40,
18,
13,
13,
4,
13,
4,
18,
13,
13,
4,
13,
0,
13,
4,
18,
18,
13,
13,
13,
10,
21,
13,
10,
4,
13,
10,
17,
13
] | [
[
58,
2
],
[
64,
32
],
[
59,
39
],
[
65,
40
],
[
62,
40
],
[
65,
45
],
[
62,
45
],
[
61,
50
],
[
59,
54
],
[
65,
55
],
[
62,
55
],
[
58,
59
],
[
61,
62
],
[
64,
65
]
] | [
"S = {\n 'a': list(input()[::-1]),\n 'b': list(input()[::-1]),\n 'c': list(input()[::-1]),\n}\n \ns='a'\nwhile True:\n if not S[s]:\n print(s.upper())\n exit()\n s = S[s].pop()",
"S = {\n 'a': list(input()[::-1]),\n 'b': list(input()[::-1]),\n 'c': list(input()[::-1]),\n}",
"S",
"{\n 'a': list(input()[::-1]),\n 'b': list(input()[::-1]),\n 'c': list(input()[::-1]),\n}",
"'a'",
"'a'",
"list(input()[::-1])",
"list",
"input()[::-1]",
"()",
"input",
"::-1",
"-1",
"'b'",
"'b'",
"list(input()[::-1])",
"list",
"input()[::-1]",
"()",
"input",
"::-1",
"-1",
"'c'",
"'c'",
"list(input()[::-1])",
"list",
"input()[::-1]",
"()",
"input",
"::-1",
"-1",
"s='a'",
"s",
"'a'",
"while True:\n if not S[s]:\n print(s.upper())\n exit()\n s = S[s].pop()",
"True",
"if not S[s]:\n print(s.upper())\n exit()\n ",
"not S[s]",
"S[s]",
"S",
"s",
"print(s.upper())",
"print",
"s.upper()",
"s.upper",
"s",
"upper",
"exit()",
"exit",
"s = S[s].pop()",
"s",
"S[s].pop()",
"[s].pop",
"[s]",
"S",
"s",
"pop",
"S = {\n 'a': list(input()[::-1]),\n 'b': list(input()[::-1]),\n 'c': list(input()[::-1]),\n}",
"{\n 'a': list(input()[::-1]),\n 'b': list(input()[::-1]),\n 'c': list(input()[::-1]),\n}",
"S",
"s = S[s].pop()",
"S[s].pop()",
"s",
"s='a'",
"'a'",
"s"
] | S = {
'a': list(input()[::-1]),
'b': list(input()[::-1]),
'c': list(input()[::-1]),
}
s='a'
while True:
if not S[s]:
print(s.upper())
exit()
s = S[s].pop() |
[
7,
0,
13,
4,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
4,
13,
0,
13,
4,
18,
13,
13,
17,
42,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
3,
0,
13,
4,
18,
13,
13,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
3,
0,
13,
4,
18,
13,
13,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
3,
0,
13,
4,
18,
13,
13,
17,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13
] | [
[
110,
2
],
[
113,
10
],
[
101,
18
],
[
107,
26
],
[
111,
29
],
[
108,
36
],
[
99,
36
],
[
105,
36
],
[
117,
36
],
[
111,
42
],
[
116,
49
],
[
111,
52
],
[
108,
57
],
[
99,
57
],
[
105,
57
],
[
117,
57
],
[
114,
63
],
[
104,
70
],
[
114,
73
],
[
108,
78
],
[
99,
78
],
[
105,
78
],
[
117,
78
],
[
102,
84
],
[
98,
91
],
[
102,
94
],
[
98,
99
],
[
101,
102
],
[
104,
105
],
[
107,
108
],
[
110,
111
],
[
113,
114
],
[
116,
117
]
] | [
"Sa=list(str(input()))\nSb=list(str(input()))\nSc=list(str(input()))\ncard=Sa.pop(0)\nwhile 1:\n if card=='a':\n if len(Sa)==0:\n print('A')\n break\n card=Sa.pop(0)\n elif card=='b':\n if len(Sb)==0:\n print('B')\n break\n card=Sb.pop(0)\n elif card=='c':\n if len(Sc)==0:\n print('C')\n break\n card=Sc.pop(0)",
"Sa=list(str(input()))",
"Sa",
"list(str(input()))",
"list",
"str(input())",
"str",
"input()",
"input",
"Sb=list(str(input()))",
"Sb",
"list(str(input()))",
"list",
"str(input())",
"str",
"input()",
"input",
"Sc=list(str(input()))",
"Sc",
"list(str(input()))",
"list",
"str(input())",
"str",
"input()",
"input",
"card=Sa.pop(0)",
"card",
"Sa.pop(0)",
"Sa.pop",
"Sa",
"pop",
"0",
"while 1:\n if card=='a':\n if len(Sa)==0:\n print('A')\n break\n card=Sa.pop(0)\n elif card=='b':\n if len(Sb)==0:\n print('B')\n break\n card=Sb.pop(0)\n elif card=='c':\n if len(Sc)==0:\n print('C')\n break\n card=Sc.pop(0)",
"1",
"if card=='a':\n if len(Sa)==0:\n print('A')\n break\n card=Sa.pop(0)\n elif card=='b':\n if len(Sb)==0:\n print('B')\n break\n card=Sb.pop(0)\n elif card=='c':\n if len(Sc)==0:\n print('C')\n break\n card=Sc.pop(0)",
"card=='a'",
"card",
"'a'",
"if len(Sa)==0:\n print('A')\n break\n ",
"len(Sa)==0",
"len(Sa)",
"len",
"Sa",
"0",
"print('A')",
"print",
"'A'",
"break",
"card=Sa.pop(0)",
"card",
"Sa.pop(0)",
"Sa.pop",
"Sa",
"pop",
"0",
"elif card=='b':\n if len(Sb)==0:\n print('B')\n break\n card=Sb.pop(0)\n ",
"card=='b'",
"card",
"'b'",
"if len(Sb)==0:\n print('B')\n break\n ",
"len(Sb)==0",
"len(Sb)",
"len",
"Sb",
"0",
"print('B')",
"print",
"'B'",
"break",
"card=Sb.pop(0)",
"card",
"Sb.pop(0)",
"Sb.pop",
"Sb",
"pop",
"0",
"elif card=='c':\n if len(Sc)==0:\n print('C')\n break\n card=Sc.pop(0)",
"card=='c'",
"card",
"'c'",
"if len(Sc)==0:\n print('C')\n break\n ",
"len(Sc)==0",
"len(Sc)",
"len",
"Sc",
"0",
"print('C')",
"print",
"'C'",
"break",
"card=Sc.pop(0)",
"card",
"Sc.pop(0)",
"Sc.pop",
"Sc",
"pop",
"0",
"card=Sc.pop(0)",
"Sc.pop(0)",
"card",
"Sc=list(str(input()))",
"list(str(input()))",
"Sc",
"card=Sb.pop(0)",
"Sb.pop(0)",
"card",
"card=Sa.pop(0)",
"Sa.pop(0)",
"card",
"Sa=list(str(input()))",
"list(str(input()))",
"Sa",
"Sb=list(str(input()))",
"list(str(input()))",
"Sb",
"card=Sa.pop(0)",
"Sa.pop(0)",
"card"
] | Sa=list(str(input()))
Sb=list(str(input()))
Sc=list(str(input()))
card=Sa.pop(0)
while 1:
if card=='a':
if len(Sa)==0:
print('A')
break
card=Sa.pop(0)
elif card=='b':
if len(Sb)==0:
print('B')
break
card=Sb.pop(0)
elif card=='c':
if len(Sc)==0:
print('C')
break
card=Sc.pop(0)
|
[
7,
0,
13,
4,
13,
13,
4,
13,
13,
4,
13,
0,
13,
18,
13,
17,
0,
13,
18,
13,
39,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
4,
13,
28,
13,
4,
13,
2,
2,
4,
13,
13,
4,
13,
13,
4,
13,
13,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
4,
13,
0,
13,
18,
13,
17,
0,
13,
18,
13,
39,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
4,
13,
0,
13,
18,
13,
17,
0,
13,
18,
13,
39,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
4,
13,
0,
13,
18,
13,
17,
0,
13,
18,
13,
39,
17,
10,
4,
13,
10,
18,
13,
10,
18,
13,
10,
4,
13,
10,
18,
13,
10,
18,
13,
10,
4,
13,
10,
18,
13,
10,
18,
13,
10,
18,
13,
10,
18,
13
] | [
[
141,
2
],
[
123,
5
],
[
132,
8
],
[
153,
12
],
[
142,
14
],
[
126,
17
],
[
142,
19
],
[
127,
26
],
[
142,
26
],
[
35,
34
],
[
127,
41
],
[
142,
41
],
[
124,
44
],
[
133,
47
],
[
154,
50
],
[
151,
50
],
[
130,
50
],
[
148,
50
],
[
127,
56
],
[
142,
56
],
[
136,
56
],
[
147,
64
],
[
127,
66
],
[
142,
66
],
[
136,
66
],
[
135,
69
],
[
127,
71
],
[
142,
71
],
[
136,
71
],
[
154,
76
],
[
151,
76
],
[
130,
76
],
[
148,
76
],
[
124,
82
],
[
145,
82
],
[
129,
90
],
[
124,
92
],
[
145,
92
],
[
144,
95
],
[
124,
97
],
[
145,
97
],
[
133,
104
],
[
139,
104
],
[
150,
112
],
[
133,
114
],
[
139,
114
],
[
138,
117
],
[
133,
119
],
[
139,
119
],
[
123,
124
],
[
126,
127
],
[
129,
130
],
[
132,
133
],
[
135,
136
],
[
138,
139
],
[
141,
142
],
[
144,
145
],
[
147,
148
],
[
150,
151
],
[
153,
154
]
] | [
"a, b, c = input(), input(), input()\nref = a[0]\na = a[1:]\nif len(a) == 0:\n print(\"A\")\n exit()\nfor _ in range(len(a)+len(b)+len(c)):\n if ref == \"a\":\n if len(a) == 0:\n print(\"A\")\n exit()\n ref = a[0]\n a = a[1:]\n\n elif ref == \"b\":\n if len(b) == 0:\n print(\"B\")\n exit()\n ref = b[0]\n b = b[1:]\n \n else:\n if len(c) == 0:\n print(\"C\")\n exit()\n ref = c[0]\n c = c[1:]",
"a, b, c = input(), input(), input()",
"a",
"input()",
"input",
"b",
"input()",
"input",
"c",
"input()",
"input",
"ref = a[0]",
"ref",
"a[0]",
"a",
"0",
"a = a[1:]",
"a",
"a[1:]",
"a",
"1:",
"1",
"if len(a) == 0:\n print(\"A\")\n exit()",
"len(a) == 0",
"len(a)",
"len",
"a",
"0",
"print(\"A\")",
"print",
"\"A\"",
"exit()",
"exit",
"for _ in range(len(a)+len(b)+len(c)):\n if ref == \"a\":\n if len(a) == 0:\n print(\"A\")\n exit()\n ref = a[0]\n a = a[1:]\n\n elif ref == \"b\":\n if len(b) == 0:\n print(\"B\")\n exit()\n ref = b[0]\n b = b[1:]\n \n else:\n if len(c) == 0:\n print(\"C\")\n exit()\n ref = c[0]\n c = c[1:]",
"_",
"range(len(a)+len(b)+len(c))",
"range",
"len(a)+len(b)+len(c)",
"len(a)+len(b)",
"len(a)",
"len",
"a",
"len(b)",
"len",
"b",
"len(c)",
"len",
"c",
"if ref == \"a\":\n if len(a) == 0:\n print(\"A\")\n exit()\n ref = a[0]\n a = a[1:]\n\n elif ref == \"b\":\n if len(b) == 0:\n print(\"B\")\n exit()\n ref = b[0]\n b = b[1:]\n \n else:\n if len(c) == 0:\n print(\"C\")\n exit()\n ref = c[0]\n c = c[1:]",
"ref == \"a\"",
"ref",
"\"a\"",
"if len(a) == 0:\n print(\"A\")\n exit()\n ",
"len(a) == 0",
"len(a)",
"len",
"a",
"0",
"print(\"A\")",
"print",
"\"A\"",
"exit()",
"exit",
"ref = a[0]",
"ref",
"a[0]",
"a",
"0",
"a = a[1:]",
"a",
"a[1:]",
"a",
"1:",
"1",
"elif ref == \"b\":\n if len(b) == 0:\n print(\"B\")\n exit()\n ref = b[0]\n b = b[1:]\n \n ",
"ref == \"b\"",
"ref",
"\"b\"",
"if len(b) == 0:\n print(\"B\")\n exit()\n ",
"len(b) == 0",
"len(b)",
"len",
"b",
"0",
"print(\"B\")",
"print",
"\"B\"",
"exit()",
"exit",
"ref = b[0]",
"ref",
"b[0]",
"b",
"0",
"b = b[1:]",
"b",
"b[1:]",
"b",
"1:",
"1",
"if len(c) == 0:\n print(\"C\")\n exit()\n ",
"len(c) == 0",
"len(c)",
"len",
"c",
"0",
"print(\"C\")",
"print",
"\"C\"",
"exit()",
"exit",
"ref = c[0]",
"ref",
"c[0]",
"c",
"0",
"c = c[1:]",
"c",
"c[1:]",
"c",
"1:",
"1",
"b, c = input(), input(), input()",
"input()",
"b",
"a = a[1:]",
"a[1:]",
"a",
"ref = b[0]",
"b[0]",
"ref",
"c = input(), input(), input()",
"input()",
"c",
"a = a[1:]",
"a[1:]",
"a",
"c = c[1:]",
"c[1:]",
"c",
"a, b, c = input(), input(), input()",
"input()",
"a",
"b = b[1:]",
"b[1:]",
"b",
"ref = a[0]",
"a[0]",
"ref",
"ref = c[0]",
"c[0]",
"ref",
"ref = a[0]",
"a[0]",
"ref"
] | a, b, c = input(), input(), input()
ref = a[0]
a = a[1:]
if len(a) == 0:
print("A")
exit()
for _ in range(len(a)+len(b)+len(c)):
if ref == "a":
if len(a) == 0:
print("A")
exit()
ref = a[0]
a = a[1:]
elif ref == "b":
if len(b) == 0:
print("B")
exit()
ref = b[0]
b = b[1:]
else:
if len(c) == 0:
print("C")
exit()
ref = c[0]
c = c[1:] |
[
7,
41,
28,
13,
17,
4,
13,
4,
13,
4,
13,
0,
13,
13,
0,
13,
17,
42,
18,
13,
13,
0,
13,
4,
18,
18,
13,
13,
13,
17,
4,
13,
4,
18,
13,
13,
10,
4,
13,
10,
17,
13,
10,
13,
13
] | [
[
4,
3
],
[
3,
6
],
[
43,
12
],
[
40,
15
],
[
44,
19
],
[
41,
20
],
[
38,
20
],
[
37,
22
],
[
44,
26
],
[
41,
27
],
[
38,
27
],
[
38,
34
],
[
41,
34
],
[
37,
38
],
[
40,
41
],
[
43,
44
]
] | [
"S={abc:list(input()) for abc in \"abc\"}\ns=\"a\"\nwhile S[s]:\n s=S[s].pop(0)\nprint(s.upper())",
"abc:list(input()) for abc in \"abc\"",
"for abc in \"abc\"",
"abc",
"\"abc\"",
"for abc in \"abc\"",
"abc",
"list(input())",
"list",
"input()",
"input",
"S={abc:list(input()) for abc in \"abc\"}",
"S",
"{abc:list(input()) for abc in \"abc\"}",
"s=\"a\"",
"s",
"\"a\"",
"while S[s]:\n s=S[s].pop(0)",
"S[s]",
"S",
"s",
"s=S[s].pop(0)",
"s",
"S[s].pop(0)",
"[s].pop",
"[s]",
"S",
"s",
"pop",
"0",
"print(s.upper())",
"print",
"s.upper()",
"s.upper",
"s",
"upper",
"s=S[s].pop(0)",
"S[s].pop(0)",
"s",
"s=\"a\"",
"\"a\"",
"s",
"S={abc:list(input()) for abc in \"abc\"}",
"{abc:list(input()) for abc in \"abc\"}",
"S"
] | S={abc:list(input()) for abc in "abc"}
s="a"
while S[s]:
s=S[s].pop(0)
print(s.upper())
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
18,
13,
13,
17,
0,
13,
17,
42,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
3,
0,
13,
4,
18,
13,
13,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
3,
0,
13,
4,
18,
13,
13,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
3,
0,
13,
4,
18,
13,
13,
17,
4,
13,
4,
18,
13,
13,
10,
17,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13
] | [
[
104,
2
],
[
98,
8
],
[
101,
14
],
[
110,
20
],
[
105,
23
],
[
92,
27
],
[
111,
33
],
[
114,
33
],
[
108,
33
],
[
96,
33
],
[
105,
39
],
[
95,
43
],
[
105,
46
],
[
111,
51
],
[
114,
51
],
[
108,
51
],
[
96,
51
],
[
99,
57
],
[
107,
61
],
[
99,
64
],
[
111,
69
],
[
114,
69
],
[
108,
69
],
[
96,
69
],
[
102,
75
],
[
113,
79
],
[
102,
82
],
[
114,
89
],
[
108,
89
],
[
96,
89
],
[
111,
89
],
[
92,
93
],
[
95,
96
],
[
98,
99
],
[
101,
102
],
[
104,
105
],
[
107,
108
],
[
110,
111
],
[
113,
114
]
] | [
"a = list(input())\nb = list(input())\nc = list(input())\n\nt = a.pop(0)\nl = 0\nwhile True:\n if t == 'a':\n if len(a) == 0:\n break\n t = a.pop(0)\n elif t == 'b':\n if len(b) == 0:\n break\n t = b.pop(0)\n elif t == 'c':\n if len(c) == 0:\n break\n t = c.pop(0)\n\nprint(t.upper())",
"a = list(input())",
"a",
"list(input())",
"list",
"input()",
"input",
"b = list(input())",
"b",
"list(input())",
"list",
"input()",
"input",
"c = list(input())",
"c",
"list(input())",
"list",
"input()",
"input",
"t = a.pop(0)",
"t",
"a.pop(0)",
"a.pop",
"a",
"pop",
"0",
"l = 0",
"l",
"0",
"while True:\n if t == 'a':\n if len(a) == 0:\n break\n t = a.pop(0)\n elif t == 'b':\n if len(b) == 0:\n break\n t = b.pop(0)\n elif t == 'c':\n if len(c) == 0:\n break\n t = c.pop(0)",
"True",
"if t == 'a':\n if len(a) == 0:\n break\n t = a.pop(0)\n elif t == 'b':\n if len(b) == 0:\n break\n t = b.pop(0)\n elif t == 'c':\n if len(c) == 0:\n break\n t = c.pop(0)",
"t == 'a'",
"t",
"'a'",
"if len(a) == 0:\n break\n ",
"len(a) == 0",
"len(a)",
"len",
"a",
"0",
"break",
"t = a.pop(0)",
"t",
"a.pop(0)",
"a.pop",
"a",
"pop",
"0",
"elif t == 'b':\n if len(b) == 0:\n break\n t = b.pop(0)\n ",
"t == 'b'",
"t",
"'b'",
"if len(b) == 0:\n break\n ",
"len(b) == 0",
"len(b)",
"len",
"b",
"0",
"break",
"t = b.pop(0)",
"t",
"b.pop(0)",
"b.pop",
"b",
"pop",
"0",
"elif t == 'c':\n if len(c) == 0:\n break\n t = c.pop(0)",
"t == 'c'",
"t",
"'c'",
"if len(c) == 0:\n break\n ",
"len(c) == 0",
"len(c)",
"len",
"c",
"0",
"break",
"t = c.pop(0)",
"t",
"c.pop(0)",
"c.pop",
"c",
"pop",
"0",
"print(t.upper())",
"print",
"t.upper()",
"t.upper",
"t",
"upper",
"l = 0",
"0",
"l",
"t = a.pop(0)",
"a.pop(0)",
"t",
"b = list(input())",
"list(input())",
"b",
"c = list(input())",
"list(input())",
"c",
"a = list(input())",
"list(input())",
"a",
"t = b.pop(0)",
"b.pop(0)",
"t",
"t = a.pop(0)",
"a.pop(0)",
"t",
"t = c.pop(0)",
"c.pop(0)",
"t"
] | a = list(input())
b = list(input())
c = list(input())
t = a.pop(0)
l = 0
while True:
if t == 'a':
if len(a) == 0:
break
t = a.pop(0)
elif t == 'b':
if len(b) == 0:
break
t = b.pop(0)
elif t == 'c':
if len(c) == 0:
break
t = c.pop(0)
print(t.upper()) |
[
7,
15,
13,
4,
18,
13,
13,
17,
0,
13,
2,
2,
17,
17,
17,
0,
13,
2,
17,
17,
12,
13,
41,
28,
13,
4,
13,
17,
4,
4,
13,
0,
13,
13,
0,
13,
2,
39,
17,
17,
0,
13,
17,
0,
13,
17,
42,
17,
14,
40,
18,
13,
13,
4,
13,
18,
13,
13,
0,
13,
4,
13,
2,
13,
17,
3,
0,
18,
13,
13,
17,
0,
13,
2,
4,
13,
18,
18,
13,
13,
2,
18,
13,
13,
17,
4,
13,
17,
4,
13,
13,
14,
2,
13,
17,
4,
13,
10,
2,
13,
10,
2,
13,
10,
12,
13
] | [
[
101,
9
],
[
98,
16
],
[
25,
24
],
[
33,
32
],
[
36,
35
],
[
42,
41
],
[
45,
44
],
[
67,
50
],
[
35,
51
],
[
41,
52
],
[
72,
52
],
[
32,
56
],
[
41,
57
],
[
72,
57
],
[
60,
59
],
[
41,
63
],
[
72,
63
],
[
70,
67
],
[
35,
68
],
[
41,
69
],
[
72,
69
],
[
73,
72
],
[
32,
78
],
[
41,
79
],
[
72,
79
],
[
67,
81
],
[
35,
82
],
[
41,
83
],
[
72,
83
],
[
59,
90
],
[
44,
90
],
[
105,
96
],
[
98,
99
],
[
101,
102
]
] | [
"import sys\nsys.setrecursionlimit(10000000)\nMOD = 10 ** 9 + 7\nINF = 10 ** 15\n\ndef main():\n card = [input() for _ in range(3)]\n idx = [0] * 3\n now = 0\n ans = None\n while True:\n if idx[now] >= len(card[now]):\n ans = chr(now + 65)\n break\n idx[now] += 1\n now = ord(card[now][idx[now] - 1]) - ord('a')\n print(ans)\n\nif __name__ == '__main__':\n main()",
"import sys",
"sys",
"sys.setrecursionlimit(10000000)",
"sys.setrecursionlimit",
"sys",
"setrecursionlimit",
"10000000",
"MOD = 10 ** 9 + 7",
"MOD",
"10 ** 9 + 7",
"10 ** 9",
"10",
"9",
"7",
"INF = 10 ** 15",
"INF",
"10 ** 15",
"10",
"15",
"def main():\n card = [input() for _ in range(3)]\n idx = [0] * 3\n now = 0\n ans = None\n while True:\n if idx[now] >= len(card[now]):\n ans = chr(now + 65)\n break\n idx[now] += 1\n now = ord(card[now][idx[now] - 1]) - ord('a')\n print(ans)",
"main",
"input() for _ in range(3)",
"for _ in range(3)",
"_",
"range(3)",
"range",
"3",
"for _ in range(3)",
"input()",
"input",
"card = [input() for _ in range(3)]",
"card",
"[input() for _ in range(3)]",
"idx = [0] * 3",
"idx",
"[0] * 3",
"[0]",
"0",
"3",
"now = 0",
"now",
"0",
"ans = None",
"ans",
"None",
"while True:\n if idx[now] >= len(card[now]):\n ans = chr(now + 65)\n break\n idx[now] += 1\n now = ord(card[now][idx[now] - 1]) - ord('a')\n ",
"True",
"if idx[now] >= len(card[now]):\n ans = chr(now + 65)\n break\n ",
"idx[now] >= len(card[now])",
"idx[now]",
"idx",
"now",
"len(card[now])",
"len",
"card[now]",
"card",
"now",
"ans = chr(now + 65)",
"ans",
"chr(now + 65)",
"chr",
"now + 65",
"now",
"65",
"break",
"idx[now] += 1",
"idx[now]",
"idx",
"now",
"1",
"now = ord(card[now][idx[now] - 1]) - ord('a')",
"now",
"ord(card[now][idx[now] - 1]) - ord('a')",
"ord(card[now][idx[now] - 1])",
"ord",
"card[now][idx[now] - 1]",
"[now]",
"card",
"now",
"idx[now] - 1",
"idx[now]",
"idx",
"now",
"1",
"ord('a')",
"ord",
"'a'",
"print(ans)",
"print",
"ans",
"if __name__ == '__main__':\n main()",
"__name__ == '__main__'",
"__name__",
"'__main__'",
"main()",
"main",
"INF = 10 ** 15",
"10 ** 15",
"INF",
"MOD = 10 ** 9 + 7",
"10 ** 9 + 7",
"MOD",
"def main():\n card = [input() for _ in range(3)]\n idx = [0] * 3\n now = 0\n ans = None\n while True:\n if idx[now] >= len(card[now]):\n ans = chr(now + 65)\n break\n idx[now] += 1\n now = ord(card[now][idx[now] - 1]) - ord('a')\n print(ans)",
"def main():\n card = [input() for _ in range(3)]\n idx = [0] * 3\n now = 0\n ans = None\n while True:\n if idx[now] >= len(card[now]):\n ans = chr(now + 65)\n break\n idx[now] += 1\n now = ord(card[now][idx[now] - 1]) - ord('a')\n print(ans)",
"main"
] | import sys
sys.setrecursionlimit(10000000)
MOD = 10 ** 9 + 7
INF = 10 ** 15
def main():
card = [input() for _ in range(3)]
idx = [0] * 3
now = 0
ans = None
while True:
if idx[now] >= len(card[now]):
ans = chr(now + 65)
break
idx[now] += 1
now = ord(card[now][idx[now] - 1]) - ord('a')
print(ans)
if __name__ == '__main__':
main()
|
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
17,
13,
17,
13,
17,
0,
13,
13,
0,
13,
13,
42,
17,
14,
2,
4,
13,
13,
13,
14,
2,
13,
13,
4,
13,
17,
14,
2,
13,
13,
4,
13,
17,
4,
13,
17,
3,
14,
2,
13,
13,
0,
13,
17,
14,
2,
13,
13,
0,
13,
17,
0,
13,
17,
14,
2,
18,
13,
13,
17,
0,
13,
13,
0,
13,
13,
14,
2,
18,
13,
13,
17,
0,
13,
13,
0,
13,
13,
0,
13,
13,
0,
13,
13,
10,
13,
13,
10,
17,
13,
10,
13,
13,
10,
4,
13,
10,
13,
13,
10,
17,
13,
10,
4,
13,
10,
17,
13,
10,
17,
13,
10,
13,
13,
10,
4,
13,
10,
13,
13,
10,
17,
13,
10,
13,
13,
10,
13,
13,
10,
17,
13,
10,
13,
13
] | [
[
118,
2
],
[
130,
6
],
[
109,
10
],
[
121,
14
],
[
145,
16
],
[
103,
18
],
[
100,
21
],
[
119,
22
],
[
142,
24
],
[
122,
25
],
[
101,
32
],
[
107,
32
],
[
134,
32
],
[
149,
32
],
[
143,
33
],
[
140,
33
],
[
113,
33
],
[
128,
33
],
[
101,
36
],
[
107,
36
],
[
134,
36
],
[
149,
36
],
[
119,
37
],
[
101,
43
],
[
107,
43
],
[
134,
43
],
[
149,
43
],
[
131,
44
],
[
101,
54
],
[
107,
54
],
[
134,
54
],
[
149,
54
],
[
119,
55
],
[
115,
57
],
[
101,
61
],
[
107,
61
],
[
134,
61
],
[
149,
61
],
[
131,
62
],
[
136,
64
],
[
124,
67
],
[
101,
72
],
[
107,
72
],
[
134,
72
],
[
149,
72
],
[
143,
73
],
[
140,
73
],
[
113,
73
],
[
128,
73
],
[
148,
76
],
[
119,
77
],
[
127,
79
],
[
116,
80
],
[
122,
80
],
[
101,
84
],
[
107,
84
],
[
134,
84
],
[
149,
84
],
[
143,
85
],
[
140,
85
],
[
113,
85
],
[
128,
85
],
[
133,
88
],
[
131,
89
],
[
112,
91
],
[
137,
92
],
[
146,
92
],
[
106,
94
],
[
110,
95
],
[
139,
97
],
[
125,
98
],
[
104,
98
],
[
119,
100
],
[
100,
101
],
[
103,
104
],
[
110,
106
],
[
106,
107
],
[
109,
110
],
[
137,
112
],
[
146,
112
],
[
112,
113
],
[
115,
116
],
[
118,
119
],
[
121,
122
],
[
124,
125
],
[
116,
127
],
[
122,
127
],
[
127,
128
],
[
130,
131
],
[
131,
133
],
[
133,
134
],
[
136,
137
],
[
125,
139
],
[
104,
139
],
[
139,
140
],
[
122,
142
],
[
142,
143
],
[
145,
146
],
[
119,
148
],
[
148,
149
]
] | [
"A = input ()\nB = input ()\nC = input ()\nX,Y,Z = 0,0,0\nP = A\nQ = X\nwhile True:\n if len(P)==Q:\n if P==A:\n print ('A')\n elif P==B:\n print ('B')\n else:\n print ('C')\n break\n if P==A:\n X += 1\n elif P==B:\n Y += 1\n else:\n Z += 1\n if P[Q]=='a':\n P = A\n Q = X\n elif P[Q]=='b':\n P = B\n Q = Y\n else:\n P = C\n Q = Z",
"A = input ()",
"A",
"input ()",
"input",
"B = input ()",
"B",
"input ()",
"input",
"C = input ()",
"C",
"input ()",
"input",
"X,Y,Z = 0,0,0",
"X",
"0",
"Y",
"0",
"Z",
"0",
"P = A",
"P",
"A",
"Q = X",
"Q",
"X",
"while True:\n if len(P)==Q:\n if P==A:\n print ('A')\n elif P==B:\n print ('B')\n else:\n print ('C')\n break\n if P==A:\n X += 1\n elif P==B:\n Y += 1\n else:\n Z += 1\n if P[Q]=='a':\n P = A\n Q = X\n elif P[Q]=='b':\n P = B\n Q = Y\n else:\n P = C\n Q = Z",
"True",
"if len(P)==Q:\n if P==A:\n print ('A')\n elif P==B:\n print ('B')\n else:\n print ('C')\n break\n ",
"len(P)==Q",
"len(P)",
"len",
"P",
"Q",
"if P==A:\n print ('A')\n elif P==B:\n print ('B')\n else:\n print ('C')\n ",
"P==A",
"P",
"A",
"print ('A')",
"print",
"'A'",
"elif P==B:\n print ('B')\n ",
"P==B",
"P",
"B",
"print ('B')",
"print",
"'B'",
"print ('C')",
"print",
"'C'",
"break",
"if P==A:\n X += 1\n elif P==B:\n Y += 1\n else:\n Z += 1\n ",
"P==A",
"P",
"A",
"X += 1",
"X",
"1",
"elif P==B:\n Y += 1\n ",
"P==B",
"P",
"B",
"Y += 1",
"Y",
"1",
"Z += 1",
"Z",
"1",
"if P[Q]=='a':\n P = A\n Q = X\n elif P[Q]=='b':\n P = B\n Q = Y\n else:\n P = C\n Q = Z",
"P[Q]=='a'",
"P[Q]",
"P",
"Q",
"'a'",
"P = A",
"P",
"A",
"Q = X",
"Q",
"X",
"elif P[Q]=='b':\n P = B\n Q = Y\n ",
"P[Q]=='b'",
"P[Q]",
"P",
"Q",
"'b'",
"P = B",
"P",
"B",
"Q = Y",
"Q",
"Y",
"P = C",
"P",
"C",
"Q = Z",
"Q",
"Z",
"P = A",
"A",
"P",
"Z = 0,0,0",
"0",
"Z",
"P = C",
"C",
"P",
"C = input ()",
"input ()",
"C",
"Q = Y",
"Y",
"Q",
"X += 1",
"1",
"X",
"A = input ()",
"input ()",
"A",
"X,Y,Z = 0,0,0",
"0",
"X",
"Z += 1",
"1",
"Z",
"Q = X",
"X",
"Q",
"B = input ()",
"input ()",
"B",
"P = B",
"B",
"P",
"Y += 1",
"1",
"Y",
"Q = Z",
"Z",
"Q",
"Q = X",
"X",
"Q",
"Y,Z = 0,0,0",
"0",
"Y",
"P = A",
"A",
"P"
] | A = input ()
B = input ()
C = input ()
X,Y,Z = 0,0,0
P = A
Q = X
while True:
if len(P)==Q:
if P==A:
print ('A')
elif P==B:
print ('B')
else:
print ('C')
break
if P==A:
X += 1
elif P==B:
Y += 1
else:
Z += 1
if P[Q]=='a':
P = A
Q = X
elif P[Q]=='b':
P = B
Q = Y
else:
P = C
Q = Z |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
18,
13,
13,
17,
28,
13,
4,
13,
17,
14,
2,
13,
17,
14,
40,
13,
4,
13,
17,
4,
13,
17,
0,
13,
4,
18,
13,
13,
17,
14,
2,
13,
17,
14,
40,
13,
4,
13,
17,
4,
13,
17,
0,
13,
4,
18,
13,
13,
17,
14,
40,
13,
4,
13,
17,
4,
13,
17,
0,
13,
4,
18,
13,
13,
17,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13
] | [
[
94,
2
],
[
88,
8
],
[
91,
14
],
[
106,
20
],
[
95,
23
],
[
28,
27
],
[
107,
33
],
[
98,
33
],
[
104,
33
],
[
101,
33
],
[
95,
37
],
[
100,
45
],
[
95,
48
],
[
107,
53
],
[
98,
53
],
[
104,
53
],
[
101,
53
],
[
89,
57
],
[
103,
65
],
[
89,
68
],
[
92,
73
],
[
97,
81
],
[
92,
84
],
[
88,
89
],
[
91,
92
],
[
94,
95
],
[
97,
98
],
[
100,
101
],
[
103,
104
],
[
106,
107
]
] | [
"A = list(input())\nB = list(input())\nC = list(input())\n\ntmp = A.pop(0)\n\nfor _ in range(500):\n if tmp == \"a\":\n if not A:\n print(\"A\")\n exit(0)\n tmp = A.pop(0)\n elif tmp == \"b\":\n if not B:\n print(\"B\")\n exit(0)\n tmp = B.pop(0)\n else:\n if not C:\n print(\"C\")\n exit(0)\n tmp = C.pop(0)",
"A = list(input())",
"A",
"list(input())",
"list",
"input()",
"input",
"B = list(input())",
"B",
"list(input())",
"list",
"input()",
"input",
"C = list(input())",
"C",
"list(input())",
"list",
"input()",
"input",
"tmp = A.pop(0)",
"tmp",
"A.pop(0)",
"A.pop",
"A",
"pop",
"0",
"for _ in range(500):\n if tmp == \"a\":\n if not A:\n print(\"A\")\n exit(0)\n tmp = A.pop(0)\n elif tmp == \"b\":\n if not B:\n print(\"B\")\n exit(0)\n tmp = B.pop(0)\n else:\n if not C:\n print(\"C\")\n exit(0)\n tmp = C.pop(0)",
"_",
"range(500)",
"range",
"500",
"if tmp == \"a\":\n if not A:\n print(\"A\")\n exit(0)\n tmp = A.pop(0)\n elif tmp == \"b\":\n if not B:\n print(\"B\")\n exit(0)\n tmp = B.pop(0)\n else:\n if not C:\n print(\"C\")\n exit(0)\n tmp = C.pop(0)",
"tmp == \"a\"",
"tmp",
"\"a\"",
"if not A:\n print(\"A\")\n exit(0)\n ",
"not A",
"A",
"print(\"A\")",
"print",
"\"A\"",
"exit(0)",
"exit",
"0",
"tmp = A.pop(0)",
"tmp",
"A.pop(0)",
"A.pop",
"A",
"pop",
"0",
"elif tmp == \"b\":\n if not B:\n print(\"B\")\n exit(0)\n tmp = B.pop(0)\n ",
"tmp == \"b\"",
"tmp",
"\"b\"",
"if not B:\n print(\"B\")\n exit(0)\n ",
"not B",
"B",
"print(\"B\")",
"print",
"\"B\"",
"exit(0)",
"exit",
"0",
"tmp = B.pop(0)",
"tmp",
"B.pop(0)",
"B.pop",
"B",
"pop",
"0",
"if not C:\n print(\"C\")\n exit(0)\n ",
"not C",
"C",
"print(\"C\")",
"print",
"\"C\"",
"exit(0)",
"exit",
"0",
"tmp = C.pop(0)",
"tmp",
"C.pop(0)",
"C.pop",
"C",
"pop",
"0",
"B = list(input())",
"list(input())",
"B",
"C = list(input())",
"list(input())",
"C",
"A = list(input())",
"list(input())",
"A",
"tmp = C.pop(0)",
"C.pop(0)",
"tmp",
"tmp = A.pop(0)",
"A.pop(0)",
"tmp",
"tmp = B.pop(0)",
"B.pop(0)",
"tmp",
"tmp = A.pop(0)",
"A.pop(0)",
"tmp"
] | A = list(input())
B = list(input())
C = list(input())
tmp = A.pop(0)
for _ in range(500):
if tmp == "a":
if not A:
print("A")
exit(0)
tmp = A.pop(0)
elif tmp == "b":
if not B:
print("B")
exit(0)
tmp = B.pop(0)
else:
if not C:
print("C")
exit(0)
tmp = C.pop(0) |
[
7,
41,
28,
13,
17,
4,
13,
4,
13,
4,
13,
0,
13,
13,
0,
13,
17,
42,
18,
13,
13,
0,
13,
4,
18,
18,
13,
13,
13,
17,
4,
13,
4,
18,
13,
13,
10,
13,
13,
10,
17,
13,
10,
4,
13
] | [
[
4,
3
],
[
3,
6
],
[
37,
12
],
[
40,
15
],
[
38,
19
],
[
41,
20
],
[
44,
20
],
[
43,
22
],
[
38,
26
],
[
41,
27
],
[
44,
27
],
[
44,
34
],
[
41,
34
],
[
37,
38
],
[
40,
41
],
[
43,
44
]
] | [
"S={char:list(input()) for char in \"abc\"}\nturn=\"a\"\nwhile S[turn]:\n turn=S[turn].pop(0)\nprint(turn.upper())",
"char:list(input()) for char in \"abc\"",
"for char in \"abc\"",
"char",
"\"abc\"",
"for char in \"abc\"",
"char",
"list(input())",
"list",
"input()",
"input",
"S={char:list(input()) for char in \"abc\"}",
"S",
"{char:list(input()) for char in \"abc\"}",
"turn=\"a\"",
"turn",
"\"a\"",
"while S[turn]:\n turn=S[turn].pop(0)",
"S[turn]",
"S",
"turn",
"turn=S[turn].pop(0)",
"turn",
"S[turn].pop(0)",
"[turn].pop",
"[turn]",
"S",
"turn",
"pop",
"0",
"print(turn.upper())",
"print",
"turn.upper()",
"turn.upper",
"turn",
"upper",
"S={char:list(input()) for char in \"abc\"}",
"{char:list(input()) for char in \"abc\"}",
"S",
"turn=\"a\"",
"\"a\"",
"turn",
"turn=S[turn].pop(0)",
"S[turn].pop(0)",
"turn"
] | S={char:list(input()) for char in "abc"}
turn="a"
while S[turn]:
turn=S[turn].pop(0)
print(turn.upper()) |
[
7,
41,
28,
13,
4,
13,
17,
4,
4,
13,
4,
13,
0,
13,
13,
0,
13,
17,
0,
13,
21,
22,
17,
17,
22,
17,
17,
22,
17,
17,
42,
17,
14,
2,
4,
13,
18,
13,
13,
17,
3,
0,
13,
4,
18,
18,
13,
13,
13,
17,
14,
2,
13,
17,
0,
13,
17,
14,
2,
13,
17,
0,
13,
17,
14,
2,
13,
17,
0,
13,
17,
4,
13,
18,
13,
13,
10,
13,
13,
10,
17,
13,
10,
17,
13,
10,
21,
13,
10,
17,
13,
10,
4,
13,
10,
17,
13
] | [
[
4,
3
],
[
77,
13
],
[
83,
16
],
[
86,
19
],
[
78,
37
],
[
84,
38
],
[
96,
38
],
[
90,
38
],
[
81,
38
],
[
92,
42
],
[
78,
46
],
[
84,
47
],
[
96,
47
],
[
90,
47
],
[
81,
47
],
[
93,
52
],
[
80,
55
],
[
93,
59
],
[
89,
62
],
[
93,
66
],
[
95,
69
],
[
87,
74
],
[
96,
75
],
[
90,
75
],
[
81,
75
],
[
84,
75
],
[
77,
78
],
[
80,
81
],
[
83,
84
],
[
86,
87
],
[
89,
90
],
[
92,
93
],
[
95,
96
]
] | [
"s = [list(input()) for _ in range(3)]\n\nn_row = 0\n\ndic = {0:\"A\",1:\"B\",2:\"C\"}\n\nwhile True:\n if len(s[n_row]) == 0:\n break\n\n s_num = s[n_row].pop(0)\n \n if s_num == \"a\":\n n_row = 0\n elif s_num == \"b\":\n n_row = 1\n elif s_num ==\"c\":\n n_row = 2\n\nprint(dic[n_row])",
"list(input()) for _ in range(3)",
"for _ in range(3)",
"_",
"range(3)",
"range",
"3",
"for _ in range(3)",
"list(input())",
"list",
"input()",
"input",
"s = [list(input()) for _ in range(3)]",
"s",
"[list(input()) for _ in range(3)]",
"n_row = 0",
"n_row",
"0",
"dic = {0:\"A\",1:\"B\",2:\"C\"}",
"dic",
"{0:\"A\",1:\"B\",2:\"C\"}",
"0",
"0",
"\"A\"",
"1",
"1",
"\"B\"",
"2",
"2",
"\"C\"",
"while True:\n if len(s[n_row]) == 0:\n break\n\n s_num = s[n_row].pop(0)\n \n if s_num == \"a\":\n n_row = 0\n elif s_num == \"b\":\n n_row = 1\n elif s_num ==\"c\":\n n_row = 2",
"True",
"if len(s[n_row]) == 0:\n break\n\n ",
"len(s[n_row]) == 0",
"len(s[n_row])",
"len",
"s[n_row]",
"s",
"n_row",
"0",
"break",
"s_num = s[n_row].pop(0)",
"s_num",
"s[n_row].pop(0)",
"[n_row].pop",
"[n_row]",
"s",
"n_row",
"pop",
"0",
"if s_num == \"a\":\n n_row = 0\n elif s_num == \"b\":\n n_row = 1\n elif s_num ==\"c\":\n n_row = 2",
"s_num == \"a\"",
"s_num",
"\"a\"",
"n_row = 0",
"n_row",
"0",
"elif s_num == \"b\":\n n_row = 1\n ",
"s_num == \"b\"",
"s_num",
"\"b\"",
"n_row = 1",
"n_row",
"1",
"elif s_num ==\"c\":\n n_row = 2",
"s_num ==\"c\"",
"s_num",
"\"c\"",
"n_row = 2",
"n_row",
"2",
"print(dic[n_row])",
"print",
"dic[n_row]",
"dic",
"n_row",
"s = [list(input()) for _ in range(3)]",
"[list(input()) for _ in range(3)]",
"s",
"n_row = 0",
"0",
"n_row",
"n_row = 0",
"0",
"n_row",
"dic = {0:\"A\",1:\"B\",2:\"C\"}",
"{0:\"A\",1:\"B\",2:\"C\"}",
"dic",
"n_row = 1",
"1",
"n_row",
"s_num = s[n_row].pop(0)",
"s[n_row].pop(0)",
"s_num",
"n_row = 2",
"2",
"n_row"
] | s = [list(input()) for _ in range(3)]
n_row = 0
dic = {0:"A",1:"B",2:"C"}
while True:
if len(s[n_row]) == 0:
break
s_num = s[n_row].pop(0)
if s_num == "a":
n_row = 0
elif s_num == "b":
n_row = 1
elif s_num =="c":
n_row = 2
print(dic[n_row]) |
[
7,
15,
13,
41,
28,
13,
4,
13,
17,
4,
4,
13,
0,
13,
13,
0,
13,
18,
18,
13,
17,
17,
42,
17,
14,
2,
13,
17,
14,
2,
4,
13,
18,
13,
17,
17,
4,
13,
17,
4,
18,
13,
13,
0,
13,
18,
18,
13,
17,
17,
0,
18,
13,
17,
18,
18,
13,
17,
39,
17,
14,
2,
13,
17,
14,
2,
4,
13,
18,
13,
17,
17,
4,
13,
17,
4,
18,
13,
13,
0,
13,
18,
18,
13,
17,
17,
0,
18,
13,
17,
18,
18,
13,
17,
39,
17,
14,
2,
4,
13,
18,
13,
17,
17,
4,
13,
17,
4,
18,
13,
13,
0,
13,
18,
18,
13,
17,
17,
0,
18,
13,
17,
18,
18,
13,
17,
39,
17,
10,
13,
13,
10,
18,
13,
10,
18,
13,
10,
18,
13,
10,
18,
13
] | [
[
6,
5
],
[
129,
13
],
[
135,
16
],
[
130,
19
],
[
136,
26
],
[
139,
26
],
[
133,
26
],
[
142,
26
],
[
130,
33
],
[
141,
44
],
[
130,
47
],
[
54,
51
],
[
130,
52
],
[
130,
56
],
[
136,
62
],
[
139,
62
],
[
133,
62
],
[
142,
62
],
[
130,
69
],
[
132,
80
],
[
130,
83
],
[
90,
87
],
[
130,
88
],
[
130,
92
],
[
130,
101
],
[
138,
112
],
[
130,
115
],
[
122,
119
],
[
130,
120
],
[
130,
124
],
[
129,
130
],
[
132,
133
],
[
135,
136
],
[
138,
139
],
[
141,
142
]
] | [
"import sys\nlst = [input() for i in range(3)]\n#print(lst)\ninit = lst[0][0]\nwhile True:\n if init == 'a':\n if len(lst[0]) == 0:\n print('A')\n sys.exit()\n else:\n init = lst[0][0]\n lst[0]=lst[0][1:]\n \n elif init =='b':\n if len(lst[1]) == 0:\n print('B')\n sys.exit()\n else:\n init = lst[1][0]\n lst[1]=lst[1][1:]\n \n else:\n if len(lst[2]) == 0:\n print('C')\n sys.exit()\n else:\n init = lst[2][0]\n lst[2]=lst[2][1:]\n \n #print(lst)",
"import sys",
"sys",
"input() for i in range(3)",
"for i in range(3)",
"i",
"range(3)",
"range",
"3",
"for i in range(3)",
"input()",
"input",
"lst = [input() for i in range(3)]",
"lst",
"[input() for i in range(3)]",
"init = lst[0][0]",
"init",
"lst[0][0]",
"[0]",
"lst",
"0",
"0",
"while True:\n if init == 'a':\n if len(lst[0]) == 0:\n print('A')\n sys.exit()\n else:\n init = lst[0][0]\n lst[0]=lst[0][1:]\n \n elif init =='b':\n if len(lst[1]) == 0:\n print('B')\n sys.exit()\n else:\n init = lst[1][0]\n lst[1]=lst[1][1:]\n \n else:\n if len(lst[2]) == 0:\n print('C')\n sys.exit()\n else:\n init = lst[2][0]\n lst[2]=lst[2][1:]\n \n #print(lst)",
"True",
"if init == 'a':\n if len(lst[0]) == 0:\n print('A')\n sys.exit()\n else:\n init = lst[0][0]\n lst[0]=lst[0][1:]\n \n elif init =='b':\n if len(lst[1]) == 0:\n print('B')\n sys.exit()\n else:\n init = lst[1][0]\n lst[1]=lst[1][1:]\n \n else:\n if len(lst[2]) == 0:\n print('C')\n sys.exit()\n else:\n init = lst[2][0]\n lst[2]=lst[2][1:]\n \n #print(lst)",
"init == 'a'",
"init",
"'a'",
"if len(lst[0]) == 0:\n print('A')\n sys.exit()\n else:\n init = lst[0][0]\n lst[0]=lst[0][1:]\n \n ",
"len(lst[0]) == 0",
"len(lst[0])",
"len",
"lst[0]",
"lst",
"0",
"0",
"print('A')",
"print",
"'A'",
"sys.exit()",
"sys.exit",
"sys",
"exit",
"init = lst[0][0]",
"init",
"lst[0][0]",
"[0]",
"lst",
"0",
"0",
"lst[0]=lst[0][1:]",
"lst[0]",
"lst",
"0",
"lst[0][1:]",
"[0]",
"lst",
"0",
"1:",
"1",
"elif init =='b':\n if len(lst[1]) == 0:\n print('B')\n sys.exit()\n else:\n init = lst[1][0]\n lst[1]=lst[1][1:]\n \n ",
"init =='b'",
"init",
"'b'",
"if len(lst[1]) == 0:\n print('B')\n sys.exit()\n else:\n init = lst[1][0]\n lst[1]=lst[1][1:]\n \n ",
"len(lst[1]) == 0",
"len(lst[1])",
"len",
"lst[1]",
"lst",
"1",
"0",
"print('B')",
"print",
"'B'",
"sys.exit()",
"sys.exit",
"sys",
"exit",
"init = lst[1][0]",
"init",
"lst[1][0]",
"[1]",
"lst",
"1",
"0",
"lst[1]=lst[1][1:]",
"lst[1]",
"lst",
"1",
"lst[1][1:]",
"[1]",
"lst",
"1",
"1:",
"1",
"if len(lst[2]) == 0:\n print('C')\n sys.exit()\n else:\n init = lst[2][0]\n lst[2]=lst[2][1:]\n \n #print(lst)",
"len(lst[2]) == 0",
"len(lst[2])",
"len",
"lst[2]",
"lst",
"2",
"0",
"print('C')",
"print",
"'C'",
"sys.exit()",
"sys.exit",
"sys",
"exit",
"init = lst[2][0]",
"init",
"lst[2][0]",
"[2]",
"lst",
"2",
"0",
"lst[2]=lst[2][1:]",
"lst[2]",
"lst",
"2",
"lst[2][1:]",
"[2]",
"lst",
"2",
"1:",
"1",
"lst = [input() for i in range(3)]",
"[input() for i in range(3)]",
"lst",
"init = lst[1][0]",
"lst[1][0]",
"init",
"init = lst[0][0]",
"lst[0][0]",
"init",
"init = lst[2][0]",
"lst[2][0]",
"init",
"init = lst[0][0]",
"lst[0][0]",
"init"
] | import sys
lst = [input() for i in range(3)]
#print(lst)
init = lst[0][0]
while True:
if init == 'a':
if len(lst[0]) == 0:
print('A')
sys.exit()
else:
init = lst[0][0]
lst[0]=lst[0][1:]
elif init =='b':
if len(lst[1]) == 0:
print('B')
sys.exit()
else:
init = lst[1][0]
lst[1]=lst[1][1:]
else:
if len(lst[2]) == 0:
print('C')
sys.exit()
else:
init = lst[2][0]
lst[2]=lst[2][1:]
#print(lst) |
[
7,
0,
13,
4,
18,
4,
13,
13,
0,
13,
4,
18,
4,
13,
13,
0,
13,
4,
18,
4,
13,
13,
0,
13,
17,
42,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
0,
13,
17,
3,
0,
13,
18,
13,
17,
0,
13,
18,
13,
39,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
0,
13,
17,
3,
0,
13,
18,
13,
17,
0,
13,
18,
13,
39,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
0,
13,
17,
3,
0,
13,
18,
13,
17,
0,
13,
18,
13,
39,
17,
4,
13,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
18,
13,
10,
18,
13,
10,
18,
13,
10,
18,
13,
10,
18,
13,
10,
17,
13,
10,
18,
13
] | [
[
112,
2
],
[
109,
9
],
[
106,
16
],
[
115,
23
],
[
116,
29
],
[
143,
29
],
[
122,
29
],
[
131,
29
],
[
140,
29
],
[
134,
29
],
[
119,
29
],
[
113,
35
],
[
125,
35
],
[
118,
38
],
[
133,
42
],
[
113,
44
],
[
125,
44
],
[
124,
47
],
[
113,
49
],
[
125,
49
],
[
116,
54
],
[
143,
54
],
[
122,
54
],
[
131,
54
],
[
140,
54
],
[
134,
54
],
[
119,
54
],
[
110,
60
],
[
128,
60
],
[
139,
63
],
[
130,
67
],
[
110,
69
],
[
128,
69
],
[
127,
72
],
[
110,
74
],
[
128,
74
],
[
116,
79
],
[
143,
79
],
[
122,
79
],
[
131,
79
],
[
140,
79
],
[
134,
79
],
[
119,
79
],
[
107,
85
],
[
137,
85
],
[
121,
88
],
[
142,
92
],
[
107,
94
],
[
137,
94
],
[
136,
97
],
[
107,
99
],
[
137,
99
],
[
143,
104
],
[
122,
104
],
[
131,
104
],
[
140,
104
],
[
134,
104
],
[
119,
104
],
[
116,
104
],
[
106,
107
],
[
109,
110
],
[
112,
113
],
[
115,
116
],
[
118,
119
],
[
121,
122
],
[
124,
125
],
[
127,
128
],
[
130,
131
],
[
133,
134
],
[
136,
137
],
[
139,
140
],
[
142,
143
]
] | [
"a = input().upper()\nb = input().upper()\nc = input().upper()\nt = \"A\"\n\nwhile True:\n if t == \"A\":\n if len(a)<1:\n t = \"A\"\n break\n t = a[0]\n a = a[1:]\n elif t == \"B\": \n if len(b)<1:\n t = \"B\"\n break\n t = b[0]\n b = b[1:]\n elif t == \"C\":\n if len(c)<1:\n t = \"C\"\n break\n t = c[0]\n c = c[1:]\n\n\nprint(t)",
"a = input().upper()",
"a",
"input().upper()",
"().upper",
"()",
"input",
"upper",
"b = input().upper()",
"b",
"input().upper()",
"().upper",
"()",
"input",
"upper",
"c = input().upper()",
"c",
"input().upper()",
"().upper",
"()",
"input",
"upper",
"t = \"A\"",
"t",
"\"A\"",
"while True:\n if t == \"A\":\n if len(a)<1:\n t = \"A\"\n break\n t = a[0]\n a = a[1:]\n elif t == \"B\": \n if len(b)<1:\n t = \"B\"\n break\n t = b[0]\n b = b[1:]\n elif t == \"C\":\n if len(c)<1:\n t = \"C\"\n break\n t = c[0]\n c = c[1:]",
"True",
"if t == \"A\":\n if len(a)<1:\n t = \"A\"\n break\n t = a[0]\n a = a[1:]\n elif t == \"B\": \n if len(b)<1:\n t = \"B\"\n break\n t = b[0]\n b = b[1:]\n elif t == \"C\":\n if len(c)<1:\n t = \"C\"\n break\n t = c[0]\n c = c[1:]",
"t == \"A\"",
"t",
"\"A\"",
"if len(a)<1:\n t = \"A\"\n break\n ",
"len(a)<1",
"len(a)",
"len",
"a",
"1",
"t = \"A\"",
"t",
"\"A\"",
"break",
"t = a[0]",
"t",
"a[0]",
"a",
"0",
"a = a[1:]",
"a",
"a[1:]",
"a",
"1:",
"1",
"elif t == \"B\": \n if len(b)<1:\n t = \"B\"\n break\n t = b[0]\n b = b[1:]\n ",
"t == \"B\"",
"t",
"\"B\"",
"if len(b)<1:\n t = \"B\"\n break\n ",
"len(b)<1",
"len(b)",
"len",
"b",
"1",
"t = \"B\"",
"t",
"\"B\"",
"break",
"t = b[0]",
"t",
"b[0]",
"b",
"0",
"b = b[1:]",
"b",
"b[1:]",
"b",
"1:",
"1",
"elif t == \"C\":\n if len(c)<1:\n t = \"C\"\n break\n t = c[0]\n c = c[1:]",
"t == \"C\"",
"t",
"\"C\"",
"if len(c)<1:\n t = \"C\"\n break\n ",
"len(c)<1",
"len(c)",
"len",
"c",
"1",
"t = \"C\"",
"t",
"\"C\"",
"break",
"t = c[0]",
"t",
"c[0]",
"c",
"0",
"c = c[1:]",
"c",
"c[1:]",
"c",
"1:",
"1",
"print(t)",
"print",
"t",
"c = input().upper()",
"input().upper()",
"c",
"b = input().upper()",
"input().upper()",
"b",
"a = input().upper()",
"input().upper()",
"a",
"t = \"A\"",
"\"A\"",
"t",
"t = \"A\"",
"\"A\"",
"t",
"t = \"C\"",
"\"C\"",
"t",
"a = a[1:]",
"a[1:]",
"a",
"b = b[1:]",
"b[1:]",
"b",
"t = b[0]",
"b[0]",
"t",
"t = a[0]",
"a[0]",
"t",
"c = c[1:]",
"c[1:]",
"c",
"t = \"B\"",
"\"B\"",
"t",
"t = c[0]",
"c[0]",
"t"
] | a = input().upper()
b = input().upper()
c = input().upper()
t = "A"
while True:
if t == "A":
if len(a)<1:
t = "A"
break
t = a[0]
a = a[1:]
elif t == "B":
if len(b)<1:
t = "B"
break
t = b[0]
b = b[1:]
elif t == "C":
if len(c)<1:
t = "C"
break
t = c[0]
c = c[1:]
print(t) |
[
7,
0,
13,
4,
13,
18,
4,
13,
39,
17,
0,
13,
4,
13,
18,
4,
13,
39,
17,
0,
13,
4,
13,
18,
4,
13,
39,
17,
0,
13,
17,
42,
17,
14,
2,
13,
17,
14,
40,
13,
4,
13,
17,
3,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
14,
40,
13,
4,
13,
17,
3,
0,
13,
4,
18,
13,
13,
14,
40,
13,
4,
13,
17,
3,
0,
13,
4,
18,
13,
13,
10,
4,
13,
10,
17,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13
] | [
[
90,
2
],
[
93,
11
],
[
81,
20
],
[
84,
29
],
[
85,
35
],
[
97,
35
],
[
100,
35
],
[
88,
35
],
[
91,
39
],
[
87,
45
],
[
91,
48
],
[
85,
52
],
[
97,
52
],
[
100,
52
],
[
88,
52
],
[
94,
56
],
[
99,
62
],
[
94,
65
],
[
82,
69
],
[
96,
75
],
[
82,
78
],
[
81,
82
],
[
84,
85
],
[
87,
88
],
[
90,
91
],
[
93,
94
],
[
96,
97
],
[
99,
100
]
] | [
"A = list(input()[::-1])\nB = list(input()[::-1])\nC = list(input()[::-1])\nturn = 'a'\nwhile True:\n if turn == 'a':\n if not A:\n print('A')\n break\n turn = A.pop()\n elif turn == 'b':\n if not B:\n print('B')\n break\n turn = B.pop()\n else:\n if not C:\n print('C')\n break\n turn = C.pop()",
"A = list(input()[::-1])",
"A",
"list(input()[::-1])",
"list",
"input()[::-1]",
"()",
"input",
"::-1",
"-1",
"B = list(input()[::-1])",
"B",
"list(input()[::-1])",
"list",
"input()[::-1]",
"()",
"input",
"::-1",
"-1",
"C = list(input()[::-1])",
"C",
"list(input()[::-1])",
"list",
"input()[::-1]",
"()",
"input",
"::-1",
"-1",
"turn = 'a'",
"turn",
"'a'",
"while True:\n if turn == 'a':\n if not A:\n print('A')\n break\n turn = A.pop()\n elif turn == 'b':\n if not B:\n print('B')\n break\n turn = B.pop()\n else:\n if not C:\n print('C')\n break\n turn = C.pop()",
"True",
"if turn == 'a':\n if not A:\n print('A')\n break\n turn = A.pop()\n elif turn == 'b':\n if not B:\n print('B')\n break\n turn = B.pop()\n else:\n if not C:\n print('C')\n break\n turn = C.pop()",
"turn == 'a'",
"turn",
"'a'",
"if not A:\n print('A')\n break\n ",
"not A",
"A",
"print('A')",
"print",
"'A'",
"break",
"turn = A.pop()",
"turn",
"A.pop()",
"A.pop",
"A",
"pop",
"elif turn == 'b':\n if not B:\n print('B')\n break\n turn = B.pop()\n ",
"turn == 'b'",
"turn",
"'b'",
"if not B:\n print('B')\n break\n ",
"not B",
"B",
"print('B')",
"print",
"'B'",
"break",
"turn = B.pop()",
"turn",
"B.pop()",
"B.pop",
"B",
"pop",
"if not C:\n print('C')\n break\n ",
"not C",
"C",
"print('C')",
"print",
"'C'",
"break",
"turn = C.pop()",
"turn",
"C.pop()",
"C.pop",
"C",
"pop",
"C = list(input()[::-1])",
"list(input()[::-1])",
"C",
"turn = 'a'",
"'a'",
"turn",
"turn = A.pop()",
"A.pop()",
"turn",
"A = list(input()[::-1])",
"list(input()[::-1])",
"A",
"B = list(input()[::-1])",
"list(input()[::-1])",
"B",
"turn = C.pop()",
"C.pop()",
"turn",
"turn = B.pop()",
"B.pop()",
"turn"
] | A = list(input()[::-1])
B = list(input()[::-1])
C = list(input()[::-1])
turn = 'a'
while True:
if turn == 'a':
if not A:
print('A')
break
turn = A.pop()
elif turn == 'b':
if not B:
print('B')
break
turn = B.pop()
else:
if not C:
print('C')
break
turn = C.pop() |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
18,
13,
13,
17,
42,
17,
14,
2,
13,
17,
14,
2,
13,
39,
4,
13,
17,
4,
13,
14,
2,
13,
17,
14,
2,
13,
39,
4,
13,
17,
4,
13,
14,
2,
13,
17,
14,
2,
13,
39,
4,
13,
17,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13
] | [
[
77,
2
],
[
68,
8
],
[
71,
14
],
[
74,
20
],
[
78,
23
],
[
75,
30
],
[
78,
34
],
[
75,
43
],
[
69,
47
],
[
75,
56
],
[
72,
60
],
[
68,
69
],
[
71,
72
],
[
74,
75
],
[
77,
78
]
] | [
"a = list(input())\nb = list(input())\nc = list(input())\n\nt = a.pop(0)\nwhile True:\n if t == \"a\":\n if a == []:\n print(\"A\")\n exit()\n else: t = a.pop(0)\n elif t == \"b\":\n if b == []:\n print(\"B\")\n exit()\n else: t = b.pop(0)\n elif t == \"c\":\n if c == []:\n print(\"C\")\n exit()\n else: t = c.pop(0)",
"a = list(input())",
"a",
"list(input())",
"list",
"input()",
"input",
"b = list(input())",
"b",
"list(input())",
"list",
"input()",
"input",
"c = list(input())",
"c",
"list(input())",
"list",
"input()",
"input",
"t = a.pop(0)",
"t",
"a.pop(0)",
"a.pop",
"a",
"pop",
"0",
"while True:\n if t == \"a\":\n if a == []:\n print(\"A\")\n exit()\n else: t = a.pop(0)\n elif t == \"b\":\n if b == []:\n print(\"B\")\n exit()\n else: t = b.pop(0)\n elif t == \"c\":\n if c == []:\n print(\"C\")\n exit()\n else: t = c.pop(0)",
"True",
"if t == \"a\":\n if a == []:\n print(\"A\")\n exit()\n else: t = a.pop(0)\n elif t == \"b\":\n if b == []:\n print(\"B\")\n exit()\n else: t = b.pop(0)\n elif t == \"c\":\n if c == []:\n print(\"C\")\n exit()\n else: t = c.pop(0)",
"t == \"a\"",
"t",
"\"a\"",
"if a == []:\n print(\"A\")\n exit()\n else: t = a.pop(0)\n ",
"a == []",
"a",
"[]",
"print(\"A\")",
"print",
"\"A\"",
"exit()",
"exit",
"elif t == \"b\":\n if b == []:\n print(\"B\")\n exit()\n else: t = b.pop(0)\n ",
"t == \"b\"",
"t",
"\"b\"",
"if b == []:\n print(\"B\")\n exit()\n else: t = b.pop(0)\n ",
"b == []",
"b",
"[]",
"print(\"B\")",
"print",
"\"B\"",
"exit()",
"exit",
"elif t == \"c\":\n if c == []:\n print(\"C\")\n exit()\n else: t = c.pop(0)",
"t == \"c\"",
"t",
"\"c\"",
"if c == []:\n print(\"C\")\n exit()\n else: t = c.pop(0)",
"c == []",
"c",
"[]",
"print(\"C\")",
"print",
"\"C\"",
"exit()",
"exit",
"b = list(input())",
"list(input())",
"b",
"c = list(input())",
"list(input())",
"c",
"t = a.pop(0)",
"a.pop(0)",
"t",
"a = list(input())",
"list(input())",
"a"
] | a = list(input())
b = list(input())
c = list(input())
t = a.pop(0)
while True:
if t == "a":
if a == []:
print("A")
exit()
else: t = a.pop(0)
elif t == "b":
if b == []:
print("B")
exit()
else: t = b.pop(0)
elif t == "c":
if c == []:
print("C")
exit()
else: t = c.pop(0) |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
4,
18,
13,
13,
4,
18,
13,
13,
4,
18,
13,
13,
0,
13,
17,
42,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
3,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
3,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
3,
0,
13,
4,
18,
13,
13,
10,
17,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13
] | [
[
112,
2
],
[
106,
8
],
[
109,
14
],
[
113,
21
],
[
107,
25
],
[
110,
29
],
[
97,
32
],
[
98,
38
],
[
116,
38
],
[
104,
38
],
[
101,
38
],
[
113,
44
],
[
100,
51
],
[
113,
54
],
[
98,
58
],
[
116,
58
],
[
104,
58
],
[
101,
58
],
[
107,
64
],
[
103,
71
],
[
107,
74
],
[
98,
78
],
[
116,
78
],
[
104,
78
],
[
101,
78
],
[
110,
84
],
[
115,
91
],
[
110,
94
],
[
97,
98
],
[
100,
101
],
[
103,
104
],
[
106,
107
],
[
109,
110
],
[
112,
113
],
[
115,
116
]
] | [
"a=list(input())\nb=list(input())\nc=list(input())\na.reverse()\nb.reverse()\nc.reverse()\np=\"a\"\nwhile True:\n if p==\"a\":\n if len(a)==False:\n print(\"A\")\n break\n p=a.pop()\n elif p==\"b\":\n if len(b)==False:\n print(\"B\")\n break\n p=b.pop()\n elif p==\"c\":\n if len(c)==False:\n print(\"C\")\n break\n p=c.pop()",
"a=list(input())",
"a",
"list(input())",
"list",
"input()",
"input",
"b=list(input())",
"b",
"list(input())",
"list",
"input()",
"input",
"c=list(input())",
"c",
"list(input())",
"list",
"input()",
"input",
"a.reverse()",
"a.reverse",
"a",
"reverse",
"b.reverse()",
"b.reverse",
"b",
"reverse",
"c.reverse()",
"c.reverse",
"c",
"reverse",
"p=\"a\"",
"p",
"\"a\"",
"while True:\n if p==\"a\":\n if len(a)==False:\n print(\"A\")\n break\n p=a.pop()\n elif p==\"b\":\n if len(b)==False:\n print(\"B\")\n break\n p=b.pop()\n elif p==\"c\":\n if len(c)==False:\n print(\"C\")\n break\n p=c.pop()",
"True",
"if p==\"a\":\n if len(a)==False:\n print(\"A\")\n break\n p=a.pop()\n elif p==\"b\":\n if len(b)==False:\n print(\"B\")\n break\n p=b.pop()\n elif p==\"c\":\n if len(c)==False:\n print(\"C\")\n break\n p=c.pop()",
"p==\"a\"",
"p",
"\"a\"",
"if len(a)==False:\n print(\"A\")\n break\n ",
"len(a)==False",
"len(a)",
"len",
"a",
"False",
"print(\"A\")",
"print",
"\"A\"",
"break",
"p=a.pop()",
"p",
"a.pop()",
"a.pop",
"a",
"pop",
"elif p==\"b\":\n if len(b)==False:\n print(\"B\")\n break\n p=b.pop()\n ",
"p==\"b\"",
"p",
"\"b\"",
"if len(b)==False:\n print(\"B\")\n break\n ",
"len(b)==False",
"len(b)",
"len",
"b",
"False",
"print(\"B\")",
"print",
"\"B\"",
"break",
"p=b.pop()",
"p",
"b.pop()",
"b.pop",
"b",
"pop",
"elif p==\"c\":\n if len(c)==False:\n print(\"C\")\n break\n p=c.pop()",
"p==\"c\"",
"p",
"\"c\"",
"if len(c)==False:\n print(\"C\")\n break\n ",
"len(c)==False",
"len(c)",
"len",
"c",
"False",
"print(\"C\")",
"print",
"\"C\"",
"break",
"p=c.pop()",
"p",
"c.pop()",
"c.pop",
"c",
"pop",
"p=\"a\"",
"\"a\"",
"p",
"p=a.pop()",
"a.pop()",
"p",
"p=b.pop()",
"b.pop()",
"p",
"b=list(input())",
"list(input())",
"b",
"c=list(input())",
"list(input())",
"c",
"a=list(input())",
"list(input())",
"a",
"p=c.pop()",
"c.pop()",
"p"
] | a=list(input())
b=list(input())
c=list(input())
a.reverse()
b.reverse()
c.reverse()
p="a"
while True:
if p=="a":
if len(a)==False:
print("A")
break
p=a.pop()
elif p=="b":
if len(b)==False:
print("B")
break
p=b.pop()
elif p=="c":
if len(c)==False:
print("C")
break
p=c.pop() |
[
7,
15,
13,
0,
13,
18,
18,
13,
13,
13,
0,
13,
18,
18,
13,
13,
13,
0,
13,
18,
18,
13,
13,
13,
4,
18,
13,
13,
2,
17,
17,
0,
13,
2,
17,
17,
0,
13,
17,
12,
13,
0,
13,
4,
18,
4,
13,
13,
0,
13,
4,
18,
4,
13,
13,
0,
13,
4,
18,
4,
13,
13,
0,
13,
4,
13,
18,
13,
39,
17,
0,
13,
4,
13,
18,
13,
39,
17,
0,
13,
4,
13,
18,
13,
39,
17,
0,
13,
13,
0,
13,
17,
42,
17,
14,
40,
13,
14,
2,
13,
17,
4,
13,
17,
14,
2,
13,
17,
4,
13,
17,
4,
13,
17,
3,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
0,
13,
13,
14,
2,
13,
17,
0,
13,
13,
0,
13,
13,
29,
14,
2,
13,
17,
4,
13,
10,
18,
13,
10,
18,
13,
10,
12,
13,
10,
18,
13,
10,
17,
13,
10,
2,
13
] | [
[
155,
4
],
[
149,
11
],
[
146,
18
],
[
161,
32
],
[
158,
37
],
[
43,
42
],
[
150,
46
],
[
50,
49
],
[
150,
53
],
[
57,
56
],
[
150,
60
],
[
64,
63
],
[
42,
67
],
[
72,
71
],
[
49,
75
],
[
80,
79
],
[
56,
83
],
[
88,
87
],
[
63,
88
],
[
42,
88
],
[
91,
90
],
[
87,
96
],
[
136,
96
],
[
133,
96
],
[
126,
96
],
[
90,
99
],
[
116,
99
],
[
90,
106
],
[
116,
106
],
[
117,
116
],
[
87,
119
],
[
136,
119
],
[
133,
119
],
[
126,
119
],
[
116,
123
],
[
90,
123
],
[
127,
126
],
[
63,
127
],
[
42,
127
],
[
116,
130
],
[
90,
130
],
[
134,
133
],
[
71,
134
],
[
49,
134
],
[
137,
136
],
[
79,
137
],
[
56,
137
],
[
153,
144
],
[
146,
147
],
[
149,
150
],
[
155,
156
],
[
158,
159
],
[
161,
162
]
] | [
"import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\nsys.setrecursionlimit(10 ** 9)\nINF = 1 << 60\nMOD = 1000000007\n\n\ndef main():\n A = readline().strip()\n B = readline().strip()\n C = readline().strip()\n\n A = list(A[::-1])\n B = list(B[::-1])\n C = list(C[::-1])\n\n P = A\n x = 'a'\n while True:\n if not P:\n if x == 'a':\n print('A')\n elif x == 'b':\n print('B')\n else:\n print('C')\n break\n x = P.pop()\n if x == 'a':\n P = A\n elif x == 'b':\n P = B\n else:\n P = C\n\n return\n\n\nif __name__ == '__main__':\n main()",
"import sys",
"sys",
"read = sys.stdin.read",
"read",
"sys.stdin.read",
"sys.stdin",
"sys",
"stdin",
"read",
"readline = sys.stdin.readline",
"readline",
"sys.stdin.readline",
"sys.stdin",
"sys",
"stdin",
"readline",
"readlines = sys.stdin.readlines",
"readlines",
"sys.stdin.readlines",
"sys.stdin",
"sys",
"stdin",
"readlines",
"sys.setrecursionlimit(10 ** 9)",
"sys.setrecursionlimit",
"sys",
"setrecursionlimit",
"10 ** 9",
"10",
"9",
"INF = 1 << 60",
"INF",
"1 << 60",
"1",
"60",
"MOD = 1000000007",
"MOD",
"1000000007",
"def main():\n A = readline().strip()\n B = readline().strip()\n C = readline().strip()\n\n A = list(A[::-1])\n B = list(B[::-1])\n C = list(C[::-1])\n\n P = A\n x = 'a'\n while True:\n if not P:\n if x == 'a':\n print('A')\n elif x == 'b':\n print('B')\n else:\n print('C')\n break\n x = P.pop()\n if x == 'a':\n P = A\n elif x == 'b':\n P = B\n else:\n P = C\n\n return",
"main",
"A = readline().strip()",
"A",
"readline().strip()",
"().strip",
"()",
"readline",
"strip",
"B = readline().strip()",
"B",
"readline().strip()",
"().strip",
"()",
"readline",
"strip",
"C = readline().strip()",
"C",
"readline().strip()",
"().strip",
"()",
"readline",
"strip",
"A = list(A[::-1])",
"A",
"list(A[::-1])",
"list",
"A[::-1]",
"A",
"::-1",
"-1",
"B = list(B[::-1])",
"B",
"list(B[::-1])",
"list",
"B[::-1]",
"B",
"::-1",
"-1",
"C = list(C[::-1])",
"C",
"list(C[::-1])",
"list",
"C[::-1]",
"C",
"::-1",
"-1",
"P = A",
"P",
"A",
"x = 'a'",
"x",
"'a'",
"while True:\n if not P:\n if x == 'a':\n print('A')\n elif x == 'b':\n print('B')\n else:\n print('C')\n break\n x = P.pop()\n if x == 'a':\n P = A\n elif x == 'b':\n P = B\n else:\n P = C\n\n ",
"True",
"if not P:\n if x == 'a':\n print('A')\n elif x == 'b':\n print('B')\n else:\n print('C')\n break\n ",
"not P",
"P",
"if x == 'a':\n print('A')\n elif x == 'b':\n print('B')\n else:\n print('C')\n ",
"x == 'a'",
"x",
"'a'",
"print('A')",
"print",
"'A'",
"elif x == 'b':\n print('B')\n ",
"x == 'b'",
"x",
"'b'",
"print('B')",
"print",
"'B'",
"print('C')",
"print",
"'C'",
"break",
"x = P.pop()",
"x",
"P.pop()",
"P.pop",
"P",
"pop",
"if x == 'a':\n P = A\n elif x == 'b':\n P = B\n else:\n P = C\n\n ",
"x == 'a'",
"x",
"'a'",
"P = A",
"P",
"A",
"elif x == 'b':\n P = B\n ",
"x == 'b'",
"x",
"'b'",
"P = B",
"P",
"B",
"P = C",
"P",
"C",
"return",
"if __name__ == '__main__':\n main()",
"__name__ == '__main__'",
"__name__",
"'__main__'",
"main()",
"main",
"readlines = sys.stdin.readlines",
"sys.stdin.readlines",
"readlines",
"readline = sys.stdin.readline",
"sys.stdin.readline",
"readline",
"def main():\n A = readline().strip()\n B = readline().strip()\n C = readline().strip()\n\n A = list(A[::-1])\n B = list(B[::-1])\n C = list(C[::-1])\n\n P = A\n x = 'a'\n while True:\n if not P:\n if x == 'a':\n print('A')\n elif x == 'b':\n print('B')\n else:\n print('C')\n break\n x = P.pop()\n if x == 'a':\n P = A\n elif x == 'b':\n P = B\n else:\n P = C\n\n return",
"def main():\n A = readline().strip()\n B = readline().strip()\n C = readline().strip()\n\n A = list(A[::-1])\n B = list(B[::-1])\n C = list(C[::-1])\n\n P = A\n x = 'a'\n while True:\n if not P:\n if x == 'a':\n print('A')\n elif x == 'b':\n print('B')\n else:\n print('C')\n break\n x = P.pop()\n if x == 'a':\n P = A\n elif x == 'b':\n P = B\n else:\n P = C\n\n return",
"main",
"read = sys.stdin.read",
"sys.stdin.read",
"read",
"MOD = 1000000007",
"1000000007",
"MOD",
"INF = 1 << 60",
"1 << 60",
"INF"
] | import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007
def main():
A = readline().strip()
B = readline().strip()
C = readline().strip()
A = list(A[::-1])
B = list(B[::-1])
C = list(C[::-1])
P = A
x = 'a'
while True:
if not P:
if x == 'a':
print('A')
elif x == 'b':
print('B')
else:
print('C')
break
x = P.pop()
if x == 'a':
P = A
elif x == 'b':
P = B
else:
P = C
return
if __name__ == '__main__':
main()
|
[
7,
15,
13,
41,
28,
13,
17,
4,
13,
4,
18,
13,
13,
4,
13,
4,
13,
0,
13,
13,
0,
13,
17,
42,
17,
14,
2,
4,
13,
18,
13,
13,
17,
13,
4,
18,
13,
13,
3,
0,
13,
4,
18,
18,
13,
13,
13,
10,
4,
13,
10,
17,
13,
10,
13,
13
] | [
[
6,
5
],
[
5,
8
],
[
54,
18
],
[
51,
21
],
[
55,
30
],
[
52,
31
],
[
49,
31
],
[
52,
36
],
[
49,
36
],
[
48,
40
],
[
55,
44
],
[
52,
45
],
[
49,
45
],
[
48,
49
],
[
51,
52
],
[
54,
55
]
] | [
"\nimport collections\nh = {p: collections.deque(list(raw_input())) for p in 'abc'}\t\nt = 'a'\nwhile(True):\n\tif len(h[t]) == 0:\n\t\tprint t.upper()\n\t\tbreak\n\tt = h[t].popleft()",
"import collections",
"collections",
"p: collections.deque(list(raw_input())) for p in 'abc'",
"for p in 'abc'",
"p",
"'abc'",
"for p in 'abc'",
"p",
"collections.deque(list(raw_input()))",
"collections.deque",
"collections",
"deque",
"list(raw_input())",
"list",
"raw_input()",
"raw_input",
"h = {p: collections.deque(list(raw_input())) for p in 'abc'}",
"h",
"{p: collections.deque(list(raw_input())) for p in 'abc'}",
"t = 'a'",
"t",
"'a'",
"while(True):\n\tif len(h[t]) == 0:\n\t\tprint t.upper()\n\t\tbreak\n\tt = h[t].popleft()",
"True",
"if len(h[t]) == 0:\n\t\tprint t.upper()\n\t\tbreak\n\t",
"len(h[t]) == 0",
"len(h[t])",
"len",
"h[t]",
"h",
"t",
"0",
"print",
"t.upper()",
"t.upper",
"t",
"upper",
"break",
"t = h[t].popleft()",
"t",
"h[t].popleft()",
"[t].popleft",
"[t]",
"h",
"t",
"popleft",
"t = h[t].popleft()",
"h[t].popleft()",
"t",
"t = 'a'",
"'a'",
"t",
"h = {p: collections.deque(list(raw_input())) for p in 'abc'}",
"{p: collections.deque(list(raw_input())) for p in 'abc'}",
"h"
] |
import collections
h = {p: collections.deque(list(raw_input())) for p in 'abc'}
t = 'a'
while(True):
if len(h[t]) == 0:
print t.upper()
break
t = h[t].popleft() |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
17,
42,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
4,
13,
0,
13,
18,
13,
17,
4,
18,
13,
13,
13,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
4,
13,
0,
13,
18,
13,
17,
4,
18,
13,
13,
13,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
4,
13,
0,
13,
18,
13,
17,
4,
18,
13,
13,
13,
10,
4,
13,
10,
18,
13,
10,
4,
13,
10,
4,
13,
10,
17,
13,
10,
18,
13,
10,
18,
13
] | [
[
100,
2
],
[
109,
8
],
[
106,
14
],
[
112,
20
],
[
113,
26
],
[
116,
26
],
[
119,
26
],
[
104,
26
],
[
101,
32
],
[
103,
40
],
[
101,
42
],
[
101,
46
],
[
104,
48
],
[
113,
48
],
[
116,
48
],
[
119,
48
],
[
104,
51
],
[
113,
51
],
[
116,
51
],
[
119,
51
],
[
110,
57
],
[
118,
65
],
[
110,
67
],
[
110,
71
],
[
119,
73
],
[
104,
73
],
[
113,
73
],
[
116,
73
],
[
119,
76
],
[
104,
76
],
[
113,
76
],
[
116,
76
],
[
107,
82
],
[
115,
90
],
[
107,
92
],
[
107,
96
],
[
116,
98
],
[
119,
98
],
[
104,
98
],
[
113,
98
],
[
100,
101
],
[
103,
104
],
[
106,
107
],
[
109,
110
],
[
112,
113
],
[
115,
116
],
[
118,
119
]
] | [
"SA = list(input())\nSB = list(input())\nSC = list(input())\n\nx = 'a'\n\nwhile True:\n if x == 'a':\n if len(SA)==0:\n print('A')\n exit()\n x = SA[0]\n SA.remove(x)\n if x == 'b':\n if len(SB)==0:\n print('B')\n exit()\n x = SB[0]\n SB.remove(x)\n if x == 'c':\n if len(SC)==0:\n print('C')\n exit()\n x = SC[0]\n SC.remove(x)\n",
"SA = list(input())",
"SA",
"list(input())",
"list",
"input()",
"input",
"SB = list(input())",
"SB",
"list(input())",
"list",
"input()",
"input",
"SC = list(input())",
"SC",
"list(input())",
"list",
"input()",
"input",
"x = 'a'",
"x",
"'a'",
"while True:\n if x == 'a':\n if len(SA)==0:\n print('A')\n exit()\n x = SA[0]\n SA.remove(x)\n if x == 'b':\n if len(SB)==0:\n print('B')\n exit()\n x = SB[0]\n SB.remove(x)\n if x == 'c':\n if len(SC)==0:\n print('C')\n exit()\n x = SC[0]\n SC.remove(x)",
"True",
"if x == 'a':\n if len(SA)==0:\n print('A')\n exit()\n x = SA[0]\n SA.remove(x)\n ",
"x == 'a'",
"x",
"'a'",
"if len(SA)==0:\n print('A')\n exit()\n ",
"len(SA)==0",
"len(SA)",
"len",
"SA",
"0",
"print('A')",
"print",
"'A'",
"exit()",
"exit",
"x = SA[0]",
"x",
"SA[0]",
"SA",
"0",
"SA.remove(x)",
"SA.remove",
"SA",
"remove",
"x",
"if x == 'b':\n if len(SB)==0:\n print('B')\n exit()\n x = SB[0]\n SB.remove(x)\n ",
"x == 'b'",
"x",
"'b'",
"if len(SB)==0:\n print('B')\n exit()\n ",
"len(SB)==0",
"len(SB)",
"len",
"SB",
"0",
"print('B')",
"print",
"'B'",
"exit()",
"exit",
"x = SB[0]",
"x",
"SB[0]",
"SB",
"0",
"SB.remove(x)",
"SB.remove",
"SB",
"remove",
"x",
"if x == 'c':\n if len(SC)==0:\n print('C')\n exit()\n x = SC[0]\n SC.remove(x)",
"x == 'c'",
"x",
"'c'",
"if len(SC)==0:\n print('C')\n exit()\n ",
"len(SC)==0",
"len(SC)",
"len",
"SC",
"0",
"print('C')",
"print",
"'C'",
"exit()",
"exit",
"x = SC[0]",
"x",
"SC[0]",
"SC",
"0",
"SC.remove(x)",
"SC.remove",
"SC",
"remove",
"x",
"SA = list(input())",
"list(input())",
"SA",
"x = SA[0]",
"SA[0]",
"x",
"SC = list(input())",
"list(input())",
"SC",
"SB = list(input())",
"list(input())",
"SB",
"x = 'a'",
"'a'",
"x",
"x = SC[0]",
"SC[0]",
"x",
"x = SB[0]",
"SB[0]",
"x"
] | SA = list(input())
SB = list(input())
SC = list(input())
x = 'a'
while True:
if x == 'a':
if len(SA)==0:
print('A')
exit()
x = SA[0]
SA.remove(x)
if x == 'b':
if len(SB)==0:
print('B')
exit()
x = SB[0]
SB.remove(x)
if x == 'c':
if len(SC)==0:
print('C')
exit()
x = SC[0]
SC.remove(x)
|
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
18,
13,
17,
0,
13,
18,
13,
39,
17,
0,
13,
21,
22,
17,
13,
22,
17,
13,
22,
17,
13,
42,
17,
14,
2,
18,
13,
13,
17,
0,
13,
13,
3,
0,
13,
18,
18,
13,
13,
17,
0,
18,
13,
13,
18,
18,
13,
13,
39,
17,
0,
13,
13,
4,
13,
4,
18,
13,
13,
10,
18,
13,
10,
4,
13,
10,
4,
13,
10,
18,
13,
10,
13,
13,
10,
4,
13,
10,
18,
13,
10,
13,
13,
10,
21,
13
] | [
[
78,
2
],
[
90,
6
],
[
81,
10
],
[
84,
14
],
[
79,
16
],
[
93,
19
],
[
79,
21
],
[
99,
25
],
[
56,
40
],
[
100,
41
],
[
85,
42
],
[
88,
42
],
[
96,
45
],
[
85,
46
],
[
88,
46
],
[
75,
49
],
[
56,
51
],
[
100,
52
],
[
85,
53
],
[
88,
53
],
[
59,
56
],
[
100,
57
],
[
85,
58
],
[
88,
58
],
[
56,
60
],
[
100,
61
],
[
85,
62
],
[
88,
62
],
[
87,
66
],
[
76,
67
],
[
97,
72
],
[
75,
76
],
[
78,
79
],
[
81,
82
],
[
84,
85
],
[
76,
87
],
[
87,
88
],
[
90,
91
],
[
93,
94
],
[
85,
96
],
[
88,
96
],
[
96,
97
],
[
99,
100
]
] | [
"SA = input()\nSB = input()\nSC = input()\n\npointer = SA[0]\nSA = SA[1:]\nd = {'a': SA, 'b': SB, 'c': SC}\n\nwhile True:\n if d[pointer] == '':\n ans = pointer\n break\n tmp = d[pointer][0]\n d[pointer] = d[pointer][1:]\n pointer = tmp\n\nprint(ans.upper())",
"SA = input()",
"SA",
"input()",
"input",
"SB = input()",
"SB",
"input()",
"input",
"SC = input()",
"SC",
"input()",
"input",
"pointer = SA[0]",
"pointer",
"SA[0]",
"SA",
"0",
"SA = SA[1:]",
"SA",
"SA[1:]",
"SA",
"1:",
"1",
"d = {'a': SA, 'b': SB, 'c': SC}",
"d",
"{'a': SA, 'b': SB, 'c': SC}",
"'a'",
"'a'",
"SA",
"'b'",
"'b'",
"SB",
"'c'",
"'c'",
"SC",
"while True:\n if d[pointer] == '':\n ans = pointer\n break\n tmp = d[pointer][0]\n d[pointer] = d[pointer][1:]\n pointer = tmp",
"True",
"if d[pointer] == '':\n ans = pointer\n break\n ",
"d[pointer] == ''",
"d[pointer]",
"d",
"pointer",
"''",
"ans = pointer",
"ans",
"pointer",
"break",
"tmp = d[pointer][0]",
"tmp",
"d[pointer][0]",
"[pointer]",
"d",
"pointer",
"0",
"d[pointer] = d[pointer][1:]",
"d[pointer]",
"d",
"pointer",
"d[pointer][1:]",
"[pointer]",
"d",
"pointer",
"1:",
"1",
"pointer = tmp",
"pointer",
"tmp",
"print(ans.upper())",
"print",
"ans.upper()",
"ans.upper",
"ans",
"upper",
"tmp = d[pointer][0]",
"d[pointer][0]",
"tmp",
"SA = input()",
"input()",
"SA",
"SC = input()",
"input()",
"SC",
"pointer = SA[0]",
"SA[0]",
"pointer",
"pointer = tmp",
"tmp",
"pointer",
"SB = input()",
"input()",
"SB",
"SA = SA[1:]",
"SA[1:]",
"SA",
"ans = pointer",
"pointer",
"ans",
"d = {'a': SA, 'b': SB, 'c': SC}",
"{'a': SA, 'b': SB, 'c': SC}",
"d"
] | SA = input()
SB = input()
SC = input()
pointer = SA[0]
SA = SA[1:]
d = {'a': SA, 'b': SB, 'c': SC}
while True:
if d[pointer] == '':
ans = pointer
break
tmp = d[pointer][0]
d[pointer] = d[pointer][1:]
pointer = tmp
print(ans.upper()) |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
18,
13,
13,
17,
42,
17,
14,
2,
2,
13,
39,
2,
13,
17,
4,
13,
17,
4,
13,
14,
2,
2,
13,
39,
2,
13,
17,
4,
13,
17,
4,
13,
14,
2,
2,
13,
39,
2,
13,
17,
4,
13,
17,
4,
13,
14,
2,
13,
17,
0,
13,
4,
18,
13,
13,
17,
14,
2,
13,
17,
0,
13,
4,
18,
13,
13,
17,
14,
2,
13,
17,
0,
13,
4,
18,
13,
13,
17,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13
] | [
[
113,
2
],
[
110,
8
],
[
116,
14
],
[
101,
20
],
[
114,
23
],
[
114,
31
],
[
102,
34
],
[
105,
34
],
[
108,
34
],
[
120,
34
],
[
111,
44
],
[
102,
47
],
[
105,
47
],
[
108,
47
],
[
120,
47
],
[
117,
57
],
[
102,
60
],
[
105,
60
],
[
108,
60
],
[
120,
60
],
[
102,
69
],
[
105,
69
],
[
108,
69
],
[
120,
69
],
[
119,
72
],
[
114,
75
],
[
102,
80
],
[
105,
80
],
[
108,
80
],
[
120,
80
],
[
107,
83
],
[
111,
86
],
[
102,
91
],
[
105,
91
],
[
108,
91
],
[
120,
91
],
[
104,
94
],
[
117,
97
],
[
101,
102
],
[
104,
105
],
[
107,
108
],
[
110,
111
],
[
113,
114
],
[
116,
117
],
[
119,
120
]
] | [
"A = list(input())\nB = list(input())\nC = list(input())\ns = A.pop(0)\nwhile True:\n if A == [] and s == 'a':\n print('A')\n exit()\n elif B == [] and s == 'b':\n print('B')\n exit()\n elif C == [] and s == 'c':\n print('C')\n exit()\n if s == 'a':\n s = A.pop(0)\n elif s == 'b':\n s = B.pop(0)\n elif s == 'c':\n s = C.pop(0)",
"A = list(input())",
"A",
"list(input())",
"list",
"input()",
"input",
"B = list(input())",
"B",
"list(input())",
"list",
"input()",
"input",
"C = list(input())",
"C",
"list(input())",
"list",
"input()",
"input",
"s = A.pop(0)",
"s",
"A.pop(0)",
"A.pop",
"A",
"pop",
"0",
"while True:\n if A == [] and s == 'a':\n print('A')\n exit()\n elif B == [] and s == 'b':\n print('B')\n exit()\n elif C == [] and s == 'c':\n print('C')\n exit()\n if s == 'a':\n s = A.pop(0)\n elif s == 'b':\n s = B.pop(0)\n elif s == 'c':\n s = C.pop(0)",
"True",
"if A == [] and s == 'a':\n print('A')\n exit()\n elif B == [] and s == 'b':\n print('B')\n exit()\n elif C == [] and s == 'c':\n print('C')\n exit()\n ",
"A == [] and s == 'a'",
"A == []",
"A",
"[]",
"s == 'a'",
"s",
"'a'",
"print('A')",
"print",
"'A'",
"exit()",
"exit",
"elif B == [] and s == 'b':\n print('B')\n exit()\n ",
"B == [] and s == 'b'",
"B == []",
"B",
"[]",
"s == 'b'",
"s",
"'b'",
"print('B')",
"print",
"'B'",
"exit()",
"exit",
"elif C == [] and s == 'c':\n print('C')\n exit()\n ",
"C == [] and s == 'c'",
"C == []",
"C",
"[]",
"s == 'c'",
"s",
"'c'",
"print('C')",
"print",
"'C'",
"exit()",
"exit",
"if s == 'a':\n s = A.pop(0)\n elif s == 'b':\n s = B.pop(0)\n elif s == 'c':\n s = C.pop(0)",
"s == 'a'",
"s",
"'a'",
"s = A.pop(0)",
"s",
"A.pop(0)",
"A.pop",
"A",
"pop",
"0",
"elif s == 'b':\n s = B.pop(0)\n ",
"s == 'b'",
"s",
"'b'",
"s = B.pop(0)",
"s",
"B.pop(0)",
"B.pop",
"B",
"pop",
"0",
"elif s == 'c':\n s = C.pop(0)",
"s == 'c'",
"s",
"'c'",
"s = C.pop(0)",
"s",
"C.pop(0)",
"C.pop",
"C",
"pop",
"0",
"s = A.pop(0)",
"A.pop(0)",
"s",
"s = C.pop(0)",
"C.pop(0)",
"s",
"s = B.pop(0)",
"B.pop(0)",
"s",
"B = list(input())",
"list(input())",
"B",
"A = list(input())",
"list(input())",
"A",
"C = list(input())",
"list(input())",
"C",
"s = A.pop(0)",
"A.pop(0)",
"s"
] | A = list(input())
B = list(input())
C = list(input())
s = A.pop(0)
while True:
if A == [] and s == 'a':
print('A')
exit()
elif B == [] and s == 'b':
print('B')
exit()
elif C == [] and s == 'c':
print('C')
exit()
if s == 'a':
s = A.pop(0)
elif s == 'b':
s = B.pop(0)
elif s == 'c':
s = C.pop(0) |
[
7,
41,
28,
13,
4,
13,
17,
4,
4,
13,
0,
13,
13,
41,
28,
13,
4,
13,
17,
4,
4,
13,
18,
13,
13,
0,
13,
13,
0,
13,
39,
17,
17,
17,
0,
13,
17,
42,
40,
18,
13,
13,
18,
13,
13,
0,
13,
18,
18,
13,
13,
18,
13,
13,
0,
18,
13,
13,
17,
0,
13,
8,
2,
13,
17,
17,
8,
2,
13,
17,
17,
17,
4,
13,
8,
2,
13,
17,
17,
8,
2,
13,
17,
17,
17,
10,
13,
13,
10,
13,
13,
10,
17,
13,
10,
18,
13,
10,
39,
13,
10,
8,
13
] | [
[
4,
3
],
[
89,
11
],
[
16,
15
],
[
90,
23
],
[
15,
24
],
[
86,
26
],
[
98,
29
],
[
92,
35
],
[
55,
39
],
[
99,
40
],
[
93,
41
],
[
102,
41
],
[
87,
43
],
[
93,
44
],
[
102,
44
],
[
95,
46
],
[
90,
49
],
[
93,
50
],
[
102,
50
],
[
55,
51
],
[
99,
52
],
[
93,
53
],
[
102,
53
],
[
58,
55
],
[
99,
56
],
[
93,
57
],
[
102,
57
],
[
101,
60
],
[
96,
63
],
[
96,
68
],
[
102,
76
],
[
93,
76
],
[
102,
81
],
[
93,
81
],
[
86,
87
],
[
89,
90
],
[
92,
93
],
[
95,
96
],
[
98,
99
],
[
101,
102
]
] | [
"s=[input() for i in range(3)]\nl=[len(s[i]) for i in range(3)]\nabc=[0,0,0]\nnow=0\nwhile abc[now]!=l[now]:\n s_sub=s[now][abc[now]]\n abc[now]+=1\n now=(0 if s_sub==\"a\" else 1 if s_sub==\"b\" else 2)\nprint(\"A\" if now==0 else \"B\" if now==1 else \"C\")",
"input() for i in range(3)",
"for i in range(3)",
"i",
"range(3)",
"range",
"3",
"for i in range(3)",
"input()",
"input",
"s=[input() for i in range(3)]",
"s",
"[input() for i in range(3)]",
"len(s[i]) for i in range(3)",
"for i in range(3)",
"i",
"range(3)",
"range",
"3",
"for i in range(3)",
"len(s[i])",
"len",
"s[i]",
"s",
"i",
"l=[len(s[i]) for i in range(3)]",
"l",
"[len(s[i]) for i in range(3)]",
"abc=[0,0,0]",
"abc",
"[0,0,0]",
"0",
"0",
"0",
"now=0",
"now",
"0",
"while abc[now]!=l[now]:\n s_sub=s[now][abc[now]]\n abc[now]+=1\n now=(0 if s_sub==\"a\" else 1 if s_sub==\"b\" else 2)",
"abc[now]!=l[now]",
"abc[now]",
"abc",
"now",
"l[now]",
"l",
"now",
"s_sub=s[now][abc[now]]",
"s_sub",
"s[now][abc[now]]",
"[now]",
"s",
"now",
"abc[now]",
"abc",
"now",
"abc[now]+=1",
"abc[now]",
"abc",
"now",
"1",
"now=(0 if s_sub==\"a\" else 1 if s_sub==\"b\" else 2)",
"now",
"0 if s_sub==\"a\" else 1 if s_sub==\"b\" else 2",
"s_sub==\"a\"",
"s_sub",
"\"a\"",
"0",
"1 if s_sub==\"b\" else 2",
"s_sub==\"b\"",
"s_sub",
"\"b\"",
"1",
"2",
"print(\"A\" if now==0 else \"B\" if now==1 else \"C\")",
"print",
"\"A\" if now==0 else \"B\" if now==1 else \"C\"",
"now==0",
"now",
"0",
"\"A\"",
"\"B\" if now==1 else \"C\"",
"now==1",
"now",
"1",
"\"B\"",
"\"C\"",
"l=[len(s[i]) for i in range(3)]",
"[len(s[i]) for i in range(3)]",
"l",
"s=[input() for i in range(3)]",
"[input() for i in range(3)]",
"s",
"now=0",
"0",
"now",
"s_sub=s[now][abc[now]]",
"s[now][abc[now]]",
"s_sub",
"abc=[0,0,0]",
"[0,0,0]",
"abc",
"now=(0 if s_sub==\"a\" else 1 if s_sub==\"b\" else 2)",
"0 if s_sub==\"a\" else 1 if s_sub==\"b\" else 2",
"now"
] | s=[input() for i in range(3)]
l=[len(s[i]) for i in range(3)]
abc=[0,0,0]
now=0
while abc[now]!=l[now]:
s_sub=s[now][abc[now]]
abc[now]+=1
now=(0 if s_sub=="a" else 1 if s_sub=="b" else 2)
print("A" if now==0 else "B" if now==1 else "C") |
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
17,
13,
17,
13,
17,
0,
13,
17,
42,
17,
14,
2,
13,
17,
14,
2,
13,
4,
13,
13,
4,
13,
17,
3,
0,
13,
18,
13,
13,
0,
13,
17,
14,
2,
13,
17,
14,
2,
13,
4,
13,
13,
4,
13,
17,
3,
0,
13,
18,
13,
13,
0,
13,
17,
14,
2,
13,
4,
13,
13,
4,
13,
17,
3,
0,
13,
18,
13,
13,
0,
13,
17,
10,
17,
13,
10,
4,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
18,
13,
10,
17,
13,
10,
18,
13,
10,
18,
13,
10,
17,
13,
10,
4,
13,
10,
4,
13,
10,
17,
13
] | [
[
118,
2
],
[
91,
6
],
[
121,
10
],
[
94,
14
],
[
124,
16
],
[
106,
18
],
[
88,
21
],
[
89,
27
],
[
110,
27
],
[
113,
27
],
[
104,
27
],
[
95,
31
],
[
116,
31
],
[
119,
34
],
[
103,
40
],
[
119,
42
],
[
95,
43
],
[
116,
43
],
[
115,
45
],
[
89,
49
],
[
110,
49
],
[
113,
49
],
[
104,
49
],
[
125,
53
],
[
98,
53
],
[
92,
56
],
[
112,
62
],
[
92,
64
],
[
125,
65
],
[
98,
65
],
[
97,
67
],
[
107,
71
],
[
101,
71
],
[
122,
74
],
[
109,
80
],
[
122,
82
],
[
107,
83
],
[
101,
83
],
[
100,
85
],
[
88,
89
],
[
91,
92
],
[
94,
95
],
[
97,
98
],
[
100,
101
],
[
103,
104
],
[
106,
107
],
[
109,
110
],
[
112,
113
],
[
115,
116
],
[
118,
119
],
[
121,
122
],
[
124,
125
]
] | [
"sa = input()\nsb = input()\nsc = input()\n\npos_a, pos_b, pos_c = 0, 0, 0\nturn = 'a'\nwhile True:\n if turn == 'a':\n if pos_a == len(sa):\n print('A')\n break\n turn = sa[pos_a]\n pos_a += 1\n\n elif turn == 'b':\n if pos_b == len(sb):\n print('B')\n break\n turn = sb[pos_b]\n pos_b += 1\n\n else:\n if pos_c == len(sc):\n print('C')\n break\n turn = sc[pos_c]\n pos_c += 1",
"sa = input()",
"sa",
"input()",
"input",
"sb = input()",
"sb",
"input()",
"input",
"sc = input()",
"sc",
"input()",
"input",
"pos_a, pos_b, pos_c = 0, 0, 0",
"pos_a",
"0",
"pos_b",
"0",
"pos_c",
"0",
"turn = 'a'",
"turn",
"'a'",
"while True:\n if turn == 'a':\n if pos_a == len(sa):\n print('A')\n break\n turn = sa[pos_a]\n pos_a += 1\n\n elif turn == 'b':\n if pos_b == len(sb):\n print('B')\n break\n turn = sb[pos_b]\n pos_b += 1\n\n else:\n if pos_c == len(sc):\n print('C')\n break\n turn = sc[pos_c]\n pos_c += 1",
"True",
"if turn == 'a':\n if pos_a == len(sa):\n print('A')\n break\n turn = sa[pos_a]\n pos_a += 1\n\n elif turn == 'b':\n if pos_b == len(sb):\n print('B')\n break\n turn = sb[pos_b]\n pos_b += 1\n\n else:\n if pos_c == len(sc):\n print('C')\n break\n turn = sc[pos_c]\n pos_c += 1",
"turn == 'a'",
"turn",
"'a'",
"if pos_a == len(sa):\n print('A')\n break\n ",
"pos_a == len(sa)",
"pos_a",
"len(sa)",
"len",
"sa",
"print('A')",
"print",
"'A'",
"break",
"turn = sa[pos_a]",
"turn",
"sa[pos_a]",
"sa",
"pos_a",
"pos_a += 1",
"pos_a",
"1",
"elif turn == 'b':\n if pos_b == len(sb):\n print('B')\n break\n turn = sb[pos_b]\n pos_b += 1\n\n ",
"turn == 'b'",
"turn",
"'b'",
"if pos_b == len(sb):\n print('B')\n break\n ",
"pos_b == len(sb)",
"pos_b",
"len(sb)",
"len",
"sb",
"print('B')",
"print",
"'B'",
"break",
"turn = sb[pos_b]",
"turn",
"sb[pos_b]",
"sb",
"pos_b",
"pos_b += 1",
"pos_b",
"1",
"if pos_c == len(sc):\n print('C')\n break\n ",
"pos_c == len(sc)",
"pos_c",
"len(sc)",
"len",
"sc",
"print('C')",
"print",
"'C'",
"break",
"turn = sc[pos_c]",
"turn",
"sc[pos_c]",
"sc",
"pos_c",
"pos_c += 1",
"pos_c",
"1",
"turn = 'a'",
"'a'",
"turn",
"sb = input()",
"input()",
"sb",
"pos_a, pos_b, pos_c = 0, 0, 0",
"0",
"pos_a",
"pos_b += 1",
"1",
"pos_b",
"pos_c += 1",
"1",
"pos_c",
"turn = sa[pos_a]",
"sa[pos_a]",
"turn",
"pos_c = 0, 0, 0",
"0",
"pos_c",
"turn = sc[pos_c]",
"sc[pos_c]",
"turn",
"turn = sb[pos_b]",
"sb[pos_b]",
"turn",
"pos_a += 1",
"1",
"pos_a",
"sa = input()",
"input()",
"sa",
"sc = input()",
"input()",
"sc",
"pos_b, pos_c = 0, 0, 0",
"0",
"pos_b"
] | sa = input()
sb = input()
sc = input()
pos_a, pos_b, pos_c = 0, 0, 0
turn = 'a'
while True:
if turn == 'a':
if pos_a == len(sa):
print('A')
break
turn = sa[pos_a]
pos_a += 1
elif turn == 'b':
if pos_b == len(sb):
print('B')
break
turn = sb[pos_b]
pos_b += 1
else:
if pos_c == len(sc):
print('C')
break
turn = sc[pos_c]
pos_c += 1 |
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
17,
42,
17,
14,
2,
13,
17,
14,
2,
13,
17,
4,
13,
17,
4,
13,
14,
2,
18,
13,
17,
17,
0,
13,
17,
14,
2,
18,
13,
17,
17,
0,
13,
17,
0,
13,
17,
0,
13,
18,
13,
39,
17,
14,
2,
13,
17,
14,
2,
13,
17,
4,
13,
17,
4,
13,
14,
2,
18,
13,
17,
17,
0,
13,
17,
14,
2,
18,
13,
17,
17,
0,
13,
17,
0,
13,
17,
0,
13,
18,
13,
39,
17,
14,
2,
13,
17,
4,
13,
17,
4,
13,
14,
2,
18,
13,
17,
17,
0,
13,
17,
14,
2,
18,
13,
17,
17,
0,
13,
17,
0,
13,
17,
0,
13,
18,
13,
39,
17,
10,
17,
13,
10,
18,
13,
10,
4,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
18,
13,
10,
17,
13,
10,
18,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
4,
13,
10,
17,
13,
10,
4,
13
] | [
[
180,
2
],
[
174,
6
],
[
141,
10
],
[
147,
14
],
[
148,
20
],
[
169,
20
],
[
136,
20
],
[
172,
20
],
[
145,
20
],
[
163,
20
],
[
151,
20
],
[
157,
20
],
[
166,
20
],
[
178,
20
],
[
181,
24
],
[
160,
24
],
[
181,
34
],
[
160,
34
],
[
177,
38
],
[
181,
43
],
[
160,
43
],
[
165,
47
],
[
156,
50
],
[
159,
53
],
[
181,
55
],
[
160,
55
],
[
148,
60
],
[
169,
60
],
[
136,
60
],
[
172,
60
],
[
145,
60
],
[
163,
60
],
[
151,
60
],
[
157,
60
],
[
166,
60
],
[
178,
60
],
[
175,
64
],
[
139,
64
],
[
175,
74
],
[
139,
74
],
[
150,
78
],
[
175,
83
],
[
139,
83
],
[
162,
87
],
[
144,
90
],
[
138,
93
],
[
175,
95
],
[
139,
95
],
[
142,
100
],
[
154,
100
],
[
142,
110
],
[
154,
110
],
[
171,
114
],
[
142,
119
],
[
154,
119
],
[
135,
123
],
[
168,
126
],
[
153,
129
],
[
142,
131
],
[
154,
131
],
[
135,
136
],
[
138,
139
],
[
141,
142
],
[
144,
145
],
[
147,
148
],
[
150,
151
],
[
153,
154
],
[
156,
157
],
[
159,
160
],
[
162,
163
],
[
165,
166
],
[
168,
169
],
[
171,
172
],
[
174,
175
],
[
177,
178
],
[
180,
181
]
] | [
"a = input()\nb = input()\nc = input()\n\nturn = 'a'\nwhile True:\n if turn == 'a':\n if a == '':\n print('A')\n exit()\n elif a[0] == 'a':\n turn = 'a'\n elif a[0] == 'b':\n turn = 'b'\n else:\n turn = 'c'\n a = a[1:]\n elif turn == 'b':\n if b == '':\n print('B')\n exit()\n elif b[0] == 'a':\n turn = 'a'\n elif b[0] == 'b':\n turn = 'b'\n else:\n turn = 'c'\n b = b[1:]\n else:\n if c == '':\n print('C')\n exit()\n elif c[0] == 'a':\n turn = 'a'\n elif c[0] == 'b':\n turn = 'b'\n else:\n turn = 'c'\n c = c[1:]",
"a = input()",
"a",
"input()",
"input",
"b = input()",
"b",
"input()",
"input",
"c = input()",
"c",
"input()",
"input",
"turn = 'a'",
"turn",
"'a'",
"while True:\n if turn == 'a':\n if a == '':\n print('A')\n exit()\n elif a[0] == 'a':\n turn = 'a'\n elif a[0] == 'b':\n turn = 'b'\n else:\n turn = 'c'\n a = a[1:]\n elif turn == 'b':\n if b == '':\n print('B')\n exit()\n elif b[0] == 'a':\n turn = 'a'\n elif b[0] == 'b':\n turn = 'b'\n else:\n turn = 'c'\n b = b[1:]\n else:\n if c == '':\n print('C')\n exit()\n elif c[0] == 'a':\n turn = 'a'\n elif c[0] == 'b':\n turn = 'b'\n else:\n turn = 'c'\n c = c[1:]",
"True",
"if turn == 'a':\n if a == '':\n print('A')\n exit()\n elif a[0] == 'a':\n turn = 'a'\n elif a[0] == 'b':\n turn = 'b'\n else:\n turn = 'c'\n a = a[1:]\n elif turn == 'b':\n if b == '':\n print('B')\n exit()\n elif b[0] == 'a':\n turn = 'a'\n elif b[0] == 'b':\n turn = 'b'\n else:\n turn = 'c'\n b = b[1:]\n else:\n if c == '':\n print('C')\n exit()\n elif c[0] == 'a':\n turn = 'a'\n elif c[0] == 'b':\n turn = 'b'\n else:\n turn = 'c'\n c = c[1:]",
"turn == 'a'",
"turn",
"'a'",
"if a == '':\n print('A')\n exit()\n elif a[0] == 'a':\n turn = 'a'\n elif a[0] == 'b':\n turn = 'b'\n else:\n turn = 'c'\n ",
"a == ''",
"a",
"''",
"print('A')",
"print",
"'A'",
"exit()",
"exit",
"elif a[0] == 'a':\n turn = 'a'\n ",
"a[0] == 'a'",
"a[0]",
"a",
"0",
"'a'",
"turn = 'a'",
"turn",
"'a'",
"elif a[0] == 'b':\n turn = 'b'\n ",
"a[0] == 'b'",
"a[0]",
"a",
"0",
"'b'",
"turn = 'b'",
"turn",
"'b'",
"turn = 'c'",
"turn",
"'c'",
"a = a[1:]",
"a",
"a[1:]",
"a",
"1:",
"1",
"elif turn == 'b':\n if b == '':\n print('B')\n exit()\n elif b[0] == 'a':\n turn = 'a'\n elif b[0] == 'b':\n turn = 'b'\n else:\n turn = 'c'\n b = b[1:]\n ",
"turn == 'b'",
"turn",
"'b'",
"if b == '':\n print('B')\n exit()\n elif b[0] == 'a':\n turn = 'a'\n elif b[0] == 'b':\n turn = 'b'\n else:\n turn = 'c'\n ",
"b == ''",
"b",
"''",
"print('B')",
"print",
"'B'",
"exit()",
"exit",
"elif b[0] == 'a':\n turn = 'a'\n ",
"b[0] == 'a'",
"b[0]",
"b",
"0",
"'a'",
"turn = 'a'",
"turn",
"'a'",
"elif b[0] == 'b':\n turn = 'b'\n ",
"b[0] == 'b'",
"b[0]",
"b",
"0",
"'b'",
"turn = 'b'",
"turn",
"'b'",
"turn = 'c'",
"turn",
"'c'",
"b = b[1:]",
"b",
"b[1:]",
"b",
"1:",
"1",
"if c == '':\n print('C')\n exit()\n elif c[0] == 'a':\n turn = 'a'\n elif c[0] == 'b':\n turn = 'b'\n else:\n turn = 'c'\n ",
"c == ''",
"c",
"''",
"print('C')",
"print",
"'C'",
"exit()",
"exit",
"elif c[0] == 'a':\n turn = 'a'\n ",
"c[0] == 'a'",
"c[0]",
"c",
"0",
"'a'",
"turn = 'a'",
"turn",
"'a'",
"elif c[0] == 'b':\n turn = 'b'\n ",
"c[0] == 'b'",
"c[0]",
"c",
"0",
"'b'",
"turn = 'b'",
"turn",
"'b'",
"turn = 'c'",
"turn",
"'c'",
"c = c[1:]",
"c",
"c[1:]",
"c",
"1:",
"1",
"turn = 'b'",
"'b'",
"turn",
"b = b[1:]",
"b[1:]",
"b",
"c = input()",
"input()",
"c",
"turn = 'c'",
"'c'",
"turn",
"turn = 'a'",
"'a'",
"turn",
"turn = 'a'",
"'a'",
"turn",
"c = c[1:]",
"c[1:]",
"c",
"turn = 'c'",
"'c'",
"turn",
"a = a[1:]",
"a[1:]",
"a",
"turn = 'b'",
"'b'",
"turn",
"turn = 'b'",
"'b'",
"turn",
"turn = 'c'",
"'c'",
"turn",
"turn = 'a'",
"'a'",
"turn",
"b = input()",
"input()",
"b",
"turn = 'a'",
"'a'",
"turn",
"a = input()",
"input()",
"a"
] | a = input()
b = input()
c = input()
turn = 'a'
while True:
if turn == 'a':
if a == '':
print('A')
exit()
elif a[0] == 'a':
turn = 'a'
elif a[0] == 'b':
turn = 'b'
else:
turn = 'c'
a = a[1:]
elif turn == 'b':
if b == '':
print('B')
exit()
elif b[0] == 'a':
turn = 'a'
elif b[0] == 'b':
turn = 'b'
else:
turn = 'c'
b = b[1:]
else:
if c == '':
print('C')
exit()
elif c[0] == 'a':
turn = 'a'
elif c[0] == 'b':
turn = 'b'
else:
turn = 'c'
c = c[1:]
|
[
7,
15,
0,
13,
4,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
4,
13,
0,
13,
17,
42,
17,
14,
2,
13,
17,
14,
13,
0,
13,
4,
18,
13,
13,
9,
0,
13,
17,
3,
14,
2,
13,
17,
14,
13,
0,
13,
4,
18,
13,
13,
9,
0,
13,
17,
3,
14,
2,
13,
17,
14,
13,
0,
13,
4,
18,
13,
13,
9,
0,
13,
17,
3,
4,
13,
13,
10,
17,
13,
10,
4,
13,
10,
17,
13,
10,
4,
13,
10,
17,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
17,
13,
10,
4,
13
] | [
[
101,
3
],
[
104,
11
],
[
89,
19
],
[
98,
27
],
[
99,
33
],
[
114,
33
],
[
96,
33
],
[
108,
33
],
[
107,
38
],
[
102,
41
],
[
110,
45
],
[
99,
50
],
[
114,
50
],
[
96,
50
],
[
108,
50
],
[
95,
55
],
[
105,
58
],
[
86,
62
],
[
99,
67
],
[
114,
67
],
[
96,
67
],
[
108,
67
],
[
113,
72
],
[
90,
75
],
[
92,
79
],
[
93,
84
],
[
87,
84
],
[
111,
84
],
[
86,
87
],
[
89,
90
],
[
92,
93
],
[
95,
96
],
[
98,
99
],
[
101,
102
],
[
104,
105
],
[
107,
108
],
[
110,
111
],
[
113,
114
]
] | [
"from collections import deque\nA = deque(list(input()))\nB = deque(list(input()))\nC = deque(list(input()))\n\ntern = \"a\"\nwhile True:\n if tern == \"a\":\n if A:\n tern = A.popleft()\n continue\n win = \"A\"\n break\n elif tern == \"b\":\n if B:\n tern = B.popleft()\n continue\n win = \"B\"\n break\n elif tern == \"c\":\n if C:\n tern = C.popleft()\n continue\n win = \"C\"\n break\n \nprint(win)",
"from collections import deque",
"A = deque(list(input()))",
"A",
"deque(list(input()))",
"deque",
"list(input())",
"list",
"input()",
"input",
"B = deque(list(input()))",
"B",
"deque(list(input()))",
"deque",
"list(input())",
"list",
"input()",
"input",
"C = deque(list(input()))",
"C",
"deque(list(input()))",
"deque",
"list(input())",
"list",
"input()",
"input",
"tern = \"a\"",
"tern",
"\"a\"",
"while True:\n if tern == \"a\":\n if A:\n tern = A.popleft()\n continue\n win = \"A\"\n break\n elif tern == \"b\":\n if B:\n tern = B.popleft()\n continue\n win = \"B\"\n break\n elif tern == \"c\":\n if C:\n tern = C.popleft()\n continue\n win = \"C\"\n break\n ",
"True",
"if tern == \"a\":\n if A:\n tern = A.popleft()\n continue\n win = \"A\"\n break\n elif tern == \"b\":\n if B:\n tern = B.popleft()\n continue\n win = \"B\"\n break\n elif tern == \"c\":\n if C:\n tern = C.popleft()\n continue\n win = \"C\"\n break\n ",
"tern == \"a\"",
"tern",
"\"a\"",
"if A:\n tern = A.popleft()\n continue\n ",
"A",
"tern = A.popleft()",
"tern",
"A.popleft()",
"A.popleft",
"A",
"popleft",
"continue",
"win = \"A\"",
"win",
"\"A\"",
"break",
"elif tern == \"b\":\n if B:\n tern = B.popleft()\n continue\n win = \"B\"\n break\n ",
"tern == \"b\"",
"tern",
"\"b\"",
"if B:\n tern = B.popleft()\n continue\n ",
"B",
"tern = B.popleft()",
"tern",
"B.popleft()",
"B.popleft",
"B",
"popleft",
"continue",
"win = \"B\"",
"win",
"\"B\"",
"break",
"elif tern == \"c\":\n if C:\n tern = C.popleft()\n continue\n win = \"C\"\n break\n ",
"tern == \"c\"",
"tern",
"\"c\"",
"if C:\n tern = C.popleft()\n continue\n ",
"C",
"tern = C.popleft()",
"tern",
"C.popleft()",
"C.popleft",
"C",
"popleft",
"continue",
"win = \"C\"",
"win",
"\"C\"",
"break",
"print(win)",
"print",
"win",
"win = \"B\"",
"\"B\"",
"win",
"C = deque(list(input()))",
"deque(list(input()))",
"C",
"win = \"C\"",
"\"C\"",
"win",
"tern = B.popleft()",
"B.popleft()",
"tern",
"tern = \"a\"",
"\"a\"",
"tern",
"A = deque(list(input()))",
"deque(list(input()))",
"A",
"B = deque(list(input()))",
"deque(list(input()))",
"B",
"tern = A.popleft()",
"A.popleft()",
"tern",
"win = \"A\"",
"\"A\"",
"win",
"tern = C.popleft()",
"C.popleft()",
"tern"
] | from collections import deque
A = deque(list(input()))
B = deque(list(input()))
C = deque(list(input()))
tern = "a"
while True:
if tern == "a":
if A:
tern = A.popleft()
continue
win = "A"
break
elif tern == "b":
if B:
tern = B.popleft()
continue
win = "B"
break
elif tern == "c":
if C:
tern = C.popleft()
continue
win = "C"
break
print(win) |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
18,
13,
13,
17,
42,
17,
14,
2,
13,
17,
14,
2,
13,
39,
4,
13,
17,
3,
0,
13,
4,
18,
13,
13,
17,
14,
2,
13,
17,
14,
2,
13,
39,
4,
13,
17,
3,
0,
13,
4,
18,
13,
13,
17,
14,
2,
13,
39,
4,
13,
17,
3,
0,
13,
4,
18,
13,
13,
17,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13
] | [
[
88,
2
],
[
91,
8
],
[
100,
14
],
[
94,
20
],
[
89,
23
],
[
95,
30
],
[
98,
30
],
[
86,
30
],
[
83,
30
],
[
89,
34
],
[
82,
41
],
[
89,
44
],
[
95,
49
],
[
98,
49
],
[
86,
49
],
[
83,
49
],
[
92,
53
],
[
85,
60
],
[
92,
63
],
[
101,
68
],
[
97,
75
],
[
101,
78
],
[
82,
83
],
[
85,
86
],
[
88,
89
],
[
91,
92
],
[
94,
95
],
[
97,
98
],
[
100,
101
]
] | [
"a = list(input())\nb = list(input())\nc = list(input())\nnext = a.pop(0)\nwhile True:\n if next == \"a\":\n if a == []:\n print(\"A\")\n break\n else:\n next = a.pop(0)\n elif next == \"b\":\n if b == []:\n print(\"B\")\n break\n else:\n next = b.pop(0)\n else:\n if c == []:\n print(\"C\")\n break\n else:\n next =c.pop(0)",
"a = list(input())",
"a",
"list(input())",
"list",
"input()",
"input",
"b = list(input())",
"b",
"list(input())",
"list",
"input()",
"input",
"c = list(input())",
"c",
"list(input())",
"list",
"input()",
"input",
"next = a.pop(0)",
"next",
"a.pop(0)",
"a.pop",
"a",
"pop",
"0",
"while True:\n if next == \"a\":\n if a == []:\n print(\"A\")\n break\n else:\n next = a.pop(0)\n elif next == \"b\":\n if b == []:\n print(\"B\")\n break\n else:\n next = b.pop(0)\n else:\n if c == []:\n print(\"C\")\n break\n else:\n next =c.pop(0)",
"True",
"if next == \"a\":\n if a == []:\n print(\"A\")\n break\n else:\n next = a.pop(0)\n elif next == \"b\":\n if b == []:\n print(\"B\")\n break\n else:\n next = b.pop(0)\n else:\n if c == []:\n print(\"C\")\n break\n else:\n next =c.pop(0)",
"next == \"a\"",
"next",
"\"a\"",
"if a == []:\n print(\"A\")\n break\n else:\n next = a.pop(0)\n ",
"a == []",
"a",
"[]",
"print(\"A\")",
"print",
"\"A\"",
"break",
"next = a.pop(0)",
"next",
"a.pop(0)",
"a.pop",
"a",
"pop",
"0",
"elif next == \"b\":\n if b == []:\n print(\"B\")\n break\n else:\n next = b.pop(0)\n ",
"next == \"b\"",
"next",
"\"b\"",
"if b == []:\n print(\"B\")\n break\n else:\n next = b.pop(0)\n ",
"b == []",
"b",
"[]",
"print(\"B\")",
"print",
"\"B\"",
"break",
"next = b.pop(0)",
"next",
"b.pop(0)",
"b.pop",
"b",
"pop",
"0",
"if c == []:\n print(\"C\")\n break\n else:\n next =c.pop(0)",
"c == []",
"c",
"[]",
"print(\"C\")",
"print",
"\"C\"",
"break",
"next =c.pop(0)",
"next",
"c.pop(0)",
"c.pop",
"c",
"pop",
"0",
"next = a.pop(0)",
"a.pop(0)",
"next",
"next = b.pop(0)",
"b.pop(0)",
"next",
"a = list(input())",
"list(input())",
"a",
"b = list(input())",
"list(input())",
"b",
"next = a.pop(0)",
"a.pop(0)",
"next",
"next =c.pop(0)",
"c.pop(0)",
"next",
"c = list(input())",
"list(input())",
"c"
] | a = list(input())
b = list(input())
c = list(input())
next = a.pop(0)
while True:
if next == "a":
if a == []:
print("A")
break
else:
next = a.pop(0)
elif next == "b":
if b == []:
print("B")
break
else:
next = b.pop(0)
else:
if c == []:
print("C")
break
else:
next =c.pop(0) |
[
7,
15,
13,
0,
13,
18,
18,
13,
13,
13,
15,
0,
13,
4,
13,
4,
13,
4,
18,
4,
13,
4,
13,
13,
17,
17,
0,
13,
4,
13,
4,
13,
4,
18,
4,
13,
4,
13,
13,
17,
17,
0,
13,
4,
13,
4,
13,
4,
18,
4,
13,
4,
13,
13,
17,
17,
0,
13,
21,
22,
17,
13,
22,
17,
13,
22,
17,
13,
0,
13,
17,
42,
17,
0,
13,
4,
18,
18,
13,
13,
13,
14,
2,
4,
13,
18,
13,
13,
17,
4,
13,
4,
18,
13,
13,
3,
10,
21,
13,
10,
4,
13,
10,
17,
13,
10,
4,
13,
10,
4,
13,
10,
18,
13,
10,
4,
13
] | [
[
112,
4
],
[
106,
12
],
[
113,
22
],
[
109,
27
],
[
113,
37
],
[
115,
42
],
[
113,
52
],
[
97,
57
],
[
103,
69
],
[
100,
74
],
[
98,
78
],
[
104,
79
],
[
101,
79
],
[
98,
86
],
[
101,
87
],
[
104,
87
],
[
101,
93
],
[
104,
93
],
[
97,
98
],
[
100,
101
],
[
103,
104
],
[
106,
107
],
[
109,
110
],
[
112,
113
],
[
115,
116
]
] | [
"# -*- coding:utf-8 -*-\nimport sys\ninput = sys.stdin.readline\nfrom collections import deque\nsa = deque(list(str(input()).replace('\\n', '')))\nsb = deque(list(str(input()).replace('\\n', '')))\nsc = deque(list(str(input()).replace('\\n', '')))\ndi = {'a':sa, 'b':sb, 'c':sc}\nturn = 'a'\nwhile True:\n turn = di[turn].popleft()\n # print(turn)\n if len(di[turn])==0:\n print(turn.upper())\n break",
"import sys",
"sys",
"input = sys.stdin.readline",
"input",
"sys.stdin.readline",
"sys.stdin",
"sys",
"stdin",
"readline",
"from collections import deque",
"sa = deque(list(str(input()).replace('\\n', '')))",
"sa",
"deque(list(str(input()).replace('\\n', '')))",
"deque",
"list(str(input()).replace('\\n', ''))",
"list",
"str(input()).replace('\\n', '')",
"(input()).replace",
"(input())",
"str",
"input()",
"input",
"replace",
"'\\n'",
"''",
"sb = deque(list(str(input()).replace('\\n', '')))",
"sb",
"deque(list(str(input()).replace('\\n', '')))",
"deque",
"list(str(input()).replace('\\n', ''))",
"list",
"str(input()).replace('\\n', '')",
"(input()).replace",
"(input())",
"str",
"input()",
"input",
"replace",
"'\\n'",
"''",
"sc = deque(list(str(input()).replace('\\n', '')))",
"sc",
"deque(list(str(input()).replace('\\n', '')))",
"deque",
"list(str(input()).replace('\\n', ''))",
"list",
"str(input()).replace('\\n', '')",
"(input()).replace",
"(input())",
"str",
"input()",
"input",
"replace",
"'\\n'",
"''",
"di = {'a':sa, 'b':sb, 'c':sc}",
"di",
"{'a':sa, 'b':sb, 'c':sc}",
"'a'",
"'a'",
"sa",
"'b'",
"'b'",
"sb",
"'c'",
"'c'",
"sc",
"turn = 'a'",
"turn",
"'a'",
"while True:\n turn = di[turn].popleft()\n # print(turn)\n if len(di[turn])==0:\n print(turn.upper())\n break",
"True",
"turn = di[turn].popleft()",
"turn",
"di[turn].popleft()",
"[turn].popleft",
"[turn]",
"di",
"turn",
"popleft",
"if len(di[turn])==0:\n print(turn.upper())\n break",
"len(di[turn])==0",
"len(di[turn])",
"len",
"di[turn]",
"di",
"turn",
"0",
"print(turn.upper())",
"print",
"turn.upper()",
"turn.upper",
"turn",
"upper",
"break",
"di = {'a':sa, 'b':sb, 'c':sc}",
"{'a':sa, 'b':sb, 'c':sc}",
"di",
"turn = di[turn].popleft()",
"di[turn].popleft()",
"turn",
"turn = 'a'",
"'a'",
"turn",
"sa = deque(list(str(input()).replace('\\n', '')))",
"deque(list(str(input()).replace('\\n', '')))",
"sa",
"sb = deque(list(str(input()).replace('\\n', '')))",
"deque(list(str(input()).replace('\\n', '')))",
"sb",
"input = sys.stdin.readline",
"sys.stdin.readline",
"input",
"sc = deque(list(str(input()).replace('\\n', '')))",
"deque(list(str(input()).replace('\\n', '')))",
"sc"
] | # -*- coding:utf-8 -*-
import sys
input = sys.stdin.readline
from collections import deque
sa = deque(list(str(input()).replace('\n', '')))
sb = deque(list(str(input()).replace('\n', '')))
sc = deque(list(str(input()).replace('\n', '')))
di = {'a':sa, 'b':sb, 'c':sc}
turn = 'a'
while True:
turn = di[turn].popleft()
# print(turn)
if len(di[turn])==0:
print(turn.upper())
break |
[
7,
41,
28,
13,
4,
13,
17,
4,
4,
13,
4,
13,
0,
13,
13,
0,
13,
17,
0,
13,
17,
42,
13,
14,
2,
2,
2,
2,
4,
13,
18,
13,
17,
17,
2,
13,
17,
2,
2,
4,
13,
18,
13,
17,
17,
2,
13,
17,
2,
2,
4,
13,
18,
13,
17,
17,
2,
13,
17,
0,
13,
17,
3,
0,
13,
4,
18,
18,
13,
13,
13,
17,
14,
2,
13,
17,
0,
13,
17,
14,
2,
13,
17,
0,
13,
17,
0,
13,
17,
14,
2,
13,
17,
4,
13,
17,
14,
2,
13,
17,
4,
13,
17,
4,
13,
17,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
4,
13,
10,
17,
13,
10,
13,
13,
10,
17,
13
] | [
[
4,
3
],
[
125,
13
],
[
107,
16
],
[
122,
19
],
[
126,
31
],
[
108,
35
],
[
117,
35
],
[
111,
35
],
[
114,
35
],
[
126,
42
],
[
108,
46
],
[
117,
46
],
[
111,
46
],
[
114,
46
],
[
126,
53
],
[
108,
57
],
[
117,
57
],
[
111,
57
],
[
114,
57
],
[
128,
60
],
[
119,
64
],
[
126,
68
],
[
108,
69
],
[
117,
69
],
[
111,
69
],
[
114,
69
],
[
120,
74
],
[
113,
77
],
[
120,
81
],
[
110,
84
],
[
116,
87
],
[
117,
91
],
[
111,
91
],
[
114,
91
],
[
108,
91
],
[
117,
98
],
[
111,
98
],
[
114,
98
],
[
108,
98
],
[
107,
108
],
[
110,
111
],
[
113,
114
],
[
116,
117
],
[
119,
120
],
[
122,
123
],
[
125,
126
],
[
128,
129
]
] | [
"check=[list(input()) for i in range(3)]\ncur=0\nflag=True\nwhile flag:\n if (len(check[0])==0 and cur==0) or (len(check[1])==0 and cur==1) or (len(check[2])==0 and cur==2):\n flag=False\n break\n temp=check[cur].pop(0)\n if temp==\"a\":\n cur=0\n elif temp==\"b\":\n cur=1\n else:\n cur=2\nif cur==0:\n print(\"A\")\nelif cur==1:\n print(\"B\")\nelse:\n print(\"C\")",
"list(input()) for i in range(3)",
"for i in range(3)",
"i",
"range(3)",
"range",
"3",
"for i in range(3)",
"list(input())",
"list",
"input()",
"input",
"check=[list(input()) for i in range(3)]",
"check",
"[list(input()) for i in range(3)]",
"cur=0",
"cur",
"0",
"flag=True",
"flag",
"True",
"while flag:\n if (len(check[0])==0 and cur==0) or (len(check[1])==0 and cur==1) or (len(check[2])==0 and cur==2):\n flag=False\n break\n temp=check[cur].pop(0)\n if temp==\"a\":\n cur=0\n elif temp==\"b\":\n cur=1\n else:\n cur=2",
"flag",
"if (len(check[0])==0 and cur==0) or (len(check[1])==0 and cur==1) or (len(check[2])==0 and cur==2):\n flag=False\n break\n ",
"(len(check[0])==0 and cur==0) or (len(check[1])==0 and cur==1) or (len(check[2])==0 and cur==2)",
"(len(check[0])==0 and cur==0) or (len(check[1])==0 and cur==1)",
"len(check[0])==0 and cur==0",
"len(check[0])==0",
"len(check[0])",
"len",
"check[0]",
"check",
"0",
"0",
"cur==0",
"cur",
"0",
"len(check[1])==0 and cur==1",
"len(check[1])==0",
"len(check[1])",
"len",
"check[1]",
"check",
"1",
"0",
"cur==1",
"cur",
"1",
"len(check[2])==0 and cur==2",
"len(check[2])==0",
"len(check[2])",
"len",
"check[2]",
"check",
"2",
"0",
"cur==2",
"cur",
"2",
"flag=False",
"flag",
"False",
"break",
"temp=check[cur].pop(0)",
"temp",
"check[cur].pop(0)",
"[cur].pop",
"[cur]",
"check",
"cur",
"pop",
"0",
"if temp==\"a\":\n cur=0\n elif temp==\"b\":\n cur=1\n else:\n cur=2",
"temp==\"a\"",
"temp",
"\"a\"",
"cur=0",
"cur",
"0",
"elif temp==\"b\":\n cur=1\n ",
"temp==\"b\"",
"temp",
"\"b\"",
"cur=1",
"cur",
"1",
"cur=2",
"cur",
"2",
"if cur==0:\n print(\"A\")\nelif cur==1:\n print(\"B\")\nelse:\n print(\"C\")",
"cur==0",
"cur",
"0",
"print(\"A\")",
"print",
"\"A\"",
"elif cur==1:\n print(\"B\")",
"cur==1",
"cur",
"1",
"print(\"B\")",
"print",
"\"B\"",
"print(\"C\")",
"print",
"\"C\"",
"cur=0",
"0",
"cur",
"cur=1",
"1",
"cur",
"cur=0",
"0",
"cur",
"cur=2",
"2",
"cur",
"temp=check[cur].pop(0)",
"check[cur].pop(0)",
"temp",
"flag=True",
"True",
"flag",
"check=[list(input()) for i in range(3)]",
"[list(input()) for i in range(3)]",
"check",
"flag=False",
"False",
"flag"
] | check=[list(input()) for i in range(3)]
cur=0
flag=True
while flag:
if (len(check[0])==0 and cur==0) or (len(check[1])==0 and cur==1) or (len(check[2])==0 and cur==2):
flag=False
break
temp=check[cur].pop(0)
if temp=="a":
cur=0
elif temp=="b":
cur=1
else:
cur=2
if cur==0:
print("A")
elif cur==1:
print("B")
else:
print("C")
|
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
17,
0,
13,
17,
0,
13,
17,
42,
40,
13,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
0,
13,
17,
0,
13,
17,
0,
13,
18,
13,
17,
0,
13,
18,
13,
39,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
0,
13,
17,
0,
13,
17,
0,
13,
18,
13,
17,
0,
13,
18,
13,
39,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
0,
13,
17,
0,
13,
17,
0,
13,
18,
13,
17,
0,
13,
18,
13,
39,
17,
4,
13,
13,
10,
18,
13,
10,
17,
13,
10,
4,
13,
10,
4,
13,
10,
17,
13,
10,
18,
13,
10,
18,
13,
10,
17,
13,
10,
18,
13,
10,
4,
13,
10,
18,
13,
10,
18,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13
] | [
[
137,
2
],
[
116,
6
],
[
119,
10
],
[
155,
14
],
[
152,
17
],
[
113,
20
],
[
156,
24
],
[
123,
24
],
[
159,
24
],
[
150,
24
],
[
114,
27
],
[
111,
27
],
[
135,
27
],
[
129,
27
],
[
138,
33
],
[
141,
33
],
[
149,
36
],
[
146,
39
],
[
128,
42
],
[
138,
44
],
[
141,
44
],
[
140,
47
],
[
138,
49
],
[
141,
49
],
[
114,
54
],
[
111,
54
],
[
135,
54
],
[
129,
54
],
[
117,
60
],
[
144,
60
],
[
158,
63
],
[
131,
66
],
[
134,
69
],
[
117,
71
],
[
144,
71
],
[
143,
74
],
[
117,
76
],
[
144,
76
],
[
114,
81
],
[
111,
81
],
[
135,
81
],
[
129,
81
],
[
120,
87
],
[
126,
87
],
[
122,
90
],
[
161,
93
],
[
110,
96
],
[
120,
98
],
[
126,
98
],
[
125,
101
],
[
120,
103
],
[
126,
103
],
[
162,
108
],
[
132,
108
],
[
147,
108
],
[
153,
108
],
[
110,
111
],
[
113,
114
],
[
116,
117
],
[
119,
120
],
[
122,
123
],
[
125,
126
],
[
128,
129
],
[
131,
132
],
[
134,
135
],
[
137,
138
],
[
140,
141
],
[
143,
144
],
[
146,
147
],
[
149,
150
],
[
152,
153
],
[
155,
156
],
[
158,
159
],
[
161,
162
]
] | [
"sa = input()\nsb = input()\nsc = input()\n\nended = False\nwinner = ''\nnext_turn = 'a'\nwhile not ended:\n if next_turn == 'a':\n if len(sa) == 0:\n ended = True\n winner = 'A'\n else:\n next_turn = sa[0]\n sa = sa[1:]\n elif next_turn == 'b':\n if len(sb) == 0:\n ended = True\n winner = 'B'\n else:\n next_turn = sb[0]\n sb = sb[1:]\n elif next_turn == 'c':\n if len(sc) == 0:\n ended = True\n winner = 'C'\n else:\n next_turn = sc[0]\n sc = sc[1:]\nprint(winner)",
"sa = input()",
"sa",
"input()",
"input",
"sb = input()",
"sb",
"input()",
"input",
"sc = input()",
"sc",
"input()",
"input",
"ended = False",
"ended",
"False",
"winner = ''",
"winner",
"''",
"next_turn = 'a'",
"next_turn",
"'a'",
"while not ended:\n if next_turn == 'a':\n if len(sa) == 0:\n ended = True\n winner = 'A'\n else:\n next_turn = sa[0]\n sa = sa[1:]\n elif next_turn == 'b':\n if len(sb) == 0:\n ended = True\n winner = 'B'\n else:\n next_turn = sb[0]\n sb = sb[1:]\n elif next_turn == 'c':\n if len(sc) == 0:\n ended = True\n winner = 'C'\n else:\n next_turn = sc[0]\n sc = sc[1:]",
"not ended",
"ended",
"if next_turn == 'a':\n if len(sa) == 0:\n ended = True\n winner = 'A'\n else:\n next_turn = sa[0]\n sa = sa[1:]\n elif next_turn == 'b':\n if len(sb) == 0:\n ended = True\n winner = 'B'\n else:\n next_turn = sb[0]\n sb = sb[1:]\n elif next_turn == 'c':\n if len(sc) == 0:\n ended = True\n winner = 'C'\n else:\n next_turn = sc[0]\n sc = sc[1:]",
"next_turn == 'a'",
"next_turn",
"'a'",
"if len(sa) == 0:\n ended = True\n winner = 'A'\n else:\n next_turn = sa[0]\n sa = sa[1:]\n ",
"len(sa) == 0",
"len(sa)",
"len",
"sa",
"0",
"ended = True",
"ended",
"True",
"winner = 'A'",
"winner",
"'A'",
"next_turn = sa[0]",
"next_turn",
"sa[0]",
"sa",
"0",
"sa = sa[1:]",
"sa",
"sa[1:]",
"sa",
"1:",
"1",
"elif next_turn == 'b':\n if len(sb) == 0:\n ended = True\n winner = 'B'\n else:\n next_turn = sb[0]\n sb = sb[1:]\n ",
"next_turn == 'b'",
"next_turn",
"'b'",
"if len(sb) == 0:\n ended = True\n winner = 'B'\n else:\n next_turn = sb[0]\n sb = sb[1:]\n ",
"len(sb) == 0",
"len(sb)",
"len",
"sb",
"0",
"ended = True",
"ended",
"True",
"winner = 'B'",
"winner",
"'B'",
"next_turn = sb[0]",
"next_turn",
"sb[0]",
"sb",
"0",
"sb = sb[1:]",
"sb",
"sb[1:]",
"sb",
"1:",
"1",
"elif next_turn == 'c':\n if len(sc) == 0:\n ended = True\n winner = 'C'\n else:\n next_turn = sc[0]\n sc = sc[1:]",
"next_turn == 'c'",
"next_turn",
"'c'",
"if len(sc) == 0:\n ended = True\n winner = 'C'\n else:\n next_turn = sc[0]\n sc = sc[1:]",
"len(sc) == 0",
"len(sc)",
"len",
"sc",
"0",
"ended = True",
"ended",
"True",
"winner = 'C'",
"winner",
"'C'",
"next_turn = sc[0]",
"next_turn",
"sc[0]",
"sc",
"0",
"sc = sc[1:]",
"sc",
"sc[1:]",
"sc",
"1:",
"1",
"print(winner)",
"print",
"winner",
"next_turn = sc[0]",
"sc[0]",
"next_turn",
"next_turn = 'a'",
"'a'",
"next_turn",
"sb = input()",
"input()",
"sb",
"sc = input()",
"input()",
"sc",
"ended = True",
"True",
"ended",
"sc = sc[1:]",
"sc[1:]",
"sc",
"next_turn = sa[0]",
"sa[0]",
"next_turn",
"winner = 'B'",
"'B'",
"winner",
"next_turn = sb[0]",
"sb[0]",
"next_turn",
"sa = input()",
"input()",
"sa",
"sa = sa[1:]",
"sa[1:]",
"sa",
"sb = sb[1:]",
"sb[1:]",
"sb",
"winner = 'A'",
"'A'",
"winner",
"ended = True",
"True",
"ended",
"winner = ''",
"''",
"winner",
"ended = False",
"False",
"ended",
"ended = True",
"True",
"ended",
"winner = 'C'",
"'C'",
"winner"
] | sa = input()
sb = input()
sc = input()
ended = False
winner = ''
next_turn = 'a'
while not ended:
if next_turn == 'a':
if len(sa) == 0:
ended = True
winner = 'A'
else:
next_turn = sa[0]
sa = sa[1:]
elif next_turn == 'b':
if len(sb) == 0:
ended = True
winner = 'B'
else:
next_turn = sb[0]
sb = sb[1:]
elif next_turn == 'c':
if len(sc) == 0:
ended = True
winner = 'C'
else:
next_turn = sc[0]
sc = sc[1:]
print(winner)
|
[
7,
15,
15,
13,
12,
13,
12,
13,
12,
13,
41,
28,
13,
4,
13,
13,
4,
4,
13,
12,
13,
23,
13,
41,
28,
13,
4,
13,
13,
4,
4,
13,
12,
13,
23,
13,
41,
28,
13,
4,
13,
13,
4,
4,
13,
12,
13,
23,
13,
12,
13,
12,
13,
0,
13,
4,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
4,
13,
0,
13,
17,
42,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
0,
13,
17,
3,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
0,
13,
17,
3,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
0,
13,
17,
3,
0,
13,
4,
18,
13,
13,
4,
13,
13,
10,
12,
13,
10,
12,
13,
10,
4,
13,
10,
12,
13,
10,
17,
13,
10,
12,
13,
10,
12,
13,
10,
12,
13,
10,
17,
13,
10,
17,
13,
10,
4,
13,
10,
4,
13,
10,
12,
13,
10,
17,
13,
10,
12,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13
] | [
[
13,
12
],
[
147,
18
],
[
22,
22
],
[
26,
25
],
[
183,
31
],
[
35,
35
],
[
39,
38
],
[
48,
48
],
[
152,
54
],
[
165,
60
],
[
176,
62
],
[
165,
68
],
[
191,
70
],
[
165,
76
],
[
173,
78
],
[
174,
84
],
[
195,
84
],
[
180,
84
],
[
198,
84
],
[
153,
90
],
[
170,
93
],
[
197,
97
],
[
153,
100
],
[
174,
104
],
[
195,
104
],
[
180,
104
],
[
198,
104
],
[
177,
110
],
[
158,
113
],
[
179,
117
],
[
177,
120
],
[
174,
124
],
[
195,
124
],
[
180,
124
],
[
198,
124
],
[
192,
130
],
[
185,
133
],
[
194,
137
],
[
192,
140
],
[
186,
144
],
[
159,
144
],
[
171,
144
],
[
152,
153
],
[
158,
159
],
[
170,
171
],
[
173,
174
],
[
176,
177
],
[
179,
180
],
[
185,
186
],
[
191,
192
],
[
194,
195
],
[
197,
198
]
] | [
"from collections import deque\nimport sys\n\n\ndef input(): return sys.stdin.readline().strip()\ndef I(): return int(input())\ndef LI(): return list(map(int, input().split()))\ndef IR(n): return [I() for i in range(n)]\ndef LIR(n): return [LI() for i in range(n)]\ndef SR(n): return [S() for i in range(n)]\ndef S(): return input()\ndef LS(): return input().split()\n\n\nsa = deque(list(S()))\nsb = deque(list(S()))\nsc = deque(list(S()))\n\nturn = 'a'\nwhile True:\n if turn == 'a':\n if len(sa) == 0:\n ans = 'A'\n break\n turn = sa.popleft()\n elif turn == 'b':\n if len(sb) == 0:\n ans = 'B'\n break\n turn = sb.popleft()\n elif turn == 'c':\n if len(sc) == 0:\n ans = 'C'\n break\n turn = sc.popleft()\n\nprint(ans)",
"from collections import deque",
"import sys",
"sys",
"def input(): return sys.stdin.readline().strip()",
"input",
"def I(): return int(input())",
"I",
"def LI(): return list(map(int, input().split()))",
"LI",
"I() for i in range(n)",
"for i in range(n)",
"i",
"range(n)",
"range",
"n",
"for i in range(n)",
"I()",
"I",
"def IR(n): return [I() for i in range(n)]",
"IR",
"n",
"n",
"LI() for i in range(n)",
"for i in range(n)",
"i",
"range(n)",
"range",
"n",
"for i in range(n)",
"LI()",
"LI",
"def LIR(n): return [LI() for i in range(n)]",
"LIR",
"n",
"n",
"S() for i in range(n)",
"for i in range(n)",
"i",
"range(n)",
"range",
"n",
"for i in range(n)",
"S()",
"S",
"def SR(n): return [S() for i in range(n)]",
"SR",
"n",
"n",
"def S(): return input()",
"S",
"def LS(): return input().split()",
"LS",
"sa = deque(list(S()))",
"sa",
"deque(list(S()))",
"deque",
"list(S())",
"list",
"S()",
"S",
"sb = deque(list(S()))",
"sb",
"deque(list(S()))",
"deque",
"list(S())",
"list",
"S()",
"S",
"sc = deque(list(S()))",
"sc",
"deque(list(S()))",
"deque",
"list(S())",
"list",
"S()",
"S",
"turn = 'a'",
"turn",
"'a'",
"while True:\n if turn == 'a':\n if len(sa) == 0:\n ans = 'A'\n break\n turn = sa.popleft()\n elif turn == 'b':\n if len(sb) == 0:\n ans = 'B'\n break\n turn = sb.popleft()\n elif turn == 'c':\n if len(sc) == 0:\n ans = 'C'\n break\n turn = sc.popleft()",
"True",
"if turn == 'a':\n if len(sa) == 0:\n ans = 'A'\n break\n turn = sa.popleft()\n elif turn == 'b':\n if len(sb) == 0:\n ans = 'B'\n break\n turn = sb.popleft()\n elif turn == 'c':\n if len(sc) == 0:\n ans = 'C'\n break\n turn = sc.popleft()",
"turn == 'a'",
"turn",
"'a'",
"if len(sa) == 0:\n ans = 'A'\n break\n ",
"len(sa) == 0",
"len(sa)",
"len",
"sa",
"0",
"ans = 'A'",
"ans",
"'A'",
"break",
"turn = sa.popleft()",
"turn",
"sa.popleft()",
"sa.popleft",
"sa",
"popleft",
"elif turn == 'b':\n if len(sb) == 0:\n ans = 'B'\n break\n turn = sb.popleft()\n ",
"turn == 'b'",
"turn",
"'b'",
"if len(sb) == 0:\n ans = 'B'\n break\n ",
"len(sb) == 0",
"len(sb)",
"len",
"sb",
"0",
"ans = 'B'",
"ans",
"'B'",
"break",
"turn = sb.popleft()",
"turn",
"sb.popleft()",
"sb.popleft",
"sb",
"popleft",
"elif turn == 'c':\n if len(sc) == 0:\n ans = 'C'\n break\n turn = sc.popleft()",
"turn == 'c'",
"turn",
"'c'",
"if len(sc) == 0:\n ans = 'C'\n break\n ",
"len(sc) == 0",
"len(sc)",
"len",
"sc",
"0",
"ans = 'C'",
"ans",
"'C'",
"break",
"turn = sc.popleft()",
"turn",
"sc.popleft()",
"sc.popleft",
"sc",
"popleft",
"print(ans)",
"print",
"ans",
"def I(): return int(input())",
"def I(): return int(input())",
"I",
"def IR(n): return [I() for i in range(n)]",
"def IR(n): return [I() for i in range(n)]",
"IR",
"sa = deque(list(S()))",
"deque(list(S()))",
"sa",
"def LS(): return input().split()",
"def LS(): return input().split()",
"LS",
"ans = 'B'",
"'B'",
"ans",
"def input(): return sys.stdin.readline().strip()",
"def input(): return sys.stdin.readline().strip()",
"input",
"def S(): return input()",
"def S(): return input()",
"S",
"def SR(n): return [S() for i in range(n)]",
"def SR(n): return [S() for i in range(n)]",
"SR",
"ans = 'A'",
"'A'",
"ans",
"turn = 'a'",
"'a'",
"turn",
"sb = deque(list(S()))",
"deque(list(S()))",
"sb",
"turn = sb.popleft()",
"sb.popleft()",
"turn",
"def LI(): return list(map(int, input().split()))",
"def LI(): return list(map(int, input().split()))",
"LI",
"ans = 'C'",
"'C'",
"ans",
"def LIR(n): return [LI() for i in range(n)]",
"def LIR(n): return [LI() for i in range(n)]",
"LIR",
"sc = deque(list(S()))",
"deque(list(S()))",
"sc",
"turn = sc.popleft()",
"sc.popleft()",
"turn",
"turn = sa.popleft()",
"sa.popleft()",
"turn"
] | from collections import deque
import sys
def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()
sa = deque(list(S()))
sb = deque(list(S()))
sc = deque(list(S()))
turn = 'a'
while True:
if turn == 'a':
if len(sa) == 0:
ans = 'A'
break
turn = sa.popleft()
elif turn == 'b':
if len(sb) == 0:
ans = 'B'
break
turn = sb.popleft()
elif turn == 'c':
if len(sc) == 0:
ans = 'C'
break
turn = sc.popleft()
print(ans)
|
[
7,
15,
12,
13,
0,
13,
4,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
4,
13,
0,
13,
21,
22,
17,
13,
22,
17,
13,
22,
17,
13,
0,
13,
17,
42,
17,
14,
2,
4,
13,
18,
13,
13,
17,
0,
13,
13,
3,
0,
13,
4,
18,
18,
13,
13,
13,
0,
13,
4,
18,
13,
13,
4,
13,
13,
14,
2,
13,
17,
4,
13,
10,
12,
13
] | [
[
6,
5
],
[
14,
13
],
[
22,
21
],
[
30,
29
],
[
42,
41
],
[
29,
50
],
[
41,
51
],
[
66,
51
],
[
55,
54
],
[
41,
55
],
[
66,
55
],
[
59,
58
],
[
29,
62
],
[
41,
63
],
[
66,
63
],
[
67,
66
],
[
58,
69
],
[
54,
73
],
[
82,
79
]
] | [
"from collections import deque\n\n\ndef main():\n sas = deque(list(input()))\n sbs = deque(list(input()))\n scs = deque(list(input()))\n\n deques = {\"A\": sas, \"B\": sbs, \"C\": scs}\n player = \"A\"\n while True:\n if len(deques[player]) == 0:\n ans = player\n break\n player_temp = deques[player].popleft()\n player = player_temp.upper()\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()",
"from collections import deque",
"def main():\n sas = deque(list(input()))\n sbs = deque(list(input()))\n scs = deque(list(input()))\n\n deques = {\"A\": sas, \"B\": sbs, \"C\": scs}\n player = \"A\"\n while True:\n if len(deques[player]) == 0:\n ans = player\n break\n player_temp = deques[player].popleft()\n player = player_temp.upper()\n print(ans)",
"main",
"sas = deque(list(input()))",
"sas",
"deque(list(input()))",
"deque",
"list(input())",
"list",
"input()",
"input",
"sbs = deque(list(input()))",
"sbs",
"deque(list(input()))",
"deque",
"list(input())",
"list",
"input()",
"input",
"scs = deque(list(input()))",
"scs",
"deque(list(input()))",
"deque",
"list(input())",
"list",
"input()",
"input",
"deques = {\"A\": sas, \"B\": sbs, \"C\": scs}",
"deques",
"{\"A\": sas, \"B\": sbs, \"C\": scs}",
"\"A\"",
"\"A\"",
"sas",
"\"B\"",
"\"B\"",
"sbs",
"\"C\"",
"\"C\"",
"scs",
"player = \"A\"",
"player",
"\"A\"",
"while True:\n if len(deques[player]) == 0:\n ans = player\n break\n player_temp = deques[player].popleft()\n player = player_temp.upper()\n ",
"True",
"if len(deques[player]) == 0:\n ans = player\n break\n ",
"len(deques[player]) == 0",
"len(deques[player])",
"len",
"deques[player]",
"deques",
"player",
"0",
"ans = player",
"ans",
"player",
"break",
"player_temp = deques[player].popleft()",
"player_temp",
"deques[player].popleft()",
"[player].popleft",
"[player]",
"deques",
"player",
"popleft",
"player = player_temp.upper()",
"player",
"player_temp.upper()",
"player_temp.upper",
"player_temp",
"upper",
"print(ans)",
"print",
"ans",
"if __name__ == \"__main__\":\n main()",
"__name__ == \"__main__\"",
"__name__",
"\"__main__\"",
"main()",
"main",
"def main():\n sas = deque(list(input()))\n sbs = deque(list(input()))\n scs = deque(list(input()))\n\n deques = {\"A\": sas, \"B\": sbs, \"C\": scs}\n player = \"A\"\n while True:\n if len(deques[player]) == 0:\n ans = player\n break\n player_temp = deques[player].popleft()\n player = player_temp.upper()\n print(ans)",
"def main():\n sas = deque(list(input()))\n sbs = deque(list(input()))\n scs = deque(list(input()))\n\n deques = {\"A\": sas, \"B\": sbs, \"C\": scs}\n player = \"A\"\n while True:\n if len(deques[player]) == 0:\n ans = player\n break\n player_temp = deques[player].popleft()\n player = player_temp.upper()\n print(ans)",
"main"
] | from collections import deque
def main():
sas = deque(list(input()))
sbs = deque(list(input()))
scs = deque(list(input()))
deques = {"A": sas, "B": sbs, "C": scs}
player = "A"
while True:
if len(deques[player]) == 0:
ans = player
break
player_temp = deques[player].popleft()
player = player_temp.upper()
print(ans)
if __name__ == "__main__":
main()
|
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
39,
13,
39,
13,
39,
28,
13,
13,
4,
18,
13,
13,
13,
28,
13,
13,
4,
18,
13,
13,
13,
28,
13,
13,
4,
18,
13,
13,
13,
0,
13,
4,
18,
13,
13,
17,
42,
17,
14,
2,
13,
17,
14,
2,
13,
39,
4,
13,
17,
3,
0,
13,
4,
18,
13,
13,
17,
14,
2,
13,
17,
14,
2,
13,
39,
4,
13,
17,
3,
0,
13,
4,
18,
13,
13,
17,
14,
2,
13,
39,
4,
13,
17,
3,
0,
13,
4,
18,
13,
13,
17,
10,
39,
13,
10,
4,
13,
10,
39,
13,
10,
39,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13
] | [
[
134,
2
],
[
128,
6
],
[
131,
10
],
[
107,
14
],
[
113,
16
],
[
116,
18
],
[
22,
21
],
[
135,
21
],
[
108,
25
],
[
21,
27
],
[
30,
29
],
[
129,
29
],
[
114,
33
],
[
29,
35
],
[
38,
37
],
[
132,
37
],
[
117,
41
],
[
37,
43
],
[
125,
45
],
[
108,
48
],
[
126,
55
],
[
111,
55
],
[
123,
55
],
[
120,
55
],
[
108,
59
],
[
119,
66
],
[
108,
69
],
[
126,
74
],
[
111,
74
],
[
123,
74
],
[
120,
74
],
[
114,
78
],
[
122,
85
],
[
114,
88
],
[
117,
93
],
[
110,
100
],
[
117,
103
],
[
107,
108
],
[
110,
111
],
[
113,
114
],
[
116,
117
],
[
119,
120
],
[
122,
123
],
[
125,
126
],
[
128,
129
],
[
131,
132
],
[
134,
135
]
] | [
"a = input()\nb = input()\nc = input()\nSa,Sb,Sc = [],[],[]\nfor x in a:\n Sa.append(x)\nfor x in b:\n Sb.append(x)\nfor x in c:\n Sc.append(x)\n\nx = Sa.pop(0)\nwhile True:\n \n if x == \"a\":\n if Sa == []:\n print(\"A\")\n break\n else:\n x = Sa.pop(0)\n elif x == \"b\":\n if Sb == []:\n print(\"B\")\n break\n else:\n x = Sb.pop(0)\n else :\n if Sc == []:\n print(\"C\")\n break\n else:\n x = Sc.pop(0)",
"a = input()",
"a",
"input()",
"input",
"b = input()",
"b",
"input()",
"input",
"c = input()",
"c",
"input()",
"input",
"Sa,Sb,Sc = [],[],[]",
"Sa",
"[]",
"Sb",
"[]",
"Sc",
"[]",
"for x in a:\n Sa.append(x)",
"x",
"a",
"Sa.append(x)",
"Sa.append",
"Sa",
"append",
"x",
"for x in b:\n Sb.append(x)",
"x",
"b",
"Sb.append(x)",
"Sb.append",
"Sb",
"append",
"x",
"for x in c:\n Sc.append(x)",
"x",
"c",
"Sc.append(x)",
"Sc.append",
"Sc",
"append",
"x",
"x = Sa.pop(0)",
"x",
"Sa.pop(0)",
"Sa.pop",
"Sa",
"pop",
"0",
"while True:\n \n if x == \"a\":\n if Sa == []:\n print(\"A\")\n break\n else:\n x = Sa.pop(0)\n elif x == \"b\":\n if Sb == []:\n print(\"B\")\n break\n else:\n x = Sb.pop(0)\n else :\n if Sc == []:\n print(\"C\")\n break\n else:\n x = Sc.pop(0)",
"True",
"if x == \"a\":\n if Sa == []:\n print(\"A\")\n break\n else:\n x = Sa.pop(0)\n elif x == \"b\":\n if Sb == []:\n print(\"B\")\n break\n else:\n x = Sb.pop(0)\n else :\n if Sc == []:\n print(\"C\")\n break\n else:\n x = Sc.pop(0)",
"x == \"a\"",
"x",
"\"a\"",
"if Sa == []:\n print(\"A\")\n break\n else:\n x = Sa.pop(0)\n ",
"Sa == []",
"Sa",
"[]",
"print(\"A\")",
"print",
"\"A\"",
"break",
"x = Sa.pop(0)",
"x",
"Sa.pop(0)",
"Sa.pop",
"Sa",
"pop",
"0",
"elif x == \"b\":\n if Sb == []:\n print(\"B\")\n break\n else:\n x = Sb.pop(0)\n ",
"x == \"b\"",
"x",
"\"b\"",
"if Sb == []:\n print(\"B\")\n break\n else:\n x = Sb.pop(0)\n ",
"Sb == []",
"Sb",
"[]",
"print(\"B\")",
"print",
"\"B\"",
"break",
"x = Sb.pop(0)",
"x",
"Sb.pop(0)",
"Sb.pop",
"Sb",
"pop",
"0",
"if Sc == []:\n print(\"C\")\n break\n else:\n x = Sc.pop(0)",
"Sc == []",
"Sc",
"[]",
"print(\"C\")",
"print",
"\"C\"",
"break",
"x = Sc.pop(0)",
"x",
"Sc.pop(0)",
"Sc.pop",
"Sc",
"pop",
"0",
"Sa,Sb,Sc = [],[],[]",
"[]",
"Sa",
"x = Sc.pop(0)",
"Sc.pop(0)",
"x",
"Sb,Sc = [],[],[]",
"[]",
"Sb",
"Sc = [],[],[]",
"[]",
"Sc",
"x = Sa.pop(0)",
"Sa.pop(0)",
"x",
"x = Sb.pop(0)",
"Sb.pop(0)",
"x",
"x = Sa.pop(0)",
"Sa.pop(0)",
"x",
"b = input()",
"input()",
"b",
"c = input()",
"input()",
"c",
"a = input()",
"input()",
"a"
] | a = input()
b = input()
c = input()
Sa,Sb,Sc = [],[],[]
for x in a:
Sa.append(x)
for x in b:
Sb.append(x)
for x in c:
Sc.append(x)
x = Sa.pop(0)
while True:
if x == "a":
if Sa == []:
print("A")
break
else:
x = Sa.pop(0)
elif x == "b":
if Sb == []:
print("B")
break
else:
x = Sb.pop(0)
else :
if Sc == []:
print("C")
break
else:
x = Sc.pop(0)
|
[
7,
0,
13,
39,
17,
17,
17,
0,
18,
13,
17,
4,
13,
4,
13,
0,
18,
13,
17,
4,
13,
4,
13,
0,
18,
13,
17,
4,
13,
4,
13,
0,
13,
17,
28,
13,
4,
13,
17,
14,
2,
4,
13,
18,
13,
13,
17,
3,
0,
13,
4,
18,
18,
13,
13,
13,
17,
14,
2,
13,
17,
0,
13,
17,
14,
2,
13,
17,
0,
13,
17,
0,
13,
17,
14,
2,
13,
17,
4,
13,
17,
14,
2,
13,
17,
4,
13,
17,
4,
13,
17,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
39,
13,
10,
17,
13,
10,
4,
13
] | [
[
101,
2
],
[
11,
8
],
[
102,
9
],
[
19,
16
],
[
102,
17
],
[
27,
24
],
[
102,
25
],
[
95,
32
],
[
36,
35
],
[
102,
44
],
[
96,
45
],
[
99,
45
],
[
105,
45
],
[
93,
45
],
[
107,
49
],
[
102,
53
],
[
96,
54
],
[
99,
54
],
[
105,
54
],
[
93,
54
],
[
108,
59
],
[
92,
62
],
[
108,
66
],
[
104,
69
],
[
98,
72
],
[
99,
76
],
[
105,
76
],
[
93,
76
],
[
96,
76
],
[
99,
83
],
[
105,
83
],
[
93,
83
],
[
96,
83
],
[
92,
93
],
[
95,
96
],
[
98,
99
],
[
101,
102
],
[
104,
105
],
[
107,
108
]
] | [
"s=[0,0,0]\ns[0]=list(input())\ns[1]=list(input())\ns[2]=list(input())\nn=0\nfor i in range(100000):\n if len(s[n])==0:\n break\n tmp=s[n].pop(0)\n if tmp==\"a\":\n n=0\n elif tmp==\"b\":\n n=1\n else:\n n=2\n\nif n==0:\n print(\"A\")\nelif n==1:\n print(\"B\")\nelse:\n print(\"C\")",
"s=[0,0,0]",
"s",
"[0,0,0]",
"0",
"0",
"0",
"s[0]=list(input())",
"s[0]",
"s",
"0",
"list(input())",
"list",
"input()",
"input",
"s[1]=list(input())",
"s[1]",
"s",
"1",
"list(input())",
"list",
"input()",
"input",
"s[2]=list(input())",
"s[2]",
"s",
"2",
"list(input())",
"list",
"input()",
"input",
"n=0",
"n",
"0",
"for i in range(100000):\n if len(s[n])==0:\n break\n tmp=s[n].pop(0)\n if tmp==\"a\":\n n=0\n elif tmp==\"b\":\n n=1\n else:\n n=2",
"i",
"range(100000)",
"range",
"100000",
"if len(s[n])==0:\n break\n ",
"len(s[n])==0",
"len(s[n])",
"len",
"s[n]",
"s",
"n",
"0",
"break",
"tmp=s[n].pop(0)",
"tmp",
"s[n].pop(0)",
"[n].pop",
"[n]",
"s",
"n",
"pop",
"0",
"if tmp==\"a\":\n n=0\n elif tmp==\"b\":\n n=1\n else:\n n=2",
"tmp==\"a\"",
"tmp",
"\"a\"",
"n=0",
"n",
"0",
"elif tmp==\"b\":\n n=1\n ",
"tmp==\"b\"",
"tmp",
"\"b\"",
"n=1",
"n",
"1",
"n=2",
"n",
"2",
"if n==0:\n print(\"A\")\nelif n==1:\n print(\"B\")\nelse:\n print(\"C\")",
"n==0",
"n",
"0",
"print(\"A\")",
"print",
"\"A\"",
"elif n==1:\n print(\"B\")",
"n==1",
"n",
"1",
"print(\"B\")",
"print",
"\"B\"",
"print(\"C\")",
"print",
"\"C\"",
"n=0",
"0",
"n",
"n=0",
"0",
"n",
"n=2",
"2",
"n",
"s=[0,0,0]",
"[0,0,0]",
"s",
"n=1",
"1",
"n",
"tmp=s[n].pop(0)",
"s[n].pop(0)",
"tmp"
] | s=[0,0,0]
s[0]=list(input())
s[1]=list(input())
s[2]=list(input())
n=0
for i in range(100000):
if len(s[n])==0:
break
tmp=s[n].pop(0)
if tmp=="a":
n=0
elif tmp=="b":
n=1
else:
n=2
if n==0:
print("A")
elif n==1:
print("B")
else:
print("C") |
[
7,
12,
13,
14,
2,
4,
13,
13,
17,
29,
39,
17,
13,
17,
29,
39,
17,
18,
13,
17,
18,
13,
39,
17,
23,
13,
12,
13,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
21,
22,
17,
13,
22,
17,
13,
22,
17,
13,
0,
13,
17,
42,
17,
0,
13,
13,
0,
13,
4,
13,
18,
13,
13,
13,
18,
13,
13,
14,
13,
4,
13,
4,
18,
13,
13,
3,
14,
2,
13,
17,
4,
13,
10,
12,
13,
10,
12,
13
] | [
[
25,
7
],
[
25,
18
],
[
25,
21
],
[
25,
25
],
[
30,
29
],
[
34,
33
],
[
38,
37
],
[
42,
41
],
[
54,
53
],
[
59,
58
],
[
53,
59
],
[
67,
59
],
[
62,
61
],
[
88,
63
],
[
68,
64
],
[
41,
65
],
[
58,
66
],
[
62,
67
],
[
62,
68
],
[
41,
69
],
[
58,
70
],
[
58,
77
],
[
91,
85
]
] | [
"def judge(c):\n if len(c) == 0:\n return 1, c, \"-1\"\n else:\n return 0, c[0], c[1:]\n\n\ndef main():\n sa = input()\n sb = input()\n sc = input()\n card = {\"a\": sa, \"b\": sb, \"c\": sc}\n next_player = \"a\"\n while True:\n now = next_player\n is_finish, next_player, card[now] = judge(card[now])\n if is_finish:\n print(now.upper())\n break\n\n\nif __name__ == '__main__':\n main()\n",
"def judge(c):\n if len(c) == 0:\n return 1, c, \"-1\"\n else:\n return 0, c[0], c[1:]",
"judge",
"if len(c) == 0:\n return 1, c, \"-1\"\n else:\n return 0, c[0], c[1:]",
"len(c) == 0",
"len(c)",
"len",
"c",
"0",
"return 1, c, \"-1\"",
"return 1, c, \"-1\"",
"1",
"c",
"\"-1\"",
"return 0, c[0], c[1:]",
"return 0, c[0], c[1:]",
"0",
"c[0]",
"c",
"0",
"c[1:]",
"c",
"1:",
"1",
"c",
"c",
"def main():\n sa = input()\n sb = input()\n sc = input()\n card = {\"a\": sa, \"b\": sb, \"c\": sc}\n next_player = \"a\"\n while True:\n now = next_player\n is_finish, next_player, card[now] = judge(card[now])\n if is_finish:\n print(now.upper())\n break",
"main",
"sa = input()",
"sa",
"input()",
"input",
"sb = input()",
"sb",
"input()",
"input",
"sc = input()",
"sc",
"input()",
"input",
"card = {\"a\": sa, \"b\": sb, \"c\": sc}",
"card",
"{\"a\": sa, \"b\": sb, \"c\": sc}",
"\"a\"",
"\"a\"",
"sa",
"\"b\"",
"\"b\"",
"sb",
"\"c\"",
"\"c\"",
"sc",
"next_player = \"a\"",
"next_player",
"\"a\"",
"while True:\n now = next_player\n is_finish, next_player, card[now] = judge(card[now])\n if is_finish:\n print(now.upper())\n break",
"True",
"now = next_player",
"now",
"next_player",
"is_finish, next_player, card[now] = judge(card[now])",
"is_finish",
"judge(card[now])",
"judge",
"card[now]",
"card",
"now",
"next_player",
"card[now]",
"card",
"now",
"if is_finish:\n print(now.upper())\n break",
"is_finish",
"print(now.upper())",
"print",
"now.upper()",
"now.upper",
"now",
"upper",
"break",
"if __name__ == '__main__':\n main()",
"__name__ == '__main__'",
"__name__",
"'__main__'",
"main()",
"main",
"def judge(c):\n if len(c) == 0:\n return 1, c, \"-1\"\n else:\n return 0, c[0], c[1:]",
"def judge(c):\n if len(c) == 0:\n return 1, c, \"-1\"\n else:\n return 0, c[0], c[1:]",
"judge",
"def main():\n sa = input()\n sb = input()\n sc = input()\n card = {\"a\": sa, \"b\": sb, \"c\": sc}\n next_player = \"a\"\n while True:\n now = next_player\n is_finish, next_player, card[now] = judge(card[now])\n if is_finish:\n print(now.upper())\n break",
"def main():\n sa = input()\n sb = input()\n sc = input()\n card = {\"a\": sa, \"b\": sb, \"c\": sc}\n next_player = \"a\"\n while True:\n now = next_player\n is_finish, next_player, card[now] = judge(card[now])\n if is_finish:\n print(now.upper())\n break",
"main"
] | def judge(c):
if len(c) == 0:
return 1, c, "-1"
else:
return 0, c[0], c[1:]
def main():
sa = input()
sb = input()
sc = input()
card = {"a": sa, "b": sb, "c": sc}
next_player = "a"
while True:
now = next_player
is_finish, next_player, card[now] = judge(card[now])
if is_finish:
print(now.upper())
break
if __name__ == '__main__':
main()
|
[
7,
15,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
18,
13,
39,
17,
0,
13,
18,
13,
39,
17,
0,
13,
18,
13,
39,
17,
0,
13,
17,
42,
17,
14,
2,
13,
17,
14,
13,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
0,
13,
17,
14,
2,
13,
17,
0,
13,
17,
0,
13,
17,
4,
13,
17,
4,
18,
13,
13,
14,
2,
13,
17,
14,
13,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
0,
13,
17,
14,
2,
13,
17,
0,
13,
17,
0,
13,
17,
4,
13,
17,
4,
18,
13,
13,
14,
13,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
0,
13,
17,
14,
2,
13,
17,
0,
13,
17,
0,
13,
17,
4,
13,
17,
4,
18,
13,
13,
10,
17,
13,
10,
17,
13,
10,
4,
13,
10,
4,
13,
10,
18,
13,
10,
17,
13,
10,
4,
13,
10,
4,
13,
10,
18,
13,
10,
17,
13,
10,
17,
13,
10,
18,
13,
10,
4,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
4,
13,
10,
17,
13,
10,
17,
13
] | [
[
197,
4
],
[
167,
10
],
[
158,
16
],
[
173,
22
],
[
198,
24
],
[
182,
28
],
[
168,
30
],
[
161,
34
],
[
159,
36
],
[
164,
40
],
[
165,
46
],
[
153,
46
],
[
189,
46
],
[
180,
46
],
[
195,
46
],
[
192,
46
],
[
177,
46
],
[
150,
46
],
[
204,
46
],
[
201,
46
],
[
170,
51
],
[
174,
54
],
[
198,
54
],
[
171,
58
],
[
156,
58
],
[
186,
58
],
[
200,
61
],
[
171,
65
],
[
156,
65
],
[
186,
65
],
[
203,
68
],
[
149,
71
],
[
165,
82
],
[
153,
82
],
[
189,
82
],
[
180,
82
],
[
195,
82
],
[
192,
82
],
[
177,
82
],
[
150,
82
],
[
204,
82
],
[
201,
82
],
[
155,
87
],
[
183,
90
],
[
168,
90
],
[
156,
94
],
[
171,
94
],
[
186,
94
],
[
176,
97
],
[
156,
101
],
[
171,
101
],
[
186,
101
],
[
191,
104
],
[
194,
107
],
[
185,
119
],
[
162,
122
],
[
159,
122
],
[
186,
126
],
[
171,
126
],
[
156,
126
],
[
179,
129
],
[
186,
133
],
[
171,
133
],
[
156,
133
],
[
188,
136
],
[
152,
139
],
[
149,
150
],
[
152,
153
],
[
155,
156
],
[
158,
159
],
[
161,
162
],
[
164,
165
],
[
167,
168
],
[
170,
171
],
[
173,
174
],
[
176,
177
],
[
179,
180
],
[
182,
183
],
[
185,
186
],
[
188,
189
],
[
191,
192
],
[
194,
195
],
[
197,
198
],
[
200,
201
],
[
203,
204
]
] | [
"import sys\nA = list(input())\nB = list(input())\nC = list(input())\nA = A[::-1]\nB = B[::-1]\nC = C[::-1]\nX = 0\nwhile True:\n if X == 0:\n if A:\n S = A.pop()\n if S == 'a':\n X = 0\n elif S == 'b':\n X = 1\n else:\n X = 2\n else:\n print('A')\n sys.exit()\n elif X == 1:\n if B:\n S = B.pop()\n if S == 'a':\n X = 0\n elif S == 'b':\n X = 1\n else:\n X = 2\n else:\n print('B')\n sys.exit()\n else:\n if C:\n S = C.pop()\n if S == 'a':\n X = 0\n elif S == 'b':\n X = 1\n else:\n X = 2\n else:\n print('C')\n sys.exit()",
"import sys",
"sys",
"A = list(input())",
"A",
"list(input())",
"list",
"input()",
"input",
"B = list(input())",
"B",
"list(input())",
"list",
"input()",
"input",
"C = list(input())",
"C",
"list(input())",
"list",
"input()",
"input",
"A = A[::-1]",
"A",
"A[::-1]",
"A",
"::-1",
"-1",
"B = B[::-1]",
"B",
"B[::-1]",
"B",
"::-1",
"-1",
"C = C[::-1]",
"C",
"C[::-1]",
"C",
"::-1",
"-1",
"X = 0",
"X",
"0",
"while True:\n if X == 0:\n if A:\n S = A.pop()\n if S == 'a':\n X = 0\n elif S == 'b':\n X = 1\n else:\n X = 2\n else:\n print('A')\n sys.exit()\n elif X == 1:\n if B:\n S = B.pop()\n if S == 'a':\n X = 0\n elif S == 'b':\n X = 1\n else:\n X = 2\n else:\n print('B')\n sys.exit()\n else:\n if C:\n S = C.pop()\n if S == 'a':\n X = 0\n elif S == 'b':\n X = 1\n else:\n X = 2\n else:\n print('C')\n sys.exit()",
"True",
"if X == 0:\n if A:\n S = A.pop()\n if S == 'a':\n X = 0\n elif S == 'b':\n X = 1\n else:\n X = 2\n else:\n print('A')\n sys.exit()\n elif X == 1:\n if B:\n S = B.pop()\n if S == 'a':\n X = 0\n elif S == 'b':\n X = 1\n else:\n X = 2\n else:\n print('B')\n sys.exit()\n else:\n if C:\n S = C.pop()\n if S == 'a':\n X = 0\n elif S == 'b':\n X = 1\n else:\n X = 2\n else:\n print('C')\n sys.exit()",
"X == 0",
"X",
"0",
"if A:\n S = A.pop()\n if S == 'a':\n X = 0\n elif S == 'b':\n X = 1\n else:\n X = 2\n else:\n print('A')\n sys.exit()\n ",
"A",
"S = A.pop()",
"S",
"A.pop()",
"A.pop",
"A",
"pop",
"if S == 'a':\n X = 0\n elif S == 'b':\n X = 1\n else:\n X = 2\n ",
"S == 'a'",
"S",
"'a'",
"X = 0",
"X",
"0",
"elif S == 'b':\n X = 1\n ",
"S == 'b'",
"S",
"'b'",
"X = 1",
"X",
"1",
"X = 2",
"X",
"2",
"print('A')",
"print",
"'A'",
"sys.exit()",
"sys.exit",
"sys",
"exit",
"elif X == 1:\n if B:\n S = B.pop()\n if S == 'a':\n X = 0\n elif S == 'b':\n X = 1\n else:\n X = 2\n else:\n print('B')\n sys.exit()\n ",
"X == 1",
"X",
"1",
"if B:\n S = B.pop()\n if S == 'a':\n X = 0\n elif S == 'b':\n X = 1\n else:\n X = 2\n else:\n print('B')\n sys.exit()\n ",
"B",
"S = B.pop()",
"S",
"B.pop()",
"B.pop",
"B",
"pop",
"if S == 'a':\n X = 0\n elif S == 'b':\n X = 1\n else:\n X = 2\n ",
"S == 'a'",
"S",
"'a'",
"X = 0",
"X",
"0",
"elif S == 'b':\n X = 1\n ",
"S == 'b'",
"S",
"'b'",
"X = 1",
"X",
"1",
"X = 2",
"X",
"2",
"print('B')",
"print",
"'B'",
"sys.exit()",
"sys.exit",
"sys",
"exit",
"if C:\n S = C.pop()\n if S == 'a':\n X = 0\n elif S == 'b':\n X = 1\n else:\n X = 2\n else:\n print('C')\n sys.exit()",
"C",
"S = C.pop()",
"S",
"C.pop()",
"C.pop",
"C",
"pop",
"if S == 'a':\n X = 0\n elif S == 'b':\n X = 1\n else:\n X = 2\n ",
"S == 'a'",
"S",
"'a'",
"X = 0",
"X",
"0",
"elif S == 'b':\n X = 1\n ",
"S == 'b'",
"S",
"'b'",
"X = 1",
"X",
"1",
"X = 2",
"X",
"2",
"print('C')",
"print",
"'C'",
"sys.exit()",
"sys.exit",
"sys",
"exit",
"X = 2",
"2",
"X",
"X = 2",
"2",
"X",
"S = B.pop()",
"B.pop()",
"S",
"C = list(input())",
"list(input())",
"C",
"C = C[::-1]",
"C[::-1]",
"C",
"X = 0",
"0",
"X",
"B = list(input())",
"list(input())",
"B",
"S = A.pop()",
"A.pop()",
"S",
"A = A[::-1]",
"A[::-1]",
"A",
"X = 0",
"0",
"X",
"X = 0",
"0",
"X",
"B = B[::-1]",
"B[::-1]",
"B",
"S = C.pop()",
"C.pop()",
"S",
"X = 1",
"1",
"X",
"X = 1",
"1",
"X",
"X = 2",
"2",
"X",
"A = list(input())",
"list(input())",
"A",
"X = 0",
"0",
"X",
"X = 1",
"1",
"X"
] | import sys
A = list(input())
B = list(input())
C = list(input())
A = A[::-1]
B = B[::-1]
C = C[::-1]
X = 0
while True:
if X == 0:
if A:
S = A.pop()
if S == 'a':
X = 0
elif S == 'b':
X = 1
else:
X = 2
else:
print('A')
sys.exit()
elif X == 1:
if B:
S = B.pop()
if S == 'a':
X = 0
elif S == 'b':
X = 1
else:
X = 2
else:
print('B')
sys.exit()
else:
if C:
S = C.pop()
if S == 'a':
X = 0
elif S == 'b':
X = 1
else:
X = 2
else:
print('C')
sys.exit() |
[
7,
0,
13,
18,
4,
13,
4,
13,
39,
17,
0,
13,
18,
4,
13,
4,
13,
39,
17,
0,
13,
18,
4,
13,
4,
13,
39,
17,
0,
13,
4,
18,
13,
13,
42,
2,
2,
2,
4,
13,
13,
17,
2,
4,
13,
13,
17,
2,
4,
13,
13,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
4,
13,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
4,
13,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
4,
13,
0,
13,
4,
18,
13,
13,
10,
4,
13,
10,
18,
13,
10,
18,
13,
10,
18,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13
] | [
[
122,
2
],
[
119,
11
],
[
125,
20
],
[
134,
29
],
[
123,
32
],
[
123,
40
],
[
120,
45
],
[
126,
50
],
[
135,
54
],
[
132,
54
],
[
129,
54
],
[
117,
54
],
[
123,
60
],
[
116,
68
],
[
123,
71
],
[
135,
75
],
[
132,
75
],
[
129,
75
],
[
117,
75
],
[
120,
81
],
[
128,
89
],
[
120,
92
],
[
135,
96
],
[
132,
96
],
[
129,
96
],
[
117,
96
],
[
126,
102
],
[
131,
110
],
[
126,
113
],
[
116,
117
],
[
119,
120
],
[
122,
123
],
[
125,
126
],
[
128,
129
],
[
131,
132
],
[
134,
135
]
] | [
"sa = list(input())[::-1]\nsb = list(input())[::-1]\nsc = list(input())[::-1]\n\n# A からスタート\np = sa.pop()\nwhile len(sa) > -1 and len(sb) > -1 and len(sc) > -1:\n if p == 'a':\n if len(sa) == 0:\n print('A')\n exit()\n p = sa.pop()\n elif p == 'b':\n if len(sb) == 0:\n print('B')\n exit()\n p = sb.pop()\n elif p == 'c':\n if len(sc) == 0:\n print('C')\n exit()\n p = sc.pop()",
"sa = list(input())[::-1]",
"sa",
"list(input())[::-1]",
"(input())",
"list",
"input()",
"input",
"::-1",
"-1",
"sb = list(input())[::-1]",
"sb",
"list(input())[::-1]",
"(input())",
"list",
"input()",
"input",
"::-1",
"-1",
"sc = list(input())[::-1]",
"sc",
"list(input())[::-1]",
"(input())",
"list",
"input()",
"input",
"::-1",
"-1",
"p = sa.pop()",
"p",
"sa.pop()",
"sa.pop",
"sa",
"pop",
"while len(sa) > -1 and len(sb) > -1 and len(sc) > -1:\n if p == 'a':\n if len(sa) == 0:\n print('A')\n exit()\n p = sa.pop()\n elif p == 'b':\n if len(sb) == 0:\n print('B')\n exit()\n p = sb.pop()\n elif p == 'c':\n if len(sc) == 0:\n print('C')\n exit()\n p = sc.pop()",
"len(sa) > -1 and len(sb) > -1 and len(sc) > -1",
"len(sa) > -1 and len(sb) > -1",
"len(sa) > -1",
"len(sa)",
"len",
"sa",
"-1",
"len(sb) > -1",
"len(sb)",
"len",
"sb",
"-1",
"len(sc) > -1",
"len(sc)",
"len",
"sc",
"-1",
"if p == 'a':\n if len(sa) == 0:\n print('A')\n exit()\n p = sa.pop()\n elif p == 'b':\n if len(sb) == 0:\n print('B')\n exit()\n p = sb.pop()\n elif p == 'c':\n if len(sc) == 0:\n print('C')\n exit()\n p = sc.pop()",
"p == 'a'",
"p",
"'a'",
"if len(sa) == 0:\n print('A')\n exit()\n ",
"len(sa) == 0",
"len(sa)",
"len",
"sa",
"0",
"print('A')",
"print",
"'A'",
"exit()",
"exit",
"p = sa.pop()",
"p",
"sa.pop()",
"sa.pop",
"sa",
"pop",
"elif p == 'b':\n if len(sb) == 0:\n print('B')\n exit()\n p = sb.pop()\n ",
"p == 'b'",
"p",
"'b'",
"if len(sb) == 0:\n print('B')\n exit()\n ",
"len(sb) == 0",
"len(sb)",
"len",
"sb",
"0",
"print('B')",
"print",
"'B'",
"exit()",
"exit",
"p = sb.pop()",
"p",
"sb.pop()",
"sb.pop",
"sb",
"pop",
"elif p == 'c':\n if len(sc) == 0:\n print('C')\n exit()\n p = sc.pop()",
"p == 'c'",
"p",
"'c'",
"if len(sc) == 0:\n print('C')\n exit()\n ",
"len(sc) == 0",
"len(sc)",
"len",
"sc",
"0",
"print('C')",
"print",
"'C'",
"exit()",
"exit",
"p = sc.pop()",
"p",
"sc.pop()",
"sc.pop",
"sc",
"pop",
"p = sa.pop()",
"sa.pop()",
"p",
"sb = list(input())[::-1]",
"list(input())[::-1]",
"sb",
"sa = list(input())[::-1]",
"list(input())[::-1]",
"sa",
"sc = list(input())[::-1]",
"list(input())[::-1]",
"sc",
"p = sb.pop()",
"sb.pop()",
"p",
"p = sc.pop()",
"sc.pop()",
"p",
"p = sa.pop()",
"sa.pop()",
"p"
] | sa = list(input())[::-1]
sb = list(input())[::-1]
sc = list(input())[::-1]
# A からスタート
p = sa.pop()
while len(sa) > -1 and len(sb) > -1 and len(sc) > -1:
if p == 'a':
if len(sa) == 0:
print('A')
exit()
p = sa.pop()
elif p == 'b':
if len(sb) == 0:
print('B')
exit()
p = sb.pop()
elif p == 'c':
if len(sc) == 0:
print('C')
exit()
p = sc.pop() |
[
7,
15,
12,
13,
0,
13,
4,
18,
13,
13,
29,
39,
13,
13,
23,
13,
12,
13,
0,
13,
4,
18,
13,
13,
29,
39,
13,
13,
23,
13,
12,
13,
0,
13,
4,
18,
13,
13,
29,
39,
13,
13,
23,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
13,
0,
13,
4,
13,
13,
0,
13,
4,
13,
13,
0,
13,
4,
18,
13,
13,
42,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
4,
13,
0,
13,
4,
13,
13,
13,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
4,
13,
0,
13,
4,
13,
13,
13,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
4,
13,
0,
13,
4,
13,
13,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
12,
13,
10,
4,
13,
10,
4,
13,
10,
12,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
12,
13,
10,
4,
13
] | [
[
6,
5
],
[
15,
8
],
[
15,
15
],
[
20,
19
],
[
29,
22
],
[
29,
29
],
[
34,
33
],
[
43,
36
],
[
43,
43
],
[
170,
45
],
[
185,
51
],
[
179,
57
],
[
194,
63
],
[
171,
66
],
[
155,
68
],
[
186,
71
],
[
173,
73
],
[
180,
76
],
[
182,
78
],
[
195,
81
],
[
183,
87
],
[
150,
87
],
[
162,
87
],
[
153,
87
],
[
195,
93
],
[
159,
93
],
[
158,
101
],
[
168,
103
],
[
195,
104
],
[
159,
104
],
[
158,
105
],
[
183,
108
],
[
150,
108
],
[
162,
108
],
[
153,
108
],
[
156,
114
],
[
165,
114
],
[
164,
122
],
[
177,
124
],
[
156,
125
],
[
165,
125
],
[
164,
126
],
[
183,
129
],
[
150,
129
],
[
162,
129
],
[
153,
129
],
[
174,
135
],
[
189,
135
],
[
188,
143
],
[
192,
145
],
[
174,
146
],
[
189,
146
],
[
188,
147
],
[
188,
150
],
[
158,
153
],
[
155,
156
],
[
158,
159
],
[
164,
162
],
[
164,
165
],
[
170,
171
],
[
173,
174
],
[
179,
180
],
[
182,
183
],
[
185,
186
],
[
188,
189
],
[
194,
195
]
] | [
"from collections import deque\ndef A(a):\n x=a.popleft()\n return x,a\ndef B(b):\n x=b.popleft()\n return x,b\ndef C(c):\n x=c.popleft()\n return x,c\nSa=list(input())\nSb=list(input())\nSc=list(input())\na=deque(Sa)\nb=deque(Sb)\nc=deque(Sc)\nx=a.popleft()\n\n#print(a,b,c,x)\nwhile True:\n\n if x==\"a\":\n if len(a)==0:\n print(\"A\")\n exit()\n x,a=A(a)\n elif x==\"b\":\n if len(b)==0:\n print(\"B\")\n exit()\n x,b=B(b)\n elif x==\"c\":\n if len(c)==0:\n print(\"C\")\n exit()\n x,c=C(c)\n #print(a,b,c,x)\n ",
"from collections import deque",
"def A(a):\n x=a.popleft()\n return x,a",
"A",
"x=a.popleft()",
"x",
"a.popleft()",
"a.popleft",
"a",
"popleft",
"return x,a",
"return x,a",
"x",
"a",
"a",
"a",
"def B(b):\n x=b.popleft()\n return x,b",
"B",
"x=b.popleft()",
"x",
"b.popleft()",
"b.popleft",
"b",
"popleft",
"return x,b",
"return x,b",
"x",
"b",
"b",
"b",
"def C(c):\n x=c.popleft()\n return x,c",
"C",
"x=c.popleft()",
"x",
"c.popleft()",
"c.popleft",
"c",
"popleft",
"return x,c",
"return x,c",
"x",
"c",
"c",
"c",
"Sa=list(input())",
"Sa",
"list(input())",
"list",
"input()",
"input",
"Sb=list(input())",
"Sb",
"list(input())",
"list",
"input()",
"input",
"Sc=list(input())",
"Sc",
"list(input())",
"list",
"input()",
"input",
"a=deque(Sa)",
"a",
"deque(Sa)",
"deque",
"Sa",
"b=deque(Sb)",
"b",
"deque(Sb)",
"deque",
"Sb",
"c=deque(Sc)",
"c",
"deque(Sc)",
"deque",
"Sc",
"x=a.popleft()",
"x",
"a.popleft()",
"a.popleft",
"a",
"popleft",
"while True:\n\n if x==\"a\":\n if len(a)==0:\n print(\"A\")\n exit()\n x,a=A(a)\n elif x==\"b\":\n if len(b)==0:\n print(\"B\")\n exit()\n x,b=B(b)\n elif x==\"c\":\n if len(c)==0:\n print(\"C\")\n exit()\n x,c=C(c)\n #print(a,b,c,x)\n ",
"True",
"if x==\"a\":\n if len(a)==0:\n print(\"A\")\n exit()\n x,a=A(a)\n elif x==\"b\":\n if len(b)==0:\n print(\"B\")\n exit()\n x,b=B(b)\n elif x==\"c\":\n if len(c)==0:\n print(\"C\")\n exit()\n x,c=C(c)\n #print(a,b,c,x)\n ",
"x==\"a\"",
"x",
"\"a\"",
"if len(a)==0:\n print(\"A\")\n exit()\n ",
"len(a)==0",
"len(a)",
"len",
"a",
"0",
"print(\"A\")",
"print",
"\"A\"",
"exit()",
"exit",
"x,a=A(a)",
"x",
"A(a)",
"A",
"a",
"a",
"elif x==\"b\":\n if len(b)==0:\n print(\"B\")\n exit()\n x,b=B(b)\n ",
"x==\"b\"",
"x",
"\"b\"",
"if len(b)==0:\n print(\"B\")\n exit()\n ",
"len(b)==0",
"len(b)",
"len",
"b",
"0",
"print(\"B\")",
"print",
"\"B\"",
"exit()",
"exit",
"x,b=B(b)",
"x",
"B(b)",
"B",
"b",
"b",
"elif x==\"c\":\n if len(c)==0:\n print(\"C\")\n exit()\n x,c=C(c)\n #print(a,b,c,x)\n ",
"x==\"c\"",
"x",
"\"c\"",
"if len(c)==0:\n print(\"C\")\n exit()\n ",
"len(c)==0",
"len(c)",
"len",
"c",
"0",
"print(\"C\")",
"print",
"\"C\"",
"exit()",
"exit",
"x,c=C(c)",
"x",
"C(c)",
"C",
"c",
"c",
"x,c=C(c)",
"C(c)",
"x",
"x,a=A(a)",
"A(a)",
"x",
"b=deque(Sb)",
"deque(Sb)",
"b",
"a=A(a)",
"A(a)",
"a",
"x,b=B(b)",
"B(b)",
"x",
"b=B(b)",
"B(b)",
"b",
"def A(a):\n x=a.popleft()\n return x,a",
"def A(a):\n x=a.popleft()\n return x,a",
"A",
"Sa=list(input())",
"list(input())",
"Sa",
"c=deque(Sc)",
"deque(Sc)",
"c",
"def B(b):\n x=b.popleft()\n return x,b",
"def B(b):\n x=b.popleft()\n return x,b",
"B",
"Sc=list(input())",
"list(input())",
"Sc",
"x=a.popleft()",
"a.popleft()",
"x",
"Sb=list(input())",
"list(input())",
"Sb",
"c=C(c)",
"C(c)",
"c",
"def C(c):\n x=c.popleft()\n return x,c",
"def C(c):\n x=c.popleft()\n return x,c",
"C",
"a=deque(Sa)",
"deque(Sa)",
"a"
] | from collections import deque
def A(a):
x=a.popleft()
return x,a
def B(b):
x=b.popleft()
return x,b
def C(c):
x=c.popleft()
return x,c
Sa=list(input())
Sb=list(input())
Sc=list(input())
a=deque(Sa)
b=deque(Sb)
c=deque(Sc)
x=a.popleft()
#print(a,b,c,x)
while True:
if x=="a":
if len(a)==0:
print("A")
exit()
x,a=A(a)
elif x=="b":
if len(b)==0:
print("B")
exit()
x,b=B(b)
elif x=="c":
if len(c)==0:
print("C")
exit()
x,c=C(c)
#print(a,b,c,x)
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
18,
13,
13,
17,
28,
13,
4,
13,
17,
14,
2,
13,
17,
14,
40,
4,
13,
13,
17,
0,
13,
4,
18,
13,
13,
17,
4,
13,
17,
4,
13,
14,
2,
13,
17,
14,
40,
4,
13,
13,
17,
0,
13,
4,
18,
13,
13,
17,
4,
13,
17,
4,
13,
14,
40,
4,
13,
13,
17,
0,
13,
4,
18,
13,
13,
17,
4,
13,
17,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13
] | [
[
106,
2
],
[
100,
8
],
[
112,
14
],
[
109,
20
],
[
107,
23
],
[
28,
27
],
[
110,
33
],
[
104,
33
],
[
98,
33
],
[
95,
33
],
[
107,
39
],
[
94,
42
],
[
107,
45
],
[
110,
55
],
[
104,
55
],
[
98,
55
],
[
95,
55
],
[
101,
61
],
[
97,
64
],
[
101,
67
],
[
113,
79
],
[
103,
82
],
[
113,
85
],
[
94,
95
],
[
97,
98
],
[
100,
101
],
[
103,
104
],
[
106,
107
],
[
109,
110
],
[
112,
113
]
] | [
"a = list(input())\nb = list(input())\nc = list(input())\ndum = a.pop(0)\nfor i in range(300):\n if dum == \"a\":\n if len(a) != 0:\n dum = a.pop(0)\n else:\n print(\"A\")\n exit()\n elif dum == \"b\":\n if len(b) != 0:\n dum = b.pop(0)\n else:\n print(\"B\")\n exit()\n else:\n if len(c) != 0:\n dum = c.pop(0)\n else:\n print(\"C\")\n exit()",
"a = list(input())",
"a",
"list(input())",
"list",
"input()",
"input",
"b = list(input())",
"b",
"list(input())",
"list",
"input()",
"input",
"c = list(input())",
"c",
"list(input())",
"list",
"input()",
"input",
"dum = a.pop(0)",
"dum",
"a.pop(0)",
"a.pop",
"a",
"pop",
"0",
"for i in range(300):\n if dum == \"a\":\n if len(a) != 0:\n dum = a.pop(0)\n else:\n print(\"A\")\n exit()\n elif dum == \"b\":\n if len(b) != 0:\n dum = b.pop(0)\n else:\n print(\"B\")\n exit()\n else:\n if len(c) != 0:\n dum = c.pop(0)\n else:\n print(\"C\")\n exit()",
"i",
"range(300)",
"range",
"300",
"if dum == \"a\":\n if len(a) != 0:\n dum = a.pop(0)\n else:\n print(\"A\")\n exit()\n elif dum == \"b\":\n if len(b) != 0:\n dum = b.pop(0)\n else:\n print(\"B\")\n exit()\n else:\n if len(c) != 0:\n dum = c.pop(0)\n else:\n print(\"C\")\n exit()",
"dum == \"a\"",
"dum",
"\"a\"",
"if len(a) != 0:\n dum = a.pop(0)\n else:\n print(\"A\")\n exit()\n ",
"len(a) != 0",
"len(a)",
"len",
"a",
"0",
"dum = a.pop(0)",
"dum",
"a.pop(0)",
"a.pop",
"a",
"pop",
"0",
"print(\"A\")",
"print",
"\"A\"",
"exit()",
"exit",
"elif dum == \"b\":\n if len(b) != 0:\n dum = b.pop(0)\n else:\n print(\"B\")\n exit()\n ",
"dum == \"b\"",
"dum",
"\"b\"",
"if len(b) != 0:\n dum = b.pop(0)\n else:\n print(\"B\")\n exit()\n ",
"len(b) != 0",
"len(b)",
"len",
"b",
"0",
"dum = b.pop(0)",
"dum",
"b.pop(0)",
"b.pop",
"b",
"pop",
"0",
"print(\"B\")",
"print",
"\"B\"",
"exit()",
"exit",
"if len(c) != 0:\n dum = c.pop(0)\n else:\n print(\"C\")\n exit()",
"len(c) != 0",
"len(c)",
"len",
"c",
"0",
"dum = c.pop(0)",
"dum",
"c.pop(0)",
"c.pop",
"c",
"pop",
"0",
"print(\"C\")",
"print",
"\"C\"",
"exit()",
"exit",
"dum = a.pop(0)",
"a.pop(0)",
"dum",
"dum = b.pop(0)",
"b.pop(0)",
"dum",
"b = list(input())",
"list(input())",
"b",
"dum = c.pop(0)",
"c.pop(0)",
"dum",
"a = list(input())",
"list(input())",
"a",
"dum = a.pop(0)",
"a.pop(0)",
"dum",
"c = list(input())",
"list(input())",
"c"
] | a = list(input())
b = list(input())
c = list(input())
dum = a.pop(0)
for i in range(300):
if dum == "a":
if len(a) != 0:
dum = a.pop(0)
else:
print("A")
exit()
elif dum == "b":
if len(b) != 0:
dum = b.pop(0)
else:
print("B")
exit()
else:
if len(c) != 0:
dum = c.pop(0)
else:
print("C")
exit()
|
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
21,
22,
17,
13,
22,
17,
13,
22,
17,
13,
0,
13,
21,
22,
17,
17,
22,
17,
17,
22,
17,
17,
0,
13,
17,
42,
17,
0,
13,
18,
13,
13,
14,
40,
4,
13,
13,
17,
4,
13,
18,
13,
13,
3,
0,
18,
13,
13,
18,
13,
39,
17,
0,
13,
18,
13,
17,
10,
21,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
18,
13,
10,
17,
13,
10,
21,
13,
10,
18,
13
] | [
[
82,
2
],
[
76,
6
],
[
79,
10
],
[
73,
14
],
[
91,
26
],
[
88,
38
],
[
85,
43
],
[
60,
44
],
[
74,
45
],
[
89,
46
],
[
95,
46
],
[
86,
51
],
[
92,
56
],
[
89,
57
],
[
95,
57
],
[
63,
60
],
[
74,
61
],
[
89,
62
],
[
95,
62
],
[
86,
64
],
[
94,
68
],
[
86,
70
],
[
73,
74
],
[
76,
77
],
[
79,
80
],
[
82,
83
],
[
60,
85
],
[
85,
86
],
[
88,
89
],
[
91,
92
],
[
94,
95
]
] | [
"SA = input()\nSB = input()\nSC = input()\n\nS_dict={'a':SA,'b':SB,'c':SC}\nans_dict={'a':'A','b':'B','c':'C'}\n\nperson = 'a'\n\nwhile True:\n S = S_dict[person]\n\n if len(S) <= 0:\n print(ans_dict[person])\n break\n \n else:\n S_dict[person] = S[1:]\n person = S[0]",
"SA = input()",
"SA",
"input()",
"input",
"SB = input()",
"SB",
"input()",
"input",
"SC = input()",
"SC",
"input()",
"input",
"S_dict={'a':SA,'b':SB,'c':SC}",
"S_dict",
"{'a':SA,'b':SB,'c':SC}",
"'a'",
"'a'",
"SA",
"'b'",
"'b'",
"SB",
"'c'",
"'c'",
"SC",
"ans_dict={'a':'A','b':'B','c':'C'}",
"ans_dict",
"{'a':'A','b':'B','c':'C'}",
"'a'",
"'a'",
"'A'",
"'b'",
"'b'",
"'B'",
"'c'",
"'c'",
"'C'",
"person = 'a'",
"person",
"'a'",
"while True:\n S = S_dict[person]\n\n if len(S) <= 0:\n print(ans_dict[person])\n break\n \n else:\n S_dict[person] = S[1:]\n person = S[0]",
"True",
"S = S_dict[person]",
"S",
"S_dict[person]",
"S_dict",
"person",
"if len(S) <= 0:\n print(ans_dict[person])\n break\n \n else:\n S_dict[person] = S[1:]\n person = S[0]",
"len(S) <= 0",
"len(S)",
"len",
"S",
"0",
"print(ans_dict[person])",
"print",
"ans_dict[person]",
"ans_dict",
"person",
"break",
"S_dict[person] = S[1:]",
"S_dict[person]",
"S_dict",
"person",
"S[1:]",
"S",
"1:",
"1",
"person = S[0]",
"person",
"S[0]",
"S",
"0",
"S_dict={'a':SA,'b':SB,'c':SC}",
"{'a':SA,'b':SB,'c':SC}",
"S_dict",
"SB = input()",
"input()",
"SB",
"SC = input()",
"input()",
"SC",
"SA = input()",
"input()",
"SA",
"S = S_dict[person]",
"S_dict[person]",
"S",
"person = 'a'",
"'a'",
"person",
"ans_dict={'a':'A','b':'B','c':'C'}",
"{'a':'A','b':'B','c':'C'}",
"ans_dict",
"person = S[0]",
"S[0]",
"person"
] | SA = input()
SB = input()
SC = input()
S_dict={'a':SA,'b':SB,'c':SC}
ans_dict={'a':'A','b':'B','c':'C'}
person = 'a'
while True:
S = S_dict[person]
if len(S) <= 0:
print(ans_dict[person])
break
else:
S_dict[person] = S[1:]
person = S[0] |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
18,
13,
13,
17,
42,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
4,
13,
0,
13,
4,
18,
13,
13,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
4,
13,
0,
13,
4,
18,
13,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
4,
13,
0,
13,
4,
18,
13,
13,
17,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13
] | [
[
91,
2
],
[
94,
8
],
[
109,
14
],
[
103,
20
],
[
92,
23
],
[
104,
30
],
[
101,
30
],
[
107,
30
],
[
98,
30
],
[
92,
36
],
[
97,
44
],
[
92,
47
],
[
104,
52
],
[
101,
52
],
[
107,
52
],
[
98,
52
],
[
95,
58
],
[
106,
66
],
[
95,
69
],
[
110,
76
],
[
100,
84
],
[
110,
87
],
[
91,
92
],
[
94,
95
],
[
97,
98
],
[
100,
101
],
[
103,
104
],
[
106,
107
],
[
109,
110
]
] | [
"A = list(input())\nB = list(input())\nC = list(input())\n\nnow = A.pop(0)\nwhile True:\n if now == \"a\":\n if len(A) == 0:\n print(\"A\")\n exit()\n now = A.pop(0)\n \n elif now == \"b\":\n if len(B) == 0:\n print(\"B\")\n exit()\n now = B.pop(0)\n \n else:\n if len(C) == 0:\n print(\"C\")\n exit()\n now =C.pop(0)",
"A = list(input())",
"A",
"list(input())",
"list",
"input()",
"input",
"B = list(input())",
"B",
"list(input())",
"list",
"input()",
"input",
"C = list(input())",
"C",
"list(input())",
"list",
"input()",
"input",
"now = A.pop(0)",
"now",
"A.pop(0)",
"A.pop",
"A",
"pop",
"0",
"while True:\n if now == \"a\":\n if len(A) == 0:\n print(\"A\")\n exit()\n now = A.pop(0)\n \n elif now == \"b\":\n if len(B) == 0:\n print(\"B\")\n exit()\n now = B.pop(0)\n \n else:\n if len(C) == 0:\n print(\"C\")\n exit()\n now =C.pop(0)",
"True",
"if now == \"a\":\n if len(A) == 0:\n print(\"A\")\n exit()\n now = A.pop(0)\n \n elif now == \"b\":\n if len(B) == 0:\n print(\"B\")\n exit()\n now = B.pop(0)\n \n else:\n if len(C) == 0:\n print(\"C\")\n exit()\n now =C.pop(0)",
"now == \"a\"",
"now",
"\"a\"",
"if len(A) == 0:\n print(\"A\")\n exit()\n ",
"len(A) == 0",
"len(A)",
"len",
"A",
"0",
"print(\"A\")",
"print",
"\"A\"",
"exit()",
"exit",
"now = A.pop(0)",
"now",
"A.pop(0)",
"A.pop",
"A",
"pop",
"0",
"elif now == \"b\":\n if len(B) == 0:\n print(\"B\")\n exit()\n now = B.pop(0)\n \n ",
"now == \"b\"",
"now",
"\"b\"",
"if len(B) == 0:\n print(\"B\")\n exit()\n ",
"len(B) == 0",
"len(B)",
"len",
"B",
"0",
"print(\"B\")",
"print",
"\"B\"",
"exit()",
"exit",
"now = B.pop(0)",
"now",
"B.pop(0)",
"B.pop",
"B",
"pop",
"0",
"if len(C) == 0:\n print(\"C\")\n exit()\n ",
"len(C) == 0",
"len(C)",
"len",
"C",
"0",
"print(\"C\")",
"print",
"\"C\"",
"exit()",
"exit",
"now =C.pop(0)",
"now",
"C.pop(0)",
"C.pop",
"C",
"pop",
"0",
"A = list(input())",
"list(input())",
"A",
"B = list(input())",
"list(input())",
"B",
"now = A.pop(0)",
"A.pop(0)",
"now",
"now =C.pop(0)",
"C.pop(0)",
"now",
"now = A.pop(0)",
"A.pop(0)",
"now",
"now = B.pop(0)",
"B.pop(0)",
"now",
"C = list(input())",
"list(input())",
"C"
] | A = list(input())
B = list(input())
C = list(input())
now = A.pop(0)
while True:
if now == "a":
if len(A) == 0:
print("A")
exit()
now = A.pop(0)
elif now == "b":
if len(B) == 0:
print("B")
exit()
now = B.pop(0)
else:
if len(C) == 0:
print("C")
exit()
now =C.pop(0) |
[
7,
41,
28,
13,
4,
13,
17,
4,
4,
13,
0,
13,
13,
0,
13,
21,
22,
17,
17,
22,
17,
17,
22,
17,
17,
0,
13,
2,
39,
17,
17,
0,
13,
17,
42,
17,
0,
18,
13,
13,
17,
14,
40,
18,
13,
13,
4,
13,
18,
13,
13,
3,
0,
13,
18,
13,
18,
18,
13,
13,
18,
13,
13,
4,
13,
18,
39,
17,
17,
17,
13,
10,
17,
13,
10,
21,
13,
10,
2,
13,
10,
18,
13,
10,
13,
13
] | [
[
4,
3
],
[
84,
11
],
[
75,
14
],
[
78,
26
],
[
72,
32
],
[
40,
37
],
[
79,
38
],
[
73,
39
],
[
82,
39
],
[
37,
43
],
[
79,
44
],
[
73,
45
],
[
82,
45
],
[
85,
49
],
[
73,
50
],
[
82,
50
],
[
81,
53
],
[
76,
55
],
[
85,
58
],
[
73,
59
],
[
82,
59
],
[
37,
60
],
[
79,
61
],
[
73,
62
],
[
82,
62
],
[
82,
70
],
[
73,
70
],
[
72,
73
],
[
75,
76
],
[
78,
79
],
[
81,
82
],
[
84,
85
]
] | [
"s = [input() for _ in range(3)]\nd = {\"a\": 0, \"b\": 1, \"c\": 2}\ni = [-1] * 3\nt = 0\nwhile True:\n i[t] += 1\n if i[t] >= len(s[t]):\n break\n t = d[s[t][i[t]]]\nprint([\"A\", \"B\", \"C\"][t])",
"input() for _ in range(3)",
"for _ in range(3)",
"_",
"range(3)",
"range",
"3",
"for _ in range(3)",
"input()",
"input",
"s = [input() for _ in range(3)]",
"s",
"[input() for _ in range(3)]",
"d = {\"a\": 0, \"b\": 1, \"c\": 2}",
"d",
"{\"a\": 0, \"b\": 1, \"c\": 2}",
"\"a\"",
"\"a\"",
"0",
"\"b\"",
"\"b\"",
"1",
"\"c\"",
"\"c\"",
"2",
"i = [-1] * 3",
"i",
"[-1] * 3",
"[-1]",
"-1",
"3",
"t = 0",
"t",
"0",
"while True:\n i[t] += 1\n if i[t] >= len(s[t]):\n break\n t = d[s[t][i[t]]]",
"True",
"i[t] += 1",
"i[t]",
"i",
"t",
"1",
"if i[t] >= len(s[t]):\n break\n ",
"i[t] >= len(s[t])",
"i[t]",
"i",
"t",
"len(s[t])",
"len",
"s[t]",
"s",
"t",
"break",
"t = d[s[t][i[t]]]",
"t",
"d[s[t][i[t]]]",
"d",
"s[t][i[t]]",
"[t]",
"s",
"t",
"i[t]",
"i",
"t",
"print([\"A\", \"B\", \"C\"][t])",
"print",
"[\"A\", \"B\", \"C\"][t]",
"[\"A\", \"B\", \"C\"]",
"\"A\"",
"\"B\"",
"\"C\"",
"t",
"t = 0",
"0",
"t",
"d = {\"a\": 0, \"b\": 1, \"c\": 2}",
"{\"a\": 0, \"b\": 1, \"c\": 2}",
"d",
"i = [-1] * 3",
"[-1] * 3",
"i",
"t = d[s[t][i[t]]]",
"d[s[t][i[t]]]",
"t",
"s = [input() for _ in range(3)]",
"[input() for _ in range(3)]",
"s"
] | s = [input() for _ in range(3)]
d = {"a": 0, "b": 1, "c": 2}
i = [-1] * 3
t = 0
while True:
i[t] += 1
if i[t] >= len(s[t]):
break
t = d[s[t][i[t]]]
print(["A", "B", "C"][t]) |
[
7,
15,
13,
0,
13,
18,
18,
13,
13,
13,
15,
12,
13,
0,
13,
4,
13,
4,
13,
4,
18,
4,
13,
13,
0,
13,
4,
13,
4,
13,
4,
18,
4,
13,
13,
0,
13,
4,
13,
4,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
17,
4,
18,
13,
13,
17,
4,
18,
13,
13,
17,
0,
13,
4,
18,
13,
13,
0,
13,
17,
42,
17,
14,
2,
13,
17,
4,
13,
4,
18,
13,
13,
29,
14,
2,
13,
17,
0,
13,
13,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
0,
13,
13,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
0,
13,
13,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
4,
13,
10,
18,
13,
10,
12,
13
] | [
[
129,
4
],
[
15,
14
],
[
130,
22
],
[
26,
25
],
[
130,
33
],
[
37,
36
],
[
130,
44
],
[
14,
48
],
[
25,
53
],
[
36,
58
],
[
63,
62
],
[
14,
65
],
[
69,
68
],
[
62,
74
],
[
117,
74
],
[
104,
74
],
[
91,
74
],
[
68,
80
],
[
114,
80
],
[
101,
80
],
[
88,
80
],
[
62,
85
],
[
117,
85
],
[
104,
85
],
[
91,
85
],
[
89,
88
],
[
62,
89
],
[
117,
89
],
[
104,
89
],
[
91,
89
],
[
92,
91
],
[
14,
94
],
[
91,
98
],
[
62,
98
],
[
117,
98
],
[
104,
98
],
[
102,
101
],
[
91,
102
],
[
62,
102
],
[
117,
102
],
[
104,
102
],
[
105,
104
],
[
25,
107
],
[
104,
111
],
[
91,
111
],
[
62,
111
],
[
117,
111
],
[
115,
114
],
[
104,
115
],
[
91,
115
],
[
62,
115
],
[
117,
115
],
[
118,
117
],
[
36,
120
],
[
133,
127
],
[
129,
130
]
] | [
"import sys\ninput = sys.stdin.readline\nfrom collections import deque\ndef main():\n A = deque(list(input().rstrip()))\n B = deque(list(input().rstrip()))\n C = deque(list(input().rstrip()))\n A.append('e')\n B.append('e')\n C.append('e')\n tmp = A.popleft()\n last = ''\n while True:\n if tmp == 'e':\n print(last.upper())\n return\n if tmp == 'a':\n last = tmp\n tmp = A.popleft()\n if tmp == 'b':\n last = tmp\n tmp = B.popleft()\n if tmp == 'c':\n last = tmp\n tmp = C.popleft()\n\nif __name__ == '__main__':\n main()",
"import sys",
"sys",
"input = sys.stdin.readline",
"input",
"sys.stdin.readline",
"sys.stdin",
"sys",
"stdin",
"readline",
"from collections import deque",
"def main():\n A = deque(list(input().rstrip()))\n B = deque(list(input().rstrip()))\n C = deque(list(input().rstrip()))\n A.append('e')\n B.append('e')\n C.append('e')\n tmp = A.popleft()\n last = ''\n while True:\n if tmp == 'e':\n print(last.upper())\n return\n if tmp == 'a':\n last = tmp\n tmp = A.popleft()\n if tmp == 'b':\n last = tmp\n tmp = B.popleft()\n if tmp == 'c':\n last = tmp\n tmp = C.popleft()",
"main",
"A = deque(list(input().rstrip()))",
"A",
"deque(list(input().rstrip()))",
"deque",
"list(input().rstrip())",
"list",
"input().rstrip()",
"().rstrip",
"()",
"input",
"rstrip",
"B = deque(list(input().rstrip()))",
"B",
"deque(list(input().rstrip()))",
"deque",
"list(input().rstrip())",
"list",
"input().rstrip()",
"().rstrip",
"()",
"input",
"rstrip",
"C = deque(list(input().rstrip()))",
"C",
"deque(list(input().rstrip()))",
"deque",
"list(input().rstrip())",
"list",
"input().rstrip()",
"().rstrip",
"()",
"input",
"rstrip",
"A.append('e')",
"A.append",
"A",
"append",
"'e'",
"B.append('e')",
"B.append",
"B",
"append",
"'e'",
"C.append('e')",
"C.append",
"C",
"append",
"'e'",
"tmp = A.popleft()",
"tmp",
"A.popleft()",
"A.popleft",
"A",
"popleft",
"last = ''",
"last",
"''",
"while True:\n if tmp == 'e':\n print(last.upper())\n return\n if tmp == 'a':\n last = tmp\n tmp = A.popleft()\n if tmp == 'b':\n last = tmp\n tmp = B.popleft()\n if tmp == 'c':\n last = tmp\n tmp = C.popleft()",
"True",
"if tmp == 'e':\n print(last.upper())\n return\n ",
"tmp == 'e'",
"tmp",
"'e'",
"print(last.upper())",
"print",
"last.upper()",
"last.upper",
"last",
"upper",
"return",
"if tmp == 'a':\n last = tmp\n tmp = A.popleft()\n ",
"tmp == 'a'",
"tmp",
"'a'",
"last = tmp",
"last",
"tmp",
"tmp = A.popleft()",
"tmp",
"A.popleft()",
"A.popleft",
"A",
"popleft",
"if tmp == 'b':\n last = tmp\n tmp = B.popleft()\n ",
"tmp == 'b'",
"tmp",
"'b'",
"last = tmp",
"last",
"tmp",
"tmp = B.popleft()",
"tmp",
"B.popleft()",
"B.popleft",
"B",
"popleft",
"if tmp == 'c':\n last = tmp\n tmp = C.popleft()",
"tmp == 'c'",
"tmp",
"'c'",
"last = tmp",
"last",
"tmp",
"tmp = C.popleft()",
"tmp",
"C.popleft()",
"C.popleft",
"C",
"popleft",
"if __name__ == '__main__':\n main()",
"__name__ == '__main__'",
"__name__",
"'__main__'",
"main()",
"main",
"input = sys.stdin.readline",
"sys.stdin.readline",
"input",
"def main():\n A = deque(list(input().rstrip()))\n B = deque(list(input().rstrip()))\n C = deque(list(input().rstrip()))\n A.append('e')\n B.append('e')\n C.append('e')\n tmp = A.popleft()\n last = ''\n while True:\n if tmp == 'e':\n print(last.upper())\n return\n if tmp == 'a':\n last = tmp\n tmp = A.popleft()\n if tmp == 'b':\n last = tmp\n tmp = B.popleft()\n if tmp == 'c':\n last = tmp\n tmp = C.popleft()",
"def main():\n A = deque(list(input().rstrip()))\n B = deque(list(input().rstrip()))\n C = deque(list(input().rstrip()))\n A.append('e')\n B.append('e')\n C.append('e')\n tmp = A.popleft()\n last = ''\n while True:\n if tmp == 'e':\n print(last.upper())\n return\n if tmp == 'a':\n last = tmp\n tmp = A.popleft()\n if tmp == 'b':\n last = tmp\n tmp = B.popleft()\n if tmp == 'c':\n last = tmp\n tmp = C.popleft()",
"main"
] | import sys
input = sys.stdin.readline
from collections import deque
def main():
A = deque(list(input().rstrip()))
B = deque(list(input().rstrip()))
C = deque(list(input().rstrip()))
A.append('e')
B.append('e')
C.append('e')
tmp = A.popleft()
last = ''
while True:
if tmp == 'e':
print(last.upper())
return
if tmp == 'a':
last = tmp
tmp = A.popleft()
if tmp == 'b':
last = tmp
tmp = B.popleft()
if tmp == 'c':
last = tmp
tmp = C.popleft()
if __name__ == '__main__':
main() |
[
7,
15,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
4,
13,
28,
13,
4,
13,
4,
13,
13,
4,
18,
13,
13,
18,
13,
13,
28,
13,
4,
13,
4,
13,
13,
4,
18,
13,
13,
18,
13,
13,
28,
13,
4,
13,
4,
13,
13,
4,
18,
13,
13,
18,
13,
13,
0,
13,
17,
42,
2,
2,
40,
4,
13,
13,
17,
40,
4,
13,
13,
17,
40,
4,
13,
13,
17,
14,
2,
2,
13,
17,
2,
4,
13,
13,
17,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
4,
13,
17,
4,
13,
14,
2,
2,
13,
17,
2,
4,
13,
13,
17,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
4,
13,
17,
4,
13,
14,
2,
2,
13,
17,
2,
4,
13,
13,
17,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
4,
13,
17,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
17,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13
] | [
[
186,
3
],
[
189,
7
],
[
165,
11
],
[
177,
15
],
[
192,
19
],
[
171,
23
],
[
28,
27
],
[
187,
32
],
[
178,
35
],
[
187,
38
],
[
27,
39
],
[
42,
41
],
[
190,
46
],
[
193,
49
],
[
190,
52
],
[
41,
53
],
[
56,
55
],
[
166,
60
],
[
172,
63
],
[
166,
66
],
[
55,
67
],
[
174,
69
],
[
178,
77
],
[
193,
82
],
[
172,
87
],
[
175,
92
],
[
184,
92
],
[
169,
92
],
[
181,
92
],
[
178,
97
],
[
180,
100
],
[
178,
103
],
[
175,
107
],
[
184,
107
],
[
169,
107
],
[
181,
107
],
[
175,
117
],
[
184,
117
],
[
169,
117
],
[
181,
117
],
[
193,
122
],
[
168,
125
],
[
193,
128
],
[
175,
132
],
[
184,
132
],
[
169,
132
],
[
181,
132
],
[
175,
142
],
[
184,
142
],
[
169,
142
],
[
181,
142
],
[
172,
147
],
[
183,
150
],
[
172,
153
],
[
175,
157
],
[
184,
157
],
[
169,
157
],
[
181,
157
],
[
165,
166
],
[
168,
169
],
[
171,
172
],
[
174,
175
],
[
177,
178
],
[
180,
181
],
[
183,
184
],
[
186,
187
],
[
189,
190
],
[
192,
193
]
] | [
"from collections import deque\n\nSA=input()\nSB=input()\nSC=input()\n\nda=deque()\ndb=deque()\ndc=deque()\n\nfor i in range(len(SA)):\n da.append(SA[i])\nfor i in range(len(SB)):\n db.append(SB[i])\nfor i in range(len(SC)):\n dc.append(SC[i])\n\n\nnv=\"a\"\nwhile len(da)>=0 and len(db)>=0 and len(dc)>=0:\n if nv ==\"a\" and len(da)>0:\n nv = da.popleft()\n elif nv ==\"a\":\n print(\"A\")\n exit()\n elif nv ==\"b\" and len(db)>0:\n nv = db.popleft()\n elif nv ==\"b\":\n print(\"B\")\n exit() \n elif nv ==\"c\" and len(dc)>0: \n nv = dc.popleft()\n elif nv ==\"c\":\n print(\"C\")\n exit()\n",
"from collections import deque",
"SA=input()",
"SA",
"input()",
"input",
"SB=input()",
"SB",
"input()",
"input",
"SC=input()",
"SC",
"input()",
"input",
"da=deque()",
"da",
"deque()",
"deque",
"db=deque()",
"db",
"deque()",
"deque",
"dc=deque()",
"dc",
"deque()",
"deque",
"for i in range(len(SA)):\n da.append(SA[i])",
"i",
"range(len(SA))",
"range",
"len(SA)",
"len",
"SA",
"da.append(SA[i])",
"da.append",
"da",
"append",
"SA[i]",
"SA",
"i",
"for i in range(len(SB)):\n db.append(SB[i])",
"i",
"range(len(SB))",
"range",
"len(SB)",
"len",
"SB",
"db.append(SB[i])",
"db.append",
"db",
"append",
"SB[i]",
"SB",
"i",
"for i in range(len(SC)):\n dc.append(SC[i])",
"i",
"range(len(SC))",
"range",
"len(SC)",
"len",
"SC",
"dc.append(SC[i])",
"dc.append",
"dc",
"append",
"SC[i]",
"SC",
"i",
"nv=\"a\"",
"nv",
"\"a\"",
"while len(da)>=0 and len(db)>=0 and len(dc)>=0:\n if nv ==\"a\" and len(da)>0:\n nv = da.popleft()\n elif nv ==\"a\":\n print(\"A\")\n exit()\n elif nv ==\"b\" and len(db)>0:\n nv = db.popleft()\n elif nv ==\"b\":\n print(\"B\")\n exit() \n elif nv ==\"c\" and len(dc)>0: \n nv = dc.popleft()\n elif nv ==\"c\":\n print(\"C\")\n exit()",
"len(da)>=0 and len(db)>=0 and len(dc)>=0",
"len(da)>=0 and len(db)>=0",
"len(da)>=0",
"len(da)",
"len",
"da",
"0",
"len(db)>=0",
"len(db)",
"len",
"db",
"0",
"len(dc)>=0",
"len(dc)",
"len",
"dc",
"0",
"if nv ==\"a\" and len(da)>0:\n nv = da.popleft()\n elif nv ==\"a\":\n print(\"A\")\n exit()\n elif nv ==\"b\" and len(db)>0:\n nv = db.popleft()\n elif nv ==\"b\":\n print(\"B\")\n exit() \n elif nv ==\"c\" and len(dc)>0: \n nv = dc.popleft()\n elif nv ==\"c\":\n print(\"C\")\n exit()",
"nv ==\"a\" and len(da)>0",
"nv ==\"a\"",
"nv",
"\"a\"",
"len(da)>0",
"len(da)",
"len",
"da",
"0",
"nv = da.popleft()",
"nv",
"da.popleft()",
"da.popleft",
"da",
"popleft",
"elif nv ==\"a\":\n print(\"A\")\n exit()\n ",
"nv ==\"a\"",
"nv",
"\"a\"",
"print(\"A\")",
"print",
"\"A\"",
"exit()",
"exit",
"elif nv ==\"b\" and len(db)>0:\n nv = db.popleft()\n ",
"nv ==\"b\" and len(db)>0",
"nv ==\"b\"",
"nv",
"\"b\"",
"len(db)>0",
"len(db)",
"len",
"db",
"0",
"nv = db.popleft()",
"nv",
"db.popleft()",
"db.popleft",
"db",
"popleft",
"elif nv ==\"b\":\n print(\"B\")\n exit() \n ",
"nv ==\"b\"",
"nv",
"\"b\"",
"print(\"B\")",
"print",
"\"B\"",
"exit()",
"exit",
"elif nv ==\"c\" and len(dc)>0: \n nv = dc.popleft()\n ",
"nv ==\"c\" and len(dc)>0",
"nv ==\"c\"",
"nv",
"\"c\"",
"len(dc)>0",
"len(dc)",
"len",
"dc",
"0",
"nv = dc.popleft()",
"nv",
"dc.popleft()",
"dc.popleft",
"dc",
"popleft",
"elif nv ==\"c\":\n print(\"C\")\n exit()",
"nv ==\"c\"",
"nv",
"\"c\"",
"print(\"C\")",
"print",
"\"C\"",
"exit()",
"exit",
"SC=input()",
"input()",
"SC",
"nv = db.popleft()",
"db.popleft()",
"nv",
"dc=deque()",
"deque()",
"dc",
"nv=\"a\"",
"\"a\"",
"nv",
"da=deque()",
"deque()",
"da",
"nv = da.popleft()",
"da.popleft()",
"nv",
"nv = dc.popleft()",
"dc.popleft()",
"nv",
"SA=input()",
"input()",
"SA",
"SB=input()",
"input()",
"SB",
"db=deque()",
"deque()",
"db"
] | from collections import deque
SA=input()
SB=input()
SC=input()
da=deque()
db=deque()
dc=deque()
for i in range(len(SA)):
da.append(SA[i])
for i in range(len(SB)):
db.append(SB[i])
for i in range(len(SC)):
dc.append(SC[i])
nv="a"
while len(da)>=0 and len(db)>=0 and len(dc)>=0:
if nv =="a" and len(da)>0:
nv = da.popleft()
elif nv =="a":
print("A")
exit()
elif nv =="b" and len(db)>0:
nv = db.popleft()
elif nv =="b":
print("B")
exit()
elif nv =="c" and len(dc)>0:
nv = dc.popleft()
elif nv =="c":
print("C")
exit()
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
13,
42,
2,
2,
40,
4,
13,
13,
17,
40,
4,
13,
13,
17,
40,
4,
13,
13,
17,
14,
2,
18,
13,
17,
17,
24,
18,
13,
17,
0,
13,
13,
14,
2,
4,
13,
13,
17,
4,
13,
17,
3,
14,
2,
18,
13,
17,
17,
24,
18,
13,
17,
0,
13,
13,
14,
2,
4,
13,
13,
17,
4,
13,
17,
3,
14,
2,
18,
13,
17,
17,
24,
18,
13,
17,
0,
13,
13,
14,
2,
4,
13,
13,
17,
4,
13,
17,
3,
10,
13,
13,
10,
13,
13,
10,
13,
13,
10,
13,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13
] | [
[
125,
2
],
[
122,
8
],
[
128,
14
],
[
110,
20
],
[
126,
21
],
[
126,
28
],
[
123,
33
],
[
129,
38
],
[
111,
43
],
[
114,
43
],
[
120,
43
],
[
117,
43
],
[
111,
48
],
[
114,
48
],
[
120,
48
],
[
117,
48
],
[
113,
51
],
[
126,
52
],
[
114,
57
],
[
111,
57
],
[
120,
57
],
[
117,
57
],
[
111,
66
],
[
114,
66
],
[
120,
66
],
[
117,
66
],
[
111,
71
],
[
114,
71
],
[
120,
71
],
[
117,
71
],
[
119,
74
],
[
123,
75
],
[
120,
80
],
[
111,
80
],
[
114,
80
],
[
117,
80
],
[
111,
89
],
[
114,
89
],
[
120,
89
],
[
117,
89
],
[
111,
94
],
[
114,
94
],
[
120,
94
],
[
117,
94
],
[
116,
97
],
[
129,
98
],
[
117,
103
],
[
111,
103
],
[
114,
103
],
[
120,
103
],
[
126,
110
],
[
110,
111
],
[
126,
113
],
[
113,
114
],
[
129,
116
],
[
116,
117
],
[
123,
119
],
[
119,
120
],
[
122,
123
],
[
125,
126
],
[
128,
129
]
] | [
"alice = list(input())#aca\nbob = list(input())#accc\ncharlie = list(input())#ca\n\ncurrent = alice\nwhile(len(alice) >= 0 and len(bob) >= 0 and len(charlie) >= 0):\n # if(len(current) == 0):\n # if(current is alice):\n # print('A')\n # break\n # elif(current is bob):\n # print('B')\n # break\n # elif(current is charlie):\n # print('C')\n # break\n if(current[0] == 'a'):\n del current[0]\n current = alice\n if(len(current) == 0):\n print('A')\n break\n elif(current[0] == 'b'):\n del current[0]\n current = bob\n if(len(current) == 0):\n print('B')\n break\n elif(current[0] == 'c'):\n del current[0]\n current = charlie\n if(len(current) == 0):\n print('C')\n break",
"alice = list(input())",
"alice",
"list(input())",
"list",
"input()",
"input",
"bob = list(input())",
"bob",
"list(input())",
"list",
"input()",
"input",
"charlie = list(input())",
"charlie",
"list(input())",
"list",
"input()",
"input",
"current = alice",
"current",
"alice",
"while(len(alice) >= 0 and len(bob) >= 0 and len(charlie) >= 0):\n # if(len(current) == 0):\n # if(current is alice):\n # print('A')\n # break\n # elif(current is bob):\n # print('B')\n # break\n # elif(current is charlie):\n # print('C')\n # break\n if(current[0] == 'a'):\n del current[0]\n current = alice\n if(len(current) == 0):\n print('A')\n break\n elif(current[0] == 'b'):\n del current[0]\n current = bob\n if(len(current) == 0):\n print('B')\n break\n elif(current[0] == 'c'):\n del current[0]\n current = charlie\n if(len(current) == 0):\n print('C')\n break",
"len(alice) >= 0 and len(bob) >= 0 and len(charlie) >= 0",
"len(alice) >= 0 and len(bob) >= 0",
"len(alice) >= 0",
"len(alice)",
"len",
"alice",
"0",
"len(bob) >= 0",
"len(bob)",
"len",
"bob",
"0",
"len(charlie) >= 0",
"len(charlie)",
"len",
"charlie",
"0",
"if(current[0] == 'a'):\n del current[0]\n current = alice\n if(len(current) == 0):\n print('A')\n break\n elif(current[0] == 'b'):\n del current[0]\n current = bob\n if(len(current) == 0):\n print('B')\n break\n elif(current[0] == 'c'):\n del current[0]\n current = charlie\n if(len(current) == 0):\n print('C')\n break",
"current[0] == 'a'",
"current[0]",
"current",
"0",
"'a'",
"del current[0]",
"current[0]",
"current",
"0",
"current = alice",
"current",
"alice",
"if(len(current) == 0):\n print('A')\n break\n ",
"len(current) == 0",
"len(current)",
"len",
"current",
"0",
"print('A')",
"print",
"'A'",
"break",
"elif(current[0] == 'b'):\n del current[0]\n current = bob\n if(len(current) == 0):\n print('B')\n break\n ",
"current[0] == 'b'",
"current[0]",
"current",
"0",
"'b'",
"del current[0]",
"current[0]",
"current",
"0",
"current = bob",
"current",
"bob",
"if(len(current) == 0):\n print('B')\n break\n ",
"len(current) == 0",
"len(current)",
"len",
"current",
"0",
"print('B')",
"print",
"'B'",
"break",
"elif(current[0] == 'c'):\n del current[0]\n current = charlie\n if(len(current) == 0):\n print('C')\n break",
"current[0] == 'c'",
"current[0]",
"current",
"0",
"'c'",
"del current[0]",
"current[0]",
"current",
"0",
"current = charlie",
"current",
"charlie",
"if(len(current) == 0):\n print('C')\n break",
"len(current) == 0",
"len(current)",
"len",
"current",
"0",
"print('C')",
"print",
"'C'",
"break",
"current = alice",
"alice",
"current",
"current = alice",
"alice",
"current",
"current = charlie",
"charlie",
"current",
"current = bob",
"bob",
"current",
"bob = list(input())",
"list(input())",
"bob",
"alice = list(input())",
"list(input())",
"alice",
"charlie = list(input())",
"list(input())",
"charlie"
] | alice = list(input())#aca
bob = list(input())#accc
charlie = list(input())#ca
current = alice
while(len(alice) >= 0 and len(bob) >= 0 and len(charlie) >= 0):
# if(len(current) == 0):
# if(current is alice):
# print('A')
# break
# elif(current is bob):
# print('B')
# break
# elif(current is charlie):
# print('C')
# break
if(current[0] == 'a'):
del current[0]
current = alice
if(len(current) == 0):
print('A')
break
elif(current[0] == 'b'):
del current[0]
current = bob
if(len(current) == 0):
print('B')
break
elif(current[0] == 'c'):
del current[0]
current = charlie
if(len(current) == 0):
print('C')
break |
[
7,
12,
13,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
17,
28,
13,
4,
13,
2,
2,
4,
13,
13,
4,
13,
13,
4,
13,
13,
14,
2,
13,
17,
14,
40,
4,
13,
13,
17,
0,
13,
18,
13,
17,
0,
13,
18,
13,
39,
17,
4,
13,
17,
4,
13,
14,
2,
13,
17,
14,
40,
4,
13,
13,
17,
0,
13,
18,
13,
17,
0,
13,
18,
13,
39,
17,
4,
13,
17,
4,
13,
14,
40,
4,
13,
13,
17,
0,
13,
18,
13,
17,
0,
13,
18,
13,
39,
17,
4,
13,
17,
4,
13,
4,
13,
10,
12,
13
] | [
[
5,
4
],
[
9,
8
],
[
13,
12
],
[
17,
16
],
[
20,
19
],
[
4,
26
],
[
8,
29
],
[
12,
32
],
[
16,
35
],
[
92,
35
],
[
70,
35
],
[
44,
35
],
[
4,
41
],
[
49,
41
],
[
45,
44
],
[
4,
46
],
[
49,
46
],
[
50,
49
],
[
4,
51
],
[
49,
51
],
[
16,
61
],
[
92,
61
],
[
70,
61
],
[
44,
61
],
[
8,
67
],
[
75,
67
],
[
71,
70
],
[
8,
72
],
[
75,
72
],
[
76,
75
],
[
8,
77
],
[
75,
77
],
[
12,
89
],
[
97,
89
],
[
93,
92
],
[
12,
94
],
[
97,
94
],
[
98,
97
],
[
12,
99
],
[
97,
99
],
[
111,
108
]
] | [
"def resolve():\n a = input()\n b = input()\n c = input()\n count = \"a\"\n for i in range(len(a)+len(b)+len(c)):\n if count == \"a\":\n if len(a) != 0:\n count = a[0]\n a = a[1:]\n else:\n print(\"A\")\n exit()\n elif count == \"b\":\n if len(b) != 0:\n count = b[0]\n b = b[1:]\n else:\n print(\"B\")\n exit()\n else:\n if len(c) != 0:\n count = c[0]\n c = c[1:]\n else:\n print(\"C\")\n exit()\nresolve()",
"def resolve():\n a = input()\n b = input()\n c = input()\n count = \"a\"\n for i in range(len(a)+len(b)+len(c)):\n if count == \"a\":\n if len(a) != 0:\n count = a[0]\n a = a[1:]\n else:\n print(\"A\")\n exit()\n elif count == \"b\":\n if len(b) != 0:\n count = b[0]\n b = b[1:]\n else:\n print(\"B\")\n exit()\n else:\n if len(c) != 0:\n count = c[0]\n c = c[1:]\n else:\n print(\"C\")\n exit()",
"resolve",
"a = input()",
"a",
"input()",
"input",
"b = input()",
"b",
"input()",
"input",
"c = input()",
"c",
"input()",
"input",
"count = \"a\"",
"count",
"\"a\"",
"for i in range(len(a)+len(b)+len(c)):\n if count == \"a\":\n if len(a) != 0:\n count = a[0]\n a = a[1:]\n else:\n print(\"A\")\n exit()\n elif count == \"b\":\n if len(b) != 0:\n count = b[0]\n b = b[1:]\n else:\n print(\"B\")\n exit()\n else:\n if len(c) != 0:\n count = c[0]\n c = c[1:]\n else:\n print(\"C\")\n exit()",
"i",
"range(len(a)+len(b)+len(c))",
"range",
"len(a)+len(b)+len(c)",
"len(a)+len(b)",
"len(a)",
"len",
"a",
"len(b)",
"len",
"b",
"len(c)",
"len",
"c",
"if count == \"a\":\n if len(a) != 0:\n count = a[0]\n a = a[1:]\n else:\n print(\"A\")\n exit()\n elif count == \"b\":\n if len(b) != 0:\n count = b[0]\n b = b[1:]\n else:\n print(\"B\")\n exit()\n else:\n if len(c) != 0:\n count = c[0]\n c = c[1:]\n else:\n print(\"C\")\n exit()",
"count == \"a\"",
"count",
"\"a\"",
"if len(a) != 0:\n count = a[0]\n a = a[1:]\n else:\n print(\"A\")\n exit()\n ",
"len(a) != 0",
"len(a)",
"len",
"a",
"0",
"count = a[0]",
"count",
"a[0]",
"a",
"0",
"a = a[1:]",
"a",
"a[1:]",
"a",
"1:",
"1",
"print(\"A\")",
"print",
"\"A\"",
"exit()",
"exit",
"elif count == \"b\":\n if len(b) != 0:\n count = b[0]\n b = b[1:]\n else:\n print(\"B\")\n exit()\n ",
"count == \"b\"",
"count",
"\"b\"",
"if len(b) != 0:\n count = b[0]\n b = b[1:]\n else:\n print(\"B\")\n exit()\n ",
"len(b) != 0",
"len(b)",
"len",
"b",
"0",
"count = b[0]",
"count",
"b[0]",
"b",
"0",
"b = b[1:]",
"b",
"b[1:]",
"b",
"1:",
"1",
"print(\"B\")",
"print",
"\"B\"",
"exit()",
"exit",
"if len(c) != 0:\n count = c[0]\n c = c[1:]\n else:\n print(\"C\")\n exit()",
"len(c) != 0",
"len(c)",
"len",
"c",
"0",
"count = c[0]",
"count",
"c[0]",
"c",
"0",
"c = c[1:]",
"c",
"c[1:]",
"c",
"1:",
"1",
"print(\"C\")",
"print",
"\"C\"",
"exit()",
"exit",
"resolve()",
"resolve",
"def resolve():\n a = input()\n b = input()\n c = input()\n count = \"a\"\n for i in range(len(a)+len(b)+len(c)):\n if count == \"a\":\n if len(a) != 0:\n count = a[0]\n a = a[1:]\n else:\n print(\"A\")\n exit()\n elif count == \"b\":\n if len(b) != 0:\n count = b[0]\n b = b[1:]\n else:\n print(\"B\")\n exit()\n else:\n if len(c) != 0:\n count = c[0]\n c = c[1:]\n else:\n print(\"C\")\n exit()",
"def resolve():\n a = input()\n b = input()\n c = input()\n count = \"a\"\n for i in range(len(a)+len(b)+len(c)):\n if count == \"a\":\n if len(a) != 0:\n count = a[0]\n a = a[1:]\n else:\n print(\"A\")\n exit()\n elif count == \"b\":\n if len(b) != 0:\n count = b[0]\n b = b[1:]\n else:\n print(\"B\")\n exit()\n else:\n if len(c) != 0:\n count = c[0]\n c = c[1:]\n else:\n print(\"C\")\n exit()",
"resolve"
] | def resolve():
a = input()
b = input()
c = input()
count = "a"
for i in range(len(a)+len(b)+len(c)):
if count == "a":
if len(a) != 0:
count = a[0]
a = a[1:]
else:
print("A")
exit()
elif count == "b":
if len(b) != 0:
count = b[0]
b = b[1:]
else:
print("B")
exit()
else:
if len(c) != 0:
count = c[0]
c = c[1:]
else:
print("C")
exit()
resolve() |
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
17,
42,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
3,
0,
13,
18,
13,
17,
0,
13,
18,
13,
39,
17,
4,
13,
13,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
3,
0,
13,
18,
13,
17,
0,
13,
18,
13,
39,
17,
4,
13,
13,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
3,
0,
13,
18,
13,
17,
0,
13,
18,
13,
39,
17,
4,
13,
13,
10,
18,
13,
10,
18,
13,
10,
4,
13,
10,
18,
13,
10,
4,
13,
10,
18,
13,
10,
17,
13,
10,
18,
13,
10,
4,
13,
10,
18,
13
] | [
[
127,
2
],
[
109,
6
],
[
115,
10
],
[
121,
14
],
[
122,
20
],
[
107,
20
],
[
131,
20
],
[
104,
20
],
[
128,
26
],
[
119,
26
],
[
103,
33
],
[
128,
35
],
[
119,
35
],
[
118,
38
],
[
128,
40
],
[
119,
40
],
[
128,
45
],
[
119,
45
],
[
122,
48
],
[
107,
48
],
[
131,
48
],
[
104,
48
],
[
110,
54
],
[
113,
54
],
[
130,
61
],
[
110,
63
],
[
113,
63
],
[
112,
66
],
[
110,
68
],
[
113,
68
],
[
110,
73
],
[
113,
73
],
[
122,
76
],
[
107,
76
],
[
131,
76
],
[
104,
76
],
[
116,
82
],
[
125,
82
],
[
106,
89
],
[
116,
91
],
[
125,
91
],
[
124,
94
],
[
116,
96
],
[
125,
96
],
[
116,
101
],
[
125,
101
],
[
103,
104
],
[
106,
107
],
[
109,
110
],
[
112,
113
],
[
115,
116
],
[
118,
119
],
[
121,
122
],
[
124,
125
],
[
127,
128
],
[
130,
131
]
] | [
"Sa = input()\nSb = input()\nSc = input()\n\nx = 'a'\n\nwhile True:\n if x == 'a':\n if len(Sa) == 0:\n print('A')\n break\n x = Sa[0]\n Sa = Sa[1:len(Sa)]\n elif x == 'b':\n if len(Sb) == 0:\n print('B')\n break\n x = Sb[0]\n Sb = Sb[1:len(Sb)]\n elif x == 'c':\n if len(Sc) == 0:\n print('C')\n break\n x = Sc[0]\n Sc = Sc[1:len(Sc)]",
"Sa = input()",
"Sa",
"input()",
"input",
"Sb = input()",
"Sb",
"input()",
"input",
"Sc = input()",
"Sc",
"input()",
"input",
"x = 'a'",
"x",
"'a'",
"while True:\n if x == 'a':\n if len(Sa) == 0:\n print('A')\n break\n x = Sa[0]\n Sa = Sa[1:len(Sa)]\n elif x == 'b':\n if len(Sb) == 0:\n print('B')\n break\n x = Sb[0]\n Sb = Sb[1:len(Sb)]\n elif x == 'c':\n if len(Sc) == 0:\n print('C')\n break\n x = Sc[0]\n Sc = Sc[1:len(Sc)]",
"True",
"if x == 'a':\n if len(Sa) == 0:\n print('A')\n break\n x = Sa[0]\n Sa = Sa[1:len(Sa)]\n elif x == 'b':\n if len(Sb) == 0:\n print('B')\n break\n x = Sb[0]\n Sb = Sb[1:len(Sb)]\n elif x == 'c':\n if len(Sc) == 0:\n print('C')\n break\n x = Sc[0]\n Sc = Sc[1:len(Sc)]",
"x == 'a'",
"x",
"'a'",
"if len(Sa) == 0:\n print('A')\n break\n ",
"len(Sa) == 0",
"len(Sa)",
"len",
"Sa",
"0",
"print('A')",
"print",
"'A'",
"break",
"x = Sa[0]",
"x",
"Sa[0]",
"Sa",
"0",
"Sa = Sa[1:len(Sa)]",
"Sa",
"Sa[1:len(Sa)]",
"Sa",
"1:len(Sa)",
"1",
"len(Sa)",
"len",
"Sa",
"elif x == 'b':\n if len(Sb) == 0:\n print('B')\n break\n x = Sb[0]\n Sb = Sb[1:len(Sb)]\n ",
"x == 'b'",
"x",
"'b'",
"if len(Sb) == 0:\n print('B')\n break\n ",
"len(Sb) == 0",
"len(Sb)",
"len",
"Sb",
"0",
"print('B')",
"print",
"'B'",
"break",
"x = Sb[0]",
"x",
"Sb[0]",
"Sb",
"0",
"Sb = Sb[1:len(Sb)]",
"Sb",
"Sb[1:len(Sb)]",
"Sb",
"1:len(Sb)",
"1",
"len(Sb)",
"len",
"Sb",
"elif x == 'c':\n if len(Sc) == 0:\n print('C')\n break\n x = Sc[0]\n Sc = Sc[1:len(Sc)]",
"x == 'c'",
"x",
"'c'",
"if len(Sc) == 0:\n print('C')\n break\n ",
"len(Sc) == 0",
"len(Sc)",
"len",
"Sc",
"0",
"print('C')",
"print",
"'C'",
"break",
"x = Sc[0]",
"x",
"Sc[0]",
"Sc",
"0",
"Sc = Sc[1:len(Sc)]",
"Sc",
"Sc[1:len(Sc)]",
"Sc",
"1:len(Sc)",
"1",
"len(Sc)",
"len",
"Sc",
"x = Sa[0]",
"Sa[0]",
"x",
"x = Sc[0]",
"Sc[0]",
"x",
"Sb = input()",
"input()",
"Sb",
"Sb = Sb[1:len(Sb)]",
"Sb[1:len(Sb)]",
"Sb",
"Sc = input()",
"input()",
"Sc",
"Sa = Sa[1:len(Sa)]",
"Sa[1:len(Sa)]",
"Sa",
"x = 'a'",
"'a'",
"x",
"Sc = Sc[1:len(Sc)]",
"Sc[1:len(Sc)]",
"Sc",
"Sa = input()",
"input()",
"Sa",
"x = Sb[0]",
"Sb[0]",
"x"
] | Sa = input()
Sb = input()
Sc = input()
x = 'a'
while True:
if x == 'a':
if len(Sa) == 0:
print('A')
break
x = Sa[0]
Sa = Sa[1:len(Sa)]
elif x == 'b':
if len(Sb) == 0:
print('B')
break
x = Sb[0]
Sb = Sb[1:len(Sb)]
elif x == 'c':
if len(Sc) == 0:
print('C')
break
x = Sc[0]
Sc = Sc[1:len(Sc)] |
[
7,
41,
28,
13,
4,
13,
17,
4,
39,
0,
13,
13,
0,
18,
13,
17,
4,
13,
0,
18,
13,
17,
4,
13,
0,
18,
13,
17,
4,
13,
0,
13,
17,
42,
17,
14,
2,
4,
13,
18,
13,
13,
17,
14,
2,
13,
17,
4,
13,
17,
14,
2,
13,
17,
4,
13,
17,
4,
13,
17,
4,
13,
0,
13,
18,
18,
13,
13,
17,
0,
18,
13,
13,
18,
18,
13,
13,
39,
17,
14,
2,
13,
17,
0,
13,
17,
14,
2,
13,
17,
0,
13,
17,
0,
13,
17,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
18,
13,
10,
13,
13
] | [
[
4,
3
],
[
112,
10
],
[
16,
13
],
[
113,
14
],
[
22,
19
],
[
113,
20
],
[
28,
25
],
[
113,
26
],
[
100,
31
],
[
70,
39
],
[
113,
40
],
[
101,
41
],
[
98,
41
],
[
104,
41
],
[
107,
41
],
[
101,
45
],
[
98,
45
],
[
104,
45
],
[
107,
45
],
[
101,
52
],
[
98,
52
],
[
104,
52
],
[
107,
52
],
[
109,
63
],
[
70,
65
],
[
113,
66
],
[
101,
67
],
[
98,
67
],
[
104,
67
],
[
107,
67
],
[
73,
70
],
[
113,
71
],
[
101,
72
],
[
98,
72
],
[
104,
72
],
[
107,
72
],
[
70,
74
],
[
113,
75
],
[
101,
76
],
[
98,
76
],
[
104,
76
],
[
107,
76
],
[
110,
81
],
[
106,
84
],
[
110,
88
],
[
103,
91
],
[
97,
94
],
[
97,
98
],
[
100,
101
],
[
103,
104
],
[
106,
107
],
[
109,
110
],
[
112,
113
]
] | [
"s=[ [] for i in range(3) ]\ns[0]=input()\ns[1]=input()\ns[2]=input()\np=0\nwhile True:\n if len(s[p])==0:\n if p==0:\n print('A')\n elif p==1:\n print('B')\n else:\n print('C')\n exit()\n tmp=s[p][0]\n s[p]=s[p][1:]\n if tmp=='a':\n p=0\n elif tmp=='b':\n p=1\n else:\n p=2",
"[] for i in range(3)",
"for i in range(3)",
"i",
"range(3)",
"range",
"3",
"for i in range(3)",
"[]",
"s=[ [] for i in range(3) ]",
"s",
"[ [] for i in range(3) ]",
"s[0]=input()",
"s[0]",
"s",
"0",
"input()",
"input",
"s[1]=input()",
"s[1]",
"s",
"1",
"input()",
"input",
"s[2]=input()",
"s[2]",
"s",
"2",
"input()",
"input",
"p=0",
"p",
"0",
"while True:\n if len(s[p])==0:\n if p==0:\n print('A')\n elif p==1:\n print('B')\n else:\n print('C')\n exit()\n tmp=s[p][0]\n s[p]=s[p][1:]\n if tmp=='a':\n p=0\n elif tmp=='b':\n p=1\n else:\n p=2",
"True",
"if len(s[p])==0:\n if p==0:\n print('A')\n elif p==1:\n print('B')\n else:\n print('C')\n exit()\n ",
"len(s[p])==0",
"len(s[p])",
"len",
"s[p]",
"s",
"p",
"0",
"if p==0:\n print('A')\n elif p==1:\n print('B')\n else:\n print('C')\n ",
"p==0",
"p",
"0",
"print('A')",
"print",
"'A'",
"elif p==1:\n print('B')\n ",
"p==1",
"p",
"1",
"print('B')",
"print",
"'B'",
"print('C')",
"print",
"'C'",
"exit()",
"exit",
"tmp=s[p][0]",
"tmp",
"s[p][0]",
"[p]",
"s",
"p",
"0",
"s[p]=s[p][1:]",
"s[p]",
"s",
"p",
"s[p][1:]",
"[p]",
"s",
"p",
"1:",
"1",
"if tmp=='a':\n p=0\n elif tmp=='b':\n p=1\n else:\n p=2",
"tmp=='a'",
"tmp",
"'a'",
"p=0",
"p",
"0",
"elif tmp=='b':\n p=1\n ",
"tmp=='b'",
"tmp",
"'b'",
"p=1",
"p",
"1",
"p=2",
"p",
"2",
"p=2",
"2",
"p",
"p=0",
"0",
"p",
"p=1",
"1",
"p",
"p=0",
"0",
"p",
"tmp=s[p][0]",
"s[p][0]",
"tmp",
"s=[ [] for i in range(3) ]",
"[ [] for i in range(3) ]",
"s"
] | s=[ [] for i in range(3) ]
s[0]=input()
s[1]=input()
s[2]=input()
p=0
while True:
if len(s[p])==0:
if p==0:
print('A')
elif p==1:
print('B')
else:
print('C')
exit()
tmp=s[p][0]
s[p]=s[p][1:]
if tmp=='a':
p=0
elif tmp=='b':
p=1
else:
p=2
|
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
17,
42,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
3,
0,
13,
18,
13,
17,
0,
13,
18,
13,
39,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
3,
0,
13,
18,
13,
17,
0,
13,
18,
13,
39,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
3,
0,
13,
18,
13,
17,
0,
13,
18,
13,
39,
17,
10,
18,
13,
10,
18,
13,
10,
18,
13,
10,
4,
13,
10,
4,
13,
10,
18,
13,
10,
18,
13,
10,
4,
13,
10,
17,
13,
10,
18,
13
] | [
[
102,
2
],
[
99,
6
],
[
111,
10
],
[
114,
14
],
[
115,
20
],
[
106,
20
],
[
94,
20
],
[
97,
20
],
[
103,
26
],
[
91,
26
],
[
96,
33
],
[
103,
35
],
[
91,
35
],
[
90,
38
],
[
103,
40
],
[
91,
40
],
[
115,
45
],
[
106,
45
],
[
94,
45
],
[
97,
45
],
[
100,
51
],
[
109,
51
],
[
93,
58
],
[
100,
60
],
[
109,
60
],
[
108,
63
],
[
100,
65
],
[
109,
65
],
[
112,
72
],
[
118,
72
],
[
105,
79
],
[
112,
81
],
[
118,
81
],
[
117,
84
],
[
112,
86
],
[
118,
86
],
[
90,
91
],
[
93,
94
],
[
96,
97
],
[
99,
100
],
[
102,
103
],
[
105,
106
],
[
108,
109
],
[
111,
112
],
[
114,
115
],
[
117,
118
]
] | [
"A = input()\nB = input()\nC = input()\nturn = 'a'\nwhile True:\n if turn == 'a':\n if len(A) == 0:\n print('A')\n break\n turn = A[0]\n A = A[1:]\n elif turn == 'b':\n if len(B) == 0:\n print('B')\n break\n turn = B[0]\n B = B[1:]\n else:\n if len(C) == 0:\n print('C')\n break\n turn = C[0]\n C = C[1:]",
"A = input()",
"A",
"input()",
"input",
"B = input()",
"B",
"input()",
"input",
"C = input()",
"C",
"input()",
"input",
"turn = 'a'",
"turn",
"'a'",
"while True:\n if turn == 'a':\n if len(A) == 0:\n print('A')\n break\n turn = A[0]\n A = A[1:]\n elif turn == 'b':\n if len(B) == 0:\n print('B')\n break\n turn = B[0]\n B = B[1:]\n else:\n if len(C) == 0:\n print('C')\n break\n turn = C[0]\n C = C[1:]",
"True",
"if turn == 'a':\n if len(A) == 0:\n print('A')\n break\n turn = A[0]\n A = A[1:]\n elif turn == 'b':\n if len(B) == 0:\n print('B')\n break\n turn = B[0]\n B = B[1:]\n else:\n if len(C) == 0:\n print('C')\n break\n turn = C[0]\n C = C[1:]",
"turn == 'a'",
"turn",
"'a'",
"if len(A) == 0:\n print('A')\n break\n ",
"len(A) == 0",
"len(A)",
"len",
"A",
"0",
"print('A')",
"print",
"'A'",
"break",
"turn = A[0]",
"turn",
"A[0]",
"A",
"0",
"A = A[1:]",
"A",
"A[1:]",
"A",
"1:",
"1",
"elif turn == 'b':\n if len(B) == 0:\n print('B')\n break\n turn = B[0]\n B = B[1:]\n ",
"turn == 'b'",
"turn",
"'b'",
"if len(B) == 0:\n print('B')\n break\n ",
"len(B) == 0",
"len(B)",
"len",
"B",
"0",
"print('B')",
"print",
"'B'",
"break",
"turn = B[0]",
"turn",
"B[0]",
"B",
"0",
"B = B[1:]",
"B",
"B[1:]",
"B",
"1:",
"1",
"if len(C) == 0:\n print('C')\n break\n ",
"len(C) == 0",
"len(C)",
"len",
"C",
"0",
"print('C')",
"print",
"'C'",
"break",
"turn = C[0]",
"turn",
"C[0]",
"C",
"0",
"C = C[1:]",
"C",
"C[1:]",
"C",
"1:",
"1",
"A = A[1:]",
"A[1:]",
"A",
"turn = B[0]",
"B[0]",
"turn",
"turn = A[0]",
"A[0]",
"turn",
"B = input()",
"input()",
"B",
"A = input()",
"input()",
"A",
"turn = C[0]",
"C[0]",
"turn",
"B = B[1:]",
"B[1:]",
"B",
"C = input()",
"input()",
"C",
"turn = 'a'",
"'a'",
"turn",
"C = C[1:]",
"C[1:]",
"C"
] | A = input()
B = input()
C = input()
turn = 'a'
while True:
if turn == 'a':
if len(A) == 0:
print('A')
break
turn = A[0]
A = A[1:]
elif turn == 'b':
if len(B) == 0:
print('B')
break
turn = B[0]
B = B[1:]
else:
if len(C) == 0:
print('C')
break
turn = C[0]
C = C[1:] |
[
7,
0,
13,
21,
22,
17,
4,
13,
22,
17,
4,
13,
22,
17,
4,
13,
0,
13,
17,
42,
18,
13,
13,
0,
13,
18,
18,
13,
13,
17,
0,
18,
13,
13,
18,
18,
13,
13,
39,
17,
0,
13,
13,
4,
13,
4,
18,
13,
13,
10,
13,
13,
10,
17,
13,
10,
21,
13,
10,
18,
13
] | [
[
56,
2
],
[
53,
17
],
[
57,
21
],
[
54,
22
],
[
51,
22
],
[
59,
24
],
[
31,
26
],
[
57,
27
],
[
54,
28
],
[
51,
28
],
[
34,
31
],
[
57,
32
],
[
54,
33
],
[
51,
33
],
[
31,
35
],
[
57,
36
],
[
54,
37
],
[
51,
37
],
[
50,
41
],
[
60,
42
],
[
51,
47
],
[
54,
47
],
[
60,
50
],
[
50,
51
],
[
53,
54
],
[
56,
57
],
[
59,
60
]
] | [
"S = {\"a\": input(), \"b\": input(), \"c\": input()}\n\nt = \"a\"\nwhile S[t]:\n nt = S[t][0]\n S[t] = S[t][1:]\n t = nt\n\nelse:\n print(t.upper())",
"S = {\"a\": input(), \"b\": input(), \"c\": input()}",
"S",
"{\"a\": input(), \"b\": input(), \"c\": input()}",
"\"a\"",
"\"a\"",
"input()",
"input",
"\"b\"",
"\"b\"",
"input()",
"input",
"\"c\"",
"\"c\"",
"input()",
"input",
"t = \"a\"",
"t",
"\"a\"",
"while S[t]:\n nt = S[t][0]\n S[t] = S[t][1:]\n t = nt\n\nelse:\n print(t.upper())",
"S[t]",
"S",
"t",
"nt = S[t][0]",
"nt",
"S[t][0]",
"[t]",
"S",
"t",
"0",
"S[t] = S[t][1:]",
"S[t]",
"S",
"t",
"S[t][1:]",
"[t]",
"S",
"t",
"1:",
"1",
"t = nt",
"t",
"nt",
"print(t.upper())",
"print",
"t.upper()",
"t.upper",
"t",
"upper",
"t = nt",
"nt",
"t",
"t = \"a\"",
"\"a\"",
"t",
"S = {\"a\": input(), \"b\": input(), \"c\": input()}",
"{\"a\": input(), \"b\": input(), \"c\": input()}",
"S",
"nt = S[t][0]",
"S[t][0]",
"nt"
] | S = {"a": input(), "b": input(), "c": input()}
t = "a"
while S[t]:
nt = S[t][0]
S[t] = S[t][1:]
t = nt
else:
print(t.upper()) |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
18,
13,
13,
42,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
0,
13,
4,
18,
13,
13,
17,
4,
13,
17,
3,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
0,
13,
4,
18,
13,
13,
17,
4,
13,
17,
3,
14,
2,
4,
13,
13,
17,
0,
13,
4,
18,
13,
13,
17,
4,
13,
17,
3,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13
] | [
[
93,
2
],
[
99,
8
],
[
105,
14
],
[
96,
20
],
[
94,
23
],
[
97,
29
],
[
91,
29
],
[
103,
29
],
[
88,
29
],
[
94,
35
],
[
87,
38
],
[
94,
41
],
[
97,
50
],
[
91,
50
],
[
103,
50
],
[
88,
50
],
[
100,
56
],
[
102,
59
],
[
100,
62
],
[
106,
73
],
[
90,
76
],
[
106,
79
],
[
87,
88
],
[
90,
91
],
[
93,
94
],
[
96,
97
],
[
99,
100
],
[
102,
103
],
[
105,
106
]
] | [
"Sa = list(input())\nSb = list(input())\nSc = list(input())\n\ncard = Sa.pop()\nwhile 1:\n if card == 'a':\n if len(Sa) > 0:\n card = Sa.pop(0)\n else:\n print('A')\n break\n elif card == 'b':\n if len(Sb) > 0:\n card = Sb.pop(0)\n else:\n print('B')\n break\n else:\n if len(Sc) > 0:\n card = Sc.pop(0)\n else:\n print('C')\n break",
"Sa = list(input())",
"Sa",
"list(input())",
"list",
"input()",
"input",
"Sb = list(input())",
"Sb",
"list(input())",
"list",
"input()",
"input",
"Sc = list(input())",
"Sc",
"list(input())",
"list",
"input()",
"input",
"card = Sa.pop()",
"card",
"Sa.pop()",
"Sa.pop",
"Sa",
"pop",
"while 1:\n if card == 'a':\n if len(Sa) > 0:\n card = Sa.pop(0)\n else:\n print('A')\n break\n elif card == 'b':\n if len(Sb) > 0:\n card = Sb.pop(0)\n else:\n print('B')\n break\n else:\n if len(Sc) > 0:\n card = Sc.pop(0)\n else:\n print('C')\n break",
"1",
"if card == 'a':\n if len(Sa) > 0:\n card = Sa.pop(0)\n else:\n print('A')\n break\n elif card == 'b':\n if len(Sb) > 0:\n card = Sb.pop(0)\n else:\n print('B')\n break\n else:\n if len(Sc) > 0:\n card = Sc.pop(0)\n else:\n print('C')\n break",
"card == 'a'",
"card",
"'a'",
"if len(Sa) > 0:\n card = Sa.pop(0)\n else:\n print('A')\n break\n ",
"len(Sa) > 0",
"len(Sa)",
"len",
"Sa",
"0",
"card = Sa.pop(0)",
"card",
"Sa.pop(0)",
"Sa.pop",
"Sa",
"pop",
"0",
"print('A')",
"print",
"'A'",
"break",
"elif card == 'b':\n if len(Sb) > 0:\n card = Sb.pop(0)\n else:\n print('B')\n break\n ",
"card == 'b'",
"card",
"'b'",
"if len(Sb) > 0:\n card = Sb.pop(0)\n else:\n print('B')\n break\n ",
"len(Sb) > 0",
"len(Sb)",
"len",
"Sb",
"0",
"card = Sb.pop(0)",
"card",
"Sb.pop(0)",
"Sb.pop",
"Sb",
"pop",
"0",
"print('B')",
"print",
"'B'",
"break",
"if len(Sc) > 0:\n card = Sc.pop(0)\n else:\n print('C')\n break",
"len(Sc) > 0",
"len(Sc)",
"len",
"Sc",
"0",
"card = Sc.pop(0)",
"card",
"Sc.pop(0)",
"Sc.pop",
"Sc",
"pop",
"0",
"print('C')",
"print",
"'C'",
"break",
"card = Sa.pop(0)",
"Sa.pop(0)",
"card",
"card = Sc.pop(0)",
"Sc.pop(0)",
"card",
"Sa = list(input())",
"list(input())",
"Sa",
"card = Sa.pop()",
"Sa.pop()",
"card",
"Sb = list(input())",
"list(input())",
"Sb",
"card = Sb.pop(0)",
"Sb.pop(0)",
"card",
"Sc = list(input())",
"list(input())",
"Sc"
] | Sa = list(input())
Sb = list(input())
Sc = list(input())
card = Sa.pop()
while 1:
if card == 'a':
if len(Sa) > 0:
card = Sa.pop(0)
else:
print('A')
break
elif card == 'b':
if len(Sb) > 0:
card = Sb.pop(0)
else:
print('B')
break
else:
if len(Sc) > 0:
card = Sc.pop(0)
else:
print('C')
break
|
[
7,
15,
0,
13,
4,
13,
4,
13,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
13,
0,
13,
4,
18,
13,
13,
28,
13,
4,
13,
17,
14,
2,
13,
17,
14,
13,
0,
13,
4,
18,
13,
13,
4,
13,
17,
3,
14,
2,
13,
17,
14,
13,
0,
13,
4,
18,
13,
13,
4,
13,
17,
3,
14,
13,
0,
13,
4,
18,
13,
13,
4,
13,
17,
3,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13
] | [
[
94,
3
],
[
103,
12
],
[
91,
21
],
[
88,
30
],
[
95,
33
],
[
37,
36
],
[
89,
42
],
[
86,
42
],
[
98,
42
],
[
101,
42
],
[
100,
47
],
[
95,
50
],
[
89,
58
],
[
86,
58
],
[
98,
58
],
[
101,
58
],
[
97,
63
],
[
104,
66
],
[
85,
75
],
[
92,
78
],
[
85,
86
],
[
88,
89
],
[
91,
92
],
[
94,
95
],
[
97,
98
],
[
100,
101
],
[
103,
104
]
] | [
"from collections import deque\nA = deque(map(str, input()))\nB = deque(map(str, input()))\nC = deque(map(str, input()))\nx = A.popleft()\nfor _ in range(10000000):\n if x == \"a\":\n if A:\n x = A.popleft()\n else:\n print(\"A\")\n break\n elif x == \"b\":\n if B:\n x = B.popleft()\n else:\n print(\"B\")\n break\n else:\n if C:\n x = C.popleft()\n else:\n print(\"C\")\n break",
"from collections import deque",
"A = deque(map(str, input()))",
"A",
"deque(map(str, input()))",
"deque",
"map(str, input())",
"map",
"str",
"input()",
"input",
"B = deque(map(str, input()))",
"B",
"deque(map(str, input()))",
"deque",
"map(str, input())",
"map",
"str",
"input()",
"input",
"C = deque(map(str, input()))",
"C",
"deque(map(str, input()))",
"deque",
"map(str, input())",
"map",
"str",
"input()",
"input",
"x = A.popleft()",
"x",
"A.popleft()",
"A.popleft",
"A",
"popleft",
"for _ in range(10000000):\n if x == \"a\":\n if A:\n x = A.popleft()\n else:\n print(\"A\")\n break\n elif x == \"b\":\n if B:\n x = B.popleft()\n else:\n print(\"B\")\n break\n else:\n if C:\n x = C.popleft()\n else:\n print(\"C\")\n break",
"_",
"range(10000000)",
"range",
"10000000",
"if x == \"a\":\n if A:\n x = A.popleft()\n else:\n print(\"A\")\n break\n elif x == \"b\":\n if B:\n x = B.popleft()\n else:\n print(\"B\")\n break\n else:\n if C:\n x = C.popleft()\n else:\n print(\"C\")\n break",
"x == \"a\"",
"x",
"\"a\"",
"if A:\n x = A.popleft()\n else:\n print(\"A\")\n break\n ",
"A",
"x = A.popleft()",
"x",
"A.popleft()",
"A.popleft",
"A",
"popleft",
"print(\"A\")",
"print",
"\"A\"",
"break",
"elif x == \"b\":\n if B:\n x = B.popleft()\n else:\n print(\"B\")\n break\n ",
"x == \"b\"",
"x",
"\"b\"",
"if B:\n x = B.popleft()\n else:\n print(\"B\")\n break\n ",
"B",
"x = B.popleft()",
"x",
"B.popleft()",
"B.popleft",
"B",
"popleft",
"print(\"B\")",
"print",
"\"B\"",
"break",
"if C:\n x = C.popleft()\n else:\n print(\"C\")\n break",
"C",
"x = C.popleft()",
"x",
"C.popleft()",
"C.popleft",
"C",
"popleft",
"print(\"C\")",
"print",
"\"C\"",
"break",
"x = C.popleft()",
"C.popleft()",
"x",
"x = A.popleft()",
"A.popleft()",
"x",
"C = deque(map(str, input()))",
"deque(map(str, input()))",
"C",
"A = deque(map(str, input()))",
"deque(map(str, input()))",
"A",
"x = B.popleft()",
"B.popleft()",
"x",
"x = A.popleft()",
"A.popleft()",
"x",
"B = deque(map(str, input()))",
"deque(map(str, input()))",
"B"
] | from collections import deque
A = deque(map(str, input()))
B = deque(map(str, input()))
C = deque(map(str, input()))
x = A.popleft()
for _ in range(10000000):
if x == "a":
if A:
x = A.popleft()
else:
print("A")
break
elif x == "b":
if B:
x = B.popleft()
else:
print("B")
break
else:
if C:
x = C.popleft()
else:
print("C")
break |
[
7,
0,
13,
4,
13,
0,
18,
13,
17,
4,
13,
0,
18,
13,
17,
4,
13,
0,
18,
13,
17,
4,
13,
0,
13,
17,
42,
17,
14,
2,
4,
13,
18,
13,
13,
17,
3,
0,
13,
18,
18,
13,
13,
17,
0,
18,
13,
13,
18,
18,
13,
13,
39,
17,
0,
13,
13,
4,
13,
4,
18,
13,
13,
10,
4,
13,
10,
13,
13,
10,
18,
13,
10,
17,
13
] | [
[
64,
2
],
[
9,
6
],
[
65,
7
],
[
15,
12
],
[
65,
13
],
[
21,
18
],
[
65,
19
],
[
73,
24
],
[
45,
32
],
[
65,
33
],
[
74,
34
],
[
68,
34
],
[
70,
38
],
[
45,
40
],
[
65,
41
],
[
74,
42
],
[
68,
42
],
[
48,
45
],
[
65,
46
],
[
74,
47
],
[
68,
47
],
[
45,
49
],
[
65,
50
],
[
74,
51
],
[
68,
51
],
[
67,
55
],
[
71,
56
],
[
68,
61
],
[
74,
61
],
[
64,
65
],
[
71,
67
],
[
67,
68
],
[
70,
71
],
[
73,
74
]
] | [
"S = dict()\nS[\"a\"] = input()\nS[\"b\"] = input()\nS[\"c\"] = input()\n\nturn = 'a'\n\nwhile True:\n if len(S[turn]) == 0:\n break\n next_turn = S[turn][0]\n S[turn] = S[turn][1:]\n turn = next_turn\n\nprint(turn.upper())",
"S = dict()",
"S",
"dict()",
"dict",
"S[\"a\"] = input()",
"S[\"a\"]",
"S",
"\"a\"",
"input()",
"input",
"S[\"b\"] = input()",
"S[\"b\"]",
"S",
"\"b\"",
"input()",
"input",
"S[\"c\"] = input()",
"S[\"c\"]",
"S",
"\"c\"",
"input()",
"input",
"turn = 'a'",
"turn",
"'a'",
"while True:\n if len(S[turn]) == 0:\n break\n next_turn = S[turn][0]\n S[turn] = S[turn][1:]\n turn = next_turn",
"True",
"if len(S[turn]) == 0:\n break\n ",
"len(S[turn]) == 0",
"len(S[turn])",
"len",
"S[turn]",
"S",
"turn",
"0",
"break",
"next_turn = S[turn][0]",
"next_turn",
"S[turn][0]",
"[turn]",
"S",
"turn",
"0",
"S[turn] = S[turn][1:]",
"S[turn]",
"S",
"turn",
"S[turn][1:]",
"[turn]",
"S",
"turn",
"1:",
"1",
"turn = next_turn",
"turn",
"next_turn",
"print(turn.upper())",
"print",
"turn.upper()",
"turn.upper",
"turn",
"upper",
"S = dict()",
"dict()",
"S",
"turn = next_turn",
"next_turn",
"turn",
"next_turn = S[turn][0]",
"S[turn][0]",
"next_turn",
"turn = 'a'",
"'a'",
"turn"
] | S = dict()
S["a"] = input()
S["b"] = input()
S["c"] = input()
turn = 'a'
while True:
if len(S[turn]) == 0:
break
next_turn = S[turn][0]
S[turn] = S[turn][1:]
turn = next_turn
print(turn.upper())
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
17,
42,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
3,
0,
13,
18,
13,
17,
0,
13,
18,
13,
39,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
3,
0,
13,
18,
13,
17,
0,
13,
18,
13,
39,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
3,
0,
13,
18,
13,
17,
0,
13,
18,
13,
39,
17,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
18,
13,
10,
17,
13,
10,
18,
13,
10,
18,
13,
10,
18,
13,
10,
18,
13,
10,
18,
13
] | [
[
100,
2
],
[
106,
8
],
[
103,
14
],
[
112,
20
],
[
113,
26
],
[
128,
26
],
[
116,
26
],
[
125,
26
],
[
101,
32
],
[
110,
32
],
[
124,
39
],
[
101,
41
],
[
110,
41
],
[
109,
44
],
[
101,
46
],
[
110,
46
],
[
113,
51
],
[
128,
51
],
[
116,
51
],
[
125,
51
],
[
107,
57
],
[
119,
57
],
[
115,
64
],
[
107,
66
],
[
119,
66
],
[
118,
69
],
[
107,
71
],
[
119,
71
],
[
113,
76
],
[
128,
76
],
[
116,
76
],
[
125,
76
],
[
104,
82
],
[
122,
82
],
[
127,
89
],
[
104,
91
],
[
122,
91
],
[
121,
94
],
[
104,
96
],
[
122,
96
],
[
100,
101
],
[
103,
104
],
[
106,
107
],
[
109,
110
],
[
112,
113
],
[
115,
116
],
[
118,
119
],
[
121,
122
],
[
124,
125
],
[
127,
128
]
] | [
"a=list(input())\nb=list(input())\nc=list(input())\norder='a'\nwhile True:\n if order=='a':\n if len(a)==0:\n print('A')\n break\n else:\n order=a[0]\n a=a[1:]\n elif order=='b':\n if len(b)==0:\n print('B')\n break\n else:\n order=b[0]\n b=b[1:]\n elif order=='c':\n if len(c)==0:\n print('C')\n break\n else:\n order=c[0]\n c=c[1:]",
"a=list(input())",
"a",
"list(input())",
"list",
"input()",
"input",
"b=list(input())",
"b",
"list(input())",
"list",
"input()",
"input",
"c=list(input())",
"c",
"list(input())",
"list",
"input()",
"input",
"order='a'",
"order",
"'a'",
"while True:\n if order=='a':\n if len(a)==0:\n print('A')\n break\n else:\n order=a[0]\n a=a[1:]\n elif order=='b':\n if len(b)==0:\n print('B')\n break\n else:\n order=b[0]\n b=b[1:]\n elif order=='c':\n if len(c)==0:\n print('C')\n break\n else:\n order=c[0]\n c=c[1:]",
"True",
"if order=='a':\n if len(a)==0:\n print('A')\n break\n else:\n order=a[0]\n a=a[1:]\n elif order=='b':\n if len(b)==0:\n print('B')\n break\n else:\n order=b[0]\n b=b[1:]\n elif order=='c':\n if len(c)==0:\n print('C')\n break\n else:\n order=c[0]\n c=c[1:]",
"order=='a'",
"order",
"'a'",
"if len(a)==0:\n print('A')\n break\n else:\n order=a[0]\n a=a[1:]\n ",
"len(a)==0",
"len(a)",
"len",
"a",
"0",
"print('A')",
"print",
"'A'",
"break",
"order=a[0]",
"order",
"a[0]",
"a",
"0",
"a=a[1:]",
"a",
"a[1:]",
"a",
"1:",
"1",
"elif order=='b':\n if len(b)==0:\n print('B')\n break\n else:\n order=b[0]\n b=b[1:]\n ",
"order=='b'",
"order",
"'b'",
"if len(b)==0:\n print('B')\n break\n else:\n order=b[0]\n b=b[1:]\n ",
"len(b)==0",
"len(b)",
"len",
"b",
"0",
"print('B')",
"print",
"'B'",
"break",
"order=b[0]",
"order",
"b[0]",
"b",
"0",
"b=b[1:]",
"b",
"b[1:]",
"b",
"1:",
"1",
"elif order=='c':\n if len(c)==0:\n print('C')\n break\n else:\n order=c[0]\n c=c[1:]",
"order=='c'",
"order",
"'c'",
"if len(c)==0:\n print('C')\n break\n else:\n order=c[0]\n c=c[1:]",
"len(c)==0",
"len(c)",
"len",
"c",
"0",
"print('C')",
"print",
"'C'",
"break",
"order=c[0]",
"order",
"c[0]",
"c",
"0",
"c=c[1:]",
"c",
"c[1:]",
"c",
"1:",
"1",
"a=list(input())",
"list(input())",
"a",
"c=list(input())",
"list(input())",
"c",
"b=list(input())",
"list(input())",
"b",
"a=a[1:]",
"a[1:]",
"a",
"order='a'",
"'a'",
"order",
"order=b[0]",
"b[0]",
"order",
"b=b[1:]",
"b[1:]",
"b",
"c=c[1:]",
"c[1:]",
"c",
"order=a[0]",
"a[0]",
"order",
"order=c[0]",
"c[0]",
"order"
] | a=list(input())
b=list(input())
c=list(input())
order='a'
while True:
if order=='a':
if len(a)==0:
print('A')
break
else:
order=a[0]
a=a[1:]
elif order=='b':
if len(b)==0:
print('B')
break
else:
order=b[0]
b=b[1:]
elif order=='c':
if len(c)==0:
print('C')
break
else:
order=c[0]
c=c[1:] |
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
4,
18,
4,
18,
4,
18,
13,
13,
17,
17,
13,
17,
17,
13,
17,
17,
0,
13,
39,
28,
13,
13,
4,
18,
13,
13,
4,
13,
13,
0,
13,
4,
18,
4,
18,
4,
18,
13,
13,
17,
17,
13,
17,
17,
13,
17,
17,
0,
13,
39,
28,
13,
13,
4,
18,
13,
13,
4,
13,
13,
0,
13,
4,
18,
4,
18,
4,
18,
13,
13,
17,
17,
13,
17,
17,
13,
17,
17,
0,
13,
39,
28,
13,
13,
4,
18,
13,
13,
4,
13,
13,
0,
13,
39,
13,
13,
13,
0,
13,
17,
0,
13,
17,
42,
40,
18,
13,
13,
39,
0,
13,
18,
18,
13,
13,
17,
0,
18,
13,
13,
18,
18,
13,
13,
39,
17,
0,
13,
13,
0,
13,
39,
17,
17,
17,
4,
13,
18,
13,
13,
10,
4,
13,
10,
17,
13,
10,
17,
13,
10,
39,
13,
10,
4,
13,
10,
4,
13,
10,
39,
13,
10,
4,
13,
10,
4,
13,
10,
13,
13,
10,
39,
13,
10,
39,
13,
10,
39,
13,
10,
4,
13,
10,
18,
13
] | [
[
180,
2
],
[
177,
6
],
[
171,
10
],
[
156,
14
],
[
181,
21
],
[
174,
32
],
[
36,
35
],
[
157,
35
],
[
175,
39
],
[
35,
43
],
[
168,
45
],
[
178,
52
],
[
192,
63
],
[
67,
66
],
[
169,
66
],
[
193,
70
],
[
66,
74
],
[
195,
76
],
[
172,
83
],
[
189,
94
],
[
98,
97
],
[
196,
97
],
[
190,
101
],
[
97,
105
],
[
165,
107
],
[
159,
113
],
[
162,
116
],
[
132,
120
],
[
166,
121
],
[
160,
122
],
[
184,
122
],
[
198,
125
],
[
132,
127
],
[
166,
128
],
[
160,
129
],
[
184,
129
],
[
135,
132
],
[
166,
133
],
[
160,
134
],
[
184,
134
],
[
132,
136
],
[
166,
137
],
[
160,
138
],
[
184,
138
],
[
183,
142
],
[
199,
143
],
[
163,
143
],
[
186,
145
],
[
187,
153
],
[
184,
154
],
[
160,
154
],
[
156,
157
],
[
159,
160
],
[
162,
163
],
[
165,
166
],
[
168,
169
],
[
171,
172
],
[
174,
175
],
[
177,
178
],
[
180,
181
],
[
199,
183
],
[
163,
183
],
[
183,
184
],
[
186,
187
],
[
189,
190
],
[
192,
193
],
[
195,
196
],
[
198,
199
]
] | [
"a=input()\nb=input()\nc=input()\nA=a.replace('a','0').replace('b','1').replace('c','2')\nlist0=[]\nfor a in A:\n list0.append(int(a))\nB=b.replace('a','0').replace('b','1').replace('c','2')\nlist1=[]\nfor b in B:\n list1.append(int(b))\nC=c.replace('a','0').replace('b','1').replace('c','2')\nlist2=[]\nfor c in C:\n list2.append(int(c))\nL=[list0,list1,list2]\n# print(L)\n# print(list0,list1,list2)\n\nturn=0\nnextturn=0\n\nwhile L[turn]!=[]:\n nextturn=L[turn][0]\n L[turn]=L[turn][1:]\n turn=nextturn\n\nansarr=['A','B','C']\nprint(ansarr[turn])",
"a=input()",
"a",
"input()",
"input",
"b=input()",
"b",
"input()",
"input",
"c=input()",
"c",
"input()",
"input",
"A=a.replace('a','0').replace('b','1').replace('c','2')",
"A",
"a.replace('a','0').replace('b','1').replace('c','2')",
"a.replace('a','0').replace('b','1').replace",
"a.replace('a','0').replace('b','1')",
"a.replace('a','0').replace",
"a.replace('a','0')",
"a.replace",
"a",
"replace",
"'a'",
"'0'",
"replace",
"'b'",
"'1'",
"replace",
"'c'",
"'2'",
"list0=[]",
"list0",
"[]",
"for a in A:\n list0.append(int(a))",
"a",
"A",
"list0.append(int(a))",
"list0.append",
"list0",
"append",
"int(a)",
"int",
"a",
"B=b.replace('a','0').replace('b','1').replace('c','2')",
"B",
"b.replace('a','0').replace('b','1').replace('c','2')",
"b.replace('a','0').replace('b','1').replace",
"b.replace('a','0').replace('b','1')",
"b.replace('a','0').replace",
"b.replace('a','0')",
"b.replace",
"b",
"replace",
"'a'",
"'0'",
"replace",
"'b'",
"'1'",
"replace",
"'c'",
"'2'",
"list1=[]",
"list1",
"[]",
"for b in B:\n list1.append(int(b))",
"b",
"B",
"list1.append(int(b))",
"list1.append",
"list1",
"append",
"int(b)",
"int",
"b",
"C=c.replace('a','0').replace('b','1').replace('c','2')",
"C",
"c.replace('a','0').replace('b','1').replace('c','2')",
"c.replace('a','0').replace('b','1').replace",
"c.replace('a','0').replace('b','1')",
"c.replace('a','0').replace",
"c.replace('a','0')",
"c.replace",
"c",
"replace",
"'a'",
"'0'",
"replace",
"'b'",
"'1'",
"replace",
"'c'",
"'2'",
"list2=[]",
"list2",
"[]",
"for c in C:\n list2.append(int(c))",
"c",
"C",
"list2.append(int(c))",
"list2.append",
"list2",
"append",
"int(c)",
"int",
"c",
"L=[list0,list1,list2]",
"L",
"[list0,list1,list2]",
"list0",
"list1",
"list2",
"turn=0",
"turn",
"0",
"nextturn=0",
"nextturn",
"0",
"while L[turn]!=[]:\n nextturn=L[turn][0]\n L[turn]=L[turn][1:]\n turn=nextturn",
"L[turn]!=[]",
"L[turn]",
"L",
"turn",
"[]",
"nextturn=L[turn][0]",
"nextturn",
"L[turn][0]",
"[turn]",
"L",
"turn",
"0",
"L[turn]=L[turn][1:]",
"L[turn]",
"L",
"turn",
"L[turn][1:]",
"[turn]",
"L",
"turn",
"1:",
"1",
"turn=nextturn",
"turn",
"nextturn",
"ansarr=['A','B','C']",
"ansarr",
"['A','B','C']",
"'A'",
"'B'",
"'C'",
"print(ansarr[turn])",
"print",
"ansarr[turn]",
"ansarr",
"turn",
"A=a.replace('a','0').replace('b','1').replace('c','2')",
"a.replace('a','0').replace('b','1').replace('c','2')",
"A",
"turn=0",
"0",
"turn",
"nextturn=0",
"0",
"nextturn",
"L=[list0,list1,list2]",
"[list0,list1,list2]",
"L",
"B=b.replace('a','0').replace('b','1').replace('c','2')",
"b.replace('a','0').replace('b','1').replace('c','2')",
"B",
"c=input()",
"input()",
"c",
"list0=[]",
"[]",
"list0",
"b=input()",
"input()",
"b",
"a=input()",
"input()",
"a",
"turn=nextturn",
"nextturn",
"turn",
"ansarr=['A','B','C']",
"['A','B','C']",
"ansarr",
"list2=[]",
"[]",
"list2",
"list1=[]",
"[]",
"list1",
"C=c.replace('a','0').replace('b','1').replace('c','2')",
"c.replace('a','0').replace('b','1').replace('c','2')",
"C",
"nextturn=L[turn][0]",
"L[turn][0]",
"nextturn"
] | a=input()
b=input()
c=input()
A=a.replace('a','0').replace('b','1').replace('c','2')
list0=[]
for a in A:
list0.append(int(a))
B=b.replace('a','0').replace('b','1').replace('c','2')
list1=[]
for b in B:
list1.append(int(b))
C=c.replace('a','0').replace('b','1').replace('c','2')
list2=[]
for c in C:
list2.append(int(c))
L=[list0,list1,list2]
# print(L)
# print(list0,list1,list2)
turn=0
nextturn=0
while L[turn]!=[]:
nextturn=L[turn][0]
L[turn]=L[turn][1:]
turn=nextturn
ansarr=['A','B','C']
print(ansarr[turn]) |
[
7,
0,
13,
2,
4,
13,
4,
13,
13,
4,
13,
39,
17,
0,
13,
2,
4,
13,
4,
13,
13,
4,
13,
39,
17,
0,
13,
2,
4,
13,
4,
13,
13,
4,
13,
39,
17,
0,
13,
17,
0,
13,
17,
42,
2,
2,
40,
4,
13,
13,
17,
40,
4,
13,
13,
17,
40,
4,
13,
13,
17,
14,
2,
13,
17,
0,
13,
18,
13,
17,
4,
18,
13,
13,
17,
0,
13,
17,
14,
2,
13,
17,
0,
13,
18,
13,
17,
4,
18,
13,
13,
17,
0,
13,
17,
0,
13,
18,
13,
17,
4,
18,
13,
13,
17,
0,
13,
17,
4,
13,
13,
10,
17,
13,
10,
2,
13,
10,
18,
13,
10,
2,
13,
10,
18,
13,
10,
17,
13,
10,
18,
13,
10,
2,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13
] | [
[
115,
2
],
[
121,
14
],
[
133,
26
],
[
142,
38
],
[
127,
41
],
[
116,
49
],
[
122,
54
],
[
134,
59
],
[
143,
63
],
[
119,
63
],
[
131,
63
],
[
125,
63
],
[
124,
66
],
[
116,
68
],
[
116,
72
],
[
139,
76
],
[
143,
80
],
[
119,
80
],
[
131,
80
],
[
125,
80
],
[
130,
83
],
[
122,
85
],
[
122,
89
],
[
112,
93
],
[
118,
96
],
[
134,
98
],
[
134,
102
],
[
136,
106
],
[
137,
110
],
[
113,
110
],
[
140,
110
],
[
128,
110
],
[
112,
113
],
[
115,
116
],
[
118,
119
],
[
121,
122
],
[
124,
125
],
[
127,
128
],
[
130,
131
],
[
133,
134
],
[
136,
137
],
[
139,
140
],
[
142,
143
]
] | [
"a = list(map(str, input()))+['a']\nb = list(map(str, input()))+['b']\nc = list(map(str, input()))+['c']\nnow = 'a'\nans = 'A'\nwhile len(a) != 0 and len(b) != 0 and len(c) != 0:\n if now == 'a':\n now = a[0]\n a.pop(0)\n ans = 'A'\n elif now == 'b':\n now = b[0]\n b.pop(0)\n ans = 'B'\n else:\n now = c[0]\n c.pop(0)\n ans = 'C'\nprint(ans)\n ",
"a = list(map(str, input()))+['a']",
"a",
"list(map(str, input()))+['a']",
"list(map(str, input()))",
"list",
"map(str, input())",
"map",
"str",
"input()",
"input",
"['a']",
"'a'",
"b = list(map(str, input()))+['b']",
"b",
"list(map(str, input()))+['b']",
"list(map(str, input()))",
"list",
"map(str, input())",
"map",
"str",
"input()",
"input",
"['b']",
"'b'",
"c = list(map(str, input()))+['c']",
"c",
"list(map(str, input()))+['c']",
"list(map(str, input()))",
"list",
"map(str, input())",
"map",
"str",
"input()",
"input",
"['c']",
"'c'",
"now = 'a'",
"now",
"'a'",
"ans = 'A'",
"ans",
"'A'",
"while len(a) != 0 and len(b) != 0 and len(c) != 0:\n if now == 'a':\n now = a[0]\n a.pop(0)\n ans = 'A'\n elif now == 'b':\n now = b[0]\n b.pop(0)\n ans = 'B'\n else:\n now = c[0]\n c.pop(0)\n ans = 'C'",
"len(a) != 0 and len(b) != 0 and len(c) != 0",
"len(a) != 0 and len(b) != 0",
"len(a) != 0",
"len(a)",
"len",
"a",
"0",
"len(b) != 0",
"len(b)",
"len",
"b",
"0",
"len(c) != 0",
"len(c)",
"len",
"c",
"0",
"if now == 'a':\n now = a[0]\n a.pop(0)\n ans = 'A'\n elif now == 'b':\n now = b[0]\n b.pop(0)\n ans = 'B'\n else:\n now = c[0]\n c.pop(0)\n ans = 'C'",
"now == 'a'",
"now",
"'a'",
"now = a[0]",
"now",
"a[0]",
"a",
"0",
"a.pop(0)",
"a.pop",
"a",
"pop",
"0",
"ans = 'A'",
"ans",
"'A'",
"elif now == 'b':\n now = b[0]\n b.pop(0)\n ans = 'B'\n ",
"now == 'b'",
"now",
"'b'",
"now = b[0]",
"now",
"b[0]",
"b",
"0",
"b.pop(0)",
"b.pop",
"b",
"pop",
"0",
"ans = 'B'",
"ans",
"'B'",
"now = c[0]",
"now",
"c[0]",
"c",
"0",
"c.pop(0)",
"c.pop",
"c",
"pop",
"0",
"ans = 'C'",
"ans",
"'C'",
"print(ans)",
"print",
"ans",
"ans = 'B'",
"'B'",
"ans",
"a = list(map(str, input()))+['a']",
"list(map(str, input()))+['a']",
"a",
"now = c[0]",
"c[0]",
"now",
"b = list(map(str, input()))+['b']",
"list(map(str, input()))+['b']",
"b",
"now = a[0]",
"a[0]",
"now",
"ans = 'A'",
"'A'",
"ans",
"now = b[0]",
"b[0]",
"now",
"c = list(map(str, input()))+['c']",
"list(map(str, input()))+['c']",
"c",
"ans = 'C'",
"'C'",
"ans",
"ans = 'A'",
"'A'",
"ans",
"now = 'a'",
"'a'",
"now"
] | a = list(map(str, input()))+['a']
b = list(map(str, input()))+['b']
c = list(map(str, input()))+['c']
now = 'a'
ans = 'A'
while len(a) != 0 and len(b) != 0 and len(c) != 0:
if now == 'a':
now = a[0]
a.pop(0)
ans = 'A'
elif now == 'b':
now = b[0]
b.pop(0)
ans = 'B'
else:
now = c[0]
c.pop(0)
ans = 'C'
print(ans)
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
41,
28,
13,
13,
4,
2,
4,
13,
13,
17,
0,
13,
39,
13,
13,
13,
0,
13,
17,
0,
13,
17,
42,
13,
14,
40,
18,
13,
13,
39,
0,
13,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
13,
17,
0,
13,
13,
14,
2,
13,
17,
0,
13,
17,
14,
2,
13,
17,
0,
13,
17,
0,
13,
17,
3,
4,
13,
13,
10,
18,
13,
10,
4,
13,
10,
17,
13,
10,
13,
13,
10,
17,
13,
10,
4,
13,
10,
17,
13,
10,
17,
13,
10,
39,
13,
10,
4,
13,
10,
17,
13
] | [
[
91,
2
],
[
103,
8
],
[
115,
14
],
[
22,
21
],
[
92,
21
],
[
21,
27
],
[
112,
30
],
[
100,
36
],
[
109,
39
],
[
113,
46
],
[
110,
47
],
[
98,
47
],
[
88,
50
],
[
113,
53
],
[
110,
54
],
[
98,
54
],
[
113,
59
],
[
110,
60
],
[
98,
60
],
[
97,
64
],
[
89,
65
],
[
110,
68
],
[
98,
68
],
[
94,
71
],
[
110,
75
],
[
98,
75
],
[
106,
78
],
[
118,
81
],
[
119,
86
],
[
107,
86
],
[
95,
86
],
[
88,
89
],
[
91,
92
],
[
94,
95
],
[
89,
97
],
[
97,
98
],
[
100,
101
],
[
103,
104
],
[
106,
107
],
[
109,
110
],
[
112,
113
],
[
115,
116
],
[
118,
119
]
] | [
"Sa = str(input())\nSb = str(input())\nSc = str(input())\nS = [[ord(i)-97 for i in Sa], [ord(i)-97 for i in Sb], [ord(i)-97 for i in Sc]]\n\nflag = True\nwho = 0\nwhile flag:\n if S[who] != []:\n tmp = S[who][0]\n S[who].pop(0)\n who = tmp\n else:\n if who == 0:\n ans = 'A'\n elif who == 1:\n ans = 'B'\n else:\n ans = 'C'\n break\nprint(ans)",
"Sa = str(input())",
"Sa",
"str(input())",
"str",
"input()",
"input",
"Sb = str(input())",
"Sb",
"str(input())",
"str",
"input()",
"input",
"Sc = str(input())",
"Sc",
"str(input())",
"str",
"input()",
"input",
"ord(i)-97 for i in Sa",
"for i in Sa",
"i",
"Sa",
"for i in Sa",
"ord(i)-97",
"ord(i)",
"ord",
"i",
"97",
"S = [[ord(i)-97 for i in Sa], [ord(i)-97 for i in Sb], [ord(i)-97 for i in Sc]]",
"S",
"[[ord(i)-97 for i in Sa], [ord(i)-97 for i in Sb], [ord(i)-97 for i in Sc]]",
"[ord(i)-97 for i in Sa]",
"[ord(i)-97 for i in Sb]",
"[ord(i)-97 for i in Sc]",
"flag = True",
"flag",
"True",
"who = 0",
"who",
"0",
"while flag:\n if S[who] != []:\n tmp = S[who][0]\n S[who].pop(0)\n who = tmp\n else:\n if who == 0:\n ans = 'A'\n elif who == 1:\n ans = 'B'\n else:\n ans = 'C'\n break",
"flag",
"if S[who] != []:\n tmp = S[who][0]\n S[who].pop(0)\n who = tmp\n else:\n if who == 0:\n ans = 'A'\n elif who == 1:\n ans = 'B'\n else:\n ans = 'C'\n break",
"S[who] != []",
"S[who]",
"S",
"who",
"[]",
"tmp = S[who][0]",
"tmp",
"S[who][0]",
"[who]",
"S",
"who",
"0",
"S[who].pop(0)",
"[who].pop",
"[who]",
"S",
"who",
"pop",
"0",
"who = tmp",
"who",
"tmp",
"if who == 0:\n ans = 'A'\n elif who == 1:\n ans = 'B'\n else:\n ans = 'C'\n ",
"who == 0",
"who",
"0",
"ans = 'A'",
"ans",
"'A'",
"elif who == 1:\n ans = 'B'\n ",
"who == 1",
"who",
"1",
"ans = 'B'",
"ans",
"'B'",
"ans = 'C'",
"ans",
"'C'",
"break",
"print(ans)",
"print",
"ans",
"tmp = S[who][0]",
"S[who][0]",
"tmp",
"Sa = str(input())",
"str(input())",
"Sa",
"ans = 'A'",
"'A'",
"ans",
"who = tmp",
"tmp",
"who",
"flag = True",
"True",
"flag",
"Sb = str(input())",
"str(input())",
"Sb",
"ans = 'B'",
"'B'",
"ans",
"who = 0",
"0",
"who",
"S = [[ord(i)-97 for i in Sa], [ord(i)-97 for i in Sb], [ord(i)-97 for i in Sc]]",
"[[ord(i)-97 for i in Sa], [ord(i)-97 for i in Sb], [ord(i)-97 for i in Sc]]",
"S",
"Sc = str(input())",
"str(input())",
"Sc",
"ans = 'C'",
"'C'",
"ans"
] | Sa = str(input())
Sb = str(input())
Sc = str(input())
S = [[ord(i)-97 for i in Sa], [ord(i)-97 for i in Sb], [ord(i)-97 for i in Sc]]
flag = True
who = 0
while flag:
if S[who] != []:
tmp = S[who][0]
S[who].pop(0)
who = tmp
else:
if who == 0:
ans = 'A'
elif who == 1:
ans = 'B'
else:
ans = 'C'
break
print(ans) |
[
7,
15,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
17,
0,
13,
17,
42,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
0,
13,
17,
3,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
0,
13,
17,
14,
2,
13,
17,
0,
13,
17,
14,
2,
13,
17,
0,
13,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
0,
13,
17,
3,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
0,
13,
17,
14,
2,
13,
17,
0,
13,
17,
14,
2,
13,
17,
0,
13,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
0,
13,
17,
3,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
0,
13,
17,
14,
2,
13,
17,
0,
13,
17,
14,
2,
13,
17,
0,
13,
17,
4,
13,
13,
10,
4,
13,
10,
17,
13,
10,
17,
13,
10,
4,
13,
10,
17,
13,
10,
17,
13,
10,
4,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13
] | [
[
164,
3
],
[
206,
9
],
[
155,
15
],
[
200,
21
],
[
197,
24
],
[
198,
30
],
[
204,
30
],
[
183,
30
],
[
159,
30
],
[
192,
30
],
[
171,
30
],
[
180,
30
],
[
186,
30
],
[
162,
30
],
[
168,
30
],
[
165,
36
],
[
176,
39
],
[
173,
43
],
[
165,
46
],
[
174,
50
],
[
167,
53
],
[
174,
57
],
[
161,
60
],
[
174,
64
],
[
185,
67
],
[
198,
71
],
[
204,
71
],
[
183,
71
],
[
159,
71
],
[
192,
71
],
[
171,
71
],
[
180,
71
],
[
186,
71
],
[
162,
71
],
[
168,
71
],
[
207,
77
],
[
188,
80
],
[
212,
84
],
[
207,
87
],
[
213,
91
],
[
179,
94
],
[
213,
98
],
[
170,
101
],
[
213,
105
],
[
191,
108
],
[
198,
112
],
[
204,
112
],
[
183,
112
],
[
159,
112
],
[
192,
112
],
[
171,
112
],
[
180,
112
],
[
186,
112
],
[
162,
112
],
[
168,
112
],
[
156,
118
],
[
194,
121
],
[
209,
125
],
[
156,
128
],
[
210,
132
],
[
158,
135
],
[
210,
139
],
[
182,
142
],
[
210,
146
],
[
203,
149
],
[
195,
153
],
[
189,
153
],
[
177,
153
],
[
155,
156
],
[
158,
159
],
[
161,
162
],
[
164,
165
],
[
167,
168
],
[
170,
171
],
[
173,
174
],
[
176,
177
],
[
179,
180
],
[
182,
183
],
[
185,
186
],
[
188,
189
],
[
191,
192
],
[
194,
195
],
[
197,
198
],
[
200,
201
],
[
203,
204
],
[
206,
207
],
[
209,
210
],
[
212,
213
]
] | [
"from collections import deque\na = deque(input())\nb = deque(input())\nc = deque(input())\n\ni = 0\nturn = 'a'\nwhile True:\n if turn == 'a':\n if len(a) == 0:\n ans = 'A'\n break\n a0 = a.popleft()\n if a0 == 'a':\n turn = 'a'\n elif a0 == 'b':\n turn = 'b'\n elif a0 == 'c':\n turn = 'c'\n elif turn == 'b':\n if len(b) == 0:\n ans = 'B'\n break\n b0 = b.popleft()\n if b0 == 'a':\n turn = 'a'\n elif b0 == 'b':\n turn = 'b'\n elif b0 == 'c':\n turn = 'c'\n elif turn == 'c':\n if len(c) == 0:\n ans = 'C'\n break\n c0 = c.popleft()\n if c0 == 'a':\n turn = 'a'\n elif c0 == 'b':\n turn = 'b'\n elif c0 == 'c':\n turn = 'c'\nprint(ans)",
"from collections import deque",
"a = deque(input())",
"a",
"deque(input())",
"deque",
"input()",
"input",
"b = deque(input())",
"b",
"deque(input())",
"deque",
"input()",
"input",
"c = deque(input())",
"c",
"deque(input())",
"deque",
"input()",
"input",
"i = 0",
"i",
"0",
"turn = 'a'",
"turn",
"'a'",
"while True:\n if turn == 'a':\n if len(a) == 0:\n ans = 'A'\n break\n a0 = a.popleft()\n if a0 == 'a':\n turn = 'a'\n elif a0 == 'b':\n turn = 'b'\n elif a0 == 'c':\n turn = 'c'\n elif turn == 'b':\n if len(b) == 0:\n ans = 'B'\n break\n b0 = b.popleft()\n if b0 == 'a':\n turn = 'a'\n elif b0 == 'b':\n turn = 'b'\n elif b0 == 'c':\n turn = 'c'\n elif turn == 'c':\n if len(c) == 0:\n ans = 'C'\n break\n c0 = c.popleft()\n if c0 == 'a':\n turn = 'a'\n elif c0 == 'b':\n turn = 'b'\n elif c0 == 'c':\n turn = 'c'",
"True",
"if turn == 'a':\n if len(a) == 0:\n ans = 'A'\n break\n a0 = a.popleft()\n if a0 == 'a':\n turn = 'a'\n elif a0 == 'b':\n turn = 'b'\n elif a0 == 'c':\n turn = 'c'\n elif turn == 'b':\n if len(b) == 0:\n ans = 'B'\n break\n b0 = b.popleft()\n if b0 == 'a':\n turn = 'a'\n elif b0 == 'b':\n turn = 'b'\n elif b0 == 'c':\n turn = 'c'\n elif turn == 'c':\n if len(c) == 0:\n ans = 'C'\n break\n c0 = c.popleft()\n if c0 == 'a':\n turn = 'a'\n elif c0 == 'b':\n turn = 'b'\n elif c0 == 'c':\n turn = 'c'",
"turn == 'a'",
"turn",
"'a'",
"if len(a) == 0:\n ans = 'A'\n break\n ",
"len(a) == 0",
"len(a)",
"len",
"a",
"0",
"ans = 'A'",
"ans",
"'A'",
"break",
"a0 = a.popleft()",
"a0",
"a.popleft()",
"a.popleft",
"a",
"popleft",
"if a0 == 'a':\n turn = 'a'\n elif a0 == 'b':\n turn = 'b'\n elif a0 == 'c':\n turn = 'c'\n ",
"a0 == 'a'",
"a0",
"'a'",
"turn = 'a'",
"turn",
"'a'",
"elif a0 == 'b':\n turn = 'b'\n ",
"a0 == 'b'",
"a0",
"'b'",
"turn = 'b'",
"turn",
"'b'",
"elif a0 == 'c':\n turn = 'c'\n ",
"a0 == 'c'",
"a0",
"'c'",
"turn = 'c'",
"turn",
"'c'",
"elif turn == 'b':\n if len(b) == 0:\n ans = 'B'\n break\n b0 = b.popleft()\n if b0 == 'a':\n turn = 'a'\n elif b0 == 'b':\n turn = 'b'\n elif b0 == 'c':\n turn = 'c'\n ",
"turn == 'b'",
"turn",
"'b'",
"if len(b) == 0:\n ans = 'B'\n break\n ",
"len(b) == 0",
"len(b)",
"len",
"b",
"0",
"ans = 'B'",
"ans",
"'B'",
"break",
"b0 = b.popleft()",
"b0",
"b.popleft()",
"b.popleft",
"b",
"popleft",
"if b0 == 'a':\n turn = 'a'\n elif b0 == 'b':\n turn = 'b'\n elif b0 == 'c':\n turn = 'c'\n ",
"b0 == 'a'",
"b0",
"'a'",
"turn = 'a'",
"turn",
"'a'",
"elif b0 == 'b':\n turn = 'b'\n ",
"b0 == 'b'",
"b0",
"'b'",
"turn = 'b'",
"turn",
"'b'",
"elif b0 == 'c':\n turn = 'c'\n ",
"b0 == 'c'",
"b0",
"'c'",
"turn = 'c'",
"turn",
"'c'",
"elif turn == 'c':\n if len(c) == 0:\n ans = 'C'\n break\n c0 = c.popleft()\n if c0 == 'a':\n turn = 'a'\n elif c0 == 'b':\n turn = 'b'\n elif c0 == 'c':\n turn = 'c'",
"turn == 'c'",
"turn",
"'c'",
"if len(c) == 0:\n ans = 'C'\n break\n ",
"len(c) == 0",
"len(c)",
"len",
"c",
"0",
"ans = 'C'",
"ans",
"'C'",
"break",
"c0 = c.popleft()",
"c0",
"c.popleft()",
"c.popleft",
"c",
"popleft",
"if c0 == 'a':\n turn = 'a'\n elif c0 == 'b':\n turn = 'b'\n elif c0 == 'c':\n turn = 'c'",
"c0 == 'a'",
"c0",
"'a'",
"turn = 'a'",
"turn",
"'a'",
"elif c0 == 'b':\n turn = 'b'\n ",
"c0 == 'b'",
"c0",
"'b'",
"turn = 'b'",
"turn",
"'b'",
"elif c0 == 'c':\n turn = 'c'",
"c0 == 'c'",
"c0",
"'c'",
"turn = 'c'",
"turn",
"'c'",
"print(ans)",
"print",
"ans",
"c = deque(input())",
"deque(input())",
"c",
"turn = 'a'",
"'a'",
"turn",
"turn = 'b'",
"'b'",
"turn",
"a = deque(input())",
"deque(input())",
"a",
"turn = 'a'",
"'a'",
"turn",
"turn = 'b'",
"'b'",
"turn",
"a0 = a.popleft()",
"a.popleft()",
"a0",
"ans = 'A'",
"'A'",
"ans",
"turn = 'a'",
"'a'",
"turn",
"turn = 'b'",
"'b'",
"turn",
"turn = 'c'",
"'c'",
"turn",
"ans = 'B'",
"'B'",
"ans",
"turn = 'c'",
"'c'",
"turn",
"ans = 'C'",
"'C'",
"ans",
"turn = 'a'",
"'a'",
"turn",
"i = 0",
"0",
"i",
"turn = 'c'",
"'c'",
"turn",
"b = deque(input())",
"deque(input())",
"b",
"c0 = c.popleft()",
"c.popleft()",
"c0",
"b0 = b.popleft()",
"b.popleft()",
"b0"
] | from collections import deque
a = deque(input())
b = deque(input())
c = deque(input())
i = 0
turn = 'a'
while True:
if turn == 'a':
if len(a) == 0:
ans = 'A'
break
a0 = a.popleft()
if a0 == 'a':
turn = 'a'
elif a0 == 'b':
turn = 'b'
elif a0 == 'c':
turn = 'c'
elif turn == 'b':
if len(b) == 0:
ans = 'B'
break
b0 = b.popleft()
if b0 == 'a':
turn = 'a'
elif b0 == 'b':
turn = 'b'
elif b0 == 'c':
turn = 'c'
elif turn == 'c':
if len(c) == 0:
ans = 'C'
break
c0 = c.popleft()
if c0 == 'a':
turn = 'a'
elif c0 == 'b':
turn = 'b'
elif c0 == 'c':
turn = 'c'
print(ans) |
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
39,
4,
18,
13,
13,
4,
18,
4,
18,
4,
18,
13,
13,
17,
17,
13,
17,
17,
13,
17,
17,
4,
18,
13,
13,
4,
18,
4,
18,
4,
18,
13,
13,
17,
17,
13,
17,
17,
13,
17,
17,
4,
18,
13,
13,
4,
18,
4,
18,
4,
18,
13,
13,
17,
17,
13,
17,
17,
13,
17,
17,
0,
13,
17,
42,
40,
18,
13,
13,
17,
0,
13,
4,
13,
18,
18,
13,
13,
17,
0,
18,
13,
13,
18,
18,
13,
13,
39,
17,
0,
13,
13,
0,
13,
17,
4,
13,
18,
13,
13,
10,
4,
13,
10,
4,
13,
10,
39,
13,
10,
4,
13,
10,
17,
13,
10,
4,
13,
10,
17,
13,
10,
13,
13
] | [
[
125,
2
],
[
116,
6
],
[
131,
10
],
[
122,
14
],
[
123,
18
],
[
126,
26
],
[
123,
38
],
[
117,
46
],
[
123,
58
],
[
132,
66
],
[
134,
77
],
[
95,
81
],
[
123,
82
],
[
135,
83
],
[
138,
83
],
[
119,
86
],
[
95,
90
],
[
123,
91
],
[
135,
92
],
[
138,
92
],
[
98,
95
],
[
123,
96
],
[
135,
97
],
[
138,
97
],
[
95,
99
],
[
123,
100
],
[
135,
101
],
[
138,
101
],
[
137,
105
],
[
120,
106
],
[
128,
108
],
[
129,
113
],
[
138,
114
],
[
135,
114
],
[
116,
117
],
[
119,
120
],
[
122,
123
],
[
125,
126
],
[
128,
129
],
[
131,
132
],
[
134,
135
],
[
120,
137
],
[
137,
138
]
] | [
"sa = input()\nsb = input()\nsc = input()\ns = []\ns.append(sa.replace('a', '0').replace('b', '1').replace('c', '2'))\ns.append(sb.replace('a', '0').replace('b', '1').replace('c', '2'))\ns.append(sc.replace('a', '0').replace('b', '1').replace('c', '2'))\ni = 0\nwhile s[i]!='':\n j = int(s[i][0])\n s[i] = s[i][1:]\n i = j\nans = 'ABC'\n\nprint(ans[i])",
"sa = input()",
"sa",
"input()",
"input",
"sb = input()",
"sb",
"input()",
"input",
"sc = input()",
"sc",
"input()",
"input",
"s = []",
"s",
"[]",
"s.append(sa.replace('a', '0').replace('b', '1').replace('c', '2'))",
"s.append",
"s",
"append",
"sa.replace('a', '0').replace('b', '1').replace('c', '2')",
"sa.replace('a', '0').replace('b', '1').replace",
"sa.replace('a', '0').replace('b', '1')",
"sa.replace('a', '0').replace",
"sa.replace('a', '0')",
"sa.replace",
"sa",
"replace",
"'a'",
"'0'",
"replace",
"'b'",
"'1'",
"replace",
"'c'",
"'2'",
"s.append(sb.replace('a', '0').replace('b', '1').replace('c', '2'))",
"s.append",
"s",
"append",
"sb.replace('a', '0').replace('b', '1').replace('c', '2')",
"sb.replace('a', '0').replace('b', '1').replace",
"sb.replace('a', '0').replace('b', '1')",
"sb.replace('a', '0').replace",
"sb.replace('a', '0')",
"sb.replace",
"sb",
"replace",
"'a'",
"'0'",
"replace",
"'b'",
"'1'",
"replace",
"'c'",
"'2'",
"s.append(sc.replace('a', '0').replace('b', '1').replace('c', '2'))",
"s.append",
"s",
"append",
"sc.replace('a', '0').replace('b', '1').replace('c', '2')",
"sc.replace('a', '0').replace('b', '1').replace",
"sc.replace('a', '0').replace('b', '1')",
"sc.replace('a', '0').replace",
"sc.replace('a', '0')",
"sc.replace",
"sc",
"replace",
"'a'",
"'0'",
"replace",
"'b'",
"'1'",
"replace",
"'c'",
"'2'",
"i = 0",
"i",
"0",
"while s[i]!='':\n j = int(s[i][0])\n s[i] = s[i][1:]\n i = j",
"s[i]!=''",
"s[i]",
"s",
"i",
"''",
"j = int(s[i][0])",
"j",
"int(s[i][0])",
"int",
"s[i][0]",
"[i]",
"s",
"i",
"0",
"s[i] = s[i][1:]",
"s[i]",
"s",
"i",
"s[i][1:]",
"[i]",
"s",
"i",
"1:",
"1",
"i = j",
"i",
"j",
"ans = 'ABC'",
"ans",
"'ABC'",
"print(ans[i])",
"print",
"ans[i]",
"ans",
"i",
"sb = input()",
"input()",
"sb",
"j = int(s[i][0])",
"int(s[i][0])",
"j",
"s = []",
"[]",
"s",
"sa = input()",
"input()",
"sa",
"ans = 'ABC'",
"'ABC'",
"ans",
"sc = input()",
"input()",
"sc",
"i = 0",
"0",
"i",
"i = j",
"j",
"i"
] | sa = input()
sb = input()
sc = input()
s = []
s.append(sa.replace('a', '0').replace('b', '1').replace('c', '2'))
s.append(sb.replace('a', '0').replace('b', '1').replace('c', '2'))
s.append(sc.replace('a', '0').replace('b', '1').replace('c', '2'))
i = 0
while s[i]!='':
j = int(s[i][0])
s[i] = s[i][1:]
i = j
ans = 'ABC'
print(ans[i]) |
[
7,
15,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
21,
22,
17,
13,
22,
17,
13,
22,
17,
13,
0,
13,
4,
18,
13,
13,
42,
17,
14,
2,
4,
13,
18,
13,
13,
17,
4,
13,
4,
18,
13,
13,
4,
13,
0,
13,
4,
18,
18,
13,
13,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
21,
13
] | [
[
68,
3
],
[
77,
9
],
[
71,
15
],
[
80,
21
],
[
65,
33
],
[
69,
36
],
[
81,
45
],
[
66,
46
],
[
75,
46
],
[
66,
52
],
[
75,
52
],
[
74,
57
],
[
81,
61
],
[
66,
62
],
[
75,
62
],
[
65,
66
],
[
68,
69
],
[
71,
72
],
[
74,
75
],
[
77,
78
],
[
80,
81
]
] | [
"from collections import deque\naq = deque(input())\nbq = deque(input())\ncq = deque(input())\nd={\"a\":aq,\"b\":bq,\"c\":cq}\np=aq.popleft()\nwhile True:\n if len(d[p])==0:\n print(p.upper())\n exit()\n p=d[p].popleft()",
"from collections import deque",
"aq = deque(input())",
"aq",
"deque(input())",
"deque",
"input()",
"input",
"bq = deque(input())",
"bq",
"deque(input())",
"deque",
"input()",
"input",
"cq = deque(input())",
"cq",
"deque(input())",
"deque",
"input()",
"input",
"d={\"a\":aq,\"b\":bq,\"c\":cq}",
"d",
"{\"a\":aq,\"b\":bq,\"c\":cq}",
"\"a\"",
"\"a\"",
"aq",
"\"b\"",
"\"b\"",
"bq",
"\"c\"",
"\"c\"",
"cq",
"p=aq.popleft()",
"p",
"aq.popleft()",
"aq.popleft",
"aq",
"popleft",
"while True:\n if len(d[p])==0:\n print(p.upper())\n exit()\n p=d[p].popleft()",
"True",
"if len(d[p])==0:\n print(p.upper())\n exit()\n ",
"len(d[p])==0",
"len(d[p])",
"len",
"d[p]",
"d",
"p",
"0",
"print(p.upper())",
"print",
"p.upper()",
"p.upper",
"p",
"upper",
"exit()",
"exit",
"p=d[p].popleft()",
"p",
"d[p].popleft()",
"[p].popleft",
"[p]",
"d",
"p",
"popleft",
"p=aq.popleft()",
"aq.popleft()",
"p",
"aq = deque(input())",
"deque(input())",
"aq",
"cq = deque(input())",
"deque(input())",
"cq",
"p=d[p].popleft()",
"d[p].popleft()",
"p",
"bq = deque(input())",
"deque(input())",
"bq",
"d={\"a\":aq,\"b\":bq,\"c\":cq}",
"{\"a\":aq,\"b\":bq,\"c\":cq}",
"d"
] | from collections import deque
aq = deque(input())
bq = deque(input())
cq = deque(input())
d={"a":aq,"b":bq,"c":cq}
p=aq.popleft()
while True:
if len(d[p])==0:
print(p.upper())
exit()
p=d[p].popleft() |
[
7,
41,
28,
13,
4,
13,
17,
4,
4,
13,
0,
13,
13,
0,
13,
17,
0,
13,
39,
17,
17,
17,
0,
13,
21,
22,
17,
17,
22,
17,
17,
22,
17,
17,
42,
17,
38,
5,
3,
0,
13,
18,
13,
18,
18,
13,
13,
18,
13,
13,
0,
18,
13,
13,
17,
0,
13,
13,
4,
13,
18,
17,
13,
10,
13,
13,
10,
13,
13,
10,
21,
13,
10,
39,
13,
10,
18,
13,
10,
17,
13
] | [
[
4,
3
],
[
64,
11
],
[
79,
14
],
[
73,
17
],
[
70,
23
],
[
76,
40
],
[
71,
42
],
[
65,
45
],
[
80,
46
],
[
68,
46
],
[
51,
47
],
[
74,
48
],
[
80,
49
],
[
68,
49
],
[
54,
51
],
[
74,
52
],
[
80,
53
],
[
68,
53
],
[
67,
56
],
[
77,
57
],
[
68,
62
],
[
80,
62
],
[
64,
65
],
[
77,
67
],
[
67,
68
],
[
70,
71
],
[
73,
74
],
[
76,
77
],
[
79,
80
]
] | [
"S_s = [input() for _ in range(3)]\nturn = 0\npos = [0, 0, 0]\ndic = {\"a\":0, \"b\":1, \"c\":2}\nwhile 1:\n try:\n n_turn = dic[S_s[turn][pos[turn]]]\n pos[turn] += 1\n turn = n_turn\n except IndexError:\n break\nprint(\"ABC\"[turn])",
"input() for _ in range(3)",
"for _ in range(3)",
"_",
"range(3)",
"range",
"3",
"for _ in range(3)",
"input()",
"input",
"S_s = [input() for _ in range(3)]",
"S_s",
"[input() for _ in range(3)]",
"turn = 0",
"turn",
"0",
"pos = [0, 0, 0]",
"pos",
"[0, 0, 0]",
"0",
"0",
"0",
"dic = {\"a\":0, \"b\":1, \"c\":2}",
"dic",
"{\"a\":0, \"b\":1, \"c\":2}",
"\"a\"",
"\"a\"",
"0",
"\"b\"",
"\"b\"",
"1",
"\"c\"",
"\"c\"",
"2",
"while 1:\n try:\n n_turn = dic[S_s[turn][pos[turn]]]\n pos[turn] += 1\n turn = n_turn\n except IndexError:\n break",
"1",
"try:\n n_turn = dic[S_s[turn][pos[turn]]]\n pos[turn] += 1\n turn = n_turn\n except IndexError:\n break",
"except IndexError:\n break",
"break",
"n_turn = dic[S_s[turn][pos[turn]]]",
"n_turn",
"dic[S_s[turn][pos[turn]]]",
"dic",
"S_s[turn][pos[turn]]",
"[turn]",
"S_s",
"turn",
"pos[turn]",
"pos",
"turn",
"pos[turn] += 1",
"pos[turn]",
"pos",
"turn",
"1",
"turn = n_turn",
"turn",
"n_turn",
"print(\"ABC\"[turn])",
"print",
"\"ABC\"[turn]",
"\"ABC\"",
"turn",
"S_s = [input() for _ in range(3)]",
"[input() for _ in range(3)]",
"S_s",
"turn = n_turn",
"n_turn",
"turn",
"dic = {\"a\":0, \"b\":1, \"c\":2}",
"{\"a\":0, \"b\":1, \"c\":2}",
"dic",
"pos = [0, 0, 0]",
"[0, 0, 0]",
"pos",
"n_turn = dic[S_s[turn][pos[turn]]]",
"dic[S_s[turn][pos[turn]]]",
"n_turn",
"turn = 0",
"0",
"turn"
] | S_s = [input() for _ in range(3)]
turn = 0
pos = [0, 0, 0]
dic = {"a":0, "b":1, "c":2}
while 1:
try:
n_turn = dic[S_s[turn][pos[turn]]]
pos[turn] += 1
turn = n_turn
except IndexError:
break
print("ABC"[turn]) |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
17,
28,
13,
4,
13,
2,
4,
13,
13,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
3,
14,
2,
18,
13,
17,
17,
0,
13,
17,
14,
2,
18,
13,
17,
17,
0,
13,
17,
14,
2,
18,
13,
17,
17,
0,
13,
17,
4,
18,
13,
13,
18,
13,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
3,
14,
2,
18,
13,
17,
17,
0,
13,
17,
14,
2,
18,
13,
17,
17,
0,
13,
17,
14,
2,
18,
13,
17,
17,
0,
13,
17,
4,
18,
13,
13,
18,
13,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
3,
14,
2,
18,
13,
17,
17,
0,
13,
17,
14,
2,
18,
13,
17,
17,
0,
13,
17,
14,
2,
18,
13,
17,
17,
0,
13,
17,
4,
18,
13,
13,
18,
13,
17,
10,
17,
13,
10,
4,
13,
10,
17,
13,
10,
17,
13,
10,
4,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
4,
13,
10,
17,
13
] | [
[
209,
2
],
[
179,
8
],
[
188,
14
],
[
194,
20
],
[
24,
23
],
[
210,
29
],
[
195,
33
],
[
213,
33
],
[
183,
33
],
[
192,
33
],
[
186,
33
],
[
207,
33
],
[
204,
33
],
[
201,
33
],
[
177,
33
],
[
198,
33
],
[
210,
39
],
[
210,
48
],
[
197,
52
],
[
210,
57
],
[
176,
61
],
[
210,
66
],
[
200,
70
],
[
210,
74
],
[
210,
77
],
[
201,
81
],
[
177,
81
],
[
198,
81
],
[
195,
81
],
[
213,
81
],
[
183,
81
],
[
192,
81
],
[
186,
81
],
[
207,
81
],
[
204,
81
],
[
180,
87
],
[
180,
96
],
[
203,
100
],
[
180,
105
],
[
206,
109
],
[
180,
114
],
[
185,
118
],
[
180,
122
],
[
180,
125
],
[
186,
129
],
[
207,
129
],
[
204,
129
],
[
201,
129
],
[
177,
129
],
[
198,
129
],
[
195,
129
],
[
213,
129
],
[
183,
129
],
[
192,
129
],
[
189,
135
],
[
189,
144
],
[
191,
148
],
[
189,
153
],
[
182,
157
],
[
189,
162
],
[
212,
166
],
[
189,
170
],
[
189,
173
],
[
176,
177
],
[
179,
180
],
[
182,
183
],
[
185,
186
],
[
188,
189
],
[
191,
192
],
[
194,
195
],
[
197,
198
],
[
200,
201
],
[
203,
204
],
[
206,
207
],
[
209,
210
],
[
212,
213
]
] | [
"A = list(input())\nB = list(input())\nC = list(input())\nturn = 1\nfor i in range(len(A)*3):\n if turn == 1:\n #A勝利\n if len(A) == 0:\n print(\"A\")\n break\n else:\n if A[0] == \"a\":\n turn = 1\n elif A[0] == \"b\":\n turn = 2\n elif A[0] == \"c\":\n turn = 3\n A.remove(A[0])\n if turn == 2:\n #B勝利\n if len(B) == 0:\n print(\"B\")\n break\n else:\n if B[0] == \"a\":\n turn = 1\n elif B[0] == \"b\":\n turn = 2\n elif B[0] == \"c\":\n turn = 3\n B.remove(B[0])\n if turn == 3:\n #C勝利\n if len(C) == 0:\n print(\"C\")\n break\n else:\n if C[0] == \"a\":\n turn = 1\n elif C[0] == \"b\":\n turn = 2\n elif C[0] == \"c\":\n turn = 3\n C.remove(C[0])",
"A = list(input())",
"A",
"list(input())",
"list",
"input()",
"input",
"B = list(input())",
"B",
"list(input())",
"list",
"input()",
"input",
"C = list(input())",
"C",
"list(input())",
"list",
"input()",
"input",
"turn = 1",
"turn",
"1",
"for i in range(len(A)*3):\n if turn == 1:\n #A勝利\n if len(A) == 0:\n print(\"A\")\n break\n else:\n if A[0] == \"a\":\n turn = 1\n elif A[0] == \"b\":\n turn = 2\n elif A[0] == \"c\":\n turn = 3\n A.remove(A[0])\n if turn == 2:\n #B勝利\n if len(B) == 0:\n print(\"B\")\n break\n else:\n if B[0] == \"a\":\n turn = 1\n elif B[0] == \"b\":\n turn = 2\n elif B[0] == \"c\":\n turn = 3\n B.remove(B[0])\n if turn == 3:\n #C勝利\n if len(C) == 0:\n print(\"C\")\n break\n else:\n if C[0] == \"a\":\n turn = 1\n elif C[0] == \"b\":\n turn = 2\n elif C[0] == \"c\":\n turn = 3\n C.remove(C[0])",
"i",
"range(len(A)*3)",
"range",
"len(A)*3",
"len(A)",
"len",
"A",
"3",
"if turn == 1:\n #A勝利\n if len(A) == 0:\n print(\"A\")\n break\n else:\n if A[0] == \"a\":\n turn = 1\n elif A[0] == \"b\":\n turn = 2\n elif A[0] == \"c\":\n turn = 3\n A.remove(A[0])\n ",
"turn == 1",
"turn",
"1",
"if len(A) == 0:\n print(\"A\")\n break\n else:\n if A[0] == \"a\":\n turn = 1\n elif A[0] == \"b\":\n turn = 2\n elif A[0] == \"c\":\n turn = 3\n A.remove(A[0])\n ",
"len(A) == 0",
"len(A)",
"len",
"A",
"0",
"print(\"A\")",
"print",
"\"A\"",
"break",
"if A[0] == \"a\":\n turn = 1\n elif A[0] == \"b\":\n turn = 2\n elif A[0] == \"c\":\n turn = 3\n ",
"A[0] == \"a\"",
"A[0]",
"A",
"0",
"\"a\"",
"turn = 1",
"turn",
"1",
"elif A[0] == \"b\":\n turn = 2\n ",
"A[0] == \"b\"",
"A[0]",
"A",
"0",
"\"b\"",
"turn = 2",
"turn",
"2",
"elif A[0] == \"c\":\n turn = 3\n ",
"A[0] == \"c\"",
"A[0]",
"A",
"0",
"\"c\"",
"turn = 3",
"turn",
"3",
"A.remove(A[0])",
"A.remove",
"A",
"remove",
"A[0]",
"A",
"0",
"if turn == 2:\n #B勝利\n if len(B) == 0:\n print(\"B\")\n break\n else:\n if B[0] == \"a\":\n turn = 1\n elif B[0] == \"b\":\n turn = 2\n elif B[0] == \"c\":\n turn = 3\n B.remove(B[0])\n ",
"turn == 2",
"turn",
"2",
"if len(B) == 0:\n print(\"B\")\n break\n else:\n if B[0] == \"a\":\n turn = 1\n elif B[0] == \"b\":\n turn = 2\n elif B[0] == \"c\":\n turn = 3\n B.remove(B[0])\n ",
"len(B) == 0",
"len(B)",
"len",
"B",
"0",
"print(\"B\")",
"print",
"\"B\"",
"break",
"if B[0] == \"a\":\n turn = 1\n elif B[0] == \"b\":\n turn = 2\n elif B[0] == \"c\":\n turn = 3\n ",
"B[0] == \"a\"",
"B[0]",
"B",
"0",
"\"a\"",
"turn = 1",
"turn",
"1",
"elif B[0] == \"b\":\n turn = 2\n ",
"B[0] == \"b\"",
"B[0]",
"B",
"0",
"\"b\"",
"turn = 2",
"turn",
"2",
"elif B[0] == \"c\":\n turn = 3\n ",
"B[0] == \"c\"",
"B[0]",
"B",
"0",
"\"c\"",
"turn = 3",
"turn",
"3",
"B.remove(B[0])",
"B.remove",
"B",
"remove",
"B[0]",
"B",
"0",
"if turn == 3:\n #C勝利\n if len(C) == 0:\n print(\"C\")\n break\n else:\n if C[0] == \"a\":\n turn = 1\n elif C[0] == \"b\":\n turn = 2\n elif C[0] == \"c\":\n turn = 3\n C.remove(C[0])",
"turn == 3",
"turn",
"3",
"if len(C) == 0:\n print(\"C\")\n break\n else:\n if C[0] == \"a\":\n turn = 1\n elif C[0] == \"b\":\n turn = 2\n elif C[0] == \"c\":\n turn = 3\n C.remove(C[0])",
"len(C) == 0",
"len(C)",
"len",
"C",
"0",
"print(\"C\")",
"print",
"\"C\"",
"break",
"if C[0] == \"a\":\n turn = 1\n elif C[0] == \"b\":\n turn = 2\n elif C[0] == \"c\":\n turn = 3\n ",
"C[0] == \"a\"",
"C[0]",
"C",
"0",
"\"a\"",
"turn = 1",
"turn",
"1",
"elif C[0] == \"b\":\n turn = 2\n ",
"C[0] == \"b\"",
"C[0]",
"C",
"0",
"\"b\"",
"turn = 2",
"turn",
"2",
"elif C[0] == \"c\":\n turn = 3\n ",
"C[0] == \"c\"",
"C[0]",
"C",
"0",
"\"c\"",
"turn = 3",
"turn",
"3",
"C.remove(C[0])",
"C.remove",
"C",
"remove",
"C[0]",
"C",
"0",
"turn = 2",
"2",
"turn",
"B = list(input())",
"list(input())",
"B",
"turn = 2",
"2",
"turn",
"turn = 3",
"3",
"turn",
"C = list(input())",
"list(input())",
"C",
"turn = 1",
"1",
"turn",
"turn = 1",
"1",
"turn",
"turn = 1",
"1",
"turn",
"turn = 3",
"3",
"turn",
"turn = 1",
"1",
"turn",
"turn = 2",
"2",
"turn",
"A = list(input())",
"list(input())",
"A",
"turn = 3",
"3",
"turn"
] | A = list(input())
B = list(input())
C = list(input())
turn = 1
for i in range(len(A)*3):
if turn == 1:
#A勝利
if len(A) == 0:
print("A")
break
else:
if A[0] == "a":
turn = 1
elif A[0] == "b":
turn = 2
elif A[0] == "c":
turn = 3
A.remove(A[0])
if turn == 2:
#B勝利
if len(B) == 0:
print("B")
break
else:
if B[0] == "a":
turn = 1
elif B[0] == "b":
turn = 2
elif B[0] == "c":
turn = 3
B.remove(B[0])
if turn == 3:
#C勝利
if len(C) == 0:
print("C")
break
else:
if C[0] == "a":
turn = 1
elif C[0] == "b":
turn = 2
elif C[0] == "c":
turn = 3
C.remove(C[0]) |
[
7,
41,
28,
13,
17,
4,
13,
4,
13,
4,
13,
0,
13,
13,
0,
13,
17,
42,
18,
13,
13,
0,
13,
4,
18,
18,
13,
13,
13,
17,
4,
13,
4,
18,
13,
13,
10,
17,
13,
10,
4,
13,
10,
13,
13
] | [
[
4,
3
],
[
3,
6
],
[
43,
12
],
[
37,
15
],
[
44,
19
],
[
38,
20
],
[
41,
20
],
[
40,
22
],
[
44,
26
],
[
38,
27
],
[
41,
27
],
[
41,
34
],
[
38,
34
],
[
37,
38
],
[
40,
41
],
[
43,
44
]
] | [
"D = {s:list(input()) for s in \"abc\"}\np = \"a\"\n\nwhile D[p]:\n p=D[p].pop(0)\n\nprint(p.upper())",
"s:list(input()) for s in \"abc\"",
"for s in \"abc\"",
"s",
"\"abc\"",
"for s in \"abc\"",
"s",
"list(input())",
"list",
"input()",
"input",
"D = {s:list(input()) for s in \"abc\"}",
"D",
"{s:list(input()) for s in \"abc\"}",
"p = \"a\"",
"p",
"\"a\"",
"while D[p]:\n p=D[p].pop(0)",
"D[p]",
"D",
"p",
"p=D[p].pop(0)",
"p",
"D[p].pop(0)",
"[p].pop",
"[p]",
"D",
"p",
"pop",
"0",
"print(p.upper())",
"print",
"p.upper()",
"p.upper",
"p",
"upper",
"p = \"a\"",
"\"a\"",
"p",
"p=D[p].pop(0)",
"D[p].pop(0)",
"p",
"D = {s:list(input()) for s in \"abc\"}",
"{s:list(input()) for s in \"abc\"}",
"D"
] | D = {s:list(input()) for s in "abc"}
p = "a"
while D[p]:
p=D[p].pop(0)
print(p.upper()) |
[
7,
15,
13,
12,
13,
12,
13,
12,
13,
12,
13,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
4,
13,
13,
13,
4,
13,
13,
13,
4,
13,
13,
0,
13,
17,
13,
17,
13,
17,
0,
13,
17,
42,
17,
14,
2,
13,
17,
14,
2,
13,
13,
4,
13,
17,
3,
0,
13,
18,
13,
13,
0,
13,
17,
14,
2,
13,
17,
14,
2,
13,
13,
4,
13,
17,
3,
0,
13,
18,
13,
13,
0,
13,
17,
14,
2,
13,
13,
4,
13,
17,
3,
0,
13,
18,
13,
13,
0,
13,
17,
14,
2,
13,
17,
4,
13,
10,
12,
13,
10,
12,
13,
10,
12,
13,
10,
12,
13
] | [
[
13,
12
],
[
17,
16
],
[
21,
20
],
[
25,
24
],
[
12,
27
],
[
29,
28
],
[
16,
31
],
[
33,
32
],
[
20,
35
],
[
38,
37
],
[
40,
39
],
[
42,
41
],
[
45,
44
],
[
44,
50
],
[
97,
50
],
[
81,
50
],
[
61,
50
],
[
37,
54
],
[
66,
54
],
[
24,
55
],
[
62,
61
],
[
12,
63
],
[
37,
64
],
[
66,
64
],
[
67,
66
],
[
44,
70
],
[
97,
70
],
[
81,
70
],
[
61,
70
],
[
39,
74
],
[
86,
74
],
[
28,
75
],
[
82,
81
],
[
16,
83
],
[
39,
84
],
[
86,
84
],
[
87,
86
],
[
41,
90
],
[
102,
90
],
[
32,
91
],
[
98,
97
],
[
20,
99
],
[
41,
100
],
[
102,
100
],
[
103,
102
],
[
112,
109
]
] | [
"import sys\n\ndef I(): return int(sys.stdin.readline())\ndef MI(): return map(int, sys.stdin.readline().split())\ndef LI(): return list(map(int, sys.stdin.readline().split()))\ndef main():\n sa = input()\n sb = input()\n sc = input()\n la, lb, lc = len(sa), len(sb), len(sc)\n ia, ib, ic = 0, 0, 0\n turn = 'a'\n while True:\n if turn == 'a':\n if ia == la:\n print('A')\n break\n turn = sa[ia]\n ia += 1\n elif turn == 'b':\n if ib == lb:\n print('B')\n break\n turn = sb[ib]\n ib += 1\n else:\n if ic == lc:\n print('C')\n break\n turn = sc[ic]\n ic += 1\n\nif __name__ == '__main__':\n main()",
"import sys",
"sys",
"def I(): return int(sys.stdin.readline())",
"I",
"def MI(): return map(int, sys.stdin.readline().split())",
"MI",
"def LI(): return list(map(int, sys.stdin.readline().split()))",
"LI",
"def main():\n sa = input()\n sb = input()\n sc = input()\n la, lb, lc = len(sa), len(sb), len(sc)\n ia, ib, ic = 0, 0, 0\n turn = 'a'\n while True:\n if turn == 'a':\n if ia == la:\n print('A')\n break\n turn = sa[ia]\n ia += 1\n elif turn == 'b':\n if ib == lb:\n print('B')\n break\n turn = sb[ib]\n ib += 1\n else:\n if ic == lc:\n print('C')\n break\n turn = sc[ic]\n ic += 1",
"main",
"sa = input()",
"sa",
"input()",
"input",
"sb = input()",
"sb",
"input()",
"input",
"sc = input()",
"sc",
"input()",
"input",
"la, lb, lc = len(sa), len(sb), len(sc)",
"la",
"len(sa)",
"len",
"sa",
"lb",
"len(sb)",
"len",
"sb",
"lc",
"len(sc)",
"len",
"sc",
"ia, ib, ic = 0, 0, 0",
"ia",
"0",
"ib",
"0",
"ic",
"0",
"turn = 'a'",
"turn",
"'a'",
"while True:\n if turn == 'a':\n if ia == la:\n print('A')\n break\n turn = sa[ia]\n ia += 1\n elif turn == 'b':\n if ib == lb:\n print('B')\n break\n turn = sb[ib]\n ib += 1\n else:\n if ic == lc:\n print('C')\n break\n turn = sc[ic]\n ic += 1",
"True",
"if turn == 'a':\n if ia == la:\n print('A')\n break\n turn = sa[ia]\n ia += 1\n elif turn == 'b':\n if ib == lb:\n print('B')\n break\n turn = sb[ib]\n ib += 1\n else:\n if ic == lc:\n print('C')\n break\n turn = sc[ic]\n ic += 1",
"turn == 'a'",
"turn",
"'a'",
"if ia == la:\n print('A')\n break\n ",
"ia == la",
"ia",
"la",
"print('A')",
"print",
"'A'",
"break",
"turn = sa[ia]",
"turn",
"sa[ia]",
"sa",
"ia",
"ia += 1",
"ia",
"1",
"elif turn == 'b':\n if ib == lb:\n print('B')\n break\n turn = sb[ib]\n ib += 1\n ",
"turn == 'b'",
"turn",
"'b'",
"if ib == lb:\n print('B')\n break\n ",
"ib == lb",
"ib",
"lb",
"print('B')",
"print",
"'B'",
"break",
"turn = sb[ib]",
"turn",
"sb[ib]",
"sb",
"ib",
"ib += 1",
"ib",
"1",
"if ic == lc:\n print('C')\n break\n ",
"ic == lc",
"ic",
"lc",
"print('C')",
"print",
"'C'",
"break",
"turn = sc[ic]",
"turn",
"sc[ic]",
"sc",
"ic",
"ic += 1",
"ic",
"1",
"if __name__ == '__main__':\n main()",
"__name__ == '__main__'",
"__name__",
"'__main__'",
"main()",
"main",
"def main():\n sa = input()\n sb = input()\n sc = input()\n la, lb, lc = len(sa), len(sb), len(sc)\n ia, ib, ic = 0, 0, 0\n turn = 'a'\n while True:\n if turn == 'a':\n if ia == la:\n print('A')\n break\n turn = sa[ia]\n ia += 1\n elif turn == 'b':\n if ib == lb:\n print('B')\n break\n turn = sb[ib]\n ib += 1\n else:\n if ic == lc:\n print('C')\n break\n turn = sc[ic]\n ic += 1",
"def main():\n sa = input()\n sb = input()\n sc = input()\n la, lb, lc = len(sa), len(sb), len(sc)\n ia, ib, ic = 0, 0, 0\n turn = 'a'\n while True:\n if turn == 'a':\n if ia == la:\n print('A')\n break\n turn = sa[ia]\n ia += 1\n elif turn == 'b':\n if ib == lb:\n print('B')\n break\n turn = sb[ib]\n ib += 1\n else:\n if ic == lc:\n print('C')\n break\n turn = sc[ic]\n ic += 1",
"main",
"def I(): return int(sys.stdin.readline())",
"def I(): return int(sys.stdin.readline())",
"I",
"def LI(): return list(map(int, sys.stdin.readline().split()))",
"def LI(): return list(map(int, sys.stdin.readline().split()))",
"LI",
"def MI(): return map(int, sys.stdin.readline().split())",
"def MI(): return map(int, sys.stdin.readline().split())",
"MI"
] | import sys
def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
sa = input()
sb = input()
sc = input()
la, lb, lc = len(sa), len(sb), len(sc)
ia, ib, ic = 0, 0, 0
turn = 'a'
while True:
if turn == 'a':
if ia == la:
print('A')
break
turn = sa[ia]
ia += 1
elif turn == 'b':
if ib == lb:
print('B')
break
turn = sb[ib]
ib += 1
else:
if ic == lc:
print('C')
break
turn = sc[ic]
ic += 1
if __name__ == '__main__':
main() |
[
7,
0,
13,
39,
28,
13,
4,
13,
17,
0,
13,
4,
13,
4,
13,
4,
18,
13,
13,
13,
0,
13,
17,
42,
17,
14,
2,
4,
13,
18,
13,
13,
17,
4,
13,
4,
13,
2,
4,
13,
17,
13,
3,
0,
13,
2,
4,
13,
18,
18,
13,
13,
17,
4,
13,
17,
24,
18,
18,
13,
13,
17,
0,
13,
13,
10,
39,
13,
10,
4,
13,
10,
13,
13,
10,
2,
13,
10,
17,
13
] | [
[
66,
2
],
[
6,
5
],
[
69,
10
],
[
67,
17
],
[
70,
19
],
[
78,
21
],
[
67,
30
],
[
79,
31
],
[
73,
31
],
[
79,
41
],
[
73,
41
],
[
75,
44
],
[
67,
50
],
[
79,
51
],
[
73,
51
],
[
67,
59
],
[
79,
60
],
[
73,
60
],
[
72,
63
],
[
76,
64
],
[
66,
67
],
[
69,
70
],
[
76,
72
],
[
72,
73
],
[
75,
76
],
[
78,
79
]
] | [
"S = []\nfor i in range(3):\n tmp = list(input())\n S.append(tmp)\nturn = 0\nwhile True:\n if len(S[turn]) == 0:\n print(chr(ord('A')+turn))\n break\n next = ord(S[turn][0]) - ord('a')\n del S[turn][0]\n turn = next",
"S = []",
"S",
"[]",
"for i in range(3):\n tmp = list(input())\n S.append(tmp)",
"i",
"range(3)",
"range",
"3",
"tmp = list(input())",
"tmp",
"list(input())",
"list",
"input()",
"input",
"S.append(tmp)",
"S.append",
"S",
"append",
"tmp",
"turn = 0",
"turn",
"0",
"while True:\n if len(S[turn]) == 0:\n print(chr(ord('A')+turn))\n break\n next = ord(S[turn][0]) - ord('a')\n del S[turn][0]\n turn = next",
"True",
"if len(S[turn]) == 0:\n print(chr(ord('A')+turn))\n break\n ",
"len(S[turn]) == 0",
"len(S[turn])",
"len",
"S[turn]",
"S",
"turn",
"0",
"print(chr(ord('A')+turn))",
"print",
"chr(ord('A')+turn)",
"chr",
"ord('A')+turn",
"ord('A')",
"ord",
"'A'",
"turn",
"break",
"next = ord(S[turn][0]) - ord('a')",
"next",
"ord(S[turn][0]) - ord('a')",
"ord(S[turn][0])",
"ord",
"S[turn][0]",
"[turn]",
"S",
"turn",
"0",
"ord('a')",
"ord",
"'a'",
"del S[turn][0]",
"S[turn][0]",
"[turn]",
"S",
"turn",
"0",
"turn = next",
"turn",
"next",
"S = []",
"[]",
"S",
"tmp = list(input())",
"list(input())",
"tmp",
"turn = next",
"next",
"turn",
"next = ord(S[turn][0]) - ord('a')",
"ord(S[turn][0]) - ord('a')",
"next",
"turn = 0",
"0",
"turn"
] | S = []
for i in range(3):
tmp = list(input())
S.append(tmp)
turn = 0
while True:
if len(S[turn]) == 0:
print(chr(ord('A')+turn))
break
next = ord(S[turn][0]) - ord('a')
del S[turn][0]
turn = next
|
[
7,
41,
28,
13,
17,
4,
13,
4,
13,
4,
13,
0,
13,
13,
0,
13,
17,
42,
18,
13,
13,
0,
13,
4,
18,
18,
13,
13,
13,
17,
4,
13,
4,
18,
13,
13,
10,
17,
13,
10,
4,
13,
10,
13,
13
] | [
[
4,
3
],
[
3,
6
],
[
43,
12
],
[
37,
15
],
[
44,
19
],
[
38,
20
],
[
41,
20
],
[
40,
22
],
[
44,
26
],
[
38,
27
],
[
41,
27
],
[
41,
34
],
[
38,
34
],
[
37,
38
],
[
40,
41
],
[
43,
44
]
] | [
"s={i:list(input()) for i in 'abc'}\nd = 'a'\nwhile s[d]:\n d = s[d].pop(0)\nprint(d.upper())",
"i:list(input()) for i in 'abc'",
"for i in 'abc'",
"i",
"'abc'",
"for i in 'abc'",
"i",
"list(input())",
"list",
"input()",
"input",
"s={i:list(input()) for i in 'abc'}",
"s",
"{i:list(input()) for i in 'abc'}",
"d = 'a'",
"d",
"'a'",
"while s[d]:\n d = s[d].pop(0)",
"s[d]",
"s",
"d",
"d = s[d].pop(0)",
"d",
"s[d].pop(0)",
"[d].pop",
"[d]",
"s",
"d",
"pop",
"0",
"print(d.upper())",
"print",
"d.upper()",
"d.upper",
"d",
"upper",
"d = 'a'",
"'a'",
"d",
"d = s[d].pop(0)",
"s[d].pop(0)",
"d",
"s={i:list(input()) for i in 'abc'}",
"{i:list(input()) for i in 'abc'}",
"s"
] | s={i:list(input()) for i in 'abc'}
d = 'a'
while s[d]:
d = s[d].pop(0)
print(d.upper()) |
[
7,
0,
13,
21,
22,
17,
4,
13,
22,
17,
4,
13,
22,
17,
4,
13,
0,
13,
17,
42,
17,
14,
2,
17,
4,
13,
18,
13,
13,
0,
13,
18,
18,
13,
13,
17,
0,
18,
13,
13,
18,
18,
13,
13,
39,
17,
0,
13,
13,
4,
13,
4,
18,
13,
13,
3,
10,
21,
13,
10,
17,
13,
10,
18,
13,
10,
13,
13
] | [
[
57,
2
],
[
60,
17
],
[
37,
26
],
[
58,
27
],
[
61,
28
],
[
67,
28
],
[
63,
30
],
[
37,
32
],
[
58,
33
],
[
61,
34
],
[
67,
34
],
[
40,
37
],
[
58,
38
],
[
61,
39
],
[
67,
39
],
[
37,
41
],
[
58,
42
],
[
61,
43
],
[
67,
43
],
[
66,
47
],
[
64,
48
],
[
61,
53
],
[
67,
53
],
[
57,
58
],
[
60,
61
],
[
63,
64
],
[
64,
66
],
[
66,
67
]
] | [
"d = { 'a':input(), 'b':input(), 'c':input() }\npointer = 'a'\nwhile True:\n if 0 < len(d[pointer]):\n tmp = d[pointer][0]\n d[pointer] = d[pointer][1:]\n pointer = tmp\n else:\n print(pointer.upper())\n break",
"d = { 'a':input(), 'b':input(), 'c':input() }",
"d",
"{ 'a':input(), 'b':input(), 'c':input() }",
"'a'",
"'a'",
"input()",
"input",
"'b'",
"'b'",
"input()",
"input",
"'c'",
"'c'",
"input()",
"input",
"pointer = 'a'",
"pointer",
"'a'",
"while True:\n if 0 < len(d[pointer]):\n tmp = d[pointer][0]\n d[pointer] = d[pointer][1:]\n pointer = tmp\n else:\n print(pointer.upper())\n break",
"True",
"if 0 < len(d[pointer]):\n tmp = d[pointer][0]\n d[pointer] = d[pointer][1:]\n pointer = tmp\n else:\n print(pointer.upper())\n break",
"0 < len(d[pointer])",
"0",
"len(d[pointer])",
"len",
"d[pointer]",
"d",
"pointer",
"tmp = d[pointer][0]",
"tmp",
"d[pointer][0]",
"[pointer]",
"d",
"pointer",
"0",
"d[pointer] = d[pointer][1:]",
"d[pointer]",
"d",
"pointer",
"d[pointer][1:]",
"[pointer]",
"d",
"pointer",
"1:",
"1",
"pointer = tmp",
"pointer",
"tmp",
"print(pointer.upper())",
"print",
"pointer.upper()",
"pointer.upper",
"pointer",
"upper",
"break",
"d = { 'a':input(), 'b':input(), 'c':input() }",
"{ 'a':input(), 'b':input(), 'c':input() }",
"d",
"pointer = 'a'",
"'a'",
"pointer",
"tmp = d[pointer][0]",
"d[pointer][0]",
"tmp",
"pointer = tmp",
"tmp",
"pointer"
] | d = { 'a':input(), 'b':input(), 'c':input() }
pointer = 'a'
while True:
if 0 < len(d[pointer]):
tmp = d[pointer][0]
d[pointer] = d[pointer][1:]
pointer = tmp
else:
print(pointer.upper())
break
|
[
7,
15,
0,
13,
4,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
4,
13,
0,
13,
17,
42,
2,
2,
40,
4,
13,
13,
17,
40,
4,
13,
13,
17,
40,
4,
13,
13,
17,
14,
2,
13,
17,
14,
13,
0,
13,
4,
18,
13,
13,
4,
13,
17,
4,
13,
14,
2,
13,
17,
14,
13,
0,
13,
4,
18,
13,
13,
4,
13,
17,
4,
13,
14,
13,
0,
13,
4,
18,
13,
13,
4,
13,
17,
4,
13,
10,
4,
13,
10,
17,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13
] | [
[
102,
3
],
[
105,
11
],
[
99,
17
],
[
96,
25
],
[
103,
33
],
[
106,
38
],
[
100,
43
],
[
97,
47
],
[
94,
47
],
[
112,
47
],
[
109,
47
],
[
108,
52
],
[
103,
55
],
[
97,
64
],
[
94,
64
],
[
112,
64
],
[
109,
64
],
[
111,
69
],
[
106,
72
],
[
93,
82
],
[
100,
85
],
[
93,
94
],
[
96,
97
],
[
99,
100
],
[
102,
103
],
[
105,
106
],
[
108,
109
],
[
111,
112
]
] | [
"from collections import deque \nA=deque(list(input()))\nB=deque(input())\nC=deque(list(input()))\nnow='a'\nwhile len(A)>=0 and len(B)>=0 and len(C)>=0:\n if now=='a':\n if A:\n now=A.popleft()\n else:\n print('A')\n exit()\n elif now=='b':\n if B:\n now=B.popleft()\n else:\n print('B')\n exit()\n else:\n if C:\n now=C.popleft()\n else:\n print('C')\n exit()",
"from collections import deque",
"A=deque(list(input()))",
"A",
"deque(list(input()))",
"deque",
"list(input())",
"list",
"input()",
"input",
"B=deque(input())",
"B",
"deque(input())",
"deque",
"input()",
"input",
"C=deque(list(input()))",
"C",
"deque(list(input()))",
"deque",
"list(input())",
"list",
"input()",
"input",
"now='a'",
"now",
"'a'",
"while len(A)>=0 and len(B)>=0 and len(C)>=0:\n if now=='a':\n if A:\n now=A.popleft()\n else:\n print('A')\n exit()\n elif now=='b':\n if B:\n now=B.popleft()\n else:\n print('B')\n exit()\n else:\n if C:\n now=C.popleft()\n else:\n print('C')\n exit()",
"len(A)>=0 and len(B)>=0 and len(C)>=0",
"len(A)>=0 and len(B)>=0",
"len(A)>=0",
"len(A)",
"len",
"A",
"0",
"len(B)>=0",
"len(B)",
"len",
"B",
"0",
"len(C)>=0",
"len(C)",
"len",
"C",
"0",
"if now=='a':\n if A:\n now=A.popleft()\n else:\n print('A')\n exit()\n elif now=='b':\n if B:\n now=B.popleft()\n else:\n print('B')\n exit()\n else:\n if C:\n now=C.popleft()\n else:\n print('C')\n exit()",
"now=='a'",
"now",
"'a'",
"if A:\n now=A.popleft()\n else:\n print('A')\n exit()\n ",
"A",
"now=A.popleft()",
"now",
"A.popleft()",
"A.popleft",
"A",
"popleft",
"print('A')",
"print",
"'A'",
"exit()",
"exit",
"elif now=='b':\n if B:\n now=B.popleft()\n else:\n print('B')\n exit()\n ",
"now=='b'",
"now",
"'b'",
"if B:\n now=B.popleft()\n else:\n print('B')\n exit()\n ",
"B",
"now=B.popleft()",
"now",
"B.popleft()",
"B.popleft",
"B",
"popleft",
"print('B')",
"print",
"'B'",
"exit()",
"exit",
"if C:\n now=C.popleft()\n else:\n print('C')\n exit()",
"C",
"now=C.popleft()",
"now",
"C.popleft()",
"C.popleft",
"C",
"popleft",
"print('C')",
"print",
"'C'",
"exit()",
"exit",
"now=C.popleft()",
"C.popleft()",
"now",
"now='a'",
"'a'",
"now",
"C=deque(list(input()))",
"deque(list(input()))",
"C",
"A=deque(list(input()))",
"deque(list(input()))",
"A",
"B=deque(input())",
"deque(input())",
"B",
"now=A.popleft()",
"A.popleft()",
"now",
"now=B.popleft()",
"B.popleft()",
"now"
] | from collections import deque
A=deque(list(input()))
B=deque(input())
C=deque(list(input()))
now='a'
while len(A)>=0 and len(B)>=0 and len(C)>=0:
if now=='a':
if A:
now=A.popleft()
else:
print('A')
exit()
elif now=='b':
if B:
now=B.popleft()
else:
print('B')
exit()
else:
if C:
now=C.popleft()
else:
print('C')
exit() |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
18,
13,
13,
17,
42,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
3,
0,
13,
4,
18,
13,
13,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
3,
0,
13,
4,
18,
13,
13,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
3,
0,
13,
4,
18,
13,
13,
17,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13
] | [
[
101,
2
],
[
98,
8
],
[
92,
14
],
[
107,
20
],
[
102,
23
],
[
108,
30
],
[
111,
30
],
[
96,
30
],
[
105,
30
],
[
102,
36
],
[
104,
43
],
[
102,
46
],
[
108,
51
],
[
111,
51
],
[
96,
51
],
[
105,
51
],
[
99,
57
],
[
95,
64
],
[
99,
67
],
[
108,
72
],
[
111,
72
],
[
96,
72
],
[
105,
72
],
[
93,
78
],
[
110,
85
],
[
93,
88
],
[
92,
93
],
[
95,
96
],
[
98,
99
],
[
101,
102
],
[
104,
105
],
[
107,
108
],
[
110,
111
]
] | [
"SA = list(input())\nSB = list(input())\nSC = list(input())\n\n\ncard = SA.pop(0)\nwhile True:\n\n if card == \"a\":\n if len(SA) == 0:\n print(\"A\")\n break\n card = SA.pop(0)\n elif card == \"b\":\n if len(SB) == 0:\n print(\"B\")\n break\n card = SB.pop(0)\n elif card == \"c\":\n if len(SC) == 0:\n print(\"C\")\n break\n card = SC.pop(0)",
"SA = list(input())",
"SA",
"list(input())",
"list",
"input()",
"input",
"SB = list(input())",
"SB",
"list(input())",
"list",
"input()",
"input",
"SC = list(input())",
"SC",
"list(input())",
"list",
"input()",
"input",
"card = SA.pop(0)",
"card",
"SA.pop(0)",
"SA.pop",
"SA",
"pop",
"0",
"while True:\n\n if card == \"a\":\n if len(SA) == 0:\n print(\"A\")\n break\n card = SA.pop(0)\n elif card == \"b\":\n if len(SB) == 0:\n print(\"B\")\n break\n card = SB.pop(0)\n elif card == \"c\":\n if len(SC) == 0:\n print(\"C\")\n break\n card = SC.pop(0)",
"True",
"if card == \"a\":\n if len(SA) == 0:\n print(\"A\")\n break\n card = SA.pop(0)\n elif card == \"b\":\n if len(SB) == 0:\n print(\"B\")\n break\n card = SB.pop(0)\n elif card == \"c\":\n if len(SC) == 0:\n print(\"C\")\n break\n card = SC.pop(0)",
"card == \"a\"",
"card",
"\"a\"",
"if len(SA) == 0:\n print(\"A\")\n break\n ",
"len(SA) == 0",
"len(SA)",
"len",
"SA",
"0",
"print(\"A\")",
"print",
"\"A\"",
"break",
"card = SA.pop(0)",
"card",
"SA.pop(0)",
"SA.pop",
"SA",
"pop",
"0",
"elif card == \"b\":\n if len(SB) == 0:\n print(\"B\")\n break\n card = SB.pop(0)\n ",
"card == \"b\"",
"card",
"\"b\"",
"if len(SB) == 0:\n print(\"B\")\n break\n ",
"len(SB) == 0",
"len(SB)",
"len",
"SB",
"0",
"print(\"B\")",
"print",
"\"B\"",
"break",
"card = SB.pop(0)",
"card",
"SB.pop(0)",
"SB.pop",
"SB",
"pop",
"0",
"elif card == \"c\":\n if len(SC) == 0:\n print(\"C\")\n break\n card = SC.pop(0)",
"card == \"c\"",
"card",
"\"c\"",
"if len(SC) == 0:\n print(\"C\")\n break\n ",
"len(SC) == 0",
"len(SC)",
"len",
"SC",
"0",
"print(\"C\")",
"print",
"\"C\"",
"break",
"card = SC.pop(0)",
"card",
"SC.pop(0)",
"SC.pop",
"SC",
"pop",
"0",
"SC = list(input())",
"list(input())",
"SC",
"card = SB.pop(0)",
"SB.pop(0)",
"card",
"SB = list(input())",
"list(input())",
"SB",
"SA = list(input())",
"list(input())",
"SA",
"card = SA.pop(0)",
"SA.pop(0)",
"card",
"card = SA.pop(0)",
"SA.pop(0)",
"card",
"card = SC.pop(0)",
"SC.pop(0)",
"card"
] | SA = list(input())
SB = list(input())
SC = list(input())
card = SA.pop(0)
while True:
if card == "a":
if len(SA) == 0:
print("A")
break
card = SA.pop(0)
elif card == "b":
if len(SB) == 0:
print("B")
break
card = SB.pop(0)
elif card == "c":
if len(SC) == 0:
print("C")
break
card = SC.pop(0)
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
17,
42,
17,
14,
2,
2,
13,
17,
2,
4,
13,
13,
17,
4,
13,
17,
3,
14,
2,
2,
13,
17,
2,
4,
13,
13,
17,
4,
13,
17,
3,
14,
2,
2,
13,
17,
2,
4,
13,
13,
17,
4,
13,
17,
3,
14,
2,
13,
17,
14,
2,
18,
13,
17,
17,
0,
13,
17,
14,
2,
18,
13,
17,
17,
0,
13,
17,
0,
13,
17,
0,
13,
18,
13,
39,
17,
14,
2,
13,
17,
14,
2,
18,
13,
17,
17,
0,
13,
17,
14,
2,
18,
13,
17,
17,
0,
13,
17,
0,
13,
17,
0,
13,
18,
13,
39,
17,
14,
2,
18,
13,
17,
17,
0,
13,
17,
14,
2,
18,
13,
17,
17,
0,
13,
17,
0,
13,
17,
0,
13,
18,
13,
39,
17,
10,
17,
13,
10,
17,
13,
10,
4,
13,
10,
4,
13,
10,
17,
13,
10,
18,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
4,
13,
10,
18,
13,
10,
18,
13,
10,
17,
13
] | [
[
165,
2
],
[
192,
8
],
[
162,
14
],
[
180,
20
],
[
181,
27
],
[
160,
27
],
[
184,
27
],
[
187,
27
],
[
190,
27
],
[
175,
27
],
[
202,
27
],
[
178,
27
],
[
157,
27
],
[
169,
27
],
[
166,
32
],
[
196,
32
],
[
181,
41
],
[
160,
41
],
[
184,
41
],
[
187,
41
],
[
190,
41
],
[
175,
41
],
[
202,
41
],
[
178,
41
],
[
157,
41
],
[
169,
41
],
[
193,
46
],
[
199,
46
],
[
181,
55
],
[
160,
55
],
[
184,
55
],
[
187,
55
],
[
190,
55
],
[
175,
55
],
[
202,
55
],
[
178,
55
],
[
157,
55
],
[
169,
55
],
[
163,
60
],
[
172,
60
],
[
181,
68
],
[
160,
68
],
[
184,
68
],
[
187,
68
],
[
190,
68
],
[
175,
68
],
[
202,
68
],
[
178,
68
],
[
157,
68
],
[
169,
68
],
[
166,
73
],
[
196,
73
],
[
168,
77
],
[
166,
82
],
[
196,
82
],
[
156,
86
],
[
177,
89
],
[
195,
92
],
[
166,
94
],
[
196,
94
],
[
181,
99
],
[
160,
99
],
[
184,
99
],
[
187,
99
],
[
190,
99
],
[
175,
99
],
[
202,
99
],
[
178,
99
],
[
157,
99
],
[
169,
99
],
[
193,
104
],
[
199,
104
],
[
201,
108
],
[
193,
113
],
[
199,
113
],
[
174,
117
],
[
189,
120
],
[
198,
123
],
[
193,
125
],
[
199,
125
],
[
163,
131
],
[
172,
131
],
[
186,
135
],
[
163,
140
],
[
172,
140
],
[
183,
144
],
[
159,
147
],
[
171,
150
],
[
163,
152
],
[
172,
152
],
[
156,
157
],
[
159,
160
],
[
162,
163
],
[
165,
166
],
[
168,
169
],
[
171,
172
],
[
174,
175
],
[
177,
178
],
[
180,
181
],
[
183,
184
],
[
186,
187
],
[
189,
190
],
[
192,
193
],
[
195,
196
],
[
198,
199
],
[
201,
202
]
] | [
"sa = str(input())\nsb = str(input())\nsc = str(input())\nturn = 1\nwhile True:\n if turn == 1 and len(sa) == 0:\n print(\"A\")\n break\n elif turn == 2 and len(sb) == 0:\n print(\"B\")\n break\n elif turn == 3 and len(sc) == 0:\n print(\"C\")\n break\n if turn == 1:\n if sa[0] == \"a\":\n turn = 1\n elif sa[0] == \"b\":\n turn = 2\n else:\n turn = 3\n sa = sa[1:]\n elif turn == 2:\n if sb[0] == \"a\":\n turn = 1\n elif sb[0] == \"b\":\n turn = 2\n else:\n turn = 3\n sb = sb[1:]\n else:\n if sc[0] == \"a\":\n turn = 1\n elif sc[0] == \"b\":\n turn = 2\n else:\n turn = 3\n sc = sc[1:]",
"sa = str(input())",
"sa",
"str(input())",
"str",
"input()",
"input",
"sb = str(input())",
"sb",
"str(input())",
"str",
"input()",
"input",
"sc = str(input())",
"sc",
"str(input())",
"str",
"input()",
"input",
"turn = 1",
"turn",
"1",
"while True:\n if turn == 1 and len(sa) == 0:\n print(\"A\")\n break\n elif turn == 2 and len(sb) == 0:\n print(\"B\")\n break\n elif turn == 3 and len(sc) == 0:\n print(\"C\")\n break\n if turn == 1:\n if sa[0] == \"a\":\n turn = 1\n elif sa[0] == \"b\":\n turn = 2\n else:\n turn = 3\n sa = sa[1:]\n elif turn == 2:\n if sb[0] == \"a\":\n turn = 1\n elif sb[0] == \"b\":\n turn = 2\n else:\n turn = 3\n sb = sb[1:]\n else:\n if sc[0] == \"a\":\n turn = 1\n elif sc[0] == \"b\":\n turn = 2\n else:\n turn = 3\n sc = sc[1:]",
"True",
"if turn == 1 and len(sa) == 0:\n print(\"A\")\n break\n elif turn == 2 and len(sb) == 0:\n print(\"B\")\n break\n elif turn == 3 and len(sc) == 0:\n print(\"C\")\n break\n ",
"turn == 1 and len(sa) == 0",
"turn == 1",
"turn",
"1",
"len(sa) == 0",
"len(sa)",
"len",
"sa",
"0",
"print(\"A\")",
"print",
"\"A\"",
"break",
"elif turn == 2 and len(sb) == 0:\n print(\"B\")\n break\n ",
"turn == 2 and len(sb) == 0",
"turn == 2",
"turn",
"2",
"len(sb) == 0",
"len(sb)",
"len",
"sb",
"0",
"print(\"B\")",
"print",
"\"B\"",
"break",
"elif turn == 3 and len(sc) == 0:\n print(\"C\")\n break\n ",
"turn == 3 and len(sc) == 0",
"turn == 3",
"turn",
"3",
"len(sc) == 0",
"len(sc)",
"len",
"sc",
"0",
"print(\"C\")",
"print",
"\"C\"",
"break",
"if turn == 1:\n if sa[0] == \"a\":\n turn = 1\n elif sa[0] == \"b\":\n turn = 2\n else:\n turn = 3\n sa = sa[1:]\n elif turn == 2:\n if sb[0] == \"a\":\n turn = 1\n elif sb[0] == \"b\":\n turn = 2\n else:\n turn = 3\n sb = sb[1:]\n else:\n if sc[0] == \"a\":\n turn = 1\n elif sc[0] == \"b\":\n turn = 2\n else:\n turn = 3\n sc = sc[1:]",
"turn == 1",
"turn",
"1",
"if sa[0] == \"a\":\n turn = 1\n elif sa[0] == \"b\":\n turn = 2\n else:\n turn = 3\n ",
"sa[0] == \"a\"",
"sa[0]",
"sa",
"0",
"\"a\"",
"turn = 1",
"turn",
"1",
"elif sa[0] == \"b\":\n turn = 2\n ",
"sa[0] == \"b\"",
"sa[0]",
"sa",
"0",
"\"b\"",
"turn = 2",
"turn",
"2",
"turn = 3",
"turn",
"3",
"sa = sa[1:]",
"sa",
"sa[1:]",
"sa",
"1:",
"1",
"elif turn == 2:\n if sb[0] == \"a\":\n turn = 1\n elif sb[0] == \"b\":\n turn = 2\n else:\n turn = 3\n sb = sb[1:]\n ",
"turn == 2",
"turn",
"2",
"if sb[0] == \"a\":\n turn = 1\n elif sb[0] == \"b\":\n turn = 2\n else:\n turn = 3\n ",
"sb[0] == \"a\"",
"sb[0]",
"sb",
"0",
"\"a\"",
"turn = 1",
"turn",
"1",
"elif sb[0] == \"b\":\n turn = 2\n ",
"sb[0] == \"b\"",
"sb[0]",
"sb",
"0",
"\"b\"",
"turn = 2",
"turn",
"2",
"turn = 3",
"turn",
"3",
"sb = sb[1:]",
"sb",
"sb[1:]",
"sb",
"1:",
"1",
"if sc[0] == \"a\":\n turn = 1\n elif sc[0] == \"b\":\n turn = 2\n else:\n turn = 3\n ",
"sc[0] == \"a\"",
"sc[0]",
"sc",
"0",
"\"a\"",
"turn = 1",
"turn",
"1",
"elif sc[0] == \"b\":\n turn = 2\n ",
"sc[0] == \"b\"",
"sc[0]",
"sc",
"0",
"\"b\"",
"turn = 2",
"turn",
"2",
"turn = 3",
"turn",
"3",
"sc = sc[1:]",
"sc",
"sc[1:]",
"sc",
"1:",
"1",
"turn = 2",
"2",
"turn",
"turn = 3",
"3",
"turn",
"sc = str(input())",
"str(input())",
"sc",
"sa = str(input())",
"str(input())",
"sa",
"turn = 1",
"1",
"turn",
"sc = sc[1:]",
"sc[1:]",
"sc",
"turn = 2",
"2",
"turn",
"turn = 3",
"3",
"turn",
"turn = 1",
"1",
"turn",
"turn = 2",
"2",
"turn",
"turn = 1",
"1",
"turn",
"turn = 3",
"3",
"turn",
"sb = str(input())",
"str(input())",
"sb",
"sa = sa[1:]",
"sa[1:]",
"sa",
"sb = sb[1:]",
"sb[1:]",
"sb",
"turn = 1",
"1",
"turn"
] | sa = str(input())
sb = str(input())
sc = str(input())
turn = 1
while True:
if turn == 1 and len(sa) == 0:
print("A")
break
elif turn == 2 and len(sb) == 0:
print("B")
break
elif turn == 3 and len(sc) == 0:
print("C")
break
if turn == 1:
if sa[0] == "a":
turn = 1
elif sa[0] == "b":
turn = 2
else:
turn = 3
sa = sa[1:]
elif turn == 2:
if sb[0] == "a":
turn = 1
elif sb[0] == "b":
turn = 2
else:
turn = 3
sb = sb[1:]
else:
if sc[0] == "a":
turn = 1
elif sc[0] == "b":
turn = 2
else:
turn = 3
sc = sc[1:] |
[
7,
15,
12,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
18,
13,
13,
42,
17,
14,
2,
13,
17,
14,
40,
4,
13,
13,
17,
0,
13,
4,
18,
13,
13,
0,
13,
17,
3,
14,
2,
13,
17,
14,
40,
4,
13,
13,
17,
0,
13,
4,
18,
13,
13,
0,
13,
17,
3,
14,
2,
13,
17,
14,
40,
4,
13,
13,
17,
0,
13,
4,
18,
13,
13,
0,
13,
17,
3,
4,
13,
13,
14,
2,
13,
17,
4,
13,
10,
12,
13
] | [
[
6,
5
],
[
12,
11
],
[
18,
17
],
[
24,
23
],
[
5,
26
],
[
23,
32
],
[
81,
32
],
[
61,
32
],
[
41,
32
],
[
5,
38
],
[
42,
41
],
[
5,
44
],
[
48,
47
],
[
23,
52
],
[
81,
52
],
[
61,
52
],
[
41,
52
],
[
11,
58
],
[
62,
61
],
[
11,
64
],
[
68,
67
],
[
23,
72
],
[
81,
72
],
[
61,
72
],
[
41,
72
],
[
17,
78
],
[
82,
81
],
[
17,
84
],
[
88,
87
],
[
87,
92
],
[
67,
92
],
[
47,
92
],
[
101,
98
]
] | [
"from collections import deque\n\n\ndef main():\n da = deque(input())\n db = deque(input())\n dc = deque(input())\n\n card = da.popleft()\n\n while True:\n if card == \"a\":\n if len(da) != 0:\n card = da.popleft()\n else:\n ans = \"A\"\n break\n elif card == \"b\":\n if len(db) != 0:\n card = db.popleft()\n else:\n ans = \"B\"\n break\n elif card == \"c\":\n if len(dc) != 0:\n card = dc.popleft()\n else:\n ans = \"C\"\n break\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()",
"from collections import deque",
"def main():\n da = deque(input())\n db = deque(input())\n dc = deque(input())\n\n card = da.popleft()\n\n while True:\n if card == \"a\":\n if len(da) != 0:\n card = da.popleft()\n else:\n ans = \"A\"\n break\n elif card == \"b\":\n if len(db) != 0:\n card = db.popleft()\n else:\n ans = \"B\"\n break\n elif card == \"c\":\n if len(dc) != 0:\n card = dc.popleft()\n else:\n ans = \"C\"\n break\n print(ans)",
"main",
"da = deque(input())",
"da",
"deque(input())",
"deque",
"input()",
"input",
"db = deque(input())",
"db",
"deque(input())",
"deque",
"input()",
"input",
"dc = deque(input())",
"dc",
"deque(input())",
"deque",
"input()",
"input",
"card = da.popleft()",
"card",
"da.popleft()",
"da.popleft",
"da",
"popleft",
"while True:\n if card == \"a\":\n if len(da) != 0:\n card = da.popleft()\n else:\n ans = \"A\"\n break\n elif card == \"b\":\n if len(db) != 0:\n card = db.popleft()\n else:\n ans = \"B\"\n break\n elif card == \"c\":\n if len(dc) != 0:\n card = dc.popleft()\n else:\n ans = \"C\"\n break\n ",
"True",
"if card == \"a\":\n if len(da) != 0:\n card = da.popleft()\n else:\n ans = \"A\"\n break\n elif card == \"b\":\n if len(db) != 0:\n card = db.popleft()\n else:\n ans = \"B\"\n break\n elif card == \"c\":\n if len(dc) != 0:\n card = dc.popleft()\n else:\n ans = \"C\"\n break\n ",
"card == \"a\"",
"card",
"\"a\"",
"if len(da) != 0:\n card = da.popleft()\n else:\n ans = \"A\"\n break\n ",
"len(da) != 0",
"len(da)",
"len",
"da",
"0",
"card = da.popleft()",
"card",
"da.popleft()",
"da.popleft",
"da",
"popleft",
"ans = \"A\"",
"ans",
"\"A\"",
"break",
"elif card == \"b\":\n if len(db) != 0:\n card = db.popleft()\n else:\n ans = \"B\"\n break\n ",
"card == \"b\"",
"card",
"\"b\"",
"if len(db) != 0:\n card = db.popleft()\n else:\n ans = \"B\"\n break\n ",
"len(db) != 0",
"len(db)",
"len",
"db",
"0",
"card = db.popleft()",
"card",
"db.popleft()",
"db.popleft",
"db",
"popleft",
"ans = \"B\"",
"ans",
"\"B\"",
"break",
"elif card == \"c\":\n if len(dc) != 0:\n card = dc.popleft()\n else:\n ans = \"C\"\n break\n ",
"card == \"c\"",
"card",
"\"c\"",
"if len(dc) != 0:\n card = dc.popleft()\n else:\n ans = \"C\"\n break\n ",
"len(dc) != 0",
"len(dc)",
"len",
"dc",
"0",
"card = dc.popleft()",
"card",
"dc.popleft()",
"dc.popleft",
"dc",
"popleft",
"ans = \"C\"",
"ans",
"\"C\"",
"break",
"print(ans)",
"print",
"ans",
"if __name__ == \"__main__\":\n main()",
"__name__ == \"__main__\"",
"__name__",
"\"__main__\"",
"main()",
"main",
"def main():\n da = deque(input())\n db = deque(input())\n dc = deque(input())\n\n card = da.popleft()\n\n while True:\n if card == \"a\":\n if len(da) != 0:\n card = da.popleft()\n else:\n ans = \"A\"\n break\n elif card == \"b\":\n if len(db) != 0:\n card = db.popleft()\n else:\n ans = \"B\"\n break\n elif card == \"c\":\n if len(dc) != 0:\n card = dc.popleft()\n else:\n ans = \"C\"\n break\n print(ans)",
"def main():\n da = deque(input())\n db = deque(input())\n dc = deque(input())\n\n card = da.popleft()\n\n while True:\n if card == \"a\":\n if len(da) != 0:\n card = da.popleft()\n else:\n ans = \"A\"\n break\n elif card == \"b\":\n if len(db) != 0:\n card = db.popleft()\n else:\n ans = \"B\"\n break\n elif card == \"c\":\n if len(dc) != 0:\n card = dc.popleft()\n else:\n ans = \"C\"\n break\n print(ans)",
"main"
] | from collections import deque
def main():
da = deque(input())
db = deque(input())
dc = deque(input())
card = da.popleft()
while True:
if card == "a":
if len(da) != 0:
card = da.popleft()
else:
ans = "A"
break
elif card == "b":
if len(db) != 0:
card = db.popleft()
else:
ans = "B"
break
elif card == "c":
if len(dc) != 0:
card = dc.popleft()
else:
ans = "C"
break
print(ans)
if __name__ == "__main__":
main() |
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
17,
0,
13,
17,
0,
13,
17,
0,
13,
13,
42,
17,
14,
2,
4,
13,
13,
17,
0,
13,
18,
13,
17,
14,
2,
13,
13,
0,
13,
18,
13,
39,
17,
14,
2,
13,
13,
0,
13,
18,
13,
39,
17,
0,
13,
18,
13,
39,
17,
14,
2,
13,
17,
0,
13,
13,
14,
2,
13,
17,
0,
13,
13,
0,
13,
13,
4,
13,
18,
13,
17,
3,
10,
18,
13,
10,
17,
13,
10,
18,
13,
10,
4,
13,
10,
13,
13,
10,
18,
13,
10,
17,
13,
10,
17,
13,
10,
13,
13,
10,
13,
13,
10,
4,
13,
10,
13,
13,
10,
4,
13,
10,
18,
13
] | [
[
118,
2
],
[
97,
6
],
[
124,
10
],
[
106,
14
],
[
91,
17
],
[
109,
20
],
[
121,
23
],
[
107,
24
],
[
119,
24
],
[
122,
31
],
[
113,
31
],
[
116,
31
],
[
101,
31
],
[
103,
34
],
[
122,
36
],
[
113,
36
],
[
116,
36
],
[
101,
36
],
[
122,
40
],
[
113,
40
],
[
116,
40
],
[
101,
40
],
[
107,
41
],
[
119,
41
],
[
128,
41
],
[
127,
43
],
[
107,
45
],
[
119,
45
],
[
128,
45
],
[
122,
50
],
[
113,
50
],
[
116,
50
],
[
101,
50
],
[
92,
51
],
[
98,
51
],
[
95,
51
],
[
94,
53
],
[
92,
55
],
[
98,
55
],
[
95,
55
],
[
88,
59
],
[
110,
61
],
[
125,
61
],
[
89,
61
],
[
104,
66
],
[
100,
69
],
[
128,
70
],
[
107,
70
],
[
119,
70
],
[
104,
73
],
[
115,
76
],
[
95,
77
],
[
92,
77
],
[
98,
77
],
[
112,
79
],
[
89,
80
],
[
110,
80
],
[
125,
80
],
[
122,
84
],
[
113,
84
],
[
116,
84
],
[
101,
84
],
[
88,
89
],
[
91,
92
],
[
94,
95
],
[
97,
98
],
[
128,
100
],
[
107,
100
],
[
119,
100
],
[
100,
101
],
[
103,
104
],
[
106,
107
],
[
109,
110
],
[
89,
112
],
[
110,
112
],
[
125,
112
],
[
112,
113
],
[
95,
115
],
[
92,
115
],
[
98,
115
],
[
115,
116
],
[
118,
119
],
[
107,
121
],
[
119,
121
],
[
121,
122
],
[
124,
125
],
[
127,
128
]
] | [
"a=input()\nb=input()\nc=input()\na+=\"A\"\nb+=\"B\"\nc+=\"C\"\nn=a\nwhile True:\n if len(n)>1:\n k=n[0]\n if n==a:\n a=a[1:]\n elif n==b:\n b=b[1:]\n else:\n c=c[1:]\n if k==\"a\":\n n=a\n elif k==\"b\":\n n=b\n else:\n n=c\n else:\n print(n[-1])\n break",
"a=input()",
"a",
"input()",
"input",
"b=input()",
"b",
"input()",
"input",
"c=input()",
"c",
"input()",
"input",
"a+=\"A\"",
"a",
"\"A\"",
"b+=\"B\"",
"b",
"\"B\"",
"c+=\"C\"",
"c",
"\"C\"",
"n=a",
"n",
"a",
"while True:\n if len(n)>1:\n k=n[0]\n if n==a:\n a=a[1:]\n elif n==b:\n b=b[1:]\n else:\n c=c[1:]\n if k==\"a\":\n n=a\n elif k==\"b\":\n n=b\n else:\n n=c\n else:\n print(n[-1])\n break",
"True",
"if len(n)>1:\n k=n[0]\n if n==a:\n a=a[1:]\n elif n==b:\n b=b[1:]\n else:\n c=c[1:]\n if k==\"a\":\n n=a\n elif k==\"b\":\n n=b\n else:\n n=c\n else:\n print(n[-1])\n break",
"len(n)>1",
"len(n)",
"len",
"n",
"1",
"k=n[0]",
"k",
"n[0]",
"n",
"0",
"if n==a:\n a=a[1:]\n elif n==b:\n b=b[1:]\n else:\n c=c[1:]\n ",
"n==a",
"n",
"a",
"a=a[1:]",
"a",
"a[1:]",
"a",
"1:",
"1",
"elif n==b:\n b=b[1:]\n ",
"n==b",
"n",
"b",
"b=b[1:]",
"b",
"b[1:]",
"b",
"1:",
"1",
"c=c[1:]",
"c",
"c[1:]",
"c",
"1:",
"1",
"if k==\"a\":\n n=a\n elif k==\"b\":\n n=b\n else:\n n=c\n ",
"k==\"a\"",
"k",
"\"a\"",
"n=a",
"n",
"a",
"elif k==\"b\":\n n=b\n ",
"k==\"b\"",
"k",
"\"b\"",
"n=b",
"n",
"b",
"n=c",
"n",
"c",
"print(n[-1])",
"print",
"n[-1]",
"n",
"-1",
"break",
"c=c[1:]",
"c[1:]",
"c",
"b+=\"B\"",
"\"B\"",
"b",
"b=b[1:]",
"b[1:]",
"b",
"b=input()",
"input()",
"b",
"n=a",
"a",
"n",
"k=n[0]",
"n[0]",
"k",
"a+=\"A\"",
"\"A\"",
"a",
"c+=\"C\"",
"\"C\"",
"c",
"n=c",
"c",
"n",
"n=b",
"b",
"n",
"a=input()",
"input()",
"a",
"n=a",
"a",
"n",
"c=input()",
"input()",
"c",
"a=a[1:]",
"a[1:]",
"a"
] | a=input()
b=input()
c=input()
a+="A"
b+="B"
c+="C"
n=a
while True:
if len(n)>1:
k=n[0]
if n==a:
a=a[1:]
elif n==b:
b=b[1:]
else:
c=c[1:]
if k=="a":
n=a
elif k=="b":
n=b
else:
n=c
else:
print(n[-1])
break |
[
7,
12,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
4,
18,
13,
13,
4,
18,
13,
13,
4,
18,
13,
13,
0,
13,
17,
28,
13,
4,
13,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
29,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
29,
0,
13,
4,
18,
13,
13,
14,
2,
4,
13,
13,
17,
4,
13,
17,
29,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
4,
13,
10,
12,
13
] | [
[
5,
4
],
[
11,
10
],
[
17,
16
],
[
4,
23
],
[
10,
27
],
[
16,
31
],
[
35,
34
],
[
38,
37
],
[
34,
43
],
[
92,
43
],
[
76,
43
],
[
56,
43
],
[
4,
49
],
[
57,
56
],
[
4,
59
],
[
34,
63
],
[
92,
63
],
[
76,
63
],
[
56,
63
],
[
10,
69
],
[
77,
76
],
[
10,
79
],
[
16,
85
],
[
93,
92
],
[
16,
95
],
[
105,
102
]
] | [
"def main():\n SA = list(input())\n SB = list(input())\n SC = list(input())\n\n SA.reverse()\n SB.reverse()\n SC.reverse()\n\n turn = 'a'\n for i in range(400):\n if turn == 'a':\n if len(SA) == 0:\n print('A')\n return\n turn = SA.pop()\n elif turn == 'b':\n if len(SB) == 0:\n print('B')\n return\n turn = SB.pop()\n else:\n if len(SC) == 0:\n print('C')\n return\n turn = SC.pop()\n \nif __name__ == \"__main__\":\n main()",
"def main():\n SA = list(input())\n SB = list(input())\n SC = list(input())\n\n SA.reverse()\n SB.reverse()\n SC.reverse()\n\n turn = 'a'\n for i in range(400):\n if turn == 'a':\n if len(SA) == 0:\n print('A')\n return\n turn = SA.pop()\n elif turn == 'b':\n if len(SB) == 0:\n print('B')\n return\n turn = SB.pop()\n else:\n if len(SC) == 0:\n print('C')\n return\n turn = SC.pop()\n ",
"main",
"SA = list(input())",
"SA",
"list(input())",
"list",
"input()",
"input",
"SB = list(input())",
"SB",
"list(input())",
"list",
"input()",
"input",
"SC = list(input())",
"SC",
"list(input())",
"list",
"input()",
"input",
"SA.reverse()",
"SA.reverse",
"SA",
"reverse",
"SB.reverse()",
"SB.reverse",
"SB",
"reverse",
"SC.reverse()",
"SC.reverse",
"SC",
"reverse",
"turn = 'a'",
"turn",
"'a'",
"for i in range(400):\n if turn == 'a':\n if len(SA) == 0:\n print('A')\n return\n turn = SA.pop()\n elif turn == 'b':\n if len(SB) == 0:\n print('B')\n return\n turn = SB.pop()\n else:\n if len(SC) == 0:\n print('C')\n return\n turn = SC.pop()\n ",
"i",
"range(400)",
"range",
"400",
"if turn == 'a':\n if len(SA) == 0:\n print('A')\n return\n turn = SA.pop()\n elif turn == 'b':\n if len(SB) == 0:\n print('B')\n return\n turn = SB.pop()\n else:\n if len(SC) == 0:\n print('C')\n return\n turn = SC.pop()\n ",
"turn == 'a'",
"turn",
"'a'",
"if len(SA) == 0:\n print('A')\n return\n ",
"len(SA) == 0",
"len(SA)",
"len",
"SA",
"0",
"print('A')",
"print",
"'A'",
"return",
"turn = SA.pop()",
"turn",
"SA.pop()",
"SA.pop",
"SA",
"pop",
"elif turn == 'b':\n if len(SB) == 0:\n print('B')\n return\n turn = SB.pop()\n ",
"turn == 'b'",
"turn",
"'b'",
"if len(SB) == 0:\n print('B')\n return\n ",
"len(SB) == 0",
"len(SB)",
"len",
"SB",
"0",
"print('B')",
"print",
"'B'",
"return",
"turn = SB.pop()",
"turn",
"SB.pop()",
"SB.pop",
"SB",
"pop",
"if len(SC) == 0:\n print('C')\n return\n ",
"len(SC) == 0",
"len(SC)",
"len",
"SC",
"0",
"print('C')",
"print",
"'C'",
"return",
"turn = SC.pop()",
"turn",
"SC.pop()",
"SC.pop",
"SC",
"pop",
"if __name__ == \"__main__\":\n main()",
"__name__ == \"__main__\"",
"__name__",
"\"__main__\"",
"main()",
"main",
"def main():\n SA = list(input())\n SB = list(input())\n SC = list(input())\n\n SA.reverse()\n SB.reverse()\n SC.reverse()\n\n turn = 'a'\n for i in range(400):\n if turn == 'a':\n if len(SA) == 0:\n print('A')\n return\n turn = SA.pop()\n elif turn == 'b':\n if len(SB) == 0:\n print('B')\n return\n turn = SB.pop()\n else:\n if len(SC) == 0:\n print('C')\n return\n turn = SC.pop()\n ",
"def main():\n SA = list(input())\n SB = list(input())\n SC = list(input())\n\n SA.reverse()\n SB.reverse()\n SC.reverse()\n\n turn = 'a'\n for i in range(400):\n if turn == 'a':\n if len(SA) == 0:\n print('A')\n return\n turn = SA.pop()\n elif turn == 'b':\n if len(SB) == 0:\n print('B')\n return\n turn = SB.pop()\n else:\n if len(SC) == 0:\n print('C')\n return\n turn = SC.pop()\n ",
"main"
] | def main():
SA = list(input())
SB = list(input())
SC = list(input())
SA.reverse()
SB.reverse()
SC.reverse()
turn = 'a'
for i in range(400):
if turn == 'a':
if len(SA) == 0:
print('A')
return
turn = SA.pop()
elif turn == 'b':
if len(SB) == 0:
print('B')
return
turn = SB.pop()
else:
if len(SC) == 0:
print('C')
return
turn = SC.pop()
if __name__ == "__main__":
main()
|
[
7,
0,
13,
4,
13,
4,
13,
4,
18,
13,
13,
17,
0,
13,
4,
13,
4,
13,
4,
18,
13,
13,
17,
0,
13,
4,
13,
4,
13,
4,
18,
13,
13,
17,
0,
13,
17,
42,
17,
14,
2,
13,
17,
0,
13,
4,
18,
13,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
4,
13,
17,
14,
2,
13,
17,
0,
13,
4,
18,
13,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
4,
13,
17,
0,
13,
4,
18,
13,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
4,
13,
17,
14,
2,
13,
17,
0,
13,
17,
14,
2,
13,
17,
0,
13,
17,
0,
13,
17,
10,
4,
13,
10,
17,
13,
10,
4,
13,
10,
4,
13,
10,
17,
13,
10,
4,
13,
10,
17,
13,
10,
17,
13,
10,
4,
13,
10,
4,
13
] | [
[
122,
2
],
[
123,
9
],
[
128,
13
],
[
129,
20
],
[
137,
24
],
[
138,
31
],
[
140,
35
],
[
141,
41
],
[
126,
41
],
[
144,
41
],
[
135,
41
],
[
149,
44
],
[
123,
47
],
[
123,
54
],
[
141,
64
],
[
126,
64
],
[
144,
64
],
[
135,
64
],
[
146,
67
],
[
129,
70
],
[
129,
77
],
[
131,
86
],
[
138,
89
],
[
138,
96
],
[
150,
106
],
[
147,
106
],
[
132,
106
],
[
134,
109
],
[
150,
113
],
[
147,
113
],
[
132,
113
],
[
143,
116
],
[
125,
119
],
[
122,
123
],
[
125,
126
],
[
128,
129
],
[
131,
132
],
[
134,
135
],
[
137,
138
],
[
140,
141
],
[
143,
144
],
[
146,
147
],
[
149,
150
]
] | [
"a = list(input())\na.append('0')\nb = list(input())\nb.append('0')\nc = list(input())\nc.append('0')\np = 0\n\nwhile True:\n if p == 0:\n y = a.pop(0)\n if len(a) == 0:\n print('A')\n exit(0)\n elif p == 1:\n y = b.pop(0)\n if len(b) == 0:\n print('B')\n exit(0)\n else:\n y = c.pop(0)\n if len(c) == 0:\n print('C')\n exit(0)\n if y == 'a':\n p = 0\n elif y == 'b':\n p = 1\n else:\n p = 2",
"a = list(input())",
"a",
"list(input())",
"list",
"input()",
"input",
"a.append('0')",
"a.append",
"a",
"append",
"'0'",
"b = list(input())",
"b",
"list(input())",
"list",
"input()",
"input",
"b.append('0')",
"b.append",
"b",
"append",
"'0'",
"c = list(input())",
"c",
"list(input())",
"list",
"input()",
"input",
"c.append('0')",
"c.append",
"c",
"append",
"'0'",
"p = 0",
"p",
"0",
"while True:\n if p == 0:\n y = a.pop(0)\n if len(a) == 0:\n print('A')\n exit(0)\n elif p == 1:\n y = b.pop(0)\n if len(b) == 0:\n print('B')\n exit(0)\n else:\n y = c.pop(0)\n if len(c) == 0:\n print('C')\n exit(0)\n if y == 'a':\n p = 0\n elif y == 'b':\n p = 1\n else:\n p = 2",
"True",
"if p == 0:\n y = a.pop(0)\n if len(a) == 0:\n print('A')\n exit(0)\n elif p == 1:\n y = b.pop(0)\n if len(b) == 0:\n print('B')\n exit(0)\n else:\n y = c.pop(0)\n if len(c) == 0:\n print('C')\n exit(0)\n ",
"p == 0",
"p",
"0",
"y = a.pop(0)",
"y",
"a.pop(0)",
"a.pop",
"a",
"pop",
"0",
"if len(a) == 0:\n print('A')\n exit(0)\n ",
"len(a) == 0",
"len(a)",
"len",
"a",
"0",
"print('A')",
"print",
"'A'",
"exit(0)",
"exit",
"0",
"elif p == 1:\n y = b.pop(0)\n if len(b) == 0:\n print('B')\n exit(0)\n ",
"p == 1",
"p",
"1",
"y = b.pop(0)",
"y",
"b.pop(0)",
"b.pop",
"b",
"pop",
"0",
"if len(b) == 0:\n print('B')\n exit(0)\n ",
"len(b) == 0",
"len(b)",
"len",
"b",
"0",
"print('B')",
"print",
"'B'",
"exit(0)",
"exit",
"0",
"y = c.pop(0)",
"y",
"c.pop(0)",
"c.pop",
"c",
"pop",
"0",
"if len(c) == 0:\n print('C')\n exit(0)\n ",
"len(c) == 0",
"len(c)",
"len",
"c",
"0",
"print('C')",
"print",
"'C'",
"exit(0)",
"exit",
"0",
"if y == 'a':\n p = 0\n elif y == 'b':\n p = 1\n else:\n p = 2",
"y == 'a'",
"y",
"'a'",
"p = 0",
"p",
"0",
"elif y == 'b':\n p = 1\n ",
"y == 'b'",
"y",
"'b'",
"p = 1",
"p",
"1",
"p = 2",
"p",
"2",
"a = list(input())",
"list(input())",
"a",
"p = 2",
"2",
"p",
"b = list(input())",
"list(input())",
"b",
"y = c.pop(0)",
"c.pop(0)",
"y",
"p = 0",
"0",
"p",
"c = list(input())",
"list(input())",
"c",
"p = 0",
"0",
"p",
"p = 1",
"1",
"p",
"y = b.pop(0)",
"b.pop(0)",
"y",
"y = a.pop(0)",
"a.pop(0)",
"y"
] | a = list(input())
a.append('0')
b = list(input())
b.append('0')
c = list(input())
c.append('0')
p = 0
while True:
if p == 0:
y = a.pop(0)
if len(a) == 0:
print('A')
exit(0)
elif p == 1:
y = b.pop(0)
if len(b) == 0:
print('B')
exit(0)
else:
y = c.pop(0)
if len(c) == 0:
print('C')
exit(0)
if y == 'a':
p = 0
elif y == 'b':
p = 1
else:
p = 2 |
[
7,
12,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
18,
13,
13,
17,
28,
13,
4,
13,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
3,
0,
13,
4,
18,
13,
13,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
3,
0,
13,
4,
18,
13,
13,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
3,
0,
13,
4,
18,
13,
13,
17,
14,
2,
13,
17,
4,
13,
10,
12,
13
] | [
[
5,
4
],
[
11,
10
],
[
17,
16
],
[
23,
22
],
[
4,
25
],
[
30,
29
],
[
22,
35
],
[
90,
35
],
[
69,
35
],
[
48,
35
],
[
4,
41
],
[
49,
48
],
[
4,
51
],
[
22,
56
],
[
90,
56
],
[
69,
56
],
[
48,
56
],
[
10,
62
],
[
70,
69
],
[
10,
72
],
[
22,
77
],
[
90,
77
],
[
69,
77
],
[
48,
77
],
[
16,
83
],
[
91,
90
],
[
16,
93
],
[
104,
101
]
] | [
"# B - 3人でカードゲームイージー\ndef main():\n sa = list(input())\n sb = list(input())\n sc = list(input())\n t = sa.pop(0)\n\n for _ in range(301):\n if t == 'a':\n if len(sa) == 0:\n print('A')\n break\n t = sa.pop(0)\n elif t == 'b':\n if len(sb) == 0:\n print('B')\n break\n t = sb.pop(0)\n elif t == 'c':\n if len(sc) == 0:\n print('C')\n break\n t = sc.pop(0)\n\n\nif __name__ == \"__main__\":\n main()",
"def main():\n sa = list(input())\n sb = list(input())\n sc = list(input())\n t = sa.pop(0)\n\n for _ in range(301):\n if t == 'a':\n if len(sa) == 0:\n print('A')\n break\n t = sa.pop(0)\n elif t == 'b':\n if len(sb) == 0:\n print('B')\n break\n t = sb.pop(0)\n elif t == 'c':\n if len(sc) == 0:\n print('C')\n break\n t = sc.pop(0)",
"main",
"sa = list(input())",
"sa",
"list(input())",
"list",
"input()",
"input",
"sb = list(input())",
"sb",
"list(input())",
"list",
"input()",
"input",
"sc = list(input())",
"sc",
"list(input())",
"list",
"input()",
"input",
"t = sa.pop(0)",
"t",
"sa.pop(0)",
"sa.pop",
"sa",
"pop",
"0",
"for _ in range(301):\n if t == 'a':\n if len(sa) == 0:\n print('A')\n break\n t = sa.pop(0)\n elif t == 'b':\n if len(sb) == 0:\n print('B')\n break\n t = sb.pop(0)\n elif t == 'c':\n if len(sc) == 0:\n print('C')\n break\n t = sc.pop(0)",
"_",
"range(301)",
"range",
"301",
"if t == 'a':\n if len(sa) == 0:\n print('A')\n break\n t = sa.pop(0)\n elif t == 'b':\n if len(sb) == 0:\n print('B')\n break\n t = sb.pop(0)\n elif t == 'c':\n if len(sc) == 0:\n print('C')\n break\n t = sc.pop(0)",
"t == 'a'",
"t",
"'a'",
"if len(sa) == 0:\n print('A')\n break\n ",
"len(sa) == 0",
"len(sa)",
"len",
"sa",
"0",
"print('A')",
"print",
"'A'",
"break",
"t = sa.pop(0)",
"t",
"sa.pop(0)",
"sa.pop",
"sa",
"pop",
"0",
"elif t == 'b':\n if len(sb) == 0:\n print('B')\n break\n t = sb.pop(0)\n ",
"t == 'b'",
"t",
"'b'",
"if len(sb) == 0:\n print('B')\n break\n ",
"len(sb) == 0",
"len(sb)",
"len",
"sb",
"0",
"print('B')",
"print",
"'B'",
"break",
"t = sb.pop(0)",
"t",
"sb.pop(0)",
"sb.pop",
"sb",
"pop",
"0",
"elif t == 'c':\n if len(sc) == 0:\n print('C')\n break\n t = sc.pop(0)",
"t == 'c'",
"t",
"'c'",
"if len(sc) == 0:\n print('C')\n break\n ",
"len(sc) == 0",
"len(sc)",
"len",
"sc",
"0",
"print('C')",
"print",
"'C'",
"break",
"t = sc.pop(0)",
"t",
"sc.pop(0)",
"sc.pop",
"sc",
"pop",
"0",
"if __name__ == \"__main__\":\n main()",
"__name__ == \"__main__\"",
"__name__",
"\"__main__\"",
"main()",
"main",
"def main():\n sa = list(input())\n sb = list(input())\n sc = list(input())\n t = sa.pop(0)\n\n for _ in range(301):\n if t == 'a':\n if len(sa) == 0:\n print('A')\n break\n t = sa.pop(0)\n elif t == 'b':\n if len(sb) == 0:\n print('B')\n break\n t = sb.pop(0)\n elif t == 'c':\n if len(sc) == 0:\n print('C')\n break\n t = sc.pop(0)",
"def main():\n sa = list(input())\n sb = list(input())\n sc = list(input())\n t = sa.pop(0)\n\n for _ in range(301):\n if t == 'a':\n if len(sa) == 0:\n print('A')\n break\n t = sa.pop(0)\n elif t == 'b':\n if len(sb) == 0:\n print('B')\n break\n t = sb.pop(0)\n elif t == 'c':\n if len(sc) == 0:\n print('C')\n break\n t = sc.pop(0)",
"main"
] | # B - 3人でカードゲームイージー
def main():
sa = list(input())
sb = list(input())
sc = list(input())
t = sa.pop(0)
for _ in range(301):
if t == 'a':
if len(sa) == 0:
print('A')
break
t = sa.pop(0)
elif t == 'b':
if len(sb) == 0:
print('B')
break
t = sb.pop(0)
elif t == 'c':
if len(sc) == 0:
print('C')
break
t = sc.pop(0)
if __name__ == "__main__":
main() |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
17,
28,
13,
4,
13,
17,
14,
2,
13,
17,
14,
40,
13,
4,
13,
17,
4,
13,
0,
13,
18,
13,
17,
4,
18,
13,
13,
17,
14,
2,
13,
17,
14,
40,
13,
4,
13,
17,
4,
13,
0,
13,
18,
13,
17,
4,
18,
13,
13,
17,
14,
40,
13,
4,
13,
17,
4,
13,
0,
13,
18,
13,
17,
4,
18,
13,
13,
17,
10,
4,
13,
10,
18,
13,
10,
18,
13,
10,
18,
13,
10,
4,
13,
10,
4,
13,
10,
17,
13
] | [
[
102,
2
],
[
90,
8
],
[
105,
14
],
[
108,
20
],
[
24,
23
],
[
109,
29
],
[
97,
29
],
[
100,
29
],
[
94,
29
],
[
103,
33
],
[
93,
40
],
[
103,
42
],
[
103,
46
],
[
109,
51
],
[
97,
51
],
[
100,
51
],
[
94,
51
],
[
91,
55
],
[
99,
62
],
[
91,
64
],
[
91,
68
],
[
106,
73
],
[
96,
80
],
[
106,
82
],
[
106,
86
],
[
90,
91
],
[
93,
94
],
[
96,
97
],
[
99,
100
],
[
102,
103
],
[
105,
106
],
[
108,
109
]
] | [
"SA = list(input())\nSB = list(input())\nSC = list(input())\nturn = \"a\"\nfor i in range(300):\n if turn == \"a\":\n if not SA:\n print(\"A\")\n exit()\n turn = SA[0]\n SA.pop(0)\n elif turn == \"b\":\n if not SB:\n print(\"B\")\n exit()\n turn = SB[0]\n SB.pop(0)\n else:\n if not SC:\n print(\"C\")\n exit()\n turn = SC[0]\n SC.pop(0)",
"SA = list(input())",
"SA",
"list(input())",
"list",
"input()",
"input",
"SB = list(input())",
"SB",
"list(input())",
"list",
"input()",
"input",
"SC = list(input())",
"SC",
"list(input())",
"list",
"input()",
"input",
"turn = \"a\"",
"turn",
"\"a\"",
"for i in range(300):\n if turn == \"a\":\n if not SA:\n print(\"A\")\n exit()\n turn = SA[0]\n SA.pop(0)\n elif turn == \"b\":\n if not SB:\n print(\"B\")\n exit()\n turn = SB[0]\n SB.pop(0)\n else:\n if not SC:\n print(\"C\")\n exit()\n turn = SC[0]\n SC.pop(0)",
"i",
"range(300)",
"range",
"300",
"if turn == \"a\":\n if not SA:\n print(\"A\")\n exit()\n turn = SA[0]\n SA.pop(0)\n elif turn == \"b\":\n if not SB:\n print(\"B\")\n exit()\n turn = SB[0]\n SB.pop(0)\n else:\n if not SC:\n print(\"C\")\n exit()\n turn = SC[0]\n SC.pop(0)",
"turn == \"a\"",
"turn",
"\"a\"",
"if not SA:\n print(\"A\")\n exit()\n ",
"not SA",
"SA",
"print(\"A\")",
"print",
"\"A\"",
"exit()",
"exit",
"turn = SA[0]",
"turn",
"SA[0]",
"SA",
"0",
"SA.pop(0)",
"SA.pop",
"SA",
"pop",
"0",
"elif turn == \"b\":\n if not SB:\n print(\"B\")\n exit()\n turn = SB[0]\n SB.pop(0)\n ",
"turn == \"b\"",
"turn",
"\"b\"",
"if not SB:\n print(\"B\")\n exit()\n ",
"not SB",
"SB",
"print(\"B\")",
"print",
"\"B\"",
"exit()",
"exit",
"turn = SB[0]",
"turn",
"SB[0]",
"SB",
"0",
"SB.pop(0)",
"SB.pop",
"SB",
"pop",
"0",
"if not SC:\n print(\"C\")\n exit()\n ",
"not SC",
"SC",
"print(\"C\")",
"print",
"\"C\"",
"exit()",
"exit",
"turn = SC[0]",
"turn",
"SC[0]",
"SC",
"0",
"SC.pop(0)",
"SC.pop",
"SC",
"pop",
"0",
"SB = list(input())",
"list(input())",
"SB",
"turn = SA[0]",
"SA[0]",
"turn",
"turn = SC[0]",
"SC[0]",
"turn",
"turn = SB[0]",
"SB[0]",
"turn",
"SA = list(input())",
"list(input())",
"SA",
"SC = list(input())",
"list(input())",
"SC",
"turn = \"a\"",
"\"a\"",
"turn"
] | SA = list(input())
SB = list(input())
SC = list(input())
turn = "a"
for i in range(300):
if turn == "a":
if not SA:
print("A")
exit()
turn = SA[0]
SA.pop(0)
elif turn == "b":
if not SB:
print("B")
exit()
turn = SB[0]
SB.pop(0)
else:
if not SC:
print("C")
exit()
turn = SC[0]
SC.pop(0) |
[
7,
15,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
39,
0,
13,
39,
0,
13,
39,
28,
13,
4,
13,
4,
13,
13,
4,
18,
13,
13,
18,
13,
13,
28,
13,
4,
13,
4,
13,
13,
4,
18,
13,
13,
18,
13,
13,
28,
13,
4,
13,
4,
13,
13,
4,
18,
13,
13,
18,
13,
13,
0,
13,
4,
13,
13,
0,
13,
4,
13,
13,
0,
13,
4,
13,
13,
0,
13,
4,
18,
13,
13,
42,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
3,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
3,
0,
13,
4,
18,
13,
13,
14,
2,
4,
13,
13,
17,
4,
13,
17,
3,
0,
13,
4,
18,
13,
13,
10,
4,
13,
10,
39,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
39,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
39,
13
] | [
[
163,
3
],
[
151,
9
],
[
175,
15
],
[
187,
21
],
[
166,
24
],
[
154,
27
],
[
31,
30
],
[
164,
35
],
[
188,
38
],
[
164,
41
],
[
30,
42
],
[
45,
44
],
[
152,
49
],
[
167,
52
],
[
152,
55
],
[
44,
56
],
[
59,
58
],
[
176,
63
],
[
155,
66
],
[
176,
69
],
[
58,
70
],
[
160,
72
],
[
188,
75
],
[
178,
77
],
[
167,
80
],
[
169,
82
],
[
155,
85
],
[
184,
87
],
[
161,
90
],
[
188,
90
],
[
185,
96
],
[
173,
96
],
[
182,
96
],
[
158,
96
],
[
161,
102
],
[
188,
102
],
[
157,
109
],
[
161,
112
],
[
188,
112
],
[
185,
116
],
[
173,
116
],
[
182,
116
],
[
158,
116
],
[
179,
122
],
[
167,
122
],
[
181,
129
],
[
179,
132
],
[
167,
132
],
[
170,
138
],
[
155,
138
],
[
172,
145
],
[
170,
148
],
[
155,
148
],
[
151,
152
],
[
154,
155
],
[
157,
158
],
[
160,
161
],
[
163,
164
],
[
166,
167
],
[
169,
170
],
[
172,
173
],
[
175,
176
],
[
178,
179
],
[
181,
182
],
[
184,
185
],
[
187,
188
]
] | [
"from collections import deque\ns1 = str(input())\ns2 = str(input())\ns3 = str(input())\na = []\nb = []\nc = []\nfor i in range(len(s1)):\n a.append(s1[i])\nfor i in range(len(s2)):\n b.append(s2[i])\nfor i in range(len(s3)):\n c.append(s3[i])\na = deque(a)\nb = deque(b)\nc = deque(c)\n\nx = a.popleft()\nwhile True:\n if x == 'a':\n if len(a) == 0:\n print('A')\n break\n x = a.popleft()\n elif x == 'b':\n if len(b) == 0:\n print('B')\n break\n x = b.popleft()\n else:\n if len(c) == 0:\n print('C')\n break\n x = c.popleft()\n\n",
"from collections import deque",
"s1 = str(input())",
"s1",
"str(input())",
"str",
"input()",
"input",
"s2 = str(input())",
"s2",
"str(input())",
"str",
"input()",
"input",
"s3 = str(input())",
"s3",
"str(input())",
"str",
"input()",
"input",
"a = []",
"a",
"[]",
"b = []",
"b",
"[]",
"c = []",
"c",
"[]",
"for i in range(len(s1)):\n a.append(s1[i])",
"i",
"range(len(s1))",
"range",
"len(s1)",
"len",
"s1",
"a.append(s1[i])",
"a.append",
"a",
"append",
"s1[i]",
"s1",
"i",
"for i in range(len(s2)):\n b.append(s2[i])",
"i",
"range(len(s2))",
"range",
"len(s2)",
"len",
"s2",
"b.append(s2[i])",
"b.append",
"b",
"append",
"s2[i]",
"s2",
"i",
"for i in range(len(s3)):\n c.append(s3[i])",
"i",
"range(len(s3))",
"range",
"len(s3)",
"len",
"s3",
"c.append(s3[i])",
"c.append",
"c",
"append",
"s3[i]",
"s3",
"i",
"a = deque(a)",
"a",
"deque(a)",
"deque",
"a",
"b = deque(b)",
"b",
"deque(b)",
"deque",
"b",
"c = deque(c)",
"c",
"deque(c)",
"deque",
"c",
"x = a.popleft()",
"x",
"a.popleft()",
"a.popleft",
"a",
"popleft",
"while True:\n if x == 'a':\n if len(a) == 0:\n print('A')\n break\n x = a.popleft()\n elif x == 'b':\n if len(b) == 0:\n print('B')\n break\n x = b.popleft()\n else:\n if len(c) == 0:\n print('C')\n break\n x = c.popleft()",
"True",
"if x == 'a':\n if len(a) == 0:\n print('A')\n break\n x = a.popleft()\n elif x == 'b':\n if len(b) == 0:\n print('B')\n break\n x = b.popleft()\n else:\n if len(c) == 0:\n print('C')\n break\n x = c.popleft()",
"x == 'a'",
"x",
"'a'",
"if len(a) == 0:\n print('A')\n break\n ",
"len(a) == 0",
"len(a)",
"len",
"a",
"0",
"print('A')",
"print",
"'A'",
"break",
"x = a.popleft()",
"x",
"a.popleft()",
"a.popleft",
"a",
"popleft",
"elif x == 'b':\n if len(b) == 0:\n print('B')\n break\n x = b.popleft()\n ",
"x == 'b'",
"x",
"'b'",
"if len(b) == 0:\n print('B')\n break\n ",
"len(b) == 0",
"len(b)",
"len",
"b",
"0",
"print('B')",
"print",
"'B'",
"break",
"x = b.popleft()",
"x",
"b.popleft()",
"b.popleft",
"b",
"popleft",
"if len(c) == 0:\n print('C')\n break\n ",
"len(c) == 0",
"len(c)",
"len",
"c",
"0",
"print('C')",
"print",
"'C'",
"break",
"x = c.popleft()",
"x",
"c.popleft()",
"c.popleft",
"c",
"popleft",
"s2 = str(input())",
"str(input())",
"s2",
"c = []",
"[]",
"c",
"x = a.popleft()",
"a.popleft()",
"x",
"a = deque(a)",
"deque(a)",
"a",
"s1 = str(input())",
"str(input())",
"s1",
"b = []",
"[]",
"b",
"c = deque(c)",
"deque(c)",
"c",
"x = c.popleft()",
"c.popleft()",
"x",
"s3 = str(input())",
"str(input())",
"s3",
"b = deque(b)",
"deque(b)",
"b",
"x = b.popleft()",
"b.popleft()",
"x",
"x = a.popleft()",
"a.popleft()",
"x",
"a = []",
"[]",
"a"
] | from collections import deque
s1 = str(input())
s2 = str(input())
s3 = str(input())
a = []
b = []
c = []
for i in range(len(s1)):
a.append(s1[i])
for i in range(len(s2)):
b.append(s2[i])
for i in range(len(s3)):
c.append(s3[i])
a = deque(a)
b = deque(b)
c = deque(c)
x = a.popleft()
while True:
if x == 'a':
if len(a) == 0:
print('A')
break
x = a.popleft()
elif x == 'b':
if len(b) == 0:
print('B')
break
x = b.popleft()
else:
if len(c) == 0:
print('C')
break
x = c.popleft()
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
39,
13,
13,
13,
0,
13,
17,
0,
13,
17,
42,
2,
13,
17,
14,
2,
18,
18,
13,
13,
17,
17,
24,
18,
18,
13,
13,
17,
0,
13,
17,
14,
2,
18,
18,
13,
13,
17,
17,
24,
18,
18,
13,
13,
17,
0,
13,
17,
14,
2,
18,
18,
13,
13,
17,
17,
24,
18,
18,
13,
13,
17,
0,
13,
17,
14,
2,
18,
13,
13,
39,
0,
13,
17,
0,
13,
39,
17,
17,
17,
4,
13,
18,
13,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
4,
13,
10,
39,
13,
10,
17,
13,
10,
4,
13,
10,
39,
13,
10,
4,
13
] | [
[
122,
2
],
[
131,
8
],
[
137,
14
],
[
134,
20
],
[
128,
26
],
[
113,
29
],
[
129,
33
],
[
111,
33
],
[
135,
39
],
[
114,
40
],
[
120,
40
],
[
108,
40
],
[
117,
40
],
[
135,
46
],
[
114,
47
],
[
120,
47
],
[
108,
47
],
[
117,
47
],
[
116,
50
],
[
135,
56
],
[
114,
57
],
[
120,
57
],
[
108,
57
],
[
117,
57
],
[
135,
63
],
[
114,
64
],
[
120,
64
],
[
108,
64
],
[
117,
64
],
[
107,
67
],
[
135,
73
],
[
114,
74
],
[
120,
74
],
[
108,
74
],
[
117,
74
],
[
135,
80
],
[
114,
81
],
[
120,
81
],
[
108,
81
],
[
117,
81
],
[
119,
84
],
[
135,
89
],
[
120,
90
],
[
108,
90
],
[
117,
90
],
[
114,
90
],
[
110,
93
],
[
125,
96
],
[
126,
104
],
[
120,
105
],
[
108,
105
],
[
117,
105
],
[
114,
105
],
[
107,
108
],
[
110,
111
],
[
113,
114
],
[
116,
117
],
[
119,
120
],
[
122,
123
],
[
125,
126
],
[
128,
129
],
[
131,
132
],
[
134,
135
],
[
137,
138
]
] | [
"A=list(input())\nB=list(input())\nC=list(input())\nli=[A,B,C]\nsw=True\nk=0\nwhile sw==True:\n if li[k][0]==\"a\":\n del li[k][0]\n k=0\n elif li[k][0]==\"b\":\n del li[k][0]\n k=1\n elif li[k][0]==\"c\":\n del li[k][0]\n k=2\n if li[k]==[]:\n sw=False\nans=[\"A\",\"B\",\"C\"]\nprint(ans[k])",
"A=list(input())",
"A",
"list(input())",
"list",
"input()",
"input",
"B=list(input())",
"B",
"list(input())",
"list",
"input()",
"input",
"C=list(input())",
"C",
"list(input())",
"list",
"input()",
"input",
"li=[A,B,C]",
"li",
"[A,B,C]",
"A",
"B",
"C",
"sw=True",
"sw",
"True",
"k=0",
"k",
"0",
"while sw==True:\n if li[k][0]==\"a\":\n del li[k][0]\n k=0\n elif li[k][0]==\"b\":\n del li[k][0]\n k=1\n elif li[k][0]==\"c\":\n del li[k][0]\n k=2\n if li[k]==[]:\n sw=False",
"sw==True",
"sw",
"True",
"if li[k][0]==\"a\":\n del li[k][0]\n k=0\n elif li[k][0]==\"b\":\n del li[k][0]\n k=1\n elif li[k][0]==\"c\":\n del li[k][0]\n k=2\n ",
"li[k][0]==\"a\"",
"li[k][0]",
"[k]",
"li",
"k",
"0",
"\"a\"",
"del li[k][0]",
"li[k][0]",
"[k]",
"li",
"k",
"0",
"k=0",
"k",
"0",
"elif li[k][0]==\"b\":\n del li[k][0]\n k=1\n ",
"li[k][0]==\"b\"",
"li[k][0]",
"[k]",
"li",
"k",
"0",
"\"b\"",
"del li[k][0]",
"li[k][0]",
"[k]",
"li",
"k",
"0",
"k=1",
"k",
"1",
"elif li[k][0]==\"c\":\n del li[k][0]\n k=2\n ",
"li[k][0]==\"c\"",
"li[k][0]",
"[k]",
"li",
"k",
"0",
"\"c\"",
"del li[k][0]",
"li[k][0]",
"[k]",
"li",
"k",
"0",
"k=2",
"k",
"2",
"if li[k]==[]:\n sw=False",
"li[k]==[]",
"li[k]",
"li",
"k",
"[]",
"sw=False",
"sw",
"False",
"ans=[\"A\",\"B\",\"C\"]",
"ans",
"[\"A\",\"B\",\"C\"]",
"\"A\"",
"\"B\"",
"\"C\"",
"print(ans[k])",
"print",
"ans[k]",
"ans",
"k",
"k=1",
"1",
"k",
"sw=False",
"False",
"sw",
"k=0",
"0",
"k",
"k=0",
"0",
"k",
"k=2",
"2",
"k",
"A=list(input())",
"list(input())",
"A",
"ans=[\"A\",\"B\",\"C\"]",
"[\"A\",\"B\",\"C\"]",
"ans",
"sw=True",
"True",
"sw",
"B=list(input())",
"list(input())",
"B",
"li=[A,B,C]",
"[A,B,C]",
"li",
"C=list(input())",
"list(input())",
"C"
] | A=list(input())
B=list(input())
C=list(input())
li=[A,B,C]
sw=True
k=0
while sw==True:
if li[k][0]=="a":
del li[k][0]
k=0
elif li[k][0]=="b":
del li[k][0]
k=1
elif li[k][0]=="c":
del li[k][0]
k=2
if li[k]==[]:
sw=False
ans=["A","B","C"]
print(ans[k])
|
[
7,
15,
13,
0,
13,
18,
18,
13,
13,
13,
0,
13,
2,
2,
17,
17,
17,
0,
13,
4,
13,
17,
4,
18,
13,
13,
2,
17,
17,
12,
13,
15,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
4,
13,
13,
0,
13,
4,
13,
13,
0,
13,
4,
13,
13,
0,
13,
17,
42,
17,
14,
2,
13,
17,
14,
40,
13,
29,
4,
13,
17,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
14,
40,
13,
29,
4,
13,
17,
0,
13,
4,
18,
13,
13,
14,
40,
13,
29,
4,
13,
17,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
4,
13,
10,
2,
13,
10,
12,
13,
10,
18,
13,
10,
4,
13
] | [
[
124,
4
],
[
118,
11
],
[
127,
18
],
[
34,
33
],
[
38,
37
],
[
42,
41
],
[
46,
45
],
[
33,
48
],
[
51,
50
],
[
37,
53
],
[
56,
55
],
[
41,
58
],
[
61,
60
],
[
60,
66
],
[
106,
66
],
[
93,
66
],
[
76,
66
],
[
45,
70
],
[
77,
76
],
[
45,
79
],
[
60,
83
],
[
106,
83
],
[
93,
83
],
[
76,
83
],
[
50,
87
],
[
94,
93
],
[
50,
96
],
[
55,
100
],
[
107,
106
],
[
55,
109
],
[
122,
116
],
[
118,
119
],
[
124,
125
],
[
127,
128
]
] | [
"import sys\n\nreadline = sys.stdin.readline\nMOD = 10 ** 9 + 7\nINF = float('INF')\nsys.setrecursionlimit(10 ** 5)\n\n\ndef main():\n from collections import deque\n\n a = input()\n b = input()\n c = input()\n\n aq = deque(a)\n bq = deque(b)\n cq = deque(c)\n\n turn = \"a\"\n\n while True:\n if turn == \"a\":\n if not aq:\n return print(\"A\")\n turn = aq.popleft()\n elif turn == \"b\":\n if not bq:\n return print(\"B\")\n turn = bq.popleft()\n else:\n if not cq:\n return print(\"C\")\n turn = cq.popleft()\n\n\nif __name__ == '__main__':\n main()",
"import sys",
"sys",
"readline = sys.stdin.readline",
"readline",
"sys.stdin.readline",
"sys.stdin",
"sys",
"stdin",
"readline",
"MOD = 10 ** 9 + 7",
"MOD",
"10 ** 9 + 7",
"10 ** 9",
"10",
"9",
"7",
"INF = float('INF')",
"INF",
"float('INF')",
"float",
"'INF'",
"sys.setrecursionlimit(10 ** 5)",
"sys.setrecursionlimit",
"sys",
"setrecursionlimit",
"10 ** 5",
"10",
"5",
"def main():\n from collections import deque\n\n a = input()\n b = input()\n c = input()\n\n aq = deque(a)\n bq = deque(b)\n cq = deque(c)\n\n turn = \"a\"\n\n while True:\n if turn == \"a\":\n if not aq:\n return print(\"A\")\n turn = aq.popleft()\n elif turn == \"b\":\n if not bq:\n return print(\"B\")\n turn = bq.popleft()\n else:\n if not cq:\n return print(\"C\")\n turn = cq.popleft()",
"main",
"from collections import deque",
"a = input()",
"a",
"input()",
"input",
"b = input()",
"b",
"input()",
"input",
"c = input()",
"c",
"input()",
"input",
"aq = deque(a)",
"aq",
"deque(a)",
"deque",
"a",
"bq = deque(b)",
"bq",
"deque(b)",
"deque",
"b",
"cq = deque(c)",
"cq",
"deque(c)",
"deque",
"c",
"turn = \"a\"",
"turn",
"\"a\"",
"while True:\n if turn == \"a\":\n if not aq:\n return print(\"A\")\n turn = aq.popleft()\n elif turn == \"b\":\n if not bq:\n return print(\"B\")\n turn = bq.popleft()\n else:\n if not cq:\n return print(\"C\")\n turn = cq.popleft()",
"True",
"if turn == \"a\":\n if not aq:\n return print(\"A\")\n turn = aq.popleft()\n elif turn == \"b\":\n if not bq:\n return print(\"B\")\n turn = bq.popleft()\n else:\n if not cq:\n return print(\"C\")\n turn = cq.popleft()",
"turn == \"a\"",
"turn",
"\"a\"",
"if not aq:\n return print(\"A\")\n ",
"not aq",
"aq",
"return print(\"A\")",
"print(\"A\")",
"print",
"\"A\"",
"turn = aq.popleft()",
"turn",
"aq.popleft()",
"aq.popleft",
"aq",
"popleft",
"elif turn == \"b\":\n if not bq:\n return print(\"B\")\n turn = bq.popleft()\n ",
"turn == \"b\"",
"turn",
"\"b\"",
"if not bq:\n return print(\"B\")\n ",
"not bq",
"bq",
"return print(\"B\")",
"print(\"B\")",
"print",
"\"B\"",
"turn = bq.popleft()",
"turn",
"bq.popleft()",
"bq.popleft",
"bq",
"popleft",
"if not cq:\n return print(\"C\")\n ",
"not cq",
"cq",
"return print(\"C\")",
"print(\"C\")",
"print",
"\"C\"",
"turn = cq.popleft()",
"turn",
"cq.popleft()",
"cq.popleft",
"cq",
"popleft",
"if __name__ == '__main__':\n main()",
"__name__ == '__main__'",
"__name__",
"'__main__'",
"main()",
"main",
"MOD = 10 ** 9 + 7",
"10 ** 9 + 7",
"MOD",
"def main():\n from collections import deque\n\n a = input()\n b = input()\n c = input()\n\n aq = deque(a)\n bq = deque(b)\n cq = deque(c)\n\n turn = \"a\"\n\n while True:\n if turn == \"a\":\n if not aq:\n return print(\"A\")\n turn = aq.popleft()\n elif turn == \"b\":\n if not bq:\n return print(\"B\")\n turn = bq.popleft()\n else:\n if not cq:\n return print(\"C\")\n turn = cq.popleft()",
"def main():\n from collections import deque\n\n a = input()\n b = input()\n c = input()\n\n aq = deque(a)\n bq = deque(b)\n cq = deque(c)\n\n turn = \"a\"\n\n while True:\n if turn == \"a\":\n if not aq:\n return print(\"A\")\n turn = aq.popleft()\n elif turn == \"b\":\n if not bq:\n return print(\"B\")\n turn = bq.popleft()\n else:\n if not cq:\n return print(\"C\")\n turn = cq.popleft()",
"main",
"readline = sys.stdin.readline",
"sys.stdin.readline",
"readline",
"INF = float('INF')",
"float('INF')",
"INF"
] | import sys
readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)
def main():
from collections import deque
a = input()
b = input()
c = input()
aq = deque(a)
bq = deque(b)
cq = deque(c)
turn = "a"
while True:
if turn == "a":
if not aq:
return print("A")
turn = aq.popleft()
elif turn == "b":
if not bq:
return print("B")
turn = bq.popleft()
else:
if not cq:
return print("C")
turn = cq.popleft()
if __name__ == '__main__':
main()
|
[
7,
15,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
39,
4,
13,
13,
4,
13,
13,
4,
13,
13,
0,
13,
21,
22,
17,
17,
22,
17,
17,
22,
17,
17,
0,
13,
17,
42,
18,
13,
13,
0,
13,
4,
18,
18,
13,
13,
13,
0,
13,
18,
13,
13,
14,
2,
13,
17,
4,
13,
17,
14,
2,
13,
17,
4,
13,
17,
14,
2,
13,
17,
4,
13,
17,
10,
4,
13,
10,
17,
13,
10,
4,
13,
10,
18,
13,
10,
21,
13,
10,
4,
13,
10,
39,
13,
10,
4,
13
] | [
[
107,
3
],
[
86,
9
],
[
92,
15
],
[
104,
21
],
[
108,
25
],
[
87,
28
],
[
93,
31
],
[
98,
33
],
[
89,
45
],
[
105,
49
],
[
90,
50
],
[
96,
50
],
[
101,
52
],
[
105,
56
],
[
90,
57
],
[
96,
57
],
[
95,
60
],
[
99,
62
],
[
102,
63
],
[
96,
66
],
[
90,
66
],
[
96,
73
],
[
90,
73
],
[
96,
80
],
[
90,
80
],
[
86,
87
],
[
89,
90
],
[
92,
93
],
[
95,
96
],
[
98,
99
],
[
101,
102
],
[
104,
105
],
[
107,
108
]
] | [
"from collections import deque\n\nA = list(input())\nB = list(input())\nC = list(input())\n\nCARDS = [deque(A),deque(B),deque(C)]\ns_to_i = {\"a\":0,\"b\":1,\"c\":2}\nturn = 0\n\nwhile CARDS[turn]:\n nxt = CARDS[turn].popleft()\n turn = s_to_i[nxt]\n \nif turn == 0:\n print(\"A\")\nelif turn == 1:\n print(\"B\")\nelif turn == 2:\n print(\"C\")\n",
"from collections import deque",
"A = list(input())",
"A",
"list(input())",
"list",
"input()",
"input",
"B = list(input())",
"B",
"list(input())",
"list",
"input()",
"input",
"C = list(input())",
"C",
"list(input())",
"list",
"input()",
"input",
"CARDS = [deque(A),deque(B),deque(C)]",
"CARDS",
"[deque(A),deque(B),deque(C)]",
"deque(A)",
"deque",
"A",
"deque(B)",
"deque",
"B",
"deque(C)",
"deque",
"C",
"s_to_i = {\"a\":0,\"b\":1,\"c\":2}",
"s_to_i",
"{\"a\":0,\"b\":1,\"c\":2}",
"\"a\"",
"\"a\"",
"0",
"\"b\"",
"\"b\"",
"1",
"\"c\"",
"\"c\"",
"2",
"turn = 0",
"turn",
"0",
"while CARDS[turn]:\n nxt = CARDS[turn].popleft()\n turn = s_to_i[nxt]\n ",
"CARDS[turn]",
"CARDS",
"turn",
"nxt = CARDS[turn].popleft()",
"nxt",
"CARDS[turn].popleft()",
"[turn].popleft",
"[turn]",
"CARDS",
"turn",
"popleft",
"turn = s_to_i[nxt]",
"turn",
"s_to_i[nxt]",
"s_to_i",
"nxt",
"if turn == 0:\n print(\"A\")\nelif turn == 1:\n print(\"B\")\nelif turn == 2:\n print(\"C\")",
"turn == 0",
"turn",
"0",
"print(\"A\")",
"print",
"\"A\"",
"elif turn == 1:\n print(\"B\")",
"turn == 1",
"turn",
"1",
"print(\"B\")",
"print",
"\"B\"",
"elif turn == 2:\n print(\"C\")",
"turn == 2",
"turn",
"2",
"print(\"C\")",
"print",
"\"C\"",
"B = list(input())",
"list(input())",
"B",
"turn = 0",
"0",
"turn",
"C = list(input())",
"list(input())",
"C",
"turn = s_to_i[nxt]",
"s_to_i[nxt]",
"turn",
"s_to_i = {\"a\":0,\"b\":1,\"c\":2}",
"{\"a\":0,\"b\":1,\"c\":2}",
"s_to_i",
"nxt = CARDS[turn].popleft()",
"CARDS[turn].popleft()",
"nxt",
"CARDS = [deque(A),deque(B),deque(C)]",
"[deque(A),deque(B),deque(C)]",
"CARDS",
"A = list(input())",
"list(input())",
"A"
] | from collections import deque
A = list(input())
B = list(input())
C = list(input())
CARDS = [deque(A),deque(B),deque(C)]
s_to_i = {"a":0,"b":1,"c":2}
turn = 0
while CARDS[turn]:
nxt = CARDS[turn].popleft()
turn = s_to_i[nxt]
if turn == 0:
print("A")
elif turn == 1:
print("B")
elif turn == 2:
print("C")
|
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
17,
42,
17,
14,
2,
13,
17,
14,
2,
13,
17,
4,
13,
17,
4,
13,
0,
13,
18,
13,
17,
0,
13,
18,
13,
39,
17,
14,
2,
13,
17,
14,
2,
13,
17,
4,
13,
17,
4,
13,
0,
13,
18,
13,
17,
0,
13,
18,
13,
39,
17,
14,
2,
13,
17,
4,
13,
17,
4,
13,
0,
13,
18,
13,
17,
0,
13,
18,
13,
39,
17,
10,
18,
13,
10,
4,
13,
10,
18,
13,
10,
17,
13,
10,
4,
13,
10,
18,
13,
10,
18,
13,
10,
18,
13,
10,
18,
13,
10,
4,
13
] | [
[
90,
2
],
[
99,
6
],
[
114,
10
],
[
96,
14
],
[
97,
20
],
[
106,
20
],
[
109,
20
],
[
112,
20
],
[
91,
24
],
[
94,
24
],
[
111,
32
],
[
91,
34
],
[
94,
34
],
[
93,
37
],
[
91,
39
],
[
94,
39
],
[
97,
44
],
[
106,
44
],
[
109,
44
],
[
112,
44
],
[
100,
48
],
[
88,
48
],
[
108,
56
],
[
100,
58
],
[
88,
58
],
[
87,
61
],
[
100,
63
],
[
88,
63
],
[
115,
68
],
[
103,
68
],
[
105,
76
],
[
115,
78
],
[
103,
78
],
[
102,
81
],
[
115,
83
],
[
103,
83
],
[
87,
88
],
[
90,
91
],
[
93,
94
],
[
96,
97
],
[
99,
100
],
[
102,
103
],
[
105,
106
],
[
108,
109
],
[
111,
112
],
[
114,
115
]
] | [
"a = input()\nb = input()\nc = input()\n\nt = 'a'\nwhile True:\n if t == 'a':\n if a == '':\n print('A')\n exit()\n t = a[0]\n a = a[1:]\n elif t == 'b':\n if b == '':\n print('B')\n exit()\n t = b[0]\n b = b[1:]\n else:\n if c == '':\n print('C')\n exit()\n t = c[0]\n c = c[1:]",
"a = input()",
"a",
"input()",
"input",
"b = input()",
"b",
"input()",
"input",
"c = input()",
"c",
"input()",
"input",
"t = 'a'",
"t",
"'a'",
"while True:\n if t == 'a':\n if a == '':\n print('A')\n exit()\n t = a[0]\n a = a[1:]\n elif t == 'b':\n if b == '':\n print('B')\n exit()\n t = b[0]\n b = b[1:]\n else:\n if c == '':\n print('C')\n exit()\n t = c[0]\n c = c[1:]",
"True",
"if t == 'a':\n if a == '':\n print('A')\n exit()\n t = a[0]\n a = a[1:]\n elif t == 'b':\n if b == '':\n print('B')\n exit()\n t = b[0]\n b = b[1:]\n else:\n if c == '':\n print('C')\n exit()\n t = c[0]\n c = c[1:]",
"t == 'a'",
"t",
"'a'",
"if a == '':\n print('A')\n exit()\n ",
"a == ''",
"a",
"''",
"print('A')",
"print",
"'A'",
"exit()",
"exit",
"t = a[0]",
"t",
"a[0]",
"a",
"0",
"a = a[1:]",
"a",
"a[1:]",
"a",
"1:",
"1",
"elif t == 'b':\n if b == '':\n print('B')\n exit()\n t = b[0]\n b = b[1:]\n ",
"t == 'b'",
"t",
"'b'",
"if b == '':\n print('B')\n exit()\n ",
"b == ''",
"b",
"''",
"print('B')",
"print",
"'B'",
"exit()",
"exit",
"t = b[0]",
"t",
"b[0]",
"b",
"0",
"b = b[1:]",
"b",
"b[1:]",
"b",
"1:",
"1",
"if c == '':\n print('C')\n exit()\n ",
"c == ''",
"c",
"''",
"print('C')",
"print",
"'C'",
"exit()",
"exit",
"t = c[0]",
"t",
"c[0]",
"c",
"0",
"c = c[1:]",
"c",
"c[1:]",
"c",
"1:",
"1",
"b = b[1:]",
"b[1:]",
"b",
"a = input()",
"input()",
"a",
"a = a[1:]",
"a[1:]",
"a",
"t = 'a'",
"'a'",
"t",
"b = input()",
"input()",
"b",
"c = c[1:]",
"c[1:]",
"c",
"t = c[0]",
"c[0]",
"t",
"t = b[0]",
"b[0]",
"t",
"t = a[0]",
"a[0]",
"t",
"c = input()",
"input()",
"c"
] | a = input()
b = input()
c = input()
t = 'a'
while True:
if t == 'a':
if a == '':
print('A')
exit()
t = a[0]
a = a[1:]
elif t == 'b':
if b == '':
print('B')
exit()
t = b[0]
b = b[1:]
else:
if c == '':
print('C')
exit()
t = c[0]
c = c[1:]
|
[
7,
41,
28,
13,
4,
13,
17,
4,
4,
13,
0,
13,
13,
28,
13,
4,
13,
17,
0,
18,
13,
13,
4,
13,
18,
13,
13,
0,
13,
17,
42,
17,
14,
2,
40,
18,
13,
17,
2,
13,
17,
4,
13,
17,
3,
14,
2,
40,
18,
13,
17,
2,
13,
17,
4,
13,
17,
3,
14,
2,
40,
18,
13,
17,
2,
13,
17,
4,
13,
17,
3,
0,
13,
4,
18,
18,
13,
13,
13,
17,
14,
2,
13,
17,
0,
13,
17,
14,
2,
13,
17,
0,
13,
17,
14,
2,
13,
17,
0,
13,
17,
10,
13,
13,
10,
4,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13
] | [
[
4,
3
],
[
102,
11
],
[
15,
14
],
[
22,
19
],
[
103,
20
],
[
14,
21
],
[
19,
24
],
[
103,
25
],
[
14,
26
],
[
111,
28
],
[
103,
36
],
[
112,
39
],
[
115,
39
],
[
109,
39
],
[
118,
39
],
[
103,
49
],
[
112,
52
],
[
115,
52
],
[
109,
52
],
[
118,
52
],
[
103,
62
],
[
112,
65
],
[
115,
65
],
[
109,
65
],
[
118,
65
],
[
105,
72
],
[
103,
76
],
[
112,
77
],
[
115,
77
],
[
109,
77
],
[
118,
77
],
[
106,
82
],
[
117,
85
],
[
106,
89
],
[
108,
92
],
[
106,
96
],
[
114,
99
],
[
102,
103
],
[
105,
106
],
[
108,
109
],
[
111,
112
],
[
114,
115
],
[
117,
118
]
] | [
"S = [input() for _ in range(3)]\nfor i in range(3):\n S[i] = list(S[i])\np = 0 #プレイヤー\nwhile True:\n if not S[0] and p == 0:\n print(\"A\")\n break\n if not S[1] and p == 1:\n print(\"B\")\n break\n if not S[2] and p == 2:\n print(\"C\")\n break\n p_t = S[p].pop(0)\n if p_t == \"a\":\n p = 0\n elif p_t == \"b\":\n p = 1\n elif p_t == \"c\":\n p = 2",
"input() for _ in range(3)",
"for _ in range(3)",
"_",
"range(3)",
"range",
"3",
"for _ in range(3)",
"input()",
"input",
"S = [input() for _ in range(3)]",
"S",
"[input() for _ in range(3)]",
"for i in range(3):\n S[i] = list(S[i])",
"i",
"range(3)",
"range",
"3",
"S[i] = list(S[i])",
"S[i]",
"S",
"i",
"list(S[i])",
"list",
"S[i]",
"S",
"i",
"p = 0",
"p",
"0",
"while True:\n if not S[0] and p == 0:\n print(\"A\")\n break\n if not S[1] and p == 1:\n print(\"B\")\n break\n if not S[2] and p == 2:\n print(\"C\")\n break\n p_t = S[p].pop(0)\n if p_t == \"a\":\n p = 0\n elif p_t == \"b\":\n p = 1\n elif p_t == \"c\":\n p = 2",
"True",
"if not S[0] and p == 0:\n print(\"A\")\n break\n ",
"not S[0] and p == 0",
"not S[0]",
"S[0]",
"S",
"0",
"p == 0",
"p",
"0",
"print(\"A\")",
"print",
"\"A\"",
"break",
"if not S[1] and p == 1:\n print(\"B\")\n break\n ",
"not S[1] and p == 1",
"not S[1]",
"S[1]",
"S",
"1",
"p == 1",
"p",
"1",
"print(\"B\")",
"print",
"\"B\"",
"break",
"if not S[2] and p == 2:\n print(\"C\")\n break\n ",
"not S[2] and p == 2",
"not S[2]",
"S[2]",
"S",
"2",
"p == 2",
"p",
"2",
"print(\"C\")",
"print",
"\"C\"",
"break",
"p_t = S[p].pop(0)",
"p_t",
"S[p].pop(0)",
"[p].pop",
"[p]",
"S",
"p",
"pop",
"0",
"if p_t == \"a\":\n p = 0\n elif p_t == \"b\":\n p = 1\n elif p_t == \"c\":\n p = 2",
"p_t == \"a\"",
"p_t",
"\"a\"",
"p = 0",
"p",
"0",
"elif p_t == \"b\":\n p = 1\n ",
"p_t == \"b\"",
"p_t",
"\"b\"",
"p = 1",
"p",
"1",
"elif p_t == \"c\":\n p = 2",
"p_t == \"c\"",
"p_t",
"\"c\"",
"p = 2",
"p",
"2",
"S = [input() for _ in range(3)]",
"[input() for _ in range(3)]",
"S",
"p_t = S[p].pop(0)",
"S[p].pop(0)",
"p_t",
"p = 1",
"1",
"p",
"p = 0",
"0",
"p",
"p = 2",
"2",
"p",
"p = 0",
"0",
"p"
] | S = [input() for _ in range(3)]
for i in range(3):
S[i] = list(S[i])
p = 0 #プレイヤー
while True:
if not S[0] and p == 0:
print("A")
break
if not S[1] and p == 1:
print("B")
break
if not S[2] and p == 2:
print("C")
break
p_t = S[p].pop(0)
if p_t == "a":
p = 0
elif p_t == "b":
p = 1
elif p_t == "c":
p = 2 |
[
7,
0,
13,
17,
0,
18,
13,
17,
4,
13,
4,
13,
0,
18,
13,
17,
4,
13,
4,
13,
0,
18,
13,
17,
4,
13,
4,
13,
0,
13,
17,
42,
2,
4,
13,
18,
13,
13,
17,
0,
13,
4,
18,
18,
13,
13,
13,
17,
4,
13,
4,
18,
13,
13,
10,
4,
13,
10,
17,
13,
10,
17,
13
] | [
[
58,
2
],
[
8,
5
],
[
59,
6
],
[
16,
13
],
[
59,
14
],
[
24,
21
],
[
59,
22
],
[
61,
29
],
[
59,
36
],
[
62,
37
],
[
56,
37
],
[
55,
40
],
[
59,
44
],
[
62,
45
],
[
56,
45
],
[
56,
52
],
[
62,
52
],
[
55,
56
],
[
58,
59
],
[
61,
62
]
] | [
"s = {}\ns[\"a\"] = list(input())\ns[\"b\"] = list(input())\ns[\"c\"] = list(input())\n\nturn = \"a\"\nwhile len(s[turn]) > 0:\n turn = s[turn].pop(0)\n\nprint(turn.upper())",
"s = {}",
"s",
"{}",
"s[\"a\"] = list(input())",
"s[\"a\"]",
"s",
"\"a\"",
"list(input())",
"list",
"input()",
"input",
"s[\"b\"] = list(input())",
"s[\"b\"]",
"s",
"\"b\"",
"list(input())",
"list",
"input()",
"input",
"s[\"c\"] = list(input())",
"s[\"c\"]",
"s",
"\"c\"",
"list(input())",
"list",
"input()",
"input",
"turn = \"a\"",
"turn",
"\"a\"",
"while len(s[turn]) > 0:\n turn = s[turn].pop(0)",
"len(s[turn]) > 0",
"len(s[turn])",
"len",
"s[turn]",
"s",
"turn",
"0",
"turn = s[turn].pop(0)",
"turn",
"s[turn].pop(0)",
"[turn].pop",
"[turn]",
"s",
"turn",
"pop",
"0",
"print(turn.upper())",
"print",
"turn.upper()",
"turn.upper",
"turn",
"upper",
"turn = s[turn].pop(0)",
"s[turn].pop(0)",
"turn",
"s = {}",
"{}",
"s",
"turn = \"a\"",
"\"a\"",
"turn"
] | s = {}
s["a"] = list(input())
s["b"] = list(input())
s["c"] = list(input())
turn = "a"
while len(s[turn]) > 0:
turn = s[turn].pop(0)
print(turn.upper())
|
[
7,
41,
28,
13,
4,
13,
17,
4,
4,
13,
0,
13,
13,
13,
13,
0,
13,
17,
28,
13,
4,
13,
17,
38,
5,
4,
13,
4,
18,
13,
13,
3,
14,
2,
13,
17,
0,
13,
18,
13,
17,
0,
13,
18,
13,
39,
17,
14,
2,
13,
17,
0,
13,
18,
13,
17,
0,
13,
18,
13,
39,
17,
14,
2,
13,
17,
0,
13,
18,
13,
17,
0,
13,
18,
13,
39,
17,
10,
18,
13,
10,
18,
13,
10,
13,
13,
10,
18,
13,
10,
13,
13,
10,
13,
13,
10,
18,
13,
10,
18,
13,
10,
18,
13,
10,
17,
13
] | [
[
4,
3
],
[
93,
11
],
[
93,
13
],
[
93,
14
],
[
105,
16
],
[
20,
19
],
[
106,
29
],
[
100,
29
],
[
97,
29
],
[
88,
29
],
[
106,
34
],
[
100,
34
],
[
97,
34
],
[
88,
34
],
[
87,
37
],
[
94,
39
],
[
103,
39
],
[
102,
42
],
[
94,
44
],
[
103,
44
],
[
106,
49
],
[
100,
49
],
[
97,
49
],
[
88,
49
],
[
96,
52
],
[
91,
54
],
[
79,
54
],
[
78,
57
],
[
91,
59
],
[
79,
59
],
[
106,
64
],
[
100,
64
],
[
97,
64
],
[
88,
64
],
[
99,
67
],
[
85,
69
],
[
82,
69
],
[
81,
72
],
[
85,
74
],
[
82,
74
],
[
78,
79
],
[
81,
82
],
[
93,
85
],
[
87,
88
],
[
93,
91
],
[
93,
94
],
[
96,
97
],
[
99,
100
],
[
102,
103
],
[
105,
106
]
] | [
"a,b,c = [input() for i in range(3)]\nsa = 'a'\nfor i in range(1796):\n try:\n if sa == 'a':\n sa = a[0]\n a = a[1:]\n\n elif sa == 'b':\n sa = b[0]\n b = b[1:]\n\n elif sa == 'c':\n sa = c[0]\n c = c[1:]\n except:\n print(sa.upper())\n break",
"input() for i in range(3)",
"for i in range(3)",
"i",
"range(3)",
"range",
"3",
"for i in range(3)",
"input()",
"input",
"a,b,c = [input() for i in range(3)]",
"a",
"[input() for i in range(3)]",
"b",
"c",
"sa = 'a'",
"sa",
"'a'",
"for i in range(1796):\n try:\n if sa == 'a':\n sa = a[0]\n a = a[1:]\n\n elif sa == 'b':\n sa = b[0]\n b = b[1:]\n\n elif sa == 'c':\n sa = c[0]\n c = c[1:]\n except:\n print(sa.upper())\n break",
"i",
"range(1796)",
"range",
"1796",
"try:\n if sa == 'a':\n sa = a[0]\n a = a[1:]\n\n elif sa == 'b':\n sa = b[0]\n b = b[1:]\n\n elif sa == 'c':\n sa = c[0]\n c = c[1:]\n except:\n print(sa.upper())\n break",
"except:\n print(sa.upper())\n break",
"print(sa.upper())",
"print",
"sa.upper()",
"sa.upper",
"sa",
"upper",
"break",
"if sa == 'a':\n sa = a[0]\n a = a[1:]\n\n elif sa == 'b':\n sa = b[0]\n b = b[1:]\n\n elif sa == 'c':\n sa = c[0]\n c = c[1:]\n ",
"sa == 'a'",
"sa",
"'a'",
"sa = a[0]",
"sa",
"a[0]",
"a",
"0",
"a = a[1:]",
"a",
"a[1:]",
"a",
"1:",
"1",
"elif sa == 'b':\n sa = b[0]\n b = b[1:]\n\n ",
"sa == 'b'",
"sa",
"'b'",
"sa = b[0]",
"sa",
"b[0]",
"b",
"0",
"b = b[1:]",
"b",
"b[1:]",
"b",
"1:",
"1",
"elif sa == 'c':\n sa = c[0]\n c = c[1:]\n ",
"sa == 'c'",
"sa",
"'c'",
"sa = c[0]",
"sa",
"c[0]",
"c",
"0",
"c = c[1:]",
"c",
"c[1:]",
"c",
"1:",
"1",
"b = b[1:]",
"b[1:]",
"b",
"c = c[1:]",
"c[1:]",
"c",
"c = [input() for i in range(3)]",
"[input() for i in range(3)]",
"c",
"sa = a[0]",
"a[0]",
"sa",
"b,c = [input() for i in range(3)]",
"[input() for i in range(3)]",
"b",
"a,b,c = [input() for i in range(3)]",
"[input() for i in range(3)]",
"a",
"sa = b[0]",
"b[0]",
"sa",
"sa = c[0]",
"c[0]",
"sa",
"a = a[1:]",
"a[1:]",
"a",
"sa = 'a'",
"'a'",
"sa"
] | a,b,c = [input() for i in range(3)]
sa = 'a'
for i in range(1796):
try:
if sa == 'a':
sa = a[0]
a = a[1:]
elif sa == 'b':
sa = b[0]
b = b[1:]
elif sa == 'c':
sa = c[0]
c = c[1:]
except:
print(sa.upper())
break |
[
7,
15,
0,
13,
4,
13,
13,
39,
4,
13,
4,
13,
4,
13,
13,
13,
0,
13,
21,
22,
17,
13,
22,
17,
13,
22,
17,
13,
0,
13,
17,
42,
17,
0,
13,
18,
13,
13,
14,
40,
13,
4,
13,
4,
18,
13,
13,
4,
13,
0,
13,
4,
18,
13,
13,
10,
4,
13,
10,
18,
13,
10,
17,
13,
10,
21,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13
] | [
[
71,
3
],
[
71,
14
],
[
71,
15
],
[
65,
17
],
[
62,
29
],
[
59,
34
],
[
66,
36
],
[
63,
37
],
[
75,
37
],
[
60,
40
],
[
63,
45
],
[
75,
45
],
[
74,
50
],
[
60,
53
],
[
71,
57
],
[
59,
60
],
[
62,
63
],
[
65,
66
],
[
71,
69
],
[
71,
72
],
[
74,
75
]
] | [
"from collections import deque\nA, B, C = map(deque, (input(), input(), input()))\nd = {'a':A, 'b':B, 'c':C}\nc = 'a'\nwhile True:\n X = d[c]\n if not X:\n print(c.upper())\n exit()\n c = X.popleft()",
"from collections import deque",
"A, B, C = map(deque, (input(), input(), input()))",
"A",
"map(deque, (input(), input(), input()))",
"map",
"deque",
"(input(), input(), input())",
"input()",
"input",
"input()",
"input",
"input()",
"input",
"B",
"C",
"d = {'a':A, 'b':B, 'c':C}",
"d",
"{'a':A, 'b':B, 'c':C}",
"'a'",
"'a'",
"A",
"'b'",
"'b'",
"B",
"'c'",
"'c'",
"C",
"c = 'a'",
"c",
"'a'",
"while True:\n X = d[c]\n if not X:\n print(c.upper())\n exit()\n c = X.popleft()",
"True",
"X = d[c]",
"X",
"d[c]",
"d",
"c",
"if not X:\n print(c.upper())\n exit()\n ",
"not X",
"X",
"print(c.upper())",
"print",
"c.upper()",
"c.upper",
"c",
"upper",
"exit()",
"exit",
"c = X.popleft()",
"c",
"X.popleft()",
"X.popleft",
"X",
"popleft",
"C = map(deque, (input(), input(), input()))",
"map(deque, (input(), input(), input()))",
"C",
"X = d[c]",
"d[c]",
"X",
"c = 'a'",
"'a'",
"c",
"d = {'a':A, 'b':B, 'c':C}",
"{'a':A, 'b':B, 'c':C}",
"d",
"B, C = map(deque, (input(), input(), input()))",
"map(deque, (input(), input(), input()))",
"B",
"A, B, C = map(deque, (input(), input(), input()))",
"map(deque, (input(), input(), input()))",
"A",
"c = X.popleft()",
"X.popleft()",
"c"
] | from collections import deque
A, B, C = map(deque, (input(), input(), input()))
d = {'a':A, 'b':B, 'c':C}
c = 'a'
while True:
X = d[c]
if not X:
print(c.upper())
exit()
c = X.popleft()
|
[
7,
15,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
18,
13,
13,
0,
13,
17,
42,
17,
14,
2,
13,
17,
0,
13,
13,
0,
13,
17,
14,
2,
13,
17,
0,
13,
13,
0,
13,
17,
14,
2,
13,
17,
0,
13,
13,
0,
13,
17,
14,
2,
4,
13,
13,
17,
3,
0,
13,
4,
18,
13,
13,
4,
13,
13,
10,
4,
13,
10,
13,
13,
10,
4,
13,
10,
4,
13,
10,
13,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
13,
13,
10,
17,
13,
10,
4,
13,
10,
4,
13
] | [
[
78,
3
],
[
84,
9
],
[
111,
15
],
[
108,
21
],
[
79,
24
],
[
93,
27
],
[
109,
33
],
[
88,
33
],
[
90,
36
],
[
79,
37
],
[
96,
39
],
[
109,
43
],
[
88,
43
],
[
81,
46
],
[
85,
47
],
[
99,
49
],
[
109,
53
],
[
88,
53
],
[
102,
56
],
[
112,
57
],
[
105,
59
],
[
103,
65
],
[
82,
65
],
[
91,
65
],
[
87,
69
],
[
103,
72
],
[
82,
72
],
[
91,
72
],
[
106,
76
],
[
100,
76
],
[
97,
76
],
[
94,
76
],
[
78,
79
],
[
85,
81
],
[
81,
82
],
[
84,
85
],
[
87,
88
],
[
79,
90
],
[
90,
91
],
[
93,
94
],
[
96,
97
],
[
99,
100
],
[
112,
102
],
[
102,
103
],
[
105,
106
],
[
108,
109
],
[
111,
112
]
] | [
"from collections import deque\n\nSA = deque(input())\nSB = deque(input())\nSC = deque(input())\n\nNowCard = SA.popleft()\nans = 'A'\n\nwhile True:\n if NowCard == 'a':\n NowList = SA\n ans = 'A'\n elif NowCard == 'b':\n NowList = SB\n ans = 'B'\n elif NowCard == 'c':\n NowList = SC\n ans = 'C'\n\n if len(NowList) == 0:\n break\n\n NowCard = NowList.popleft()\n\nprint(ans)",
"from collections import deque",
"SA = deque(input())",
"SA",
"deque(input())",
"deque",
"input()",
"input",
"SB = deque(input())",
"SB",
"deque(input())",
"deque",
"input()",
"input",
"SC = deque(input())",
"SC",
"deque(input())",
"deque",
"input()",
"input",
"NowCard = SA.popleft()",
"NowCard",
"SA.popleft()",
"SA.popleft",
"SA",
"popleft",
"ans = 'A'",
"ans",
"'A'",
"while True:\n if NowCard == 'a':\n NowList = SA\n ans = 'A'\n elif NowCard == 'b':\n NowList = SB\n ans = 'B'\n elif NowCard == 'c':\n NowList = SC\n ans = 'C'\n\n if len(NowList) == 0:\n break\n\n NowCard = NowList.popleft()",
"True",
"if NowCard == 'a':\n NowList = SA\n ans = 'A'\n elif NowCard == 'b':\n NowList = SB\n ans = 'B'\n elif NowCard == 'c':\n NowList = SC\n ans = 'C'\n\n ",
"NowCard == 'a'",
"NowCard",
"'a'",
"NowList = SA",
"NowList",
"SA",
"ans = 'A'",
"ans",
"'A'",
"elif NowCard == 'b':\n NowList = SB\n ans = 'B'\n ",
"NowCard == 'b'",
"NowCard",
"'b'",
"NowList = SB",
"NowList",
"SB",
"ans = 'B'",
"ans",
"'B'",
"elif NowCard == 'c':\n NowList = SC\n ans = 'C'\n\n ",
"NowCard == 'c'",
"NowCard",
"'c'",
"NowList = SC",
"NowList",
"SC",
"ans = 'C'",
"ans",
"'C'",
"if len(NowList) == 0:\n break\n\n ",
"len(NowList) == 0",
"len(NowList)",
"len",
"NowList",
"0",
"break",
"NowCard = NowList.popleft()",
"NowCard",
"NowList.popleft()",
"NowList.popleft",
"NowList",
"popleft",
"print(ans)",
"print",
"ans",
"SA = deque(input())",
"deque(input())",
"SA",
"NowList = SB",
"SB",
"NowList",
"SB = deque(input())",
"deque(input())",
"SB",
"NowCard = NowList.popleft()",
"NowList.popleft()",
"NowCard",
"NowList = SA",
"SA",
"NowList",
"ans = 'A'",
"'A'",
"ans",
"ans = 'A'",
"'A'",
"ans",
"ans = 'B'",
"'B'",
"ans",
"NowList = SC",
"SC",
"NowList",
"ans = 'C'",
"'C'",
"ans",
"NowCard = SA.popleft()",
"SA.popleft()",
"NowCard",
"SC = deque(input())",
"deque(input())",
"SC"
] | from collections import deque
SA = deque(input())
SB = deque(input())
SC = deque(input())
NowCard = SA.popleft()
ans = 'A'
while True:
if NowCard == 'a':
NowList = SA
ans = 'A'
elif NowCard == 'b':
NowList = SB
ans = 'B'
elif NowCard == 'c':
NowList = SC
ans = 'C'
if len(NowList) == 0:
break
NowCard = NowList.popleft()
print(ans)
|
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
13,
0,
13,
4,
13,
0,
13,
4,
13,
13,
0,
13,
4,
13,
0,
13,
4,
13,
13,
0,
13,
17,
42,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
3,
0,
13,
4,
18,
13,
13,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
3,
0,
13,
4,
18,
13,
13,
17,
14,
2,
4,
13,
13,
17,
3,
0,
13,
4,
18,
13,
13,
17,
4,
13,
4,
18,
13,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
17,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13
] | [
[
114,
2
],
[
90,
6
],
[
115,
9
],
[
99,
11
],
[
93,
15
],
[
100,
18
],
[
96,
20
],
[
111,
24
],
[
97,
27
],
[
108,
29
],
[
109,
35
],
[
103,
35
],
[
118,
35
],
[
106,
35
],
[
91,
41
],
[
105,
45
],
[
91,
48
],
[
109,
53
],
[
103,
53
],
[
118,
53
],
[
106,
53
],
[
94,
59
],
[
117,
63
],
[
94,
66
],
[
112,
73
],
[
102,
77
],
[
112,
80
],
[
103,
87
],
[
118,
87
],
[
106,
87
],
[
109,
87
],
[
90,
91
],
[
93,
94
],
[
96,
97
],
[
99,
100
],
[
102,
103
],
[
105,
106
],
[
108,
109
],
[
111,
112
],
[
114,
115
],
[
117,
118
]
] | [
"AA = input()\nA =list(AA)\nBB = input()\nB = list(BB)\nCC = input()\nC = list(CC)\n\nX ='a'\n\nwhile True:\n \n if X == 'a':\n if len(A) == 0:\n break\n else:\n X = A.pop(0) \n elif X =='b':\n if len(B) ==0:\n break\n else:\n X = B.pop(0)\n else:\n if len(C) == 0:\n break\n else:\n X = C.pop(0)\nprint(X.upper())",
"AA = input()",
"AA",
"input()",
"input",
"A =list(AA)",
"A",
"list(AA)",
"list",
"AA",
"BB = input()",
"BB",
"input()",
"input",
"B = list(BB)",
"B",
"list(BB)",
"list",
"BB",
"CC = input()",
"CC",
"input()",
"input",
"C = list(CC)",
"C",
"list(CC)",
"list",
"CC",
"X ='a'",
"X",
"'a'",
"while True:\n \n if X == 'a':\n if len(A) == 0:\n break\n else:\n X = A.pop(0) \n elif X =='b':\n if len(B) ==0:\n break\n else:\n X = B.pop(0)\n else:\n if len(C) == 0:\n break\n else:\n X = C.pop(0)",
"True",
"if X == 'a':\n if len(A) == 0:\n break\n else:\n X = A.pop(0) \n elif X =='b':\n if len(B) ==0:\n break\n else:\n X = B.pop(0)\n else:\n if len(C) == 0:\n break\n else:\n X = C.pop(0)",
"X == 'a'",
"X",
"'a'",
"if len(A) == 0:\n break\n else:\n X = A.pop(0) \n ",
"len(A) == 0",
"len(A)",
"len",
"A",
"0",
"break",
"X = A.pop(0)",
"X",
"A.pop(0)",
"A.pop",
"A",
"pop",
"0",
"elif X =='b':\n if len(B) ==0:\n break\n else:\n X = B.pop(0)\n ",
"X =='b'",
"X",
"'b'",
"if len(B) ==0:\n break\n else:\n X = B.pop(0)\n ",
"len(B) ==0",
"len(B)",
"len",
"B",
"0",
"break",
"X = B.pop(0)",
"X",
"B.pop(0)",
"B.pop",
"B",
"pop",
"0",
"if len(C) == 0:\n break\n else:\n X = C.pop(0)",
"len(C) == 0",
"len(C)",
"len",
"C",
"0",
"break",
"X = C.pop(0)",
"X",
"C.pop(0)",
"C.pop",
"C",
"pop",
"0",
"print(X.upper())",
"print",
"X.upper()",
"X.upper",
"X",
"upper",
"A =list(AA)",
"list(AA)",
"A",
"B = list(BB)",
"list(BB)",
"B",
"CC = input()",
"input()",
"CC",
"BB = input()",
"input()",
"BB",
"X = C.pop(0)",
"C.pop(0)",
"X",
"X = A.pop(0)",
"A.pop(0)",
"X",
"X ='a'",
"'a'",
"X",
"C = list(CC)",
"list(CC)",
"C",
"AA = input()",
"input()",
"AA",
"X = B.pop(0)",
"B.pop(0)",
"X"
] | AA = input()
A =list(AA)
BB = input()
B = list(BB)
CC = input()
C = list(CC)
X ='a'
while True:
if X == 'a':
if len(A) == 0:
break
else:
X = A.pop(0)
elif X =='b':
if len(B) ==0:
break
else:
X = B.pop(0)
else:
if len(C) == 0:
break
else:
X = C.pop(0)
print(X.upper())
|
[
7,
0,
13,
17,
0,
18,
13,
17,
4,
13,
4,
13,
0,
18,
13,
17,
4,
13,
4,
13,
0,
18,
13,
17,
4,
13,
4,
13,
0,
13,
17,
42,
18,
13,
13,
0,
13,
4,
18,
18,
13,
13,
13,
17,
4,
13,
4,
18,
13,
13,
10,
17,
13,
10,
17,
13,
10,
4,
13
] | [
[
54,
2
],
[
8,
5
],
[
55,
6
],
[
16,
13
],
[
55,
14
],
[
24,
21
],
[
55,
22
],
[
51,
29
],
[
55,
33
],
[
52,
34
],
[
58,
34
],
[
57,
36
],
[
55,
40
],
[
52,
41
],
[
58,
41
],
[
58,
48
],
[
52,
48
],
[
51,
52
],
[
54,
55
],
[
57,
58
]
] | [
"s={}\ns['a']=list(input())\ns['b']=list(input())\ns['c']=list(input())\nx='a'\nwhile(s[x]):\n x=s[x].pop(0)\nprint(x.upper())",
"s={}",
"s",
"{}",
"s['a']=list(input())",
"s['a']",
"s",
"'a'",
"list(input())",
"list",
"input()",
"input",
"s['b']=list(input())",
"s['b']",
"s",
"'b'",
"list(input())",
"list",
"input()",
"input",
"s['c']=list(input())",
"s['c']",
"s",
"'c'",
"list(input())",
"list",
"input()",
"input",
"x='a'",
"x",
"'a'",
"while(s[x]):\n x=s[x].pop(0)",
"s[x]",
"s",
"x",
"x=s[x].pop(0)",
"x",
"s[x].pop(0)",
"[x].pop",
"[x]",
"s",
"x",
"pop",
"0",
"print(x.upper())",
"print",
"x.upper()",
"x.upper",
"x",
"upper",
"x='a'",
"'a'",
"x",
"s={}",
"{}",
"s",
"x=s[x].pop(0)",
"s[x].pop(0)",
"x"
] | s={}
s['a']=list(input())
s['b']=list(input())
s['c']=list(input())
x='a'
while(s[x]):
x=s[x].pop(0)
print(x.upper())
|
[
7,
0,
13,
39,
4,
13,
4,
13,
4,
13,
0,
13,
17,
42,
18,
13,
13,
0,
13,
18,
18,
13,
13,
17,
0,
18,
13,
13,
18,
18,
13,
13,
39,
17,
0,
13,
2,
4,
13,
13,
4,
13,
17,
4,
13,
18,
17,
13,
10,
2,
13,
10,
39,
13,
10,
17,
13,
10,
18,
13
] | [
[
52,
2
],
[
55,
11
],
[
53,
15
],
[
56,
16
],
[
50,
16
],
[
58,
18
],
[
25,
20
],
[
53,
21
],
[
56,
22
],
[
50,
22
],
[
28,
25
],
[
53,
26
],
[
56,
27
],
[
50,
27
],
[
25,
29
],
[
53,
30
],
[
56,
31
],
[
50,
31
],
[
49,
35
],
[
59,
39
],
[
50,
47
],
[
56,
47
],
[
49,
50
],
[
52,
53
],
[
55,
56
],
[
58,
59
]
] | [
"a=[input(),input(),input()]\nnow=0\nwhile a[now]:\n y=a[now][0];a[now]=a[now][1:];now=ord(y)-ord('a')\nprint(\"ABC\"[now])",
"a=[input(),input(),input()]",
"a",
"[input(),input(),input()]",
"input()",
"input",
"input()",
"input",
"input()",
"input",
"now=0",
"now",
"0",
"while a[now]:\n y=a[now][0];a[now]=a[now][1:];now=ord(y)-ord('a')",
"a[now]",
"a",
"now",
"y=a[now][0]",
"y",
"a[now][0]",
"[now]",
"a",
"now",
"0",
"a[now]=a[now][1:]",
"a[now]",
"a",
"now",
"a[now][1:]",
"[now]",
"a",
"now",
"1:",
"1",
"now=ord(y)-ord('a')",
"now",
"ord(y)-ord('a')",
"ord(y)",
"ord",
"y",
"ord('a')",
"ord",
"'a'",
"print(\"ABC\"[now])",
"print",
"\"ABC\"[now]",
"\"ABC\"",
"now",
"now=ord(y)-ord('a')",
"ord(y)-ord('a')",
"now",
"a=[input(),input(),input()]",
"[input(),input(),input()]",
"a",
"now=0",
"0",
"now",
"y=a[now][0]",
"a[now][0]",
"y"
] | a=[input(),input(),input()]
now=0
while a[now]:
y=a[now][0];a[now]=a[now][1:];now=ord(y)-ord('a')
print("ABC"[now]) |
[
7,
15,
12,
13,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
4,
13,
41,
28,
13,
13,
40,
13,
17,
4,
13,
0,
13,
13,
41,
28,
13,
13,
40,
13,
17,
4,
13,
0,
13,
13,
41,
28,
13,
13,
40,
13,
17,
4,
13,
0,
13,
13,
0,
13,
4,
13,
13,
0,
13,
4,
13,
13,
0,
13,
4,
13,
13,
14,
40,
13,
4,
13,
17,
29,
0,
13,
4,
18,
13,
13,
0,
13,
17,
42,
17,
14,
2,
2,
13,
17,
13,
0,
13,
4,
18,
13,
13,
14,
2,
2,
13,
17,
13,
0,
13,
4,
18,
13,
13,
14,
2,
2,
13,
17,
13,
0,
13,
4,
18,
13,
13,
14,
2,
2,
13,
17,
40,
13,
0,
13,
17,
3,
14,
2,
2,
13,
17,
40,
13,
0,
13,
17,
3,
14,
2,
2,
13,
17,
40,
13,
0,
13,
17,
3,
14,
2,
13,
17,
4,
13,
17,
14,
2,
13,
17,
4,
13,
17,
4,
13,
17,
29,
14,
2,
13,
17,
4,
13,
10,
12,
13
] | [
[
6,
5
],
[
10,
9
],
[
14,
13
],
[
19,
18
],
[
5,
18
],
[
18,
21
],
[
18,
24
],
[
27,
26
],
[
31,
30
],
[
9,
30
],
[
30,
33
],
[
30,
36
],
[
39,
38
],
[
43,
42
],
[
13,
42
],
[
42,
45
],
[
42,
48
],
[
51,
50
],
[
54,
53
],
[
26,
56
],
[
5,
56
],
[
59,
58
],
[
38,
61
],
[
9,
61
],
[
64,
63
],
[
50,
66
],
[
13,
66
],
[
53,
69
],
[
26,
69
],
[
5,
69
],
[
76,
75
],
[
53,
78
],
[
26,
78
],
[
5,
78
],
[
82,
81
],
[
75,
88
],
[
116,
88
],
[
104,
88
],
[
92,
88
],
[
53,
90
],
[
26,
90
],
[
5,
90
],
[
93,
92
],
[
53,
95
],
[
26,
95
],
[
5,
95
],
[
75,
100
],
[
116,
100
],
[
104,
100
],
[
92,
100
],
[
58,
102
],
[
38,
102
],
[
9,
102
],
[
105,
104
],
[
58,
107
],
[
38,
107
],
[
9,
107
],
[
75,
112
],
[
116,
112
],
[
104,
112
],
[
92,
112
],
[
63,
114
],
[
50,
114
],
[
13,
114
],
[
117,
116
],
[
63,
119
],
[
50,
119
],
[
13,
119
],
[
75,
124
],
[
116,
124
],
[
104,
124
],
[
92,
124
],
[
53,
127
],
[
26,
127
],
[
5,
127
],
[
130,
129
],
[
75,
135
],
[
116,
135
],
[
104,
135
],
[
92,
135
],
[
58,
138
],
[
38,
138
],
[
9,
138
],
[
141,
140
],
[
75,
146
],
[
116,
146
],
[
104,
146
],
[
92,
146
],
[
63,
149
],
[
50,
149
],
[
13,
149
],
[
152,
151
],
[
151,
156
],
[
140,
156
],
[
129,
156
],
[
81,
156
],
[
151,
163
],
[
140,
163
],
[
129,
163
],
[
81,
163
],
[
180,
177
]
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# FileName: \tB\n# CreatedDate: 2020-07-16 23:00:42 +0900\n# LastModified: 2020-07-16 23:23:14 +0900\n#\nfrom collections import deque\n\n\ndef main():\n s_a = input()\n s_b = input()\n s_c = input()\n s_a = [s for s in s_a if s != 'a']\n s_b = [s for s in s_b if s != 'b']\n s_c = [s for s in s_c if s != 'c']\n s_a = deque(s_a)\n s_b = deque(s_b)\n s_c = deque(s_c)\n if not s_a:\n print(\"A\")\n return\n turn = s_a.popleft()\n ans = -1\n while 1:\n if turn == 'a' and s_a:\n turn = s_a.popleft()\n elif turn == 'b' and s_b:\n turn = s_b.popleft()\n elif turn == 'c' and s_c:\n turn = s_c.popleft()\n elif turn == 'a' and not s_a:\n ans = 0\n break\n elif turn == 'b' and not s_b:\n ans = 1\n break\n elif turn == 'c' and not s_c:\n ans = 2\n break\n if ans == 0:\n print(\"A\")\n elif ans == 1:\n print(\"B\")\n else:\n print(\"C\")\n return\n\n\n\n\nif __name__ == \"__main__\":\n main()",
"from collections import deque",
"def main():\n s_a = input()\n s_b = input()\n s_c = input()\n s_a = [s for s in s_a if s != 'a']\n s_b = [s for s in s_b if s != 'b']\n s_c = [s for s in s_c if s != 'c']\n s_a = deque(s_a)\n s_b = deque(s_b)\n s_c = deque(s_c)\n if not s_a:\n print(\"A\")\n return\n turn = s_a.popleft()\n ans = -1\n while 1:\n if turn == 'a' and s_a:\n turn = s_a.popleft()\n elif turn == 'b' and s_b:\n turn = s_b.popleft()\n elif turn == 'c' and s_c:\n turn = s_c.popleft()\n elif turn == 'a' and not s_a:\n ans = 0\n break\n elif turn == 'b' and not s_b:\n ans = 1\n break\n elif turn == 'c' and not s_c:\n ans = 2\n break\n if ans == 0:\n print(\"A\")\n elif ans == 1:\n print(\"B\")\n else:\n print(\"C\")\n return",
"main",
"s_a = input()",
"s_a",
"input()",
"input",
"s_b = input()",
"s_b",
"input()",
"input",
"s_c = input()",
"s_c",
"input()",
"input",
"s for s in s_a if s != 'a'",
"for s in s_a if s != 'a'",
"s",
"s_a",
"s != 'a'",
"s",
"'a'",
"if s != 'a'",
"s",
"s_a = [s for s in s_a if s != 'a']",
"s_a",
"[s for s in s_a if s != 'a']",
"s for s in s_b if s != 'b'",
"for s in s_b if s != 'b'",
"s",
"s_b",
"s != 'b'",
"s",
"'b'",
"if s != 'b'",
"s",
"s_b = [s for s in s_b if s != 'b']",
"s_b",
"[s for s in s_b if s != 'b']",
"s for s in s_c if s != 'c'",
"for s in s_c if s != 'c'",
"s",
"s_c",
"s != 'c'",
"s",
"'c'",
"if s != 'c'",
"s",
"s_c = [s for s in s_c if s != 'c']",
"s_c",
"[s for s in s_c if s != 'c']",
"s_a = deque(s_a)",
"s_a",
"deque(s_a)",
"deque",
"s_a",
"s_b = deque(s_b)",
"s_b",
"deque(s_b)",
"deque",
"s_b",
"s_c = deque(s_c)",
"s_c",
"deque(s_c)",
"deque",
"s_c",
"if not s_a:\n print(\"A\")\n return\n ",
"not s_a",
"s_a",
"print(\"A\")",
"print",
"\"A\"",
"return",
"turn = s_a.popleft()",
"turn",
"s_a.popleft()",
"s_a.popleft",
"s_a",
"popleft",
"ans = -1",
"ans",
"-1",
"while 1:\n if turn == 'a' and s_a:\n turn = s_a.popleft()\n elif turn == 'b' and s_b:\n turn = s_b.popleft()\n elif turn == 'c' and s_c:\n turn = s_c.popleft()\n elif turn == 'a' and not s_a:\n ans = 0\n break\n elif turn == 'b' and not s_b:\n ans = 1\n break\n elif turn == 'c' and not s_c:\n ans = 2\n break\n ",
"1",
"if turn == 'a' and s_a:\n turn = s_a.popleft()\n elif turn == 'b' and s_b:\n turn = s_b.popleft()\n elif turn == 'c' and s_c:\n turn = s_c.popleft()\n elif turn == 'a' and not s_a:\n ans = 0\n break\n elif turn == 'b' and not s_b:\n ans = 1\n break\n elif turn == 'c' and not s_c:\n ans = 2\n break\n ",
"turn == 'a' and s_a",
"turn == 'a'",
"turn",
"'a'",
"s_a",
"turn = s_a.popleft()",
"turn",
"s_a.popleft()",
"s_a.popleft",
"s_a",
"popleft",
"elif turn == 'b' and s_b:\n turn = s_b.popleft()\n ",
"turn == 'b' and s_b",
"turn == 'b'",
"turn",
"'b'",
"s_b",
"turn = s_b.popleft()",
"turn",
"s_b.popleft()",
"s_b.popleft",
"s_b",
"popleft",
"elif turn == 'c' and s_c:\n turn = s_c.popleft()\n ",
"turn == 'c' and s_c",
"turn == 'c'",
"turn",
"'c'",
"s_c",
"turn = s_c.popleft()",
"turn",
"s_c.popleft()",
"s_c.popleft",
"s_c",
"popleft",
"elif turn == 'a' and not s_a:\n ans = 0\n break\n ",
"turn == 'a' and not s_a",
"turn == 'a'",
"turn",
"'a'",
"not s_a",
"s_a",
"ans = 0",
"ans",
"0",
"break",
"elif turn == 'b' and not s_b:\n ans = 1\n break\n ",
"turn == 'b' and not s_b",
"turn == 'b'",
"turn",
"'b'",
"not s_b",
"s_b",
"ans = 1",
"ans",
"1",
"break",
"elif turn == 'c' and not s_c:\n ans = 2\n break\n ",
"turn == 'c' and not s_c",
"turn == 'c'",
"turn",
"'c'",
"not s_c",
"s_c",
"ans = 2",
"ans",
"2",
"break",
"if ans == 0:\n print(\"A\")\n elif ans == 1:\n print(\"B\")\n else:\n print(\"C\")\n ",
"ans == 0",
"ans",
"0",
"print(\"A\")",
"print",
"\"A\"",
"elif ans == 1:\n print(\"B\")\n ",
"ans == 1",
"ans",
"1",
"print(\"B\")",
"print",
"\"B\"",
"print(\"C\")",
"print",
"\"C\"",
"return",
"if __name__ == \"__main__\":\n main()",
"__name__ == \"__main__\"",
"__name__",
"\"__main__\"",
"main()",
"main",
"def main():\n s_a = input()\n s_b = input()\n s_c = input()\n s_a = [s for s in s_a if s != 'a']\n s_b = [s for s in s_b if s != 'b']\n s_c = [s for s in s_c if s != 'c']\n s_a = deque(s_a)\n s_b = deque(s_b)\n s_c = deque(s_c)\n if not s_a:\n print(\"A\")\n return\n turn = s_a.popleft()\n ans = -1\n while 1:\n if turn == 'a' and s_a:\n turn = s_a.popleft()\n elif turn == 'b' and s_b:\n turn = s_b.popleft()\n elif turn == 'c' and s_c:\n turn = s_c.popleft()\n elif turn == 'a' and not s_a:\n ans = 0\n break\n elif turn == 'b' and not s_b:\n ans = 1\n break\n elif turn == 'c' and not s_c:\n ans = 2\n break\n if ans == 0:\n print(\"A\")\n elif ans == 1:\n print(\"B\")\n else:\n print(\"C\")\n return",
"def main():\n s_a = input()\n s_b = input()\n s_c = input()\n s_a = [s for s in s_a if s != 'a']\n s_b = [s for s in s_b if s != 'b']\n s_c = [s for s in s_c if s != 'c']\n s_a = deque(s_a)\n s_b = deque(s_b)\n s_c = deque(s_c)\n if not s_a:\n print(\"A\")\n return\n turn = s_a.popleft()\n ans = -1\n while 1:\n if turn == 'a' and s_a:\n turn = s_a.popleft()\n elif turn == 'b' and s_b:\n turn = s_b.popleft()\n elif turn == 'c' and s_c:\n turn = s_c.popleft()\n elif turn == 'a' and not s_a:\n ans = 0\n break\n elif turn == 'b' and not s_b:\n ans = 1\n break\n elif turn == 'c' and not s_c:\n ans = 2\n break\n if ans == 0:\n print(\"A\")\n elif ans == 1:\n print(\"B\")\n else:\n print(\"C\")\n return",
"main"
] | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: B
# CreatedDate: 2020-07-16 23:00:42 +0900
# LastModified: 2020-07-16 23:23:14 +0900
#
from collections import deque
def main():
s_a = input()
s_b = input()
s_c = input()
s_a = [s for s in s_a if s != 'a']
s_b = [s for s in s_b if s != 'b']
s_c = [s for s in s_c if s != 'c']
s_a = deque(s_a)
s_b = deque(s_b)
s_c = deque(s_c)
if not s_a:
print("A")
return
turn = s_a.popleft()
ans = -1
while 1:
if turn == 'a' and s_a:
turn = s_a.popleft()
elif turn == 'b' and s_b:
turn = s_b.popleft()
elif turn == 'c' and s_c:
turn = s_c.popleft()
elif turn == 'a' and not s_a:
ans = 0
break
elif turn == 'b' and not s_b:
ans = 1
break
elif turn == 'c' and not s_c:
ans = 2
break
if ans == 0:
print("A")
elif ans == 1:
print("B")
else:
print("C")
return
if __name__ == "__main__":
main()
|
[
7,
12,
13,
29,
4,
13,
4,
18,
4,
13,
13,
12,
13,
29,
4,
13,
4,
13,
13,
4,
18,
4,
18,
4,
13,
13,
13,
17,
12,
13,
29,
4,
13,
4,
13,
13,
23,
13,
12,
13,
0,
13,
21,
22,
17,
4,
13,
4,
18,
4,
13,
13,
22,
17,
4,
13,
4,
18,
4,
13,
13,
22,
17,
4,
13,
4,
18,
4,
13,
13,
0,
13,
17,
42,
18,
13,
13,
0,
13,
4,
18,
18,
13,
13,
13,
29,
4,
18,
13,
13,
14,
2,
13,
17,
4,
13,
4,
13,
10,
12,
13,
10,
12,
13,
10,
12,
13,
10,
12,
13
] | [
[
37,
35
],
[
37,
37
],
[
42,
41
],
[
72,
71
],
[
41,
75
],
[
71,
76
],
[
78,
76
],
[
79,
78
],
[
41,
82
],
[
71,
83
],
[
78,
83
],
[
78,
88
],
[
71,
88
],
[
103,
97
]
] | [
"\n\ndef read_int():\n return int(input().strip())\n\n\ndef read_ints():\n return list(map(int, input().strip().split(' ')))\n\n\ndef reverse(s):\n return list(reversed(s))\n\n\ndef solve():\n S = {\n 'a': reverse(input().strip()),\n 'b': reverse(input().strip()),\n 'c': reverse(input().strip()),\n }\n current = 'a'\n while S[current]:\n current = S[current].pop()\n return current.upper()\n\n\nif __name__ == '__main__':\n print(solve())",
"def read_int():\n return int(input().strip())",
"read_int",
"return int(input().strip())",
"int(input().strip())",
"int",
"input().strip()",
"().strip",
"()",
"input",
"strip",
"def read_ints():\n return list(map(int, input().strip().split(' ')))",
"read_ints",
"return list(map(int, input().strip().split(' ')))",
"list(map(int, input().strip().split(' ')))",
"list",
"map(int, input().strip().split(' '))",
"map",
"int",
"input().strip().split(' ')",
"().strip().split",
"().strip()",
"().strip",
"()",
"input",
"strip",
"split",
"' '",
"def reverse(s):\n return list(reversed(s))",
"reverse",
"return list(reversed(s))",
"list(reversed(s))",
"list",
"reversed(s)",
"reversed",
"s",
"s",
"s",
"def solve():\n S = {\n 'a': reverse(input().strip()),\n 'b': reverse(input().strip()),\n 'c': reverse(input().strip()),\n }\n current = 'a'\n while S[current]:\n current = S[current].pop()\n return current.upper()",
"solve",
"S = {\n 'a': reverse(input().strip()),\n 'b': reverse(input().strip()),\n 'c': reverse(input().strip()),\n }",
"S",
"{\n 'a': reverse(input().strip()),\n 'b': reverse(input().strip()),\n 'c': reverse(input().strip()),\n }",
"'a'",
"'a'",
"reverse(input().strip())",
"reverse",
"input().strip()",
"().strip",
"()",
"input",
"strip",
"'b'",
"'b'",
"reverse(input().strip())",
"reverse",
"input().strip()",
"().strip",
"()",
"input",
"strip",
"'c'",
"'c'",
"reverse(input().strip())",
"reverse",
"input().strip()",
"().strip",
"()",
"input",
"strip",
"current = 'a'",
"current",
"'a'",
"while S[current]:\n current = S[current].pop()\n ",
"S[current]",
"S",
"current",
"current = S[current].pop()",
"current",
"S[current].pop()",
"[current].pop",
"[current]",
"S",
"current",
"pop",
"return current.upper()",
"current.upper()",
"current.upper",
"current",
"upper",
"if __name__ == '__main__':\n print(solve())",
"__name__ == '__main__'",
"__name__",
"'__main__'",
"print(solve())",
"print",
"solve()",
"solve",
"def read_int():\n return int(input().strip())",
"def read_int():\n return int(input().strip())",
"read_int",
"def solve():\n S = {\n 'a': reverse(input().strip()),\n 'b': reverse(input().strip()),\n 'c': reverse(input().strip()),\n }\n current = 'a'\n while S[current]:\n current = S[current].pop()\n return current.upper()",
"def solve():\n S = {\n 'a': reverse(input().strip()),\n 'b': reverse(input().strip()),\n 'c': reverse(input().strip()),\n }\n current = 'a'\n while S[current]:\n current = S[current].pop()\n return current.upper()",
"solve",
"def read_ints():\n return list(map(int, input().strip().split(' ')))",
"def read_ints():\n return list(map(int, input().strip().split(' ')))",
"read_ints",
"def reverse(s):\n return list(reversed(s))",
"def reverse(s):\n return list(reversed(s))",
"reverse"
] |
def read_int():
return int(input().strip())
def read_ints():
return list(map(int, input().strip().split(' ')))
def reverse(s):
return list(reversed(s))
def solve():
S = {
'a': reverse(input().strip()),
'b': reverse(input().strip()),
'c': reverse(input().strip()),
}
current = 'a'
while S[current]:
current = S[current].pop()
return current.upper()
if __name__ == '__main__':
print(solve())
|
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
0,
13,
4,
13,
41,
28,
13,
4,
13,
4,
13,
13,
4,
18,
13,
13,
0,
13,
13,
41,
28,
13,
4,
13,
4,
13,
13,
4,
18,
13,
13,
0,
13,
13,
41,
28,
13,
4,
13,
4,
13,
13,
4,
18,
13,
13,
0,
13,
13,
0,
13,
17,
42,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
4,
13,
0,
13,
4,
18,
13,
13,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
4,
13,
0,
13,
4,
18,
13,
13,
17,
14,
2,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
4,
13,
0,
13,
4,
18,
13,
13,
17,
10,
13,
13,
10,
13,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
13,
13,
10,
17,
13,
10,
4,
13
] | [
[
136,
2
],
[
139,
6
],
[
148,
10
],
[
16,
15
],
[
137,
20
],
[
137,
23
],
[
15,
24
],
[
130,
26
],
[
31,
30
],
[
140,
35
],
[
140,
38
],
[
30,
39
],
[
133,
41
],
[
46,
45
],
[
149,
50
],
[
149,
53
],
[
45,
54
],
[
151,
56
],
[
154,
59
],
[
155,
65
],
[
143,
65
],
[
146,
65
],
[
158,
65
],
[
131,
71
],
[
157,
79
],
[
131,
82
],
[
155,
87
],
[
143,
87
],
[
146,
87
],
[
158,
87
],
[
134,
93
],
[
145,
101
],
[
134,
104
],
[
155,
109
],
[
143,
109
],
[
146,
109
],
[
158,
109
],
[
152,
115
],
[
142,
123
],
[
152,
126
],
[
130,
131
],
[
133,
134
],
[
136,
137
],
[
139,
140
],
[
142,
143
],
[
145,
146
],
[
148,
149
],
[
151,
152
],
[
154,
155
],
[
157,
158
]
] | [
"sa = input()\nsb = input()\nsc = input()\na = [sa[i] for i in range(len(sa))]\nb = [sb[i] for i in range(len(sb))]\nc = [sc[i] for i in range(len(sc))]\n\nn = 'a'\nwhile True:\n if n == 'a':\n if len(a) == 0:\n print('A')\n exit()\n else:\n n = a.pop(0)\n elif n == 'b':\n if len(b) == 0:\n print('B')\n exit()\n else:\n n = b.pop(0)\n elif n == 'c':\n if len(c) == 0:\n print('C')\n exit()\n else:\n n = c.pop(0)",
"sa = input()",
"sa",
"input()",
"input",
"sb = input()",
"sb",
"input()",
"input",
"sc = input()",
"sc",
"input()",
"input",
"sa[i] for i in range(len(sa))",
"for i in range(len(sa))",
"i",
"range(len(sa))",
"range",
"len(sa)",
"len",
"sa",
"for i in range(len(sa))",
"sa[i]",
"sa",
"i",
"a = [sa[i] for i in range(len(sa))]",
"a",
"[sa[i] for i in range(len(sa))]",
"sb[i] for i in range(len(sb))",
"for i in range(len(sb))",
"i",
"range(len(sb))",
"range",
"len(sb)",
"len",
"sb",
"for i in range(len(sb))",
"sb[i]",
"sb",
"i",
"b = [sb[i] for i in range(len(sb))]",
"b",
"[sb[i] for i in range(len(sb))]",
"sc[i] for i in range(len(sc))",
"for i in range(len(sc))",
"i",
"range(len(sc))",
"range",
"len(sc)",
"len",
"sc",
"for i in range(len(sc))",
"sc[i]",
"sc",
"i",
"c = [sc[i] for i in range(len(sc))]",
"c",
"[sc[i] for i in range(len(sc))]",
"n = 'a'",
"n",
"'a'",
"while True:\n if n == 'a':\n if len(a) == 0:\n print('A')\n exit()\n else:\n n = a.pop(0)\n elif n == 'b':\n if len(b) == 0:\n print('B')\n exit()\n else:\n n = b.pop(0)\n elif n == 'c':\n if len(c) == 0:\n print('C')\n exit()\n else:\n n = c.pop(0)",
"True",
"if n == 'a':\n if len(a) == 0:\n print('A')\n exit()\n else:\n n = a.pop(0)\n elif n == 'b':\n if len(b) == 0:\n print('B')\n exit()\n else:\n n = b.pop(0)\n elif n == 'c':\n if len(c) == 0:\n print('C')\n exit()\n else:\n n = c.pop(0)",
"n == 'a'",
"n",
"'a'",
"if len(a) == 0:\n print('A')\n exit()\n else:\n n = a.pop(0)\n ",
"len(a) == 0",
"len(a)",
"len",
"a",
"0",
"print('A')",
"print",
"'A'",
"exit()",
"exit",
"n = a.pop(0)",
"n",
"a.pop(0)",
"a.pop",
"a",
"pop",
"0",
"elif n == 'b':\n if len(b) == 0:\n print('B')\n exit()\n else:\n n = b.pop(0)\n ",
"n == 'b'",
"n",
"'b'",
"if len(b) == 0:\n print('B')\n exit()\n else:\n n = b.pop(0)\n ",
"len(b) == 0",
"len(b)",
"len",
"b",
"0",
"print('B')",
"print",
"'B'",
"exit()",
"exit",
"n = b.pop(0)",
"n",
"b.pop(0)",
"b.pop",
"b",
"pop",
"0",
"elif n == 'c':\n if len(c) == 0:\n print('C')\n exit()\n else:\n n = c.pop(0)",
"n == 'c'",
"n",
"'c'",
"if len(c) == 0:\n print('C')\n exit()\n else:\n n = c.pop(0)",
"len(c) == 0",
"len(c)",
"len",
"c",
"0",
"print('C')",
"print",
"'C'",
"exit()",
"exit",
"n = c.pop(0)",
"n",
"c.pop(0)",
"c.pop",
"c",
"pop",
"0",
"a = [sa[i] for i in range(len(sa))]",
"[sa[i] for i in range(len(sa))]",
"a",
"b = [sb[i] for i in range(len(sb))]",
"[sb[i] for i in range(len(sb))]",
"b",
"sa = input()",
"input()",
"sa",
"sb = input()",
"input()",
"sb",
"n = c.pop(0)",
"c.pop(0)",
"n",
"n = b.pop(0)",
"b.pop(0)",
"n",
"sc = input()",
"input()",
"sc",
"c = [sc[i] for i in range(len(sc))]",
"[sc[i] for i in range(len(sc))]",
"c",
"n = 'a'",
"'a'",
"n",
"n = a.pop(0)",
"a.pop(0)",
"n"
] | sa = input()
sb = input()
sc = input()
a = [sa[i] for i in range(len(sa))]
b = [sb[i] for i in range(len(sb))]
c = [sc[i] for i in range(len(sc))]
n = 'a'
while True:
if n == 'a':
if len(a) == 0:
print('A')
exit()
else:
n = a.pop(0)
elif n == 'b':
if len(b) == 0:
print('B')
exit()
else:
n = b.pop(0)
elif n == 'c':
if len(c) == 0:
print('C')
exit()
else:
n = c.pop(0) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.