node_ids
sequencelengths
4
1.4k
edge_index
sequencelengths
1
2.22k
text
sequencelengths
4
1.4k
source
stringlengths
14
427k
[ 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, 4, 18, 13, 13, 42, 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, 4, 13, 13, 17, 4, 13, 17, 4, 13, 0, 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 ]
[ [ 112, 3 ], [ 106, 11 ], [ 97, 19 ], [ 109, 27 ], [ 113, 30 ], [ 110, 36 ], [ 95, 36 ], [ 101, 36 ], [ 104, 36 ], [ 113, 42 ], [ 103, 50 ], [ 113, 53 ], [ 110, 57 ], [ 95, 57 ], [ 101, 57 ], [ 104, 57 ], [ 107, 63 ], [ 100, 71 ], [ 107, 74 ], [ 98, 80 ], [ 94, 88 ], [ 98, 91 ], [ 94, 95 ], [ 97, 98 ], [ 100, 101 ], [ 103, 104 ], [ 106, 107 ], [ 109, 110 ], [ 112, 113 ] ]
[ "from collections import deque\nsa = deque(str(input()))\nsb = deque(str(input()))\nsc = deque(str(input()))\np = sa.popleft()\nwhile 1:\n if p ==\"a\":\n if len(sa) == 0:\n print(\"A\")\n exit()\n p = sa.popleft()\n \n elif p == \"b\":\n if len(sb) == 0:\n print(\"B\")\n exit()\n p = sb.popleft()\n else:\n if len(sc) == 0:\n print(\"C\")\n exit()\n p = sc.popleft()", "from collections import deque", "sa = deque(str(input()))", "sa", "deque(str(input()))", "deque", "str(input())", "str", "input()", "input", "sb = deque(str(input()))", "sb", "deque(str(input()))", "deque", "str(input())", "str", "input()", "input", "sc = deque(str(input()))", "sc", "deque(str(input()))", "deque", "str(input())", "str", "input()", "input", "p = sa.popleft()", "p", "sa.popleft()", "sa.popleft", "sa", "popleft", "while 1:\n if p ==\"a\":\n if len(sa) == 0:\n print(\"A\")\n exit()\n p = sa.popleft()\n \n elif p == \"b\":\n if len(sb) == 0:\n print(\"B\")\n exit()\n p = sb.popleft()\n else:\n if len(sc) == 0:\n print(\"C\")\n exit()\n p = sc.popleft()", "1", "if p ==\"a\":\n if len(sa) == 0:\n print(\"A\")\n exit()\n p = sa.popleft()\n \n elif p == \"b\":\n if len(sb) == 0:\n print(\"B\")\n exit()\n p = sb.popleft()\n else:\n if len(sc) == 0:\n print(\"C\")\n exit()\n p = sc.popleft()", "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.popleft()", "p", "sa.popleft()", "sa.popleft", "sa", "popleft", "elif p == \"b\":\n if len(sb) == 0:\n print(\"B\")\n exit()\n p = sb.popleft()\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.popleft()", "p", "sb.popleft()", "sb.popleft", "sb", "popleft", "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.popleft()", "p", "sc.popleft()", "sc.popleft", "sc", "popleft", "p = sc.popleft()", "sc.popleft()", "p", "sc = deque(str(input()))", "deque(str(input()))", "sc", "p = sb.popleft()", "sb.popleft()", "p", "p = sa.popleft()", "sa.popleft()", "p", "sb = deque(str(input()))", "deque(str(input()))", "sb", "p = sa.popleft()", "sa.popleft()", "p", "sa = deque(str(input()))", "deque(str(input()))", "sa" ]
from collections import deque sa = deque(str(input())) sb = deque(str(input())) sc = deque(str(input())) p = sa.popleft() while 1: if p =="a": if len(sa) == 0: print("A") exit() p = sa.popleft() elif p == "b": if len(sb) == 0: print("B") exit() p = sb.popleft() else: if len(sc) == 0: print("C") exit() p = sc.popleft()
[ 7, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 0, 13, 17, 0, 13, 17, 42, 17, 14, 2, 13, 17, 14, 2, 13, 4, 13, 13, 0, 13, 17, 3, 14, 2, 18, 13, 13, 17, 0, 13, 17, 14, 2, 18, 13, 13, 17, 0, 13, 17, 14, 2, 18, 13, 13, 17, 0, 13, 17, 0, 13, 17, 14, 2, 13, 17, 14, 2, 13, 4, 13, 13, 0, 13, 17, 3, 14, 2, 18, 13, 13, 17, 0, 13, 17, 14, 2, 18, 13, 13, 17, 0, 13, 17, 14, 2, 18, 13, 13, 17, 0, 13, 17, 0, 13, 17, 14, 2, 13, 17, 14, 2, 13, 4, 13, 13, 0, 13, 17, 3, 14, 2, 18, 13, 13, 17, 0, 13, 17, 14, 2, 18, 13, 13, 17, 0, 13, 17, 14, 2, 18, 13, 13, 17, 0, 13, 17, 0, 13, 17, 4, 13, 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, 17, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13 ]
[ [ 208, 2 ], [ 226, 6 ], [ 172, 10 ], [ 214, 14 ], [ 190, 17 ], [ 178, 20 ], [ 193, 23 ], [ 184, 26 ], [ 194, 32 ], [ 167, 32 ], [ 203, 32 ], [ 224, 32 ], [ 221, 32 ], [ 206, 32 ], [ 230, 32 ], [ 200, 32 ], [ 212, 32 ], [ 188, 32 ], [ 215, 36 ], [ 218, 36 ], [ 209, 39 ], [ 196, 41 ], [ 209, 47 ], [ 215, 48 ], [ 218, 48 ], [ 187, 51 ], [ 209, 56 ], [ 215, 57 ], [ 218, 57 ], [ 211, 60 ], [ 209, 65 ], [ 215, 66 ], [ 218, 66 ], [ 199, 69 ], [ 217, 72 ], [ 194, 76 ], [ 167, 76 ], [ 203, 76 ], [ 224, 76 ], [ 221, 76 ], [ 206, 76 ], [ 230, 76 ], [ 200, 76 ], [ 212, 76 ], [ 188, 76 ], [ 191, 80 ], [ 170, 80 ], [ 227, 83 ], [ 175, 85 ], [ 227, 91 ], [ 191, 92 ], [ 170, 92 ], [ 229, 95 ], [ 227, 100 ], [ 191, 101 ], [ 170, 101 ], [ 205, 104 ], [ 227, 109 ], [ 191, 110 ], [ 170, 110 ], [ 220, 113 ], [ 169, 116 ], [ 194, 120 ], [ 167, 120 ], [ 203, 120 ], [ 224, 120 ], [ 221, 120 ], [ 206, 120 ], [ 230, 120 ], [ 200, 120 ], [ 212, 120 ], [ 188, 120 ], [ 179, 124 ], [ 182, 124 ], [ 173, 127 ], [ 232, 129 ], [ 173, 135 ], [ 179, 136 ], [ 182, 136 ], [ 223, 139 ], [ 173, 144 ], [ 179, 145 ], [ 182, 145 ], [ 202, 148 ], [ 173, 153 ], [ 179, 154 ], [ 182, 154 ], [ 166, 157 ], [ 181, 160 ], [ 233, 164 ], [ 176, 164 ], [ 197, 164 ], [ 185, 164 ], [ 166, 167 ], [ 169, 170 ], [ 172, 173 ], [ 175, 176 ], [ 178, 179 ], [ 181, 182 ], [ 184, 185 ], [ 187, 188 ], [ 190, 191 ], [ 193, 194 ], [ 196, 197 ], [ 199, 200 ], [ 202, 203 ], [ 205, 206 ], [ 208, 209 ], [ 211, 212 ], [ 214, 215 ], [ 217, 218 ], [ 220, 221 ], [ 223, 224 ], [ 226, 227 ], [ 229, 230 ], [ 232, 233 ] ]
[ "SA = input()\nSB = input()\nSC = input()\n\nindexA = 0\nindexB = 0\nindexC = 0\nturn = 'A'\nwinner = ''\nwhile 1:\n if turn == 'A':\n if indexA == len(SA):\n winner = 'A'\n break\n if SA[indexA] == 'a':\n turn = 'A'\n elif SA[indexA] == 'b':\n turn = 'B'\n elif SA[indexA] == 'c':\n turn = 'C'\n indexA += 1\n elif turn == 'B':\n if indexB == len(SB):\n winner = 'B'\n break\n if SB[indexB] == 'a':\n turn = 'A'\n elif SB[indexB] == 'b':\n turn = 'B'\n elif SB[indexB] == 'c':\n turn = 'C'\n indexB += 1\n elif turn == 'C':\n if indexC == len(SC):\n winner = 'C'\n break\n if SC[indexC] == 'a':\n turn = 'A'\n elif SC[indexC] == 'b':\n turn = 'B'\n elif SC[indexC] == 'c':\n turn = 'C'\n indexC += 1\nprint(winner)", "SA = input()", "SA", "input()", "input", "SB = input()", "SB", "input()", "input", "SC = input()", "SC", "input()", "input", "indexA = 0", "indexA", "0", "indexB = 0", "indexB", "0", "indexC = 0", "indexC", "0", "turn = 'A'", "turn", "'A'", "winner = ''", "winner", "''", "while 1:\n if turn == 'A':\n if indexA == len(SA):\n winner = 'A'\n break\n if SA[indexA] == 'a':\n turn = 'A'\n elif SA[indexA] == 'b':\n turn = 'B'\n elif SA[indexA] == 'c':\n turn = 'C'\n indexA += 1\n elif turn == 'B':\n if indexB == len(SB):\n winner = 'B'\n break\n if SB[indexB] == 'a':\n turn = 'A'\n elif SB[indexB] == 'b':\n turn = 'B'\n elif SB[indexB] == 'c':\n turn = 'C'\n indexB += 1\n elif turn == 'C':\n if indexC == len(SC):\n winner = 'C'\n break\n if SC[indexC] == 'a':\n turn = 'A'\n elif SC[indexC] == 'b':\n turn = 'B'\n elif SC[indexC] == 'c':\n turn = 'C'\n indexC += 1", "1", "if turn == 'A':\n if indexA == len(SA):\n winner = 'A'\n break\n if SA[indexA] == 'a':\n turn = 'A'\n elif SA[indexA] == 'b':\n turn = 'B'\n elif SA[indexA] == 'c':\n turn = 'C'\n indexA += 1\n elif turn == 'B':\n if indexB == len(SB):\n winner = 'B'\n break\n if SB[indexB] == 'a':\n turn = 'A'\n elif SB[indexB] == 'b':\n turn = 'B'\n elif SB[indexB] == 'c':\n turn = 'C'\n indexB += 1\n elif turn == 'C':\n if indexC == len(SC):\n winner = 'C'\n break\n if SC[indexC] == 'a':\n turn = 'A'\n elif SC[indexC] == 'b':\n turn = 'B'\n elif SC[indexC] == 'c':\n turn = 'C'\n indexC += 1", "turn == 'A'", "turn", "'A'", "if indexA == len(SA):\n winner = 'A'\n break\n ", "indexA == len(SA)", "indexA", "len(SA)", "len", "SA", "winner = 'A'", "winner", "'A'", "break", "if SA[indexA] == 'a':\n turn = 'A'\n elif SA[indexA] == 'b':\n turn = 'B'\n elif SA[indexA] == 'c':\n turn = 'C'\n ", "SA[indexA] == 'a'", "SA[indexA]", "SA", "indexA", "'a'", "turn = 'A'", "turn", "'A'", "elif SA[indexA] == 'b':\n turn = 'B'\n ", "SA[indexA] == 'b'", "SA[indexA]", "SA", "indexA", "'b'", "turn = 'B'", "turn", "'B'", "elif SA[indexA] == 'c':\n turn = 'C'\n ", "SA[indexA] == 'c'", "SA[indexA]", "SA", "indexA", "'c'", "turn = 'C'", "turn", "'C'", "indexA += 1", "indexA", "1", "elif turn == 'B':\n if indexB == len(SB):\n winner = 'B'\n break\n if SB[indexB] == 'a':\n turn = 'A'\n elif SB[indexB] == 'b':\n turn = 'B'\n elif SB[indexB] == 'c':\n turn = 'C'\n indexB += 1\n ", "turn == 'B'", "turn", "'B'", "if indexB == len(SB):\n winner = 'B'\n break\n ", "indexB == len(SB)", "indexB", "len(SB)", "len", "SB", "winner = 'B'", "winner", "'B'", "break", "if SB[indexB] == 'a':\n turn = 'A'\n elif SB[indexB] == 'b':\n turn = 'B'\n elif SB[indexB] == 'c':\n turn = 'C'\n ", "SB[indexB] == 'a'", "SB[indexB]", "SB", "indexB", "'a'", "turn = 'A'", "turn", "'A'", "elif SB[indexB] == 'b':\n turn = 'B'\n ", "SB[indexB] == 'b'", "SB[indexB]", "SB", "indexB", "'b'", "turn = 'B'", "turn", "'B'", "elif SB[indexB] == 'c':\n turn = 'C'\n ", "SB[indexB] == 'c'", "SB[indexB]", "SB", "indexB", "'c'", "turn = 'C'", "turn", "'C'", "indexB += 1", "indexB", "1", "elif turn == 'C':\n if indexC == len(SC):\n winner = 'C'\n break\n if SC[indexC] == 'a':\n turn = 'A'\n elif SC[indexC] == 'b':\n turn = 'B'\n elif SC[indexC] == 'c':\n turn = 'C'\n indexC += 1", "turn == 'C'", "turn", "'C'", "if indexC == len(SC):\n winner = 'C'\n break\n ", "indexC == len(SC)", "indexC", "len(SC)", "len", "SC", "winner = 'C'", "winner", "'C'", "break", "if SC[indexC] == 'a':\n turn = 'A'\n elif SC[indexC] == 'b':\n turn = 'B'\n elif SC[indexC] == 'c':\n turn = 'C'\n ", "SC[indexC] == 'a'", "SC[indexC]", "SC", "indexC", "'a'", "turn = 'A'", "turn", "'A'", "elif SC[indexC] == 'b':\n turn = 'B'\n ", "SC[indexC] == 'b'", "SC[indexC]", "SC", "indexC", "'b'", "turn = 'B'", "turn", "'B'", "elif SC[indexC] == 'c':\n turn = 'C'\n ", "SC[indexC] == 'c'", "SC[indexC]", "SC", "indexC", "'c'", "turn = 'C'", "turn", "'C'", "indexC += 1", "indexC", "1", "print(winner)", "print", "winner", "turn = 'C'", "'C'", "turn", "indexB += 1", "1", "indexB", "SC = input()", "input()", "SC", "winner = 'B'", "'B'", "winner", "indexC = 0", "0", "indexC", "indexC += 1", "1", "indexC", "winner = ''", "''", "winner", "turn = 'A'", "'A'", "turn", "indexB = 0", "0", "indexB", "turn = 'A'", "'A'", "turn", "winner = 'A'", "'A'", "winner", "turn = 'C'", "'C'", "turn", "turn = 'B'", "'B'", "turn", "turn = 'B'", "'B'", "turn", "SA = input()", "input()", "SA", "turn = 'B'", "'B'", "turn", "indexA = 0", "0", "indexA", "indexA += 1", "1", "indexA", "turn = 'C'", "'C'", "turn", "turn = 'A'", "'A'", "turn", "SB = input()", "input()", "SB", "turn = 'A'", "'A'", "turn", "winner = 'C'", "'C'", "winner" ]
SA = input() SB = input() SC = input() indexA = 0 indexB = 0 indexC = 0 turn = 'A' winner = '' while 1: if turn == 'A': if indexA == len(SA): winner = 'A' break if SA[indexA] == 'a': turn = 'A' elif SA[indexA] == 'b': turn = 'B' elif SA[indexA] == 'c': turn = 'C' indexA += 1 elif turn == 'B': if indexB == len(SB): winner = 'B' break if SB[indexB] == 'a': turn = 'A' elif SB[indexB] == 'b': turn = 'B' elif SB[indexB] == 'c': turn = 'C' indexB += 1 elif turn == 'C': if indexC == len(SC): winner = 'C' break if SC[indexC] == 'a': turn = 'A' elif SC[indexC] == 'b': turn = 'B' elif SC[indexC] == 'c': turn = 'C' indexC += 1 print(winner)
[ 7, 0, 13, 4, 13, 4, 13, 0, 13, 4, 13, 4, 13, 0, 13, 4, 13, 4, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 0, 13, 18, 13, 17, 42, 2, 2, 40, 13, 4, 13, 13, 40, 13, 4, 13, 13, 40, 13, 4, 13, 13, 14, 2, 13, 17, 14, 2, 13, 4, 13, 13, 0, 13, 18, 13, 13, 0, 13, 17, 14, 2, 13, 17, 14, 2, 13, 4, 13, 13, 0, 13, 18, 13, 13, 0, 13, 17, 14, 2, 13, 17, 14, 2, 13, 4, 13, 13, 0, 13, 18, 13, 13, 0, 13, 17, 14, 2, 13, 2, 4, 13, 13, 17, 4, 13, 17, 14, 2, 13, 2, 4, 13, 13, 17, 4, 13, 17, 14, 2, 13, 2, 4, 13, 13, 17, 4, 13, 17, 10, 4, 13, 10, 17, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 18, 13, 10, 4, 13 ]
[ [ 154, 2 ], [ 139, 8 ], [ 175, 14 ], [ 157, 20 ], [ 169, 23 ], [ 166, 26 ], [ 172, 29 ], [ 155, 31 ], [ 158, 37 ], [ 143, 37 ], [ 155, 40 ], [ 170, 42 ], [ 164, 42 ], [ 140, 45 ], [ 167, 47 ], [ 161, 47 ], [ 176, 50 ], [ 173, 53 ], [ 146, 53 ], [ 152, 53 ], [ 149, 53 ], [ 158, 57 ], [ 143, 57 ], [ 155, 60 ], [ 148, 62 ], [ 155, 64 ], [ 158, 65 ], [ 143, 65 ], [ 142, 67 ], [ 149, 71 ], [ 173, 71 ], [ 146, 71 ], [ 152, 71 ], [ 170, 75 ], [ 164, 75 ], [ 140, 78 ], [ 151, 80 ], [ 140, 82 ], [ 170, 83 ], [ 164, 83 ], [ 163, 85 ], [ 152, 89 ], [ 149, 89 ], [ 173, 89 ], [ 146, 89 ], [ 167, 93 ], [ 161, 93 ], [ 176, 96 ], [ 145, 98 ], [ 176, 100 ], [ 167, 101 ], [ 161, 101 ], [ 160, 103 ], [ 143, 107 ], [ 158, 107 ], [ 155, 111 ], [ 164, 118 ], [ 170, 118 ], [ 140, 122 ], [ 161, 129 ], [ 167, 129 ], [ 176, 133 ], [ 139, 140 ], [ 142, 143 ], [ 145, 146 ], [ 148, 149 ], [ 151, 152 ], [ 154, 155 ], [ 157, 158 ], [ 160, 161 ], [ 163, 164 ], [ 166, 167 ], [ 169, 170 ], [ 172, 173 ], [ 175, 176 ] ]
[ "a = list(input())\nb = list(input())\nc = list(input())\n\ni = 1\nj = 0\nk = 0\nlast = a[0]\n\nwhile i<=len(a) and j<=len(b) and k<=len(c):\n if last == 'a':\n if i < len(a):\n last = a[i]\n i += 1\n if last == 'b':\n if j < len(b):\n last = b[j]\n j += 1\n if last == 'c':\n if k < len(c):\n last = c[k]\n k += 1\n\nif i == len(a)+1:\n print('A')\nelif j == len(b)+1:\n print('B')\nelif k == len(c)+1:\n print('C')", "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", "i = 1", "i", "1", "j = 0", "j", "0", "k = 0", "k", "0", "last = a[0]", "last", "a[0]", "a", "0", "while i<=len(a) and j<=len(b) and k<=len(c):\n if last == 'a':\n if i < len(a):\n last = a[i]\n i += 1\n if last == 'b':\n if j < len(b):\n last = b[j]\n j += 1\n if last == 'c':\n if k < len(c):\n last = c[k]\n k += 1", "i<=len(a) and j<=len(b) and k<=len(c)", "i<=len(a) and j<=len(b)", "i<=len(a)", "i", "len(a)", "len", "a", "j<=len(b)", "j", "len(b)", "len", "b", "k<=len(c)", "k", "len(c)", "len", "c", "if last == 'a':\n if i < len(a):\n last = a[i]\n i += 1\n ", "last == 'a'", "last", "'a'", "if i < len(a):\n last = a[i]\n ", "i < len(a)", "i", "len(a)", "len", "a", "last = a[i]", "last", "a[i]", "a", "i", "i += 1", "i", "1", "if last == 'b':\n if j < len(b):\n last = b[j]\n j += 1\n ", "last == 'b'", "last", "'b'", "if j < len(b):\n last = b[j]\n ", "j < len(b)", "j", "len(b)", "len", "b", "last = b[j]", "last", "b[j]", "b", "j", "j += 1", "j", "1", "if last == 'c':\n if k < len(c):\n last = c[k]\n k += 1", "last == 'c'", "last", "'c'", "if k < len(c):\n last = c[k]\n ", "k < len(c)", "k", "len(c)", "len", "c", "last = c[k]", "last", "c[k]", "c", "k", "k += 1", "k", "1", "if i == len(a)+1:\n print('A')\nelif j == len(b)+1:\n print('B')\nelif k == len(c)+1:\n print('C')", "i == len(a)+1", "i", "len(a)+1", "len(a)", "len", "a", "1", "print('A')", "print", "'A'", "elif j == len(b)+1:\n print('B')", "j == len(b)+1", "j", "len(b)+1", "len(b)", "len", "b", "1", "print('B')", "print", "'B'", "elif k == len(c)+1:\n print('C')", "k == len(c)+1", "k", "len(c)+1", "len(c)", "len", "c", "1", "print('C')", "print", "'C'", "b = list(input())", "list(input())", "b", "i += 1", "1", "i", "last = c[k]", "c[k]", "last", "last = a[i]", "a[i]", "last", "last = b[j]", "b[j]", "last", "a = list(input())", "list(input())", "a", "i = 1", "1", "i", "k += 1", "1", "k", "j += 1", "1", "j", "k = 0", "0", "k", "j = 0", "0", "j", "last = a[0]", "a[0]", "last", "c = list(input())", "list(input())", "c" ]
a = list(input()) b = list(input()) c = list(input()) i = 1 j = 0 k = 0 last = a[0] while i<=len(a) and j<=len(b) and k<=len(c): if last == 'a': if i < len(a): last = a[i] i += 1 if last == 'b': if j < len(b): last = b[j] j += 1 if last == 'c': if k < len(c): last = c[k] k += 1 if i == len(a)+1: print('A') elif j == len(b)+1: print('B') elif k == len(c)+1: print('C')
[ 7, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 18, 13, 17, 12, 13, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 4, 13, 17, 29, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 4, 13, 17, 29, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 4, 13, 17, 29, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 29, 4, 13, 13, 13, 13, 13, 23, 13, 23, 13, 23, 13, 23, 13, 4, 13, 13, 13, 13, 13, 10, 18, 13, 10, 4, 13, 10, 12, 13, 10, 4, 13, 10, 4, 13 ]
[ [ 126, 2 ], [ 129, 6 ], [ 120, 10 ], [ 117, 14 ], [ 127, 16 ], [ 109, 22 ], [ 103, 28 ], [ 36, 35 ], [ 103, 37 ], [ 41, 40 ], [ 103, 42 ], [ 109, 47 ], [ 105, 53 ], [ 61, 60 ], [ 105, 62 ], [ 66, 65 ], [ 105, 67 ], [ 109, 72 ], [ 107, 78 ], [ 86, 85 ], [ 107, 87 ], [ 91, 90 ], [ 107, 92 ], [ 40, 98 ], [ 103, 98 ], [ 65, 99 ], [ 105, 99 ], [ 90, 100 ], [ 107, 100 ], [ 85, 101 ], [ 60, 101 ], [ 35, 101 ], [ 103, 103 ], [ 105, 105 ], [ 107, 107 ], [ 109, 109 ], [ 124, 111 ], [ 127, 112 ], [ 130, 113 ], [ 121, 114 ], [ 118, 115 ], [ 117, 118 ], [ 120, 121 ], [ 126, 127 ], [ 129, 130 ] ]
[ "A = input()\nB = input()\nC = input()\n\nx = A[0]\n\ndef turn(A, B, C, x):\n if x == 'a':\n if len(A) == 0:\n print('A')\n return\n else:\n y = A[0]\n A = A[1:]\n \n if x == 'b':\n if len(B) == 0:\n print('B')\n return\n else:\n y = B[0]\n B = B[1:]\n \n if x == 'c':\n if len(C) == 0:\n print('C')\n return\n else:\n y = C[0]\n C = C[1:]\n \n return turn(A, B, C, y)\n\nturn(A, B, C, x)", "A = input()", "A", "input()", "input", "B = input()", "B", "input()", "input", "C = input()", "C", "input()", "input", "x = A[0]", "x", "A[0]", "A", "0", "def turn(A, B, C, x):\n if x == 'a':\n if len(A) == 0:\n print('A')\n return\n else:\n y = A[0]\n A = A[1:]\n \n if x == 'b':\n if len(B) == 0:\n print('B')\n return\n else:\n y = B[0]\n B = B[1:]\n \n if x == 'c':\n if len(C) == 0:\n print('C')\n return\n else:\n y = C[0]\n C = C[1:]\n \n return turn(A, B, C, y)", "turn", "if x == 'a':\n if len(A) == 0:\n print('A')\n return\n else:\n y = A[0]\n A = A[1:]\n \n ", "x == 'a'", "x", "'a'", "if len(A) == 0:\n print('A')\n return\n else:\n y = A[0]\n A = A[1:]\n \n ", "len(A) == 0", "len(A)", "len", "A", "0", "print('A')", "print", "'A'", "return", "y = A[0]", "y", "A[0]", "A", "0", "A = A[1:]", "A", "A[1:]", "A", "1:", "1", "if x == 'b':\n if len(B) == 0:\n print('B')\n return\n else:\n y = B[0]\n B = B[1:]\n \n ", "x == 'b'", "x", "'b'", "if len(B) == 0:\n print('B')\n return\n else:\n y = B[0]\n B = B[1:]\n \n ", "len(B) == 0", "len(B)", "len", "B", "0", "print('B')", "print", "'B'", "return", "y = B[0]", "y", "B[0]", "B", "0", "B = B[1:]", "B", "B[1:]", "B", "1:", "1", "if x == 'c':\n if len(C) == 0:\n print('C')\n return\n else:\n y = C[0]\n C = C[1:]\n \n ", "x == 'c'", "x", "'c'", "if len(C) == 0:\n print('C')\n return\n else:\n y = C[0]\n C = C[1:]\n \n ", "len(C) == 0", "len(C)", "len", "C", "0", "print('C')", "print", "'C'", "return", "y = C[0]", "y", "C[0]", "C", "0", "C = C[1:]", "C", "C[1:]", "C", "1:", "1", "return turn(A, B, C, y)", "turn(A, B, C, y)", "turn", "A", "B", "C", "y", "A", "A", "B", "B", "C", "C", "x", "x", "turn(A, B, C, x)", "turn", "A", "B", "C", "x", "x = A[0]", "A[0]", "x", "C = input()", "input()", "C", "def turn(A, B, C, x):\n if x == 'a':\n if len(A) == 0:\n print('A')\n return\n else:\n y = A[0]\n A = A[1:]\n \n if x == 'b':\n if len(B) == 0:\n print('B')\n return\n else:\n y = B[0]\n B = B[1:]\n \n if x == 'c':\n if len(C) == 0:\n print('C')\n return\n else:\n y = C[0]\n C = C[1:]\n \n return turn(A, B, C, y)", "def turn(A, B, C, x):\n if x == 'a':\n if len(A) == 0:\n print('A')\n return\n else:\n y = A[0]\n A = A[1:]\n \n if x == 'b':\n if len(B) == 0:\n print('B')\n return\n else:\n y = B[0]\n B = B[1:]\n \n if x == 'c':\n if len(C) == 0:\n print('C')\n return\n else:\n y = C[0]\n C = C[1:]\n \n return turn(A, B, C, y)", "turn", "A = input()", "input()", "A", "B = input()", "input()", "B" ]
A = input() B = input() C = input() x = A[0] def turn(A, B, C, x): if x == 'a': if len(A) == 0: print('A') return else: y = A[0] A = A[1:] if x == 'b': if len(B) == 0: print('B') return else: y = B[0] B = B[1:] if x == 'c': if len(C) == 0: print('C') return else: y = C[0] C = C[1:] return turn(A, B, C, y) turn(A, B, C, x)
[ 7, 0, 13, 4, 13, 4, 13, 0, 13, 4, 13, 4, 13, 0, 13, 4, 13, 4, 13, 4, 18, 13, 13, 17, 4, 18, 13, 13, 17, 4, 18, 13, 13, 17, 0, 13, 21, 22, 17, 13, 22, 17, 13, 22, 17, 13, 0, 13, 17, 0, 13, 17, 42, 40, 13, 0, 13, 4, 18, 18, 13, 13, 13, 17, 14, 2, 13, 17, 4, 13, 13, 0, 13, 17, 0, 13, 4, 18, 13, 13, 10, 4, 13, 10, 17, 13, 10, 21, 13, 10, 17, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 17, 13, 10, 4, 13 ]
[ [ 105, 2 ], [ 96, 8 ], [ 81, 14 ], [ 106, 21 ], [ 97, 26 ], [ 82, 31 ], [ 87, 35 ], [ 84, 47 ], [ 90, 50 ], [ 91, 54 ], [ 103, 54 ], [ 99, 56 ], [ 88, 60 ], [ 85, 61 ], [ 94, 61 ], [ 100, 66 ], [ 85, 70 ], [ 94, 70 ], [ 102, 72 ], [ 93, 75 ], [ 100, 78 ], [ 81, 82 ], [ 84, 85 ], [ 87, 88 ], [ 90, 91 ], [ 93, 94 ], [ 96, 97 ], [ 99, 100 ], [ 102, 103 ], [ 105, 106 ] ]
[ "A = list(input())\nB = list(input())\nC = list(input())\n\nA.append(\"#\")\nB.append(\"#\")\nC.append(\"#\")\ngame = {\n \"A\" : A,\n \"B\" : B,\n \"C\" : C\n}\nturn = \"A\"\nfinished = False\n\nwhile not finished:\n next_turn = game[turn].pop(0)\n if next_turn == \"#\":\n print(turn)\n finished = True\n else:\n turn = next_turn.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", "A.append(\"#\")", "A.append", "A", "append", "\"#\"", "B.append(\"#\")", "B.append", "B", "append", "\"#\"", "C.append(\"#\")", "C.append", "C", "append", "\"#\"", "game = {\n \"A\" : A,\n \"B\" : B,\n \"C\" : C\n}", "game", "{\n \"A\" : A,\n \"B\" : B,\n \"C\" : C\n}", "\"A\"", "\"A\"", "A", "\"B\"", "\"B\"", "B", "\"C\"", "\"C\"", "C", "turn = \"A\"", "turn", "\"A\"", "finished = False", "finished", "False", "while not finished:\n next_turn = game[turn].pop(0)\n if next_turn == \"#\":\n print(turn)\n finished = True\n else:\n turn = next_turn.upper()", "not finished", "finished", "next_turn = game[turn].pop(0)", "next_turn", "game[turn].pop(0)", "[turn].pop", "[turn]", "game", "turn", "pop", "0", "if next_turn == \"#\":\n print(turn)\n finished = True\n else:\n turn = next_turn.upper()", "next_turn == \"#\"", "next_turn", "\"#\"", "print(turn)", "print", "turn", "finished = True", "finished", "True", "turn = next_turn.upper()", "turn", "next_turn.upper()", "next_turn.upper", "next_turn", "upper", "C = list(input())", "list(input())", "C", "turn = \"A\"", "\"A\"", "turn", "game = {\n \"A\" : A,\n \"B\" : B,\n \"C\" : C\n}", "{\n \"A\" : A,\n \"B\" : B,\n \"C\" : C\n}", "game", "finished = False", "False", "finished", "turn = next_turn.upper()", "next_turn.upper()", "turn", "B = list(input())", "list(input())", "B", "next_turn = game[turn].pop(0)", "game[turn].pop(0)", "next_turn", "finished = True", "True", "finished", "A = list(input())", "list(input())", "A" ]
A = list(input()) B = list(input()) C = list(input()) A.append("#") B.append("#") C.append("#") game = { "A" : A, "B" : B, "C" : C } turn = "A" finished = False while not finished: next_turn = game[turn].pop(0) if next_turn == "#": print(turn) finished = True else: turn = next_turn.upper()
[ 7, 15, 13, 12, 13, 41, 0, 13, 39, 41, 41, 41, 0, 13, 39, 0, 13, 39, 0, 13, 39, 28, 13, 4, 13, 17, 4, 18, 13, 13, 4, 13, 0, 13, 4, 13, 18, 13, 17, 0, 13, 4, 13, 18, 13, 17, 0, 13, 4, 13, 18, 13, 17, 4, 13, 12, 13, 41, 14, 2, 13, 39, 4, 13, 17, 4, 18, 13, 13, 0, 13, 18, 13, 17, 24, 18, 13, 17, 14, 2, 13, 17, 4, 13, 14, 2, 13, 17, 4, 13, 14, 2, 13, 17, 4, 13, 12, 13, 41, 14, 2, 13, 39, 4, 13, 17, 4, 18, 13, 13, 0, 13, 18, 13, 17, 24, 18, 13, 17, 14, 2, 13, 17, 4, 13, 14, 2, 13, 17, 4, 13, 14, 2, 13, 17, 4, 13, 4, 13, 17, 12, 13, 41, 14, 2, 13, 39, 4, 13, 17, 4, 18, 13, 13, 0, 13, 18, 13, 17, 24, 18, 13, 17, 14, 2, 13, 17, 4, 13, 14, 2, 13, 17, 4, 13, 14, 2, 13, 17, 4, 13, 4, 13, 17, 4, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13 ]
[ [ 8, 7 ], [ 14, 13 ], [ 17, 16 ], [ 20, 19 ], [ 23, 22 ], [ 7, 28 ], [ 34, 33 ], [ 7, 37 ], [ 41, 40 ], [ 7, 44 ], [ 48, 47 ], [ 7, 51 ], [ 71, 70 ], [ 70, 80 ], [ 70, 86 ], [ 70, 92 ], [ 112, 111 ], [ 111, 121 ], [ 188, 124 ], [ 111, 127 ], [ 111, 133 ], [ 156, 155 ], [ 155, 165 ], [ 188, 168 ], [ 155, 171 ], [ 191, 174 ], [ 155, 177 ], [ 194, 185 ] ]
[ "import sys\n\ndef atcoderB():\n \n global gamelis\n gamelis = []\n\n global alis\n global blis\n global clis\n alis = []\n blis = []\n clis = []\n\n\n for i in range(3):\n gamelis.append(input())\n alis = list(gamelis[0])\n blis = list(gamelis[1])\n clis = list(gamelis[2])\n funca()\n \ndef funca():\n global switchval\n if alis ==[]:\n print(\"A\")\n sys.exit()\n switchval = alis[0]\n del alis[0]\n\n\n if switchval == \"a\":\n funca()\n if switchval == \"b\":\n funcb()\n if switchval == \"c\":\n funcc()\n\n \n \ndef funcb():\n global switchval\n if blis ==[]:\n print(\"B\")\n sys.exit()\n switchval = blis[0]\n del blis[0]\n\n\n if switchval == \"a\":\n funca()\n if switchval == \"b\":\n funcb()\n if switchval == \"c\":\n funcc()\n else:\n print(\"B\")\n\n \ndef funcc():\n global switchval\n if clis ==[]:\n print(\"C\")\n sys.exit()\n switchval = clis[0]\n del clis[0]\n\n if switchval == \"a\":\n funca()\n if switchval == \"b\":\n funcb()\n if switchval == \"c\":\n funcc()\n else:\n print(\"C\")\n\n\n \natcoderB()", "import sys", "sys", "def atcoderB():\n \n global gamelis\n gamelis = []\n\n global alis\n global blis\n global clis\n alis = []\n blis = []\n clis = []\n\n\n for i in range(3):\n gamelis.append(input())\n alis = list(gamelis[0])\n blis = list(gamelis[1])\n clis = list(gamelis[2])\n funca()\n ", "atcoderB", "global gamelis", "gamelis = []", "gamelis", "[]", "global alis", "global blis", "global clis", "alis = []", "alis", "[]", "blis = []", "blis", "[]", "clis = []", "clis", "[]", "for i in range(3):\n gamelis.append(input())\n ", "i", "range(3)", "range", "3", "gamelis.append(input())", "gamelis.append", "gamelis", "append", "input()", "input", "alis = list(gamelis[0])", "alis", "list(gamelis[0])", "list", "gamelis[0]", "gamelis", "0", "blis = list(gamelis[1])", "blis", "list(gamelis[1])", "list", "gamelis[1]", "gamelis", "1", "clis = list(gamelis[2])", "clis", "list(gamelis[2])", "list", "gamelis[2]", "gamelis", "2", "funca()", "funca", "def funca():\n global switchval\n if alis ==[]:\n print(\"A\")\n sys.exit()\n switchval = alis[0]\n del alis[0]\n\n\n if switchval == \"a\":\n funca()\n if switchval == \"b\":\n funcb()\n if switchval == \"c\":\n funcc()\n\n \n ", "funca", "global switchval", "if alis ==[]:\n print(\"A\")\n sys.exit()\n ", "alis ==[]", "alis", "[]", "print(\"A\")", "print", "\"A\"", "sys.exit()", "sys.exit", "sys", "exit", "switchval = alis[0]", "switchval", "alis[0]", "alis", "0", "del alis[0]", "alis[0]", "alis", "0", "if switchval == \"a\":\n funca()\n ", "switchval == \"a\"", "switchval", "\"a\"", "funca()", "funca", "if switchval == \"b\":\n funcb()\n ", "switchval == \"b\"", "switchval", "\"b\"", "funcb()", "funcb", "if switchval == \"c\":\n funcc()\n\n \n ", "switchval == \"c\"", "switchval", "\"c\"", "funcc()", "funcc", "def funcb():\n global switchval\n if blis ==[]:\n print(\"B\")\n sys.exit()\n switchval = blis[0]\n del blis[0]\n\n\n if switchval == \"a\":\n funca()\n if switchval == \"b\":\n funcb()\n if switchval == \"c\":\n funcc()\n else:\n print(\"B\")\n\n ", "funcb", "global switchval", "if blis ==[]:\n print(\"B\")\n sys.exit()\n ", "blis ==[]", "blis", "[]", "print(\"B\")", "print", "\"B\"", "sys.exit()", "sys.exit", "sys", "exit", "switchval = blis[0]", "switchval", "blis[0]", "blis", "0", "del blis[0]", "blis[0]", "blis", "0", "if switchval == \"a\":\n funca()\n ", "switchval == \"a\"", "switchval", "\"a\"", "funca()", "funca", "if switchval == \"b\":\n funcb()\n ", "switchval == \"b\"", "switchval", "\"b\"", "funcb()", "funcb", "if switchval == \"c\":\n funcc()\n else:\n print(\"B\")\n\n ", "switchval == \"c\"", "switchval", "\"c\"", "funcc()", "funcc", "print(\"B\")", "print", "\"B\"", "def funcc():\n global switchval\n if clis ==[]:\n print(\"C\")\n sys.exit()\n switchval = clis[0]\n del clis[0]\n\n if switchval == \"a\":\n funca()\n if switchval == \"b\":\n funcb()\n if switchval == \"c\":\n funcc()\n else:\n print(\"C\")\n\n\n ", "funcc", "global switchval", "if clis ==[]:\n print(\"C\")\n sys.exit()\n ", "clis ==[]", "clis", "[]", "print(\"C\")", "print", "\"C\"", "sys.exit()", "sys.exit", "sys", "exit", "switchval = clis[0]", "switchval", "clis[0]", "clis", "0", "del clis[0]", "clis[0]", "clis", "0", "if switchval == \"a\":\n funca()\n ", "switchval == \"a\"", "switchval", "\"a\"", "funca()", "funca", "if switchval == \"b\":\n funcb()\n ", "switchval == \"b\"", "switchval", "\"b\"", "funcb()", "funcb", "if switchval == \"c\":\n funcc()\n else:\n print(\"C\")\n\n\n ", "switchval == \"c\"", "switchval", "\"c\"", "funcc()", "funcc", "print(\"C\")", "print", "\"C\"", "atcoderB()", "atcoderB", "def funca():\n global switchval\n if alis ==[]:\n print(\"A\")\n sys.exit()\n switchval = alis[0]\n del alis[0]\n\n\n if switchval == \"a\":\n funca()\n if switchval == \"b\":\n funcb()\n if switchval == \"c\":\n funcc()\n\n \n ", "def funca():\n global switchval\n if alis ==[]:\n print(\"A\")\n sys.exit()\n switchval = alis[0]\n del alis[0]\n\n\n if switchval == \"a\":\n funca()\n if switchval == \"b\":\n funcb()\n if switchval == \"c\":\n funcc()\n\n \n ", "funca", "def funcb():\n global switchval\n if blis ==[]:\n print(\"B\")\n sys.exit()\n switchval = blis[0]\n del blis[0]\n\n\n if switchval == \"a\":\n funca()\n if switchval == \"b\":\n funcb()\n if switchval == \"c\":\n funcc()\n else:\n print(\"B\")\n\n ", "def funcb():\n global switchval\n if blis ==[]:\n print(\"B\")\n sys.exit()\n switchval = blis[0]\n del blis[0]\n\n\n if switchval == \"a\":\n funca()\n if switchval == \"b\":\n funcb()\n if switchval == \"c\":\n funcc()\n else:\n print(\"B\")\n\n ", "funcb", "def atcoderB():\n \n global gamelis\n gamelis = []\n\n global alis\n global blis\n global clis\n alis = []\n blis = []\n clis = []\n\n\n for i in range(3):\n gamelis.append(input())\n alis = list(gamelis[0])\n blis = list(gamelis[1])\n clis = list(gamelis[2])\n funca()\n ", "def atcoderB():\n \n global gamelis\n gamelis = []\n\n global alis\n global blis\n global clis\n alis = []\n blis = []\n clis = []\n\n\n for i in range(3):\n gamelis.append(input())\n alis = list(gamelis[0])\n blis = list(gamelis[1])\n clis = list(gamelis[2])\n funca()\n ", "atcoderB", "def funcc():\n global switchval\n if clis ==[]:\n print(\"C\")\n sys.exit()\n switchval = clis[0]\n del clis[0]\n\n if switchval == \"a\":\n funca()\n if switchval == \"b\":\n funcb()\n if switchval == \"c\":\n funcc()\n else:\n print(\"C\")\n\n\n ", "def funcc():\n global switchval\n if clis ==[]:\n print(\"C\")\n sys.exit()\n switchval = clis[0]\n del clis[0]\n\n if switchval == \"a\":\n funca()\n if switchval == \"b\":\n funcb()\n if switchval == \"c\":\n funcc()\n else:\n print(\"C\")\n\n\n ", "funcc" ]
import sys def atcoderB(): global gamelis gamelis = [] global alis global blis global clis alis = [] blis = [] clis = [] for i in range(3): gamelis.append(input()) alis = list(gamelis[0]) blis = list(gamelis[1]) clis = list(gamelis[2]) funca() def funca(): global switchval if alis ==[]: print("A") sys.exit() switchval = alis[0] del alis[0] if switchval == "a": funca() if switchval == "b": funcb() if switchval == "c": funcc() def funcb(): global switchval if blis ==[]: print("B") sys.exit() switchval = blis[0] del blis[0] if switchval == "a": funca() if switchval == "b": funcb() if switchval == "c": funcc() else: print("B") def funcc(): global switchval if clis ==[]: print("C") sys.exit() switchval = clis[0] del clis[0] if switchval == "a": funca() if switchval == "b": funcb() if switchval == "c": funcc() else: print("C") atcoderB()
[ 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, 0, 13, 13, 42, 13, 0, 13, 4, 18, 13, 13, 14, 2, 13, 17, 14, 40, 13, 4, 13, 17, 3, 0, 13, 13, 14, 2, 13, 17, 14, 40, 13, 4, 13, 17, 3, 0, 13, 13, 14, 40, 13, 4, 13, 17, 3, 0, 13, 13, 10, 4, 13, 10, 4, 13, 10, 13, 13, 10, 17, 13, 10, 4, 13, 10, 13, 13, 10, 13, 13, 10, 4, 13, 10, 13, 13 ]
[ [ 79, 3 ], [ 82, 11 ], [ 100, 19 ], [ 88, 27 ], [ 103, 30 ], [ 80, 31 ], [ 91, 35 ], [ 104, 38 ], [ 95, 38 ], [ 98, 38 ], [ 86, 38 ], [ 92, 42 ], [ 80, 46 ], [ 85, 52 ], [ 80, 53 ], [ 92, 56 ], [ 83, 60 ], [ 97, 66 ], [ 83, 67 ], [ 101, 70 ], [ 94, 76 ], [ 101, 77 ], [ 79, 80 ], [ 82, 83 ], [ 80, 85 ], [ 85, 86 ], [ 88, 89 ], [ 91, 92 ], [ 101, 94 ], [ 94, 95 ], [ 83, 97 ], [ 97, 98 ], [ 100, 101 ], [ 80, 103 ], [ 103, 104 ] ]
[ "from collections import deque\nsa = deque(list(input()))\nsb = deque(list(input()))\nsc = deque(list(input()))\n\nflag = True\nnext = sa\nwhile flag:\n x = next.popleft()\n if x =='a':\n if not sa:\n print('A')\n break\n next = sa\n elif x =='b':\n if not sb:\n print('B')\n break\n next = sb\n else:\n if not sc:\n print('C')\n break\n next = sc", "from collections import deque", "sa = deque(list(input()))", "sa", "deque(list(input()))", "deque", "list(input())", "list", "input()", "input", "sb = deque(list(input()))", "sb", "deque(list(input()))", "deque", "list(input())", "list", "input()", "input", "sc = deque(list(input()))", "sc", "deque(list(input()))", "deque", "list(input())", "list", "input()", "input", "flag = True", "flag", "True", "next = sa", "next", "sa", "while flag:\n x = next.popleft()\n if x =='a':\n if not sa:\n print('A')\n break\n next = sa\n elif x =='b':\n if not sb:\n print('B')\n break\n next = sb\n else:\n if not sc:\n print('C')\n break\n next = sc", "flag", "x = next.popleft()", "x", "next.popleft()", "next.popleft", "next", "popleft", "if x =='a':\n if not sa:\n print('A')\n break\n next = sa\n elif x =='b':\n if not sb:\n print('B')\n break\n next = sb\n else:\n if not sc:\n print('C')\n break\n next = sc", "x =='a'", "x", "'a'", "if not sa:\n print('A')\n break\n ", "not sa", "sa", "print('A')", "print", "'A'", "break", "next = sa", "next", "sa", "elif x =='b':\n if not sb:\n print('B')\n break\n next = sb\n ", "x =='b'", "x", "'b'", "if not sb:\n print('B')\n break\n ", "not sb", "sb", "print('B')", "print", "'B'", "break", "next = sb", "next", "sb", "if not sc:\n print('C')\n break\n ", "not sc", "sc", "print('C')", "print", "'C'", "break", "next = sc", "next", "sc", "sa = deque(list(input()))", "deque(list(input()))", "sa", "sb = deque(list(input()))", "deque(list(input()))", "sb", "next = sa", "sa", "next", "flag = True", "True", "flag", "x = next.popleft()", "next.popleft()", "x", "next = sc", "sc", "next", "next = sb", "sb", "next", "sc = deque(list(input()))", "deque(list(input()))", "sc", "next = sa", "sa", "next" ]
from collections import deque sa = deque(list(input())) sb = deque(list(input())) sc = deque(list(input())) flag = True next = sa while flag: x = next.popleft() if x =='a': if not sa: print('A') break next = sa elif x =='b': if not sb: print('B') break next = sb else: if not sc: print('C') break next = sc
[ 7, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 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, 4, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 4, 13, 10, 18, 13, 10, 4, 13 ]
[ [ 105, 2 ], [ 129, 6 ], [ 135, 10 ], [ 108, 14 ], [ 106, 16 ], [ 123, 19 ], [ 106, 21 ], [ 109, 28 ], [ 121, 28 ], [ 112, 28 ], [ 127, 28 ], [ 124, 34 ], [ 106, 34 ], [ 133, 34 ], [ 126, 42 ], [ 124, 44 ], [ 106, 44 ], [ 133, 44 ], [ 132, 47 ], [ 124, 49 ], [ 106, 49 ], [ 133, 49 ], [ 109, 54 ], [ 121, 54 ], [ 112, 54 ], [ 127, 54 ], [ 130, 60 ], [ 115, 60 ], [ 111, 68 ], [ 130, 70 ], [ 115, 70 ], [ 114, 73 ], [ 130, 75 ], [ 115, 75 ], [ 109, 80 ], [ 121, 80 ], [ 112, 80 ], [ 127, 80 ], [ 136, 86 ], [ 118, 86 ], [ 120, 94 ], [ 136, 96 ], [ 118, 96 ], [ 117, 99 ], [ 136, 101 ], [ 118, 101 ], [ 105, 106 ], [ 108, 109 ], [ 111, 112 ], [ 114, 115 ], [ 117, 118 ], [ 120, 121 ], [ 123, 124 ], [ 126, 127 ], [ 129, 130 ], [ 132, 133 ], [ 135, 136 ] ]
[ "A = input()\nB = input()\nC = input()\n\ncheck = A[0]\nA = A[1:]\nwhile True:\n if check == \"a\":\n if len(A) == 0:\n print(\"A\")\n exit()\n check = A[0]\n A = A[1:]\n elif check == \"b\":\n if len(B) == 0:\n print(\"B\")\n exit()\n check = B[0]\n B = B[1:]\n elif check == \"c\":\n if len(C) == 0:\n print(\"C\")\n exit()\n check = C[0]\n C = C[1:]", "A = input()", "A", "input()", "input", "B = input()", "B", "input()", "input", "C = input()", "C", "input()", "input", "check = A[0]", "check", "A[0]", "A", "0", "A = A[1:]", "A", "A[1:]", "A", "1:", "1", "while True:\n if check == \"a\":\n if len(A) == 0:\n print(\"A\")\n exit()\n check = A[0]\n A = A[1:]\n elif check == \"b\":\n if len(B) == 0:\n print(\"B\")\n exit()\n check = B[0]\n B = B[1:]\n elif check == \"c\":\n if len(C) == 0:\n print(\"C\")\n exit()\n check = C[0]\n C = C[1:]", "True", "if check == \"a\":\n if len(A) == 0:\n print(\"A\")\n exit()\n check = A[0]\n A = A[1:]\n elif check == \"b\":\n if len(B) == 0:\n print(\"B\")\n exit()\n check = B[0]\n B = B[1:]\n elif check == \"c\":\n if len(C) == 0:\n print(\"C\")\n exit()\n check = C[0]\n C = C[1:]", "check == \"a\"", "check", "\"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", "check = A[0]", "check", "A[0]", "A", "0", "A = A[1:]", "A", "A[1:]", "A", "1:", "1", "elif check == \"b\":\n if len(B) == 0:\n print(\"B\")\n exit()\n check = B[0]\n B = B[1:]\n ", "check == \"b\"", "check", "\"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", "check = B[0]", "check", "B[0]", "B", "0", "B = B[1:]", "B", "B[1:]", "B", "1:", "1", "elif check == \"c\":\n if len(C) == 0:\n print(\"C\")\n exit()\n check = C[0]\n C = C[1:]", "check == \"c\"", "check", "\"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", "check = C[0]", "check", "C[0]", "C", "0", "C = C[1:]", "C", "C[1:]", "C", "1:", "1", "A = input()", "input()", "A", "check = A[0]", "A[0]", "check", "check = B[0]", "B[0]", "check", "B = B[1:]", "B[1:]", "B", "C = C[1:]", "C[1:]", "C", "check = C[0]", "C[0]", "check", "A = A[1:]", "A[1:]", "A", "check = A[0]", "A[0]", "check", "B = input()", "input()", "B", "A = A[1:]", "A[1:]", "A", "C = input()", "input()", "C" ]
A = input() B = input() C = input() check = A[0] A = A[1:] while True: if check == "a": if len(A) == 0: print("A") exit() check = A[0] A = A[1:] elif check == "b": if len(B) == 0: print("B") exit() check = B[0] B = B[1:] elif check == "c": if len(C) == 0: print("C") exit() check = C[0] C = C[1:]
[ 7, 0, 13, 4, 18, 4, 18, 4, 13, 17, 13, 13, 13, 13, 0, 13, 17, 28, 13, 4, 13, 2, 2, 4, 13, 13, 4, 13, 13, 4, 13, 13, 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, 4, 13, 10, 4, 13, 10, 18, 13, 10, 4, 13, 10, 18, 13, 10, 18, 13, 10, 17, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13 ]
[ [ 110, 2 ], [ 110, 12 ], [ 110, 13 ], [ 119, 15 ], [ 19, 18 ], [ 105, 25 ], [ 102, 28 ], [ 111, 31 ], [ 120, 34 ], [ 114, 34 ], [ 117, 34 ], [ 108, 34 ], [ 105, 38 ], [ 123, 38 ], [ 107, 46 ], [ 105, 48 ], [ 123, 48 ], [ 122, 51 ], [ 105, 53 ], [ 123, 53 ], [ 120, 58 ], [ 114, 58 ], [ 117, 58 ], [ 108, 58 ], [ 102, 62 ], [ 126, 62 ], [ 116, 70 ], [ 102, 72 ], [ 126, 72 ], [ 125, 75 ], [ 102, 77 ], [ 126, 77 ], [ 111, 82 ], [ 129, 82 ], [ 113, 90 ], [ 111, 92 ], [ 129, 92 ], [ 128, 95 ], [ 111, 97 ], [ 129, 97 ], [ 110, 102 ], [ 110, 105 ], [ 107, 108 ], [ 110, 111 ], [ 113, 114 ], [ 116, 117 ], [ 119, 120 ], [ 122, 123 ], [ 125, 126 ], [ 128, 129 ] ]
[ "A,B,C = open(0).read().split()\nP = \"a\"\n\nfor x in range(len(A)+len(B)+len(C)):\n if P==\"a\":\n if A==\"\":\n print(\"A\")\n exit()\n else:\n P = A[0]\n A = A[1:]\n \n elif P==\"b\":\n if B==\"\":\n print(\"B\")\n exit()\n else:\n P = B[0]\n B = B[1:]\n \n else:\n if C==\"\":\n print(\"C\")\n exit()\n else:\n P = C[0]\n C = C[1:]", "A,B,C = open(0).read().split()", "A", "open(0).read().split()", "(0).read().split", "(0).read()", "(0).read", "(0)", "open", "0", "read", "split", "B", "C", "P = \"a\"", "P", "\"a\"", "for x in range(len(A)+len(B)+len(C)):\n if P==\"a\":\n if A==\"\":\n print(\"A\")\n exit()\n else:\n P = A[0]\n A = A[1:]\n \n elif P==\"b\":\n if B==\"\":\n print(\"B\")\n exit()\n else:\n P = B[0]\n B = B[1:]\n \n else:\n if C==\"\":\n print(\"C\")\n exit()\n else:\n P = C[0]\n C = C[1:]", "x", "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 P==\"a\":\n if A==\"\":\n print(\"A\")\n exit()\n else:\n P = A[0]\n A = A[1:]\n \n elif P==\"b\":\n if B==\"\":\n print(\"B\")\n exit()\n else:\n P = B[0]\n B = B[1:]\n \n else:\n if C==\"\":\n print(\"C\")\n exit()\n else:\n P = C[0]\n C = C[1:]", "P==\"a\"", "P", "\"a\"", "if A==\"\":\n print(\"A\")\n exit()\n else:\n P = A[0]\n A = A[1:]\n \n ", "A==\"\"", "A", "\"\"", "print(\"A\")", "print", "\"A\"", "exit()", "exit", "P = A[0]", "P", "A[0]", "A", "0", "A = A[1:]", "A", "A[1:]", "A", "1:", "1", "elif P==\"b\":\n if B==\"\":\n print(\"B\")\n exit()\n else:\n P = B[0]\n B = B[1:]\n \n ", "P==\"b\"", "P", "\"b\"", "if B==\"\":\n print(\"B\")\n exit()\n else:\n P = B[0]\n B = B[1:]\n \n ", "B==\"\"", "B", "\"\"", "print(\"B\")", "print", "\"B\"", "exit()", "exit", "P = B[0]", "P", "B[0]", "B", "0", "B = B[1:]", "B", "B[1:]", "B", "1:", "1", "if C==\"\":\n print(\"C\")\n exit()\n else:\n P = C[0]\n C = C[1:]", "C==\"\"", "C", "\"\"", "print(\"C\")", "print", "\"C\"", "exit()", "exit", "P = C[0]", "P", "C[0]", "C", "0", "C = C[1:]", "C", "C[1:]", "C", "1:", "1", "B,C = open(0).read().split()", "open(0).read().split()", "B", "A,B,C = open(0).read().split()", "open(0).read().split()", "A", "P = A[0]", "A[0]", "P", "C = open(0).read().split()", "open(0).read().split()", "C", "P = C[0]", "C[0]", "P", "P = B[0]", "B[0]", "P", "P = \"a\"", "\"a\"", "P", "A = A[1:]", "A[1:]", "A", "B = B[1:]", "B[1:]", "B", "C = C[1:]", "C[1:]", "C" ]
A,B,C = open(0).read().split() P = "a" for x in range(len(A)+len(B)+len(C)): if P=="a": if A=="": print("A") exit() else: P = A[0] A = A[1:] elif P=="b": if B=="": print("B") exit() else: P = B[0] B = B[1:] else: if C=="": print("C") exit() else: P = C[0] C = C[1:]
[ 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, 4, 13, 2, 2, 13, 13, 13, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 4, 13, 17, 3, 0, 13, 18, 13, 17, 4, 18, 13, 13, 18, 13, 17, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 4, 13, 17, 3, 0, 13, 18, 13, 17, 4, 18, 13, 13, 18, 13, 17, 14, 2, 4, 13, 13, 17, 4, 13, 17, 3, 0, 13, 18, 13, 17, 4, 18, 13, 13, 18, 13, 17, 10, 18, 13, 10, 17, 13, 10, 4, 13, 10, 18, 13, 10, 4, 13, 10, 4, 13, 10, 18, 13 ]
[ [ 120, 2 ], [ 123, 8 ], [ 114, 14 ], [ 111, 20 ], [ 24, 23 ], [ 121, 30 ], [ 124, 31 ], [ 115, 32 ], [ 112, 35 ], [ 127, 35 ], [ 118, 35 ], [ 109, 35 ], [ 121, 41 ], [ 108, 48 ], [ 121, 50 ], [ 121, 54 ], [ 121, 57 ], [ 112, 61 ], [ 127, 61 ], [ 118, 61 ], [ 109, 61 ], [ 124, 67 ], [ 117, 74 ], [ 124, 76 ], [ 124, 80 ], [ 124, 83 ], [ 115, 89 ], [ 126, 96 ], [ 115, 98 ], [ 115, 102 ], [ 115, 105 ], [ 108, 109 ], [ 111, 112 ], [ 114, 115 ], [ 117, 118 ], [ 120, 121 ], [ 123, 124 ], [ 126, 127 ] ]
[ "sa = list(input())\nsb = list(input())\nsc = list(input())\nturn = \"a\"\nfor i in range(len(sa+sb+sc)):\n if turn == \"a\":\n if len(sa) == 0:\n print(\"A\")\n break\n else:\n turn = sa[0]\n sa.remove(sa[0])\n elif turn == \"b\":\n if len(sb) == 0:\n print(\"B\")\n break\n else:\n turn = sb[0]\n sb.remove(sb[0])\n else:\n if len(sc) == 0:\n print(\"C\")\n break\n else:\n turn = sc[0]\n sc.remove(sc[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(len(sa+sb+sc)):\n if turn == \"a\":\n if len(sa) == 0:\n print(\"A\")\n break\n else:\n turn = sa[0]\n sa.remove(sa[0])\n elif turn == \"b\":\n if len(sb) == 0:\n print(\"B\")\n break\n else:\n turn = sb[0]\n sb.remove(sb[0])\n else:\n if len(sc) == 0:\n print(\"C\")\n break\n else:\n turn = sc[0]\n sc.remove(sc[0])", "i", "range(len(sa+sb+sc))", "range", "len(sa+sb+sc)", "len", "sa+sb+sc", "sa+sb", "sa", "sb", "sc", "if turn == \"a\":\n if len(sa) == 0:\n print(\"A\")\n break\n else:\n turn = sa[0]\n sa.remove(sa[0])\n elif turn == \"b\":\n if len(sb) == 0:\n print(\"B\")\n break\n else:\n turn = sb[0]\n sb.remove(sb[0])\n else:\n if len(sc) == 0:\n print(\"C\")\n break\n else:\n turn = sc[0]\n sc.remove(sc[0])", "turn == \"a\"", "turn", "\"a\"", "if len(sa) == 0:\n print(\"A\")\n break\n else:\n turn = sa[0]\n sa.remove(sa[0])\n ", "len(sa) == 0", "len(sa)", "len", "sa", "0", "print(\"A\")", "print", "\"A\"", "break", "turn = sa[0]", "turn", "sa[0]", "sa", "0", "sa.remove(sa[0])", "sa.remove", "sa", "remove", "sa[0]", "sa", "0", "elif turn == \"b\":\n if len(sb) == 0:\n print(\"B\")\n break\n else:\n turn = sb[0]\n sb.remove(sb[0])\n ", "turn == \"b\"", "turn", "\"b\"", "if len(sb) == 0:\n print(\"B\")\n break\n else:\n turn = sb[0]\n sb.remove(sb[0])\n ", "len(sb) == 0", "len(sb)", "len", "sb", "0", "print(\"B\")", "print", "\"B\"", "break", "turn = sb[0]", "turn", "sb[0]", "sb", "0", "sb.remove(sb[0])", "sb.remove", "sb", "remove", "sb[0]", "sb", "0", "if len(sc) == 0:\n print(\"C\")\n break\n else:\n turn = sc[0]\n sc.remove(sc[0])", "len(sc) == 0", "len(sc)", "len", "sc", "0", "print(\"C\")", "print", "\"C\"", "break", "turn = sc[0]", "turn", "sc[0]", "sc", "0", "sc.remove(sc[0])", "sc.remove", "sc", "remove", "sc[0]", "sc", "0", "turn = sa[0]", "sa[0]", "turn", "turn = \"a\"", "\"a\"", "turn", "sc = list(input())", "list(input())", "sc", "turn = sb[0]", "sb[0]", "turn", "sa = list(input())", "list(input())", "sa", "sb = list(input())", "list(input())", "sb", "turn = sc[0]", "sc[0]", "turn" ]
sa = list(input()) sb = list(input()) sc = list(input()) turn = "a" for i in range(len(sa+sb+sc)): if turn == "a": if len(sa) == 0: print("A") break else: turn = sa[0] sa.remove(sa[0]) elif turn == "b": if len(sb) == 0: print("B") break else: turn = sb[0] sb.remove(sb[0]) else: if len(sc) == 0: print("C") break else: turn = sc[0] sc.remove(sc[0])
[ 7, 12, 13, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 18, 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, 2, 4, 13, 13, 17, 4, 13, 17, 29, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 4, 13, 17, 29, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 4, 13, 17, 29, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 4, 13, 10, 12, 13 ]
[ [ 5, 4 ], [ 9, 8 ], [ 13, 12 ], [ 17, 16 ], [ 4, 18 ], [ 4, 26 ], [ 58, 26 ], [ 8, 31 ], [ 83, 31 ], [ 12, 36 ], [ 108, 36 ], [ 16, 40 ], [ 103, 40 ], [ 78, 40 ], [ 53, 40 ], [ 4, 46 ], [ 58, 46 ], [ 54, 53 ], [ 4, 55 ], [ 58, 55 ], [ 59, 58 ], [ 4, 60 ], [ 58, 60 ], [ 53, 65 ], [ 16, 65 ], [ 103, 65 ], [ 78, 65 ], [ 8, 71 ], [ 83, 71 ], [ 79, 78 ], [ 8, 80 ], [ 83, 80 ], [ 84, 83 ], [ 8, 85 ], [ 83, 85 ], [ 78, 90 ], [ 53, 90 ], [ 16, 90 ], [ 103, 90 ], [ 12, 96 ], [ 108, 96 ], [ 104, 103 ], [ 12, 105 ], [ 108, 105 ], [ 109, 108 ], [ 12, 110 ], [ 108, 110 ], [ 117, 114 ] ]
[ "def game():\n\ts1 = input()\n\ts2 = input()\n\ts3 = input()\n\tx = s1[0]\n\twhile len(s1)>=0 and len(s2)>=0 and len(s3)>=0:\n\t\tif x=='a':\n\t\t\tif len(s1)==0:\n\t\t\t\tprint(\"A\")\n\t\t\t\treturn\n\t\t\tx = s1[0]\n\t\t\ts1 = s1[1:]\n\t\tif x=='b':\n\t\t\tif len(s2)==0:\n\t\t\t\tprint(\"B\")\n\t\t\t\treturn\n\t\t\tx = s2[0]\n\t\t\ts2 = s2[1:]\n\t\tif x=='c':\n\t\t\tif len(s3)==0:\n\t\t\t\tprint(\"C\")\n\t\t\t\treturn\n\t\t\tx = s3[0]\n\t\t\ts3 = s3[1:]\n\t\t\ngame()", "def game():\n\ts1 = input()\n\ts2 = input()\n\ts3 = input()\n\tx = s1[0]\n\twhile len(s1)>=0 and len(s2)>=0 and len(s3)>=0:\n\t\tif x=='a':\n\t\t\tif len(s1)==0:\n\t\t\t\tprint(\"A\")\n\t\t\t\treturn\n\t\t\tx = s1[0]\n\t\t\ts1 = s1[1:]\n\t\tif x=='b':\n\t\t\tif len(s2)==0:\n\t\t\t\tprint(\"B\")\n\t\t\t\treturn\n\t\t\tx = s2[0]\n\t\t\ts2 = s2[1:]\n\t\tif x=='c':\n\t\t\tif len(s3)==0:\n\t\t\t\tprint(\"C\")\n\t\t\t\treturn\n\t\t\tx = s3[0]\n\t\t\ts3 = s3[1:]\n\t\t", "game", "s1 = input()", "s1", "input()", "input", "s2 = input()", "s2", "input()", "input", "s3 = input()", "s3", "input()", "input", "x = s1[0]", "x", "s1[0]", "s1", "0", "while len(s1)>=0 and len(s2)>=0 and len(s3)>=0:\n\t\tif x=='a':\n\t\t\tif len(s1)==0:\n\t\t\t\tprint(\"A\")\n\t\t\t\treturn\n\t\t\tx = s1[0]\n\t\t\ts1 = s1[1:]\n\t\tif x=='b':\n\t\t\tif len(s2)==0:\n\t\t\t\tprint(\"B\")\n\t\t\t\treturn\n\t\t\tx = s2[0]\n\t\t\ts2 = s2[1:]\n\t\tif x=='c':\n\t\t\tif len(s3)==0:\n\t\t\t\tprint(\"C\")\n\t\t\t\treturn\n\t\t\tx = s3[0]\n\t\t\ts3 = s3[1:]\n\t\t", "len(s1)>=0 and len(s2)>=0 and len(s3)>=0", "len(s1)>=0 and len(s2)>=0", "len(s1)>=0", "len(s1)", "len", "s1", "0", "len(s2)>=0", "len(s2)", "len", "s2", "0", "len(s3)>=0", "len(s3)", "len", "s3", "0", "if x=='a':\n\t\t\tif len(s1)==0:\n\t\t\t\tprint(\"A\")\n\t\t\t\treturn\n\t\t\tx = s1[0]\n\t\t\ts1 = s1[1:]\n\t\t", "x=='a'", "x", "'a'", "if len(s1)==0:\n\t\t\t\tprint(\"A\")\n\t\t\t\treturn\n\t\t\t", "len(s1)==0", "len(s1)", "len", "s1", "0", "print(\"A\")", "print", "\"A\"", "return", "x = s1[0]", "x", "s1[0]", "s1", "0", "s1 = s1[1:]", "s1", "s1[1:]", "s1", "1:", "1", "if x=='b':\n\t\t\tif len(s2)==0:\n\t\t\t\tprint(\"B\")\n\t\t\t\treturn\n\t\t\tx = s2[0]\n\t\t\ts2 = s2[1:]\n\t\t", "x=='b'", "x", "'b'", "if len(s2)==0:\n\t\t\t\tprint(\"B\")\n\t\t\t\treturn\n\t\t\t", "len(s2)==0", "len(s2)", "len", "s2", "0", "print(\"B\")", "print", "\"B\"", "return", "x = s2[0]", "x", "s2[0]", "s2", "0", "s2 = s2[1:]", "s2", "s2[1:]", "s2", "1:", "1", "if x=='c':\n\t\t\tif len(s3)==0:\n\t\t\t\tprint(\"C\")\n\t\t\t\treturn\n\t\t\tx = s3[0]\n\t\t\ts3 = s3[1:]\n\t\t", "x=='c'", "x", "'c'", "if len(s3)==0:\n\t\t\t\tprint(\"C\")\n\t\t\t\treturn\n\t\t\t", "len(s3)==0", "len(s3)", "len", "s3", "0", "print(\"C\")", "print", "\"C\"", "return", "x = s3[0]", "x", "s3[0]", "s3", "0", "s3 = s3[1:]", "s3", "s3[1:]", "s3", "1:", "1", "game()", "game", "def game():\n\ts1 = input()\n\ts2 = input()\n\ts3 = input()\n\tx = s1[0]\n\twhile len(s1)>=0 and len(s2)>=0 and len(s3)>=0:\n\t\tif x=='a':\n\t\t\tif len(s1)==0:\n\t\t\t\tprint(\"A\")\n\t\t\t\treturn\n\t\t\tx = s1[0]\n\t\t\ts1 = s1[1:]\n\t\tif x=='b':\n\t\t\tif len(s2)==0:\n\t\t\t\tprint(\"B\")\n\t\t\t\treturn\n\t\t\tx = s2[0]\n\t\t\ts2 = s2[1:]\n\t\tif x=='c':\n\t\t\tif len(s3)==0:\n\t\t\t\tprint(\"C\")\n\t\t\t\treturn\n\t\t\tx = s3[0]\n\t\t\ts3 = s3[1:]\n\t\t", "def game():\n\ts1 = input()\n\ts2 = input()\n\ts3 = input()\n\tx = s1[0]\n\twhile len(s1)>=0 and len(s2)>=0 and len(s3)>=0:\n\t\tif x=='a':\n\t\t\tif len(s1)==0:\n\t\t\t\tprint(\"A\")\n\t\t\t\treturn\n\t\t\tx = s1[0]\n\t\t\ts1 = s1[1:]\n\t\tif x=='b':\n\t\t\tif len(s2)==0:\n\t\t\t\tprint(\"B\")\n\t\t\t\treturn\n\t\t\tx = s2[0]\n\t\t\ts2 = s2[1:]\n\t\tif x=='c':\n\t\t\tif len(s3)==0:\n\t\t\t\tprint(\"C\")\n\t\t\t\treturn\n\t\t\tx = s3[0]\n\t\t\ts3 = s3[1:]\n\t\t", "game" ]
def game(): s1 = input() s2 = input() s3 = input() x = s1[0] while len(s1)>=0 and len(s2)>=0 and len(s3)>=0: if x=='a': if len(s1)==0: print("A") return x = s1[0] s1 = s1[1:] if x=='b': if len(s2)==0: print("B") return x = s2[0] s2 = s2[1:] if x=='c': if len(s3)==0: print("C") return x = s3[0] s3 = s3[1:] game()
[ 7, 15, 13, 13, 13, 13, 13, 13, 15, 13, 12, 13, 12, 13, 12, 13, 12, 13, 12, 13, 0, 13, 4, 18, 13, 13, 4, 13, 4, 13, 0, 13, 4, 18, 13, 13, 4, 13, 4, 13, 0, 13, 4, 18, 13, 13, 4, 13, 4, 13, 0, 13, 17, 0, 13, 17, 42, 2, 13, 17, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 0, 13, 17, 0, 13, 4, 18, 13, 13, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 0, 13, 17, 0, 13, 4, 18, 13, 13, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 0, 13, 17, 0, 13, 4, 18, 13, 13, 4, 13, 13, 4, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13 ]
[ [ 22, 21 ], [ 130, 29 ], [ 32, 31 ], [ 130, 39 ], [ 42, 41 ], [ 130, 49 ], [ 52, 51 ], [ 55, 54 ], [ 51, 58 ], [ 109, 58 ], [ 90, 58 ], [ 71, 58 ], [ 54, 62 ], [ 112, 62 ], [ 93, 62 ], [ 74, 62 ], [ 21, 68 ], [ 72, 71 ], [ 75, 74 ], [ 21, 77 ], [ 74, 81 ], [ 54, 81 ], [ 112, 81 ], [ 93, 81 ], [ 31, 87 ], [ 91, 90 ], [ 94, 93 ], [ 31, 96 ], [ 93, 100 ], [ 74, 100 ], [ 54, 100 ], [ 112, 100 ], [ 41, 106 ], [ 110, 109 ], [ 113, 112 ], [ 41, 115 ], [ 109, 119 ], [ 90, 119 ], [ 71, 119 ], [ 51, 119 ], [ 133, 121 ] ]
[ "import bisect,collections,copy,itertools,math,string\nimport sys\ndef I(): return int(sys.stdin.readline().rstrip())\ndef LI(): return list(map(int,sys.stdin.readline().rstrip().split()))\ndef S(): return sys.stdin.readline().rstrip()\ndef LS(): return list(sys.stdin.readline().rstrip().split())\ndef main():\n sa = collections.deque(list(S()))\n sb = collections.deque(list(S()))\n sc = collections.deque(list(S()))\n ans = None \n nxt = \"a\"\n\n while ans == None:\n if nxt == \"a\":\n if len(sa) == 0:\n ans = \"A\"\n else:\n nxt = sa.popleft()\n if nxt == \"b\":\n if len(sb) == 0:\n ans = \"B\"\n else:\n nxt = sb.popleft()\n if nxt == \"c\":\n if len(sc) == 0:\n ans = \"C\"\n else:\n nxt = sc.popleft()\n print(ans)\nmain() ", "import bisect,collections,copy,itertools,math,string", "bisect", "collections", "copy", "itertools", "math", "string", "import sys", "sys", "def I(): return int(sys.stdin.readline().rstrip())", "I", "def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))", "LI", "def S(): return sys.stdin.readline().rstrip()", "S", "def LS(): return list(sys.stdin.readline().rstrip().split())", "LS", "def main():\n sa = collections.deque(list(S()))\n sb = collections.deque(list(S()))\n sc = collections.deque(list(S()))\n ans = None \n nxt = \"a\"\n\n while ans == None:\n if nxt == \"a\":\n if len(sa) == 0:\n ans = \"A\"\n else:\n nxt = sa.popleft()\n if nxt == \"b\":\n if len(sb) == 0:\n ans = \"B\"\n else:\n nxt = sb.popleft()\n if nxt == \"c\":\n if len(sc) == 0:\n ans = \"C\"\n else:\n nxt = sc.popleft()\n print(ans)", "main", "sa = collections.deque(list(S()))", "sa", "collections.deque(list(S()))", "collections.deque", "collections", "deque", "list(S())", "list", "S()", "S", "sb = collections.deque(list(S()))", "sb", "collections.deque(list(S()))", "collections.deque", "collections", "deque", "list(S())", "list", "S()", "S", "sc = collections.deque(list(S()))", "sc", "collections.deque(list(S()))", "collections.deque", "collections", "deque", "list(S())", "list", "S()", "S", "ans = None", "ans", "None", "nxt = \"a\"", "nxt", "\"a\"", "while ans == None:\n if nxt == \"a\":\n if len(sa) == 0:\n ans = \"A\"\n else:\n nxt = sa.popleft()\n if nxt == \"b\":\n if len(sb) == 0:\n ans = \"B\"\n else:\n nxt = sb.popleft()\n if nxt == \"c\":\n if len(sc) == 0:\n ans = \"C\"\n else:\n nxt = sc.popleft()\n ", "ans == None", "ans", "None", "if nxt == \"a\":\n if len(sa) == 0:\n ans = \"A\"\n else:\n nxt = sa.popleft()\n ", "nxt == \"a\"", "nxt", "\"a\"", "if len(sa) == 0:\n ans = \"A\"\n else:\n nxt = sa.popleft()\n ", "len(sa) == 0", "len(sa)", "len", "sa", "0", "ans = \"A\"", "ans", "\"A\"", "nxt = sa.popleft()", "nxt", "sa.popleft()", "sa.popleft", "sa", "popleft", "if nxt == \"b\":\n if len(sb) == 0:\n ans = \"B\"\n else:\n nxt = sb.popleft()\n ", "nxt == \"b\"", "nxt", "\"b\"", "if len(sb) == 0:\n ans = \"B\"\n else:\n nxt = sb.popleft()\n ", "len(sb) == 0", "len(sb)", "len", "sb", "0", "ans = \"B\"", "ans", "\"B\"", "nxt = sb.popleft()", "nxt", "sb.popleft()", "sb.popleft", "sb", "popleft", "if nxt == \"c\":\n if len(sc) == 0:\n ans = \"C\"\n else:\n nxt = sc.popleft()\n ", "nxt == \"c\"", "nxt", "\"c\"", "if len(sc) == 0:\n ans = \"C\"\n else:\n nxt = sc.popleft()\n ", "len(sc) == 0", "len(sc)", "len", "sc", "0", "ans = \"C\"", "ans", "\"C\"", "nxt = sc.popleft()", "nxt", "sc.popleft()", "sc.popleft", "sc", "popleft", "print(ans)", "print", "ans", "main()", "main", "def LS(): return list(sys.stdin.readline().rstrip().split())", "def LS(): return list(sys.stdin.readline().rstrip().split())", "LS", "def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))", "def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))", "LI", "def S(): return sys.stdin.readline().rstrip()", "def S(): return sys.stdin.readline().rstrip()", "S", "def main():\n sa = collections.deque(list(S()))\n sb = collections.deque(list(S()))\n sc = collections.deque(list(S()))\n ans = None \n nxt = \"a\"\n\n while ans == None:\n if nxt == \"a\":\n if len(sa) == 0:\n ans = \"A\"\n else:\n nxt = sa.popleft()\n if nxt == \"b\":\n if len(sb) == 0:\n ans = \"B\"\n else:\n nxt = sb.popleft()\n if nxt == \"c\":\n if len(sc) == 0:\n ans = \"C\"\n else:\n nxt = sc.popleft()\n print(ans)", "def main():\n sa = collections.deque(list(S()))\n sb = collections.deque(list(S()))\n sc = collections.deque(list(S()))\n ans = None \n nxt = \"a\"\n\n while ans == None:\n if nxt == \"a\":\n if len(sa) == 0:\n ans = \"A\"\n else:\n nxt = sa.popleft()\n if nxt == \"b\":\n if len(sb) == 0:\n ans = \"B\"\n else:\n nxt = sb.popleft()\n if nxt == \"c\":\n if len(sc) == 0:\n ans = \"C\"\n else:\n nxt = sc.popleft()\n print(ans)", "main", "def I(): return int(sys.stdin.readline().rstrip())", "def I(): return int(sys.stdin.readline().rstrip())", "I" ]
import bisect,collections,copy,itertools,math,string import sys def I(): return int(sys.stdin.readline().rstrip()) def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) def S(): return sys.stdin.readline().rstrip() def LS(): return list(sys.stdin.readline().rstrip().split()) def main(): sa = collections.deque(list(S())) sb = collections.deque(list(S())) sc = collections.deque(list(S())) ans = None nxt = "a" while ans == None: if nxt == "a": if len(sa) == 0: ans = "A" else: nxt = sa.popleft() if nxt == "b": if len(sb) == 0: ans = "B" else: nxt = sb.popleft() if nxt == "c": if len(sc) == 0: ans = "C" else: nxt = sc.popleft() print(ans) main()
[ 7, 0, 13, 4, 13, 4, 13, 0, 13, 4, 13, 4, 13, 0, 13, 4, 13, 4, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 0, 13, 17, 0, 13, 17, 42, 2, 13, 17, 14, 2, 13, 17, 14, 2, 13, 4, 13, 13, 0, 13, 17, 0, 13, 18, 13, 13, 0, 13, 17, 14, 2, 13, 17, 14, 2, 13, 4, 13, 13, 0, 13, 17, 0, 13, 18, 13, 13, 0, 13, 17, 14, 2, 13, 17, 14, 2, 13, 4, 13, 13, 0, 13, 17, 0, 13, 18, 13, 13, 0, 13, 17, 4, 13, 13, 10, 18, 13, 10, 4, 13, 10, 18, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 4, 13, 10, 18, 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 ]
[ [ 108, 2 ], [ 126, 8 ], [ 123, 14 ], [ 132, 20 ], [ 141, 23 ], [ 135, 26 ], [ 117, 29 ], [ 144, 32 ], [ 118, 36 ], [ 151, 36 ], [ 121, 36 ], [ 115, 36 ], [ 145, 40 ], [ 106, 40 ], [ 130, 40 ], [ 112, 40 ], [ 133, 44 ], [ 148, 44 ], [ 109, 47 ], [ 114, 49 ], [ 111, 52 ], [ 109, 54 ], [ 133, 55 ], [ 148, 55 ], [ 147, 57 ], [ 112, 61 ], [ 145, 61 ], [ 106, 61 ], [ 130, 61 ], [ 142, 65 ], [ 154, 65 ], [ 127, 68 ], [ 120, 70 ], [ 129, 73 ], [ 127, 75 ], [ 142, 76 ], [ 154, 76 ], [ 153, 78 ], [ 130, 82 ], [ 112, 82 ], [ 145, 82 ], [ 106, 82 ], [ 136, 86 ], [ 139, 86 ], [ 124, 89 ], [ 150, 91 ], [ 105, 94 ], [ 124, 96 ], [ 136, 97 ], [ 139, 97 ], [ 138, 99 ], [ 151, 103 ], [ 121, 103 ], [ 115, 103 ], [ 118, 103 ], [ 105, 106 ], [ 108, 109 ], [ 111, 112 ], [ 114, 115 ], [ 117, 118 ], [ 120, 121 ], [ 123, 124 ], [ 126, 127 ], [ 129, 130 ], [ 132, 133 ], [ 135, 136 ], [ 138, 139 ], [ 141, 142 ], [ 144, 145 ], [ 147, 148 ], [ 150, 151 ], [ 153, 154 ] ]
[ "SA = list(input())\nSB = list(input())\nSC = list(input())\nA = 0\nB = 0\nC = 0\nans = \"\"\nturn = \"a\"\nwhile ans == \"\":\n if turn == \"a\":\n if A == len(SA):\n ans = \"A\"\n else:\n turn = SA[A]\n A +=1\n if turn == \"b\":\n if B == len(SB):\n ans = \"B\"\n else:\n turn = SB[B]\n B += 1\n if turn == \"c\":\n if C == len(SC):\n ans = \"C\"\n else:\n turn = SC[C]\n C += 1\nprint(ans)", "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 = 0", "A", "0", "B = 0", "B", "0", "C = 0", "C", "0", "ans = \"\"", "ans", "\"\"", "turn = \"a\"", "turn", "\"a\"", "while ans == \"\":\n if turn == \"a\":\n if A == len(SA):\n ans = \"A\"\n else:\n turn = SA[A]\n A +=1\n if turn == \"b\":\n if B == len(SB):\n ans = \"B\"\n else:\n turn = SB[B]\n B += 1\n if turn == \"c\":\n if C == len(SC):\n ans = \"C\"\n else:\n turn = SC[C]\n C += 1", "ans == \"\"", "ans", "\"\"", "if turn == \"a\":\n if A == len(SA):\n ans = \"A\"\n else:\n turn = SA[A]\n A +=1\n ", "turn == \"a\"", "turn", "\"a\"", "if A == len(SA):\n ans = \"A\"\n else:\n turn = SA[A]\n ", "A == len(SA)", "A", "len(SA)", "len", "SA", "ans = \"A\"", "ans", "\"A\"", "turn = SA[A]", "turn", "SA[A]", "SA", "A", "A +=1", "A", "1", "if turn == \"b\":\n if B == len(SB):\n ans = \"B\"\n else:\n turn = SB[B]\n B += 1\n ", "turn == \"b\"", "turn", "\"b\"", "if B == len(SB):\n ans = \"B\"\n else:\n turn = SB[B]\n ", "B == len(SB)", "B", "len(SB)", "len", "SB", "ans = \"B\"", "ans", "\"B\"", "turn = SB[B]", "turn", "SB[B]", "SB", "B", "B += 1", "B", "1", "if turn == \"c\":\n if C == len(SC):\n ans = \"C\"\n else:\n turn = SC[C]\n C += 1", "turn == \"c\"", "turn", "\"c\"", "if C == len(SC):\n ans = \"C\"\n else:\n turn = SC[C]\n ", "C == len(SC)", "C", "len(SC)", "len", "SC", "ans = \"C\"", "ans", "\"C\"", "turn = SC[C]", "turn", "SC[C]", "SC", "C", "C += 1", "C", "1", "print(ans)", "print", "ans", "turn = SC[C]", "SC[C]", "turn", "SA = list(input())", "list(input())", "SA", "turn = SA[A]", "SA[A]", "turn", "ans = \"A\"", "\"A\"", "ans", "ans = \"\"", "\"\"", "ans", "ans = \"B\"", "\"B\"", "ans", "SC = list(input())", "list(input())", "SC", "SB = list(input())", "list(input())", "SB", "turn = SB[B]", "SB[B]", "turn", "A = 0", "0", "A", "C = 0", "0", "C", "C += 1", "1", "C", "B = 0", "0", "B", "turn = \"a\"", "\"a\"", "turn", "A +=1", "1", "A", "ans = \"C\"", "\"C\"", "ans", "B += 1", "1", "B" ]
SA = list(input()) SB = list(input()) SC = list(input()) A = 0 B = 0 C = 0 ans = "" turn = "a" while ans == "": if turn == "a": if A == len(SA): ans = "A" else: turn = SA[A] A +=1 if turn == "b": if B == len(SB): ans = "B" else: turn = SB[B] B += 1 if turn == "c": if C == len(SC): ans = "C" else: turn = SC[C] C += 1 print(ans)
[ 7, 15, 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, 4, 18, 13, 13, 42, 2, 2, 13, 13, 13, 14, 2, 13, 17, 0, 13, 4, 18, 13, 13, 14, 2, 13, 17, 0, 13, 4, 18, 13, 13, 0, 13, 4, 18, 13, 13, 4, 13, 4, 18, 4, 13, 13, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13 ]
[ [ 94, 3 ], [ 95, 10 ], [ 91, 14 ], [ 92, 21 ], [ 88, 25 ], [ 89, 32 ], [ 85, 36 ], [ 95, 39 ], [ 95, 44 ], [ 92, 45 ], [ 89, 46 ], [ 86, 49 ], [ 98, 49 ], [ 101, 49 ], [ 83, 49 ], [ 82, 52 ], [ 95, 55 ], [ 86, 59 ], [ 98, 59 ], [ 101, 59 ], [ 83, 59 ], [ 100, 62 ], [ 92, 65 ], [ 97, 68 ], [ 89, 71 ], [ 98, 79 ], [ 101, 79 ], [ 83, 79 ], [ 86, 79 ], [ 82, 83 ], [ 85, 86 ], [ 88, 89 ], [ 91, 92 ], [ 94, 95 ], [ 97, 98 ], [ 100, 101 ] ]
[ "from collections import deque\na = deque(input())\na.append(\"a\")\nb = deque(input())\nb.append(\"b\")\nc = deque(input())\nc.append(\"c\")\n \nstart = a.popleft()\nwhile a and b and c:\n if start == \"a\":\n start = a.popleft()\n elif start == \"b\":\n start = b.popleft()\n else:\n start = c.popleft()\n \nprint(str(start).upper())", "from collections import deque", "a = deque(input())", "a", "deque(input())", "deque", "input()", "input", "a.append(\"a\")", "a.append", "a", "append", "\"a\"", "b = deque(input())", "b", "deque(input())", "deque", "input()", "input", "b.append(\"b\")", "b.append", "b", "append", "\"b\"", "c = deque(input())", "c", "deque(input())", "deque", "input()", "input", "c.append(\"c\")", "c.append", "c", "append", "\"c\"", "start = a.popleft()", "start", "a.popleft()", "a.popleft", "a", "popleft", "while a and b and c:\n if start == \"a\":\n start = a.popleft()\n elif start == \"b\":\n start = b.popleft()\n else:\n start = c.popleft()\n ", "a and b and c", "a and b", "a", "b", "c", "if start == \"a\":\n start = a.popleft()\n elif start == \"b\":\n start = b.popleft()\n else:\n start = c.popleft()\n ", "start == \"a\"", "start", "\"a\"", "start = a.popleft()", "start", "a.popleft()", "a.popleft", "a", "popleft", "elif start == \"b\":\n start = b.popleft()\n ", "start == \"b\"", "start", "\"b\"", "start = b.popleft()", "start", "b.popleft()", "b.popleft", "b", "popleft", "start = c.popleft()", "start", "c.popleft()", "c.popleft", "c", "popleft", "print(str(start).upper())", "print", "str(start).upper()", "(start).upper", "(start)", "str", "start", "upper", "start = a.popleft()", "a.popleft()", "start", "start = a.popleft()", "a.popleft()", "start", "c = deque(input())", "deque(input())", "c", "b = deque(input())", "deque(input())", "b", "a = deque(input())", "deque(input())", "a", "start = c.popleft()", "c.popleft()", "start", "start = b.popleft()", "b.popleft()", "start" ]
from collections import deque a = deque(input()) a.append("a") b = deque(input()) b.append("b") c = deque(input()) c.append("c") start = a.popleft() while a and b and c: if start == "a": start = a.popleft() elif start == "b": start = b.popleft() else: start = c.popleft() print(str(start).upper())
[ 7, 12, 13, 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, 13, 0, 13, 4, 18, 13, 13, 17, 4, 13, 17, 3, 14, 2, 13, 17, 14, 13, 0, 13, 4, 18, 13, 13, 17, 4, 13, 17, 3, 14, 2, 13, 17, 14, 13, 0, 13, 4, 18, 13, 13, 17, 4, 13, 17, 3, 14, 2, 13, 17, 4, 13, 10, 12, 13 ]
[ [ 5, 4 ], [ 11, 10 ], [ 17, 16 ], [ 23, 22 ], [ 22, 28 ], [ 67, 28 ], [ 50, 28 ], [ 33, 28 ], [ 34, 33 ], [ 4, 36 ], [ 33, 45 ], [ 22, 45 ], [ 67, 45 ], [ 50, 45 ], [ 51, 50 ], [ 10, 53 ], [ 50, 62 ], [ 33, 62 ], [ 22, 62 ], [ 67, 62 ], [ 68, 67 ], [ 16, 70 ], [ 85, 82 ] ]
[ "def main():\n sa = list(input())\n sb = list(input())\n sc = list(input())\n nex = 'a'\n while True:\n if nex == 'a':\n if sa:\n nex = sa.pop(0)\n else:\n print('A')\n break\n if nex == 'b':\n if sb:\n nex = sb.pop(0)\n else:\n print('B')\n break\n if nex == 'c':\n if sc:\n nex = sc.pop(0)\n else:\n print('C')\n break\n \n\nif __name__ == '__main__':\n main()", "def main():\n sa = list(input())\n sb = list(input())\n sc = list(input())\n nex = 'a'\n while True:\n if nex == 'a':\n if sa:\n nex = sa.pop(0)\n else:\n print('A')\n break\n if nex == 'b':\n if sb:\n nex = sb.pop(0)\n else:\n print('B')\n break\n if nex == 'c':\n if sc:\n nex = sc.pop(0)\n else:\n print('C')\n break\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", "nex = 'a'", "nex", "'a'", "while True:\n if nex == 'a':\n if sa:\n nex = sa.pop(0)\n else:\n print('A')\n break\n if nex == 'b':\n if sb:\n nex = sb.pop(0)\n else:\n print('B')\n break\n if nex == 'c':\n if sc:\n nex = sc.pop(0)\n else:\n print('C')\n break\n ", "True", "if nex == 'a':\n if sa:\n nex = sa.pop(0)\n else:\n print('A')\n break\n ", "nex == 'a'", "nex", "'a'", "if sa:\n nex = sa.pop(0)\n else:\n print('A')\n break\n ", "sa", "nex = sa.pop(0)", "nex", "sa.pop(0)", "sa.pop", "sa", "pop", "0", "print('A')", "print", "'A'", "break", "if nex == 'b':\n if sb:\n nex = sb.pop(0)\n else:\n print('B')\n break\n ", "nex == 'b'", "nex", "'b'", "if sb:\n nex = sb.pop(0)\n else:\n print('B')\n break\n ", "sb", "nex = sb.pop(0)", "nex", "sb.pop(0)", "sb.pop", "sb", "pop", "0", "print('B')", "print", "'B'", "break", "if nex == 'c':\n if sc:\n nex = sc.pop(0)\n else:\n print('C')\n break\n ", "nex == 'c'", "nex", "'c'", "if sc:\n nex = sc.pop(0)\n else:\n print('C')\n break\n ", "sc", "nex = sc.pop(0)", "nex", "sc.pop(0)", "sc.pop", "sc", "pop", "0", "print('C')", "print", "'C'", "break", "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 nex = 'a'\n while True:\n if nex == 'a':\n if sa:\n nex = sa.pop(0)\n else:\n print('A')\n break\n if nex == 'b':\n if sb:\n nex = sb.pop(0)\n else:\n print('B')\n break\n if nex == 'c':\n if sc:\n nex = sc.pop(0)\n else:\n print('C')\n break\n ", "def main():\n sa = list(input())\n sb = list(input())\n sc = list(input())\n nex = 'a'\n while True:\n if nex == 'a':\n if sa:\n nex = sa.pop(0)\n else:\n print('A')\n break\n if nex == 'b':\n if sb:\n nex = sb.pop(0)\n else:\n print('B')\n break\n if nex == 'c':\n if sc:\n nex = sc.pop(0)\n else:\n print('C')\n break\n ", "main" ]
def main(): sa = list(input()) sb = list(input()) sc = list(input()) nex = 'a' while True: if nex == 'a': if sa: nex = sa.pop(0) else: print('A') break if nex == 'b': if sb: nex = sb.pop(0) else: print('B') break if nex == 'c': if sc: nex = sc.pop(0) else: print('C') break 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, 0, 13, 13, 42, 40, 13, 17, 14, 2, 18, 13, 17, 17, 4, 18, 13, 13, 17, 0, 13, 13, 14, 2, 4, 13, 13, 17, 4, 13, 17, 0, 13, 17, 14, 2, 18, 13, 17, 17, 4, 18, 13, 13, 17, 0, 13, 13, 14, 2, 4, 13, 13, 17, 4, 13, 17, 0, 13, 17, 4, 18, 13, 13, 17, 0, 13, 13, 14, 2, 4, 13, 13, 17, 4, 13, 17, 0, 13, 17, 10, 13, 13, 10, 13, 13, 10, 4, 13, 10, 13, 13, 10, 13, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13 ]
[ [ 108, 2 ], [ 126, 8 ], [ 117, 14 ], [ 120, 20 ], [ 102, 23 ], [ 109, 24 ], [ 121, 27 ], [ 130, 27 ], [ 124, 27 ], [ 133, 27 ], [ 103, 32 ], [ 106, 32 ], [ 115, 32 ], [ 112, 32 ], [ 103, 37 ], [ 106, 37 ], [ 115, 37 ], [ 112, 37 ], [ 105, 41 ], [ 109, 42 ], [ 109, 47 ], [ 132, 53 ], [ 103, 58 ], [ 106, 58 ], [ 115, 58 ], [ 112, 58 ], [ 103, 63 ], [ 106, 63 ], [ 115, 63 ], [ 112, 63 ], [ 114, 67 ], [ 127, 68 ], [ 127, 73 ], [ 123, 79 ], [ 103, 83 ], [ 106, 83 ], [ 115, 83 ], [ 112, 83 ], [ 111, 87 ], [ 118, 88 ], [ 118, 93 ], [ 129, 99 ], [ 109, 102 ], [ 102, 103 ], [ 109, 105 ], [ 105, 106 ], [ 108, 109 ], [ 118, 111 ], [ 111, 112 ], [ 127, 114 ], [ 114, 115 ], [ 117, 118 ], [ 120, 121 ], [ 123, 124 ], [ 126, 127 ], [ 129, 130 ], [ 132, 133 ] ]
[ "a = list(input())\nb = list(input())\nc = list(input())\n\nwin = False # if win == True, someone will win\nrun = a\n\nwhile win != True:\n if run[0] == \"a\":\n run.pop(0)\n run = a # reset run\n if len(a) == 0:\n print(\"A\")\n win = True\n elif run[0] == \"b\":\n run.pop(0)\n run = b\n if len(b) == 0:\n print(\"B\")\n win = True\n else:\n run.pop(0)\n run = c\n if len(c) == 0:\n print(\"C\")\n win = True\n\n\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", "win = False", "win", "False", "run = a", "run", "a", "while win != True:\n if run[0] == \"a\":\n run.pop(0)\n run = a # reset run\n if len(a) == 0:\n print(\"A\")\n win = True\n elif run[0] == \"b\":\n run.pop(0)\n run = b\n if len(b) == 0:\n print(\"B\")\n win = True\n else:\n run.pop(0)\n run = c\n if len(c) == 0:\n print(\"C\")\n win = True", "win != True", "win", "True", "if run[0] == \"a\":\n run.pop(0)\n run = a # reset run\n if len(a) == 0:\n print(\"A\")\n win = True\n elif run[0] == \"b\":\n run.pop(0)\n run = b\n if len(b) == 0:\n print(\"B\")\n win = True\n else:\n run.pop(0)\n run = c\n if len(c) == 0:\n print(\"C\")\n win = True", "run[0] == \"a\"", "run[0]", "run", "0", "\"a\"", "run.pop(0)", "run.pop", "run", "pop", "0", "run = a", "run", "a", "if len(a) == 0:\n print(\"A\")\n win = True\n ", "len(a) == 0", "len(a)", "len", "a", "0", "print(\"A\")", "print", "\"A\"", "win = True", "win", "True", "elif run[0] == \"b\":\n run.pop(0)\n run = b\n if len(b) == 0:\n print(\"B\")\n win = True\n ", "run[0] == \"b\"", "run[0]", "run", "0", "\"b\"", "run.pop(0)", "run.pop", "run", "pop", "0", "run = b", "run", "b", "if len(b) == 0:\n print(\"B\")\n win = True\n ", "len(b) == 0", "len(b)", "len", "b", "0", "print(\"B\")", "print", "\"B\"", "win = True", "win", "True", "run.pop(0)", "run.pop", "run", "pop", "0", "run = c", "run", "c", "if len(c) == 0:\n print(\"C\")\n win = True", "len(c) == 0", "len(c)", "len", "c", "0", "print(\"C\")", "print", "\"C\"", "win = True", "win", "True", "run = a", "a", "run", "run = a", "a", "run", "a = list(input())", "list(input())", "a", "run = c", "c", "run", "run = b", "b", "run", "c = list(input())", "list(input())", "c", "win = False", "False", "win", "win = True", "True", "win", "b = list(input())", "list(input())", "b", "win = True", "True", "win", "win = True", "True", "win" ]
a = list(input()) b = list(input()) c = list(input()) win = False # if win == True, someone will win run = a while win != True: if run[0] == "a": run.pop(0) run = a # reset run if len(a) == 0: print("A") win = True elif run[0] == "b": run.pop(0) run = b if len(b) == 0: print("B") win = True else: run.pop(0) run = c if len(c) == 0: print("C") win = True
[ 7, 15, 13, 12, 13, 29, 4, 13, 4, 13, 12, 13, 29, 4, 13, 13, 4, 18, 4, 13, 13, 12, 13, 29, 4, 13, 4, 13, 13, 4, 18, 4, 13, 13, 12, 13, 29, 4, 18, 4, 18, 18, 13, 13, 13, 13, 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, 4, 18, 18, 13, 17, 13, 17, 42, 17, 14, 40, 4, 13, 18, 13, 2, 4, 13, 13, 17, 3, 0, 13, 4, 18, 18, 13, 2, 4, 13, 13, 17, 13, 17, 14, 2, 13, 17, 4, 13, 17, 14, 2, 13, 17, 4, 13, 17, 4, 13, 17, 10, 4, 13, 10, 4, 13, 10, 12, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 12, 13, 10, 12, 13, 10, 39, 13, 10, 12, 13 ]
[ [ 133, 47 ], [ 146, 51 ], [ 127, 53 ], [ 146, 57 ], [ 139, 59 ], [ 146, 63 ], [ 148, 65 ], [ 136, 71 ], [ 149, 75 ], [ 149, 86 ], [ 137, 90 ], [ 125, 90 ], [ 124, 94 ], [ 149, 98 ], [ 137, 102 ], [ 125, 102 ], [ 125, 108 ], [ 137, 108 ], [ 125, 115 ], [ 137, 115 ], [ 124, 125 ], [ 127, 128 ], [ 133, 134 ], [ 136, 137 ], [ 139, 140 ], [ 148, 149 ] ]
[ "import sys\n\n\ndef getN():\n return int(input())\n\n\ndef getNM():\n return map(int, input().split())\n\n\ndef getList():\n return list(map(int, input().split()))\n\n\ndef input():\n return sys.stdin.readline().rstrip()\n\n\n#############\n# Main Code #\n#############\nsa = list(input())\nsb = list(input())\nsc = list(input())\n\ns = [sa, sb, sc]\nnow = s[0].pop(0)\n\nwhile True:\n if not len(s[ord(now) - 97]):\n break\n\n now = s[ord(now) - 97].pop(0)\n\nif now == 'a':\n print('A')\nelif now == 'b':\n print('B')\nelse:\n print('C')", "import sys", "sys", "def getN():\n return int(input())", "getN", "return int(input())", "int(input())", "int", "input()", "input", "def getNM():\n return map(int, input().split())", "getNM", "return map(int, input().split())", "map(int, input().split())", "map", "int", "input().split()", "().split", "()", "input", "split", "def getList():\n return list(map(int, input().split()))", "getList", "return list(map(int, input().split()))", "list(map(int, input().split()))", "list", "map(int, input().split())", "map", "int", "input().split()", "().split", "()", "input", "split", "def input():\n return sys.stdin.readline().rstrip()\n\n\n#############\n# Main Code #\n#############", "input", "return sys.stdin.readline().rstrip()", "sys.stdin.readline().rstrip()", "sys.stdin.readline().rstrip", "sys.stdin.readline()", "sys.stdin.readline", "sys.stdin", "sys", "stdin", "readline", "rstrip", "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", "s = [sa, sb, sc]", "s", "[sa, sb, sc]", "sa", "sb", "sc", "now = s[0].pop(0)", "now", "s[0].pop(0)", "[0].pop", "[0]", "s", "0", "pop", "0", "while True:\n if not len(s[ord(now) - 97]):\n break\n\n now = s[ord(now) - 97].pop(0)", "True", "if not len(s[ord(now) - 97]):\n break\n\n ", "not len(s[ord(now) - 97])", "len(s[ord(now) - 97])", "len", "s[ord(now) - 97]", "s", "ord(now) - 97", "ord(now)", "ord", "now", "97", "break", "now = s[ord(now) - 97].pop(0)", "now", "s[ord(now) - 97].pop(0)", "[ord(now) - 97].pop", "[ord(now) - 97]", "s", "ord(now) - 97", "ord(now)", "ord", "now", "97", "pop", "0", "if now == 'a':\n print('A')\nelif now == 'b':\n print('B')\nelse:\n print('C')", "now == 'a'", "now", "'a'", "print('A')", "print", "'A'", "elif now == 'b':\n print('B')", "now == 'b'", "now", "'b'", "print('B')", "print", "'B'", "print('C')", "print", "'C'", "now = s[ord(now) - 97].pop(0)", "s[ord(now) - 97].pop(0)", "now", "sb = list(input())", "list(input())", "sb", "def getList():\n return list(map(int, input().split()))", "def getList():\n return list(map(int, input().split()))", "getList", "sa = list(input())", "list(input())", "sa", "now = s[0].pop(0)", "s[0].pop(0)", "now", "sc = list(input())", "list(input())", "sc", "def getN():\n return int(input())", "def getN():\n return int(input())", "getN", "def input():\n return sys.stdin.readline().rstrip()\n\n\n#############\n# Main Code #\n#############", "def input():\n return sys.stdin.readline().rstrip()\n\n\n#############\n# Main Code #\n#############", "input", "s = [sa, sb, sc]", "[sa, sb, sc]", "s", "def getNM():\n return map(int, input().split())", "def getNM():\n return map(int, input().split())", "getNM" ]
import sys def getN(): return int(input()) def getNM(): return map(int, input().split()) def getList(): return list(map(int, input().split())) def input(): return sys.stdin.readline().rstrip() ############# # Main Code # ############# sa = list(input()) sb = list(input()) sc = list(input()) s = [sa, sb, sc] now = s[0].pop(0) while True: if not len(s[ord(now) - 97]): break now = s[ord(now) - 97].pop(0) if now == 'a': print('A') elif now == 'b': print('B') else: print('C')
[ 7, 15, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 4, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 42, 13, 0, 13, 4, 18, 13, 13, 14, 2, 13, 17, 14, 40, 13, 0, 13, 17, 3, 4, 18, 13, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 14, 2, 13, 17, 14, 40, 13, 0, 13, 17, 3, 4, 18, 13, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 14, 2, 13, 17, 14, 40, 13, 0, 13, 17, 3, 4, 18, 13, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 4, 13, 13, 10, 17, 13, 10, 18, 13, 10, 4, 13, 10, 18, 13, 10, 18, 13, 10, 17, 13, 10, 4, 13, 10, 4, 13, 10, 18, 13, 10, 4, 13, 10, 4, 13, 10, 17, 13 ]
[ [ 138, 3 ], [ 129, 7 ], [ 141, 11 ], [ 132, 15 ], [ 139, 19 ], [ 123, 22 ], [ 139, 24 ], [ 117, 30 ], [ 133, 33 ], [ 118, 37 ], [ 124, 41 ], [ 139, 41 ], [ 115, 41 ], [ 126, 43 ], [ 133, 48 ], [ 124, 51 ], [ 139, 51 ], [ 115, 51 ], [ 114, 54 ], [ 124, 56 ], [ 139, 56 ], [ 115, 56 ], [ 118, 61 ], [ 130, 65 ], [ 121, 65 ], [ 144, 67 ], [ 133, 72 ], [ 130, 75 ], [ 121, 75 ], [ 120, 78 ], [ 130, 80 ], [ 121, 80 ], [ 118, 85 ], [ 142, 89 ], [ 136, 89 ], [ 111, 91 ], [ 133, 96 ], [ 142, 99 ], [ 136, 99 ], [ 135, 102 ], [ 142, 104 ], [ 136, 104 ], [ 112, 109 ], [ 145, 109 ], [ 127, 109 ], [ 111, 112 ], [ 114, 115 ], [ 117, 118 ], [ 120, 121 ], [ 123, 124 ], [ 126, 127 ], [ 129, 130 ], [ 132, 133 ], [ 135, 136 ], [ 138, 139 ], [ 141, 142 ], [ 144, 145 ] ]
[ "from collections import deque\nsa = input()\nsb = input()\nsc = input()\n\nq = deque(sa[0])\nsa = sa[1:]\nwhile q:\n t = q.pop()\n if t == \"a\":\n if not sa:\n ans = \"A\"\n break\n q.append(sa[0])\n sa = sa[1:]\n elif t == \"b\":\n if not sb:\n ans = \"B\"\n break\n q.append(sb[0])\n sb = sb[1:]\n elif t == \"c\":\n if not sc:\n ans = \"C\"\n break\n q.append(sc[0])\n sc = sc[1:]\nprint(ans)", "from collections import deque", "sa = input()", "sa", "input()", "input", "sb = input()", "sb", "input()", "input", "sc = input()", "sc", "input()", "input", "q = deque(sa[0])", "q", "deque(sa[0])", "deque", "sa[0]", "sa", "0", "sa = sa[1:]", "sa", "sa[1:]", "sa", "1:", "1", "while q:\n t = q.pop()\n if t == \"a\":\n if not sa:\n ans = \"A\"\n break\n q.append(sa[0])\n sa = sa[1:]\n elif t == \"b\":\n if not sb:\n ans = \"B\"\n break\n q.append(sb[0])\n sb = sb[1:]\n elif t == \"c\":\n if not sc:\n ans = \"C\"\n break\n q.append(sc[0])\n sc = sc[1:]", "q", "t = q.pop()", "t", "q.pop()", "q.pop", "q", "pop", "if t == \"a\":\n if not sa:\n ans = \"A\"\n break\n q.append(sa[0])\n sa = sa[1:]\n elif t == \"b\":\n if not sb:\n ans = \"B\"\n break\n q.append(sb[0])\n sb = sb[1:]\n elif t == \"c\":\n if not sc:\n ans = \"C\"\n break\n q.append(sc[0])\n sc = sc[1:]", "t == \"a\"", "t", "\"a\"", "if not sa:\n ans = \"A\"\n break\n ", "not sa", "sa", "ans = \"A\"", "ans", "\"A\"", "break", "q.append(sa[0])", "q.append", "q", "append", "sa[0]", "sa", "0", "sa = sa[1:]", "sa", "sa[1:]", "sa", "1:", "1", "elif t == \"b\":\n if not sb:\n ans = \"B\"\n break\n q.append(sb[0])\n sb = sb[1:]\n ", "t == \"b\"", "t", "\"b\"", "if not sb:\n ans = \"B\"\n break\n ", "not sb", "sb", "ans = \"B\"", "ans", "\"B\"", "break", "q.append(sb[0])", "q.append", "q", "append", "sb[0]", "sb", "0", "sb = sb[1:]", "sb", "sb[1:]", "sb", "1:", "1", "elif t == \"c\":\n if not sc:\n ans = \"C\"\n break\n q.append(sc[0])\n sc = sc[1:]", "t == \"c\"", "t", "\"c\"", "if not sc:\n ans = \"C\"\n break\n ", "not sc", "sc", "ans = \"C\"", "ans", "\"C\"", "break", "q.append(sc[0])", "q.append", "q", "append", "sc[0]", "sc", "0", "sc = sc[1:]", "sc", "sc[1:]", "sc", "1:", "1", "print(ans)", "print", "ans", "ans = \"C\"", "\"C\"", "ans", "sa = sa[1:]", "sa[1:]", "sa", "t = q.pop()", "q.pop()", "t", "sb = sb[1:]", "sb[1:]", "sb", "sa = sa[1:]", "sa[1:]", "sa", "ans = \"A\"", "\"A\"", "ans", "sb = input()", "input()", "sb", "q = deque(sa[0])", "deque(sa[0])", "q", "sc = sc[1:]", "sc[1:]", "sc", "sa = input()", "input()", "sa", "sc = input()", "input()", "sc", "ans = \"B\"", "\"B\"", "ans" ]
from collections import deque sa = input() sb = input() sc = input() q = deque(sa[0]) sa = sa[1:] while q: t = q.pop() if t == "a": if not sa: ans = "A" break q.append(sa[0]) sa = sa[1:] elif t == "b": if not sb: ans = "B" break q.append(sb[0]) sb = sb[1:] elif t == "c": if not sc: ans = "C" break q.append(sc[0]) sc = sc[1:] print(ans)
[ 7, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 39, 0, 13, 39, 0, 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, 0, 13, 17, 42, 17, 14, 2, 13, 17, 14, 40, 13, 0, 13, 17, 3, 0, 13, 4, 18, 13, 13, 17, 14, 2, 13, 17, 14, 40, 13, 0, 13, 17, 3, 0, 13, 4, 18, 13, 13, 17, 14, 2, 13, 17, 14, 40, 13, 0, 13, 17, 3, 0, 13, 4, 18, 13, 13, 17, 4, 13, 13, 10, 39, 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, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13 ]
[ [ 119, 2 ], [ 140, 6 ], [ 131, 10 ], [ 122, 14 ], [ 116, 17 ], [ 134, 20 ], [ 24, 23 ], [ 120, 23 ], [ 123, 27 ], [ 23, 29 ], [ 32, 31 ], [ 141, 31 ], [ 117, 35 ], [ 31, 37 ], [ 40, 39 ], [ 132, 39 ], [ 135, 43 ], [ 39, 45 ], [ 125, 47 ], [ 123, 50 ], [ 143, 54 ], [ 126, 60 ], [ 156, 60 ], [ 129, 60 ], [ 138, 60 ], [ 123, 64 ], [ 146, 66 ], [ 137, 70 ], [ 123, 73 ], [ 138, 78 ], [ 126, 78 ], [ 156, 78 ], [ 129, 78 ], [ 117, 82 ], [ 152, 84 ], [ 128, 88 ], [ 117, 91 ], [ 129, 96 ], [ 138, 96 ], [ 126, 96 ], [ 156, 96 ], [ 135, 100 ], [ 149, 102 ], [ 155, 106 ], [ 135, 109 ], [ 150, 114 ], [ 153, 114 ], [ 147, 114 ], [ 144, 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 ] ]
[ "a = input()\nb = input()\nc = input()\nsa = []\nsb = []\nsc = []\nfor i in a:\n sa.append(i)\nfor i in b:\n sb.append(i)\nfor i in c:\n sc.append(i)\ncur = sa.pop(0)\nans = \"\"\nwhile True:\n if cur==\"a\":\n if not sa:\n ans = \"A\"\n break\n cur = sa.pop(0)\n if cur==\"b\":\n if not sb:\n ans = \"B\"\n break\n cur = sb.pop(0)\n if cur==\"c\":\n if not sc:\n ans = \"C\"\n break\n cur = sc.pop(0)\nprint(ans)", "a = input()", "a", "input()", "input", "b = input()", "b", "input()", "input", "c = input()", "c", "input()", "input", "sa = []", "sa", "[]", "sb = []", "sb", "[]", "sc = []", "sc", "[]", "for i in a:\n sa.append(i)", "i", "a", "sa.append(i)", "sa.append", "sa", "append", "i", "for i in b:\n sb.append(i)", "i", "b", "sb.append(i)", "sb.append", "sb", "append", "i", "for i in c:\n sc.append(i)", "i", "c", "sc.append(i)", "sc.append", "sc", "append", "i", "cur = sa.pop(0)", "cur", "sa.pop(0)", "sa.pop", "sa", "pop", "0", "ans = \"\"", "ans", "\"\"", "while True:\n if cur==\"a\":\n if not sa:\n ans = \"A\"\n break\n cur = sa.pop(0)\n if cur==\"b\":\n if not sb:\n ans = \"B\"\n break\n cur = sb.pop(0)\n if cur==\"c\":\n if not sc:\n ans = \"C\"\n break\n cur = sc.pop(0)", "True", "if cur==\"a\":\n if not sa:\n ans = \"A\"\n break\n cur = sa.pop(0)\n ", "cur==\"a\"", "cur", "\"a\"", "if not sa:\n ans = \"A\"\n break\n ", "not sa", "sa", "ans = \"A\"", "ans", "\"A\"", "break", "cur = sa.pop(0)", "cur", "sa.pop(0)", "sa.pop", "sa", "pop", "0", "if cur==\"b\":\n if not sb:\n ans = \"B\"\n break\n cur = sb.pop(0)\n ", "cur==\"b\"", "cur", "\"b\"", "if not sb:\n ans = \"B\"\n break\n ", "not sb", "sb", "ans = \"B\"", "ans", "\"B\"", "break", "cur = sb.pop(0)", "cur", "sb.pop(0)", "sb.pop", "sb", "pop", "0", "if cur==\"c\":\n if not sc:\n ans = \"C\"\n break\n cur = sc.pop(0)", "cur==\"c\"", "cur", "\"c\"", "if not sc:\n ans = \"C\"\n break\n ", "not sc", "sc", "ans = \"C\"", "ans", "\"C\"", "break", "cur = sc.pop(0)", "cur", "sc.pop(0)", "sc.pop", "sc", "pop", "0", "print(ans)", "print", "ans", "sb = []", "[]", "sb", "a = input()", "input()", "a", "sa = []", "[]", "sa", "cur = sa.pop(0)", "sa.pop(0)", "cur", "cur = sb.pop(0)", "sb.pop(0)", "cur", "c = input()", "input()", "c", "sc = []", "[]", "sc", "cur = sa.pop(0)", "sa.pop(0)", "cur", "b = input()", "input()", "b", "ans = \"\"", "\"\"", "ans", "ans = \"A\"", "\"A\"", "ans", "ans = \"C\"", "\"C\"", "ans", "ans = \"B\"", "\"B\"", "ans", "cur = sc.pop(0)", "sc.pop(0)", "cur" ]
a = input() b = input() c = input() sa = [] sb = [] sc = [] for i in a: sa.append(i) for i in b: sb.append(i) for i in c: sc.append(i) cur = sa.pop(0) ans = "" while True: if cur=="a": if not sa: ans = "A" break cur = sa.pop(0) if cur=="b": if not sb: ans = "B" break cur = sb.pop(0) if cur=="c": if not sc: ans = "C" break cur = sc.pop(0) print(ans)
[ 7, 15, 13, 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, 13, 17, 13, 17, 0, 13, 17, 42, 17, 14, 2, 13, 17, 42, 2, 2, 13, 13, 2, 18, 13, 13, 17, 0, 13, 17, 14, 40, 13, 13, 4, 13, 17, 4, 18, 13, 13, 0, 13, 18, 13, 13, 0, 13, 17, 14, 2, 13, 17, 42, 2, 2, 13, 13, 2, 18, 13, 13, 17, 0, 13, 17, 14, 40, 13, 13, 4, 13, 17, 4, 18, 13, 13, 0, 13, 18, 13, 13, 0, 13, 17, 14, 2, 13, 17, 42, 2, 2, 13, 13, 2, 18, 13, 13, 17, 0, 13, 17, 14, 40, 13, 13, 4, 13, 17, 4, 18, 13, 13, 0, 13, 18, 13, 13, 0, 13, 17, 10, 4, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 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, 4, 13, 10, 4, 13, 10, 18, 13, 10, 17, 13 ]
[ [ 157, 4 ], [ 178, 8 ], [ 199, 12 ], [ 196, 16 ], [ 158, 19 ], [ 151, 21 ], [ 179, 24 ], [ 166, 26 ], [ 200, 29 ], [ 154, 31 ], [ 169, 33 ], [ 187, 35 ], [ 193, 38 ], [ 194, 44 ], [ 191, 44 ], [ 176, 44 ], [ 203, 44 ], [ 155, 49 ], [ 206, 49 ], [ 173, 49 ], [ 197, 50 ], [ 158, 53 ], [ 155, 54 ], [ 206, 54 ], [ 173, 54 ], [ 205, 57 ], [ 206, 61 ], [ 155, 61 ], [ 173, 61 ], [ 197, 62 ], [ 202, 71 ], [ 158, 73 ], [ 206, 74 ], [ 155, 74 ], [ 173, 74 ], [ 172, 76 ], [ 203, 80 ], [ 194, 80 ], [ 191, 80 ], [ 176, 80 ], [ 170, 85 ], [ 161, 85 ], [ 185, 85 ], [ 152, 86 ], [ 179, 89 ], [ 170, 90 ], [ 161, 90 ], [ 185, 90 ], [ 160, 93 ], [ 161, 97 ], [ 170, 97 ], [ 185, 97 ], [ 152, 98 ], [ 175, 107 ], [ 179, 109 ], [ 161, 110 ], [ 170, 110 ], [ 185, 110 ], [ 184, 112 ], [ 176, 116 ], [ 203, 116 ], [ 194, 116 ], [ 191, 116 ], [ 188, 121 ], [ 164, 121 ], [ 182, 121 ], [ 167, 122 ], [ 200, 125 ], [ 188, 126 ], [ 164, 126 ], [ 182, 126 ], [ 163, 129 ], [ 164, 133 ], [ 188, 133 ], [ 182, 133 ], [ 167, 134 ], [ 190, 143 ], [ 200, 145 ], [ 164, 146 ], [ 188, 146 ], [ 182, 146 ], [ 181, 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 ], [ 190, 191 ], [ 193, 194 ], [ 196, 197 ], [ 199, 200 ], [ 202, 203 ], [ 205, 206 ] ]
[ "import sys\nSa = input()\nSb = input()\nSc = input()\nNa = len(Sa)\nNb = len(Sb)\nNc = len(Sc)\nia, ib, ic = 0, 0, 0\nt = 'a'\nwhile True:\n if t == 'a':\n while ia < Na and Sa[ia] == 'a':\n ia += 1\n if ia >= Na:\n print('A')\n sys.exit()\n t = Sa[ia]\n ia += 1\n if t == 'b':\n while ib < Nb and Sb[ib] == 'b':\n ib += 1\n if ib >= Nb:\n print('B')\n sys.exit()\n t = Sb[ib]\n ib += 1\n if t == 'c':\n while ic < Nc and Sc[ic] == 'c':\n ic += 1\n if ic >= Nc:\n print('C')\n sys.exit()\n t = Sc[ic]\n ic += 1", "import sys", "sys", "Sa = input()", "Sa", "input()", "input", "Sb = input()", "Sb", "input()", "input", "Sc = input()", "Sc", "input()", "input", "Na = len(Sa)", "Na", "len(Sa)", "len", "Sa", "Nb = len(Sb)", "Nb", "len(Sb)", "len", "Sb", "Nc = len(Sc)", "Nc", "len(Sc)", "len", "Sc", "ia, ib, ic = 0, 0, 0", "ia", "0", "ib", "0", "ic", "0", "t = 'a'", "t", "'a'", "while True:\n if t == 'a':\n while ia < Na and Sa[ia] == 'a':\n ia += 1\n if ia >= Na:\n print('A')\n sys.exit()\n t = Sa[ia]\n ia += 1\n if t == 'b':\n while ib < Nb and Sb[ib] == 'b':\n ib += 1\n if ib >= Nb:\n print('B')\n sys.exit()\n t = Sb[ib]\n ib += 1\n if t == 'c':\n while ic < Nc and Sc[ic] == 'c':\n ic += 1\n if ic >= Nc:\n print('C')\n sys.exit()\n t = Sc[ic]\n ic += 1", "True", "if t == 'a':\n while ia < Na and Sa[ia] == 'a':\n ia += 1\n if ia >= Na:\n print('A')\n sys.exit()\n t = Sa[ia]\n ia += 1\n ", "t == 'a'", "t", "'a'", "while ia < Na and Sa[ia] == 'a':\n ia += 1\n ", "ia < Na and Sa[ia] == 'a'", "ia < Na", "ia", "Na", "Sa[ia] == 'a'", "Sa[ia]", "Sa", "ia", "'a'", "ia += 1", "ia", "1", "if ia >= Na:\n print('A')\n sys.exit()\n ", "ia >= Na", "ia", "Na", "print('A')", "print", "'A'", "sys.exit()", "sys.exit", "sys", "exit", "t = Sa[ia]", "t", "Sa[ia]", "Sa", "ia", "ia += 1", "ia", "1", "if t == 'b':\n while ib < Nb and Sb[ib] == 'b':\n ib += 1\n if ib >= Nb:\n print('B')\n sys.exit()\n t = Sb[ib]\n ib += 1\n ", "t == 'b'", "t", "'b'", "while ib < Nb and Sb[ib] == 'b':\n ib += 1\n ", "ib < Nb and Sb[ib] == 'b'", "ib < Nb", "ib", "Nb", "Sb[ib] == 'b'", "Sb[ib]", "Sb", "ib", "'b'", "ib += 1", "ib", "1", "if ib >= Nb:\n print('B')\n sys.exit()\n ", "ib >= Nb", "ib", "Nb", "print('B')", "print", "'B'", "sys.exit()", "sys.exit", "sys", "exit", "t = Sb[ib]", "t", "Sb[ib]", "Sb", "ib", "ib += 1", "ib", "1", "if t == 'c':\n while ic < Nc and Sc[ic] == 'c':\n ic += 1\n if ic >= Nc:\n print('C')\n sys.exit()\n t = Sc[ic]\n ic += 1", "t == 'c'", "t", "'c'", "while ic < Nc and Sc[ic] == 'c':\n ic += 1\n ", "ic < Nc and Sc[ic] == 'c'", "ic < Nc", "ic", "Nc", "Sc[ic] == 'c'", "Sc[ic]", "Sc", "ic", "'c'", "ic += 1", "ic", "1", "if ic >= Nc:\n print('C')\n sys.exit()\n ", "ic >= Nc", "ic", "Nc", "print('C')", "print", "'C'", "sys.exit()", "sys.exit", "sys", "exit", "t = Sc[ic]", "t", "Sc[ic]", "Sc", "ic", "ic += 1", "ic", "1", "Nb = len(Sb)", "len(Sb)", "Nb", "ia, ib, ic = 0, 0, 0", "0", "ia", "Sa = input()", "input()", "Sa", "ib += 1", "1", "ib", "ic += 1", "1", "ic", "Nc = len(Sc)", "len(Sc)", "Nc", "ib, ic = 0, 0, 0", "0", "ib", "ia += 1", "1", "ia", "t = Sb[ib]", "Sb[ib]", "t", "Sb = input()", "input()", "Sb", "ic += 1", "1", "ic", "ib += 1", "1", "ib", "ic = 0, 0, 0", "0", "ic", "t = Sc[ic]", "Sc[ic]", "t", "t = 'a'", "'a'", "t", "Na = len(Sa)", "len(Sa)", "Na", "Sc = input()", "input()", "Sc", "t = Sa[ia]", "Sa[ia]", "t", "ia += 1", "1", "ia" ]
import sys Sa = input() Sb = input() Sc = input() Na = len(Sa) Nb = len(Sb) Nc = len(Sc) ia, ib, ic = 0, 0, 0 t = 'a' while True: if t == 'a': while ia < Na and Sa[ia] == 'a': ia += 1 if ia >= Na: print('A') sys.exit() t = Sa[ia] ia += 1 if t == 'b': while ib < Nb and Sb[ib] == 'b': ib += 1 if ib >= Nb: print('B') sys.exit() t = Sb[ib] ib += 1 if t == 'c': while ic < Nc and Sc[ic] == 'c': ic += 1 if ic >= Nc: print('C') sys.exit() t = Sc[ic] ic += 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 = {alpha:list(input()) for alpha in 'abc'}\n\ns = 'a'\n\nwhile S[s]:\n s = S[s].pop(0)\nprint(s.upper())", "alpha:list(input()) for alpha in 'abc'", "for alpha in 'abc'", "alpha", "'abc'", "for alpha in 'abc'", "alpha", "list(input())", "list", "input()", "input", "S = {alpha:list(input()) for alpha in 'abc'}", "S", "{alpha:list(input()) for alpha 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 = {alpha:list(input()) for alpha in 'abc'}", "{alpha:list(input()) for alpha in 'abc'}", "S" ]
S = {alpha:list(input()) for alpha 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, 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 ], [ 94, 14 ], [ 97, 20 ], [ 89, 23 ], [ 98, 30 ], [ 83, 30 ], [ 86, 30 ], [ 101, 30 ], [ 89, 34 ], [ 100, 41 ], [ 89, 44 ], [ 98, 49 ], [ 83, 49 ], [ 86, 49 ], [ 101, 49 ], [ 92, 53 ], [ 85, 60 ], [ 92, 63 ], [ 95, 68 ], [ 82, 75 ], [ 95, 78 ], [ 82, 83 ], [ 85, 86 ], [ 88, 89 ], [ 91, 92 ], [ 94, 95 ], [ 97, 98 ], [ 100, 101 ] ]
[ "Sa = list(input())\nSb = list(input())\nSc = list(input())\n\ns = Sa.pop(0)\nwhile True:\n if s == 'a':\n if Sa ==[]:\n print('A')\n break\n s = Sa.pop(0)\n elif s == 'b':\n if Sb ==[]:\n print('B')\n break\n s = Sb.pop(0)\n else:\n if Sc ==[]:\n print('C')\n break\n s = 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", "s = Sa.pop(0)", "s", "Sa.pop(0)", "Sa.pop", "Sa", "pop", "0", "while True:\n if s == 'a':\n if Sa ==[]:\n print('A')\n break\n s = Sa.pop(0)\n elif s == 'b':\n if Sb ==[]:\n print('B')\n break\n s = Sb.pop(0)\n else:\n if Sc ==[]:\n print('C')\n break\n s = Sc.pop(0)", "True", "if s == 'a':\n if Sa ==[]:\n print('A')\n break\n s = Sa.pop(0)\n elif s == 'b':\n if Sb ==[]:\n print('B')\n break\n s = Sb.pop(0)\n else:\n if Sc ==[]:\n print('C')\n break\n s = Sc.pop(0)", "s == 'a'", "s", "'a'", "if Sa ==[]:\n print('A')\n break\n ", "Sa ==[]", "Sa", "[]", "print('A')", "print", "'A'", "break", "s = Sa.pop(0)", "s", "Sa.pop(0)", "Sa.pop", "Sa", "pop", "0", "elif s == 'b':\n if Sb ==[]:\n print('B')\n break\n s = Sb.pop(0)\n ", "s == 'b'", "s", "'b'", "if Sb ==[]:\n print('B')\n break\n ", "Sb ==[]", "Sb", "[]", "print('B')", "print", "'B'", "break", "s = Sb.pop(0)", "s", "Sb.pop(0)", "Sb.pop", "Sb", "pop", "0", "if Sc ==[]:\n print('C')\n break\n ", "Sc ==[]", "Sc", "[]", "print('C')", "print", "'C'", "break", "s = Sc.pop(0)", "s", "Sc.pop(0)", "Sc.pop", "Sc", "pop", "0", "s = Sc.pop(0)", "Sc.pop(0)", "s", "s = Sb.pop(0)", "Sb.pop(0)", "s", "Sa = list(input())", "list(input())", "Sa", "Sb = list(input())", "list(input())", "Sb", "Sc = list(input())", "list(input())", "Sc", "s = Sa.pop(0)", "Sa.pop(0)", "s", "s = Sa.pop(0)", "Sa.pop(0)", "s" ]
Sa = list(input()) Sb = list(input()) Sc = list(input()) s = Sa.pop(0) while True: if s == 'a': if Sa ==[]: print('A') break s = Sa.pop(0) elif s == 'b': if Sb ==[]: print('B') break s = Sb.pop(0) else: if Sc ==[]: print('C') break s = Sc.pop(0)
[ 7, 41, 28, 13, 4, 13, 17, 4, 4, 13, 4, 13, 0, 13, 13, 0, 13, 17, 0, 13, 17, 28, 13, 4, 13, 17, 14, 18, 13, 13, 0, 13, 4, 18, 13, 13, 4, 18, 18, 13, 13, 13, 17, 4, 13, 4, 18, 18, 13, 13, 13, 4, 13, 10, 17, 13, 10, 17, 13, 10, 13, 13, 10, 4, 13 ]
[ [ 4, 3 ], [ 60, 13 ], [ 54, 16 ], [ 57, 19 ], [ 23, 22 ], [ 61, 28 ], [ 58, 29 ], [ 64, 29 ], [ 63, 31 ], [ 55, 34 ], [ 61, 39 ], [ 58, 40 ], [ 64, 40 ], [ 55, 48 ], [ 58, 49 ], [ 64, 49 ], [ 54, 55 ], [ 57, 58 ], [ 60, 61 ], [ 63, 64 ] ]
[ "S = [list(input()) for _ in range(3)]\nl = 'abc'\nnum = 0\nfor i in range(10000):\n if S[num]:\n num = l.find(S[num].pop(0))\n else:\n print(l[num].upper())\n exit()", "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)]", "l = 'abc'", "l", "'abc'", "num = 0", "num", "0", "for i in range(10000):\n if S[num]:\n num = l.find(S[num].pop(0))\n else:\n print(l[num].upper())\n exit()", "i", "range(10000)", "range", "10000", "if S[num]:\n num = l.find(S[num].pop(0))\n else:\n print(l[num].upper())\n exit()", "S[num]", "S", "num", "num = l.find(S[num].pop(0))", "num", "l.find(S[num].pop(0))", "l.find", "l", "find", "S[num].pop(0)", "[num].pop", "[num]", "S", "num", "pop", "0", "print(l[num].upper())", "print", "l[num].upper()", "[num].upper", "[num]", "l", "num", "upper", "exit()", "exit", "l = 'abc'", "'abc'", "l", "num = 0", "0", "num", "S = [list(input()) for _ in range(3)]", "[list(input()) for _ in range(3)]", "S", "num = l.find(S[num].pop(0))", "l.find(S[num].pop(0))", "num" ]
S = [list(input()) for _ in range(3)] l = 'abc' num = 0 for i in range(10000): if S[num]: num = l.find(S[num].pop(0)) else: print(l[num].upper()) exit()
[ 7, 15, 0, 13, 21, 22, 17, 4, 13, 4, 13, 22, 17, 4, 13, 4, 13, 22, 17, 4, 13, 4, 13, 0, 13, 4, 18, 18, 13, 17, 13, 42, 18, 13, 13, 0, 13, 4, 18, 18, 13, 13, 13, 4, 13, 4, 18, 13, 13, 10, 21, 13, 10, 4, 13, 10, 4, 13 ]
[ [ 50, 3 ], [ 56, 24 ], [ 51, 28 ], [ 51, 33 ], [ 57, 34 ], [ 54, 34 ], [ 53, 36 ], [ 51, 40 ], [ 57, 41 ], [ 54, 41 ], [ 54, 47 ], [ 57, 47 ], [ 50, 51 ], [ 53, 54 ], [ 56, 57 ] ]
[ "from collections import deque\ncard = {'a' : deque(input()), 'b' : deque(input()), 'c' : deque(input())}\n\nplayer = card['a'].popleft()\nwhile card[player]:\n player = card[player].popleft()\n\nprint(player.upper())", "from collections import deque", "card = {'a' : deque(input()), 'b' : deque(input()), 'c' : deque(input())}", "card", "{'a' : deque(input()), 'b' : deque(input()), 'c' : deque(input())}", "'a'", "'a'", "deque(input())", "deque", "input()", "input", "'b'", "'b'", "deque(input())", "deque", "input()", "input", "'c'", "'c'", "deque(input())", "deque", "input()", "input", "player = card['a'].popleft()", "player", "card['a'].popleft()", "['a'].popleft", "['a']", "card", "'a'", "popleft", "while card[player]:\n player = card[player].popleft()", "card[player]", "card", "player", "player = card[player].popleft()", "player", "card[player].popleft()", "[player].popleft", "[player]", "card", "player", "popleft", "print(player.upper())", "print", "player.upper()", "player.upper", "player", "upper", "card = {'a' : deque(input()), 'b' : deque(input()), 'c' : deque(input())}", "{'a' : deque(input()), 'b' : deque(input()), 'c' : deque(input())}", "card", "player = card[player].popleft()", "card[player].popleft()", "player", "player = card['a'].popleft()", "card['a'].popleft()", "player" ]
from collections import deque card = {'a' : deque(input()), 'b' : deque(input()), 'c' : deque(input())} player = card['a'].popleft() while card[player]: player = card[player].popleft() print(player.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, 40, 13, 4, 13, 17, 3, 0, 13, 4, 18, 13, 13, 17, 14, 2, 13, 17, 14, 40, 13, 4, 13, 17, 3, 0, 13, 4, 18, 13, 13, 17, 14, 2, 13, 17, 14, 40, 13, 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, 17, 13, 10, 4, 13 ]
[ [ 85, 2 ], [ 91, 8 ], [ 82, 14 ], [ 94, 20 ], [ 95, 26 ], [ 98, 26 ], [ 80, 26 ], [ 89, 26 ], [ 86, 30 ], [ 88, 36 ], [ 86, 39 ], [ 89, 44 ], [ 95, 44 ], [ 98, 44 ], [ 80, 44 ], [ 92, 48 ], [ 79, 54 ], [ 92, 57 ], [ 80, 62 ], [ 89, 62 ], [ 95, 62 ], [ 98, 62 ], [ 83, 66 ], [ 97, 72 ], [ 83, 75 ], [ 79, 80 ], [ 82, 83 ], [ 85, 86 ], [ 88, 89 ], [ 91, 92 ], [ 94, 95 ], [ 97, 98 ] ]
[ "a = list(input())\nb = list(input())\nc = list(input())\ncur = \"a\"\nwhile(True):\n if cur == \"a\":\n if not a:\n print(\"A\")\n break\n cur = a.pop(0)\n if cur == \"b\":\n if not b:\n print(\"B\")\n break\n cur = b.pop(0)\n if cur == \"c\":\n if not c:\n print(\"C\")\n break\n cur = 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", "cur = \"a\"", "cur", "\"a\"", "while(True):\n if cur == \"a\":\n if not a:\n print(\"A\")\n break\n cur = a.pop(0)\n if cur == \"b\":\n if not b:\n print(\"B\")\n break\n cur = b.pop(0)\n if cur == \"c\":\n if not c:\n print(\"C\")\n break\n cur = c.pop(0)", "True", "if cur == \"a\":\n if not a:\n print(\"A\")\n break\n cur = a.pop(0)\n ", "cur == \"a\"", "cur", "\"a\"", "if not a:\n print(\"A\")\n break\n ", "not a", "a", "print(\"A\")", "print", "\"A\"", "break", "cur = a.pop(0)", "cur", "a.pop(0)", "a.pop", "a", "pop", "0", "if cur == \"b\":\n if not b:\n print(\"B\")\n break\n cur = b.pop(0)\n ", "cur == \"b\"", "cur", "\"b\"", "if not b:\n print(\"B\")\n break\n ", "not b", "b", "print(\"B\")", "print", "\"B\"", "break", "cur = b.pop(0)", "cur", "b.pop(0)", "b.pop", "b", "pop", "0", "if cur == \"c\":\n if not c:\n print(\"C\")\n break\n cur = c.pop(0)", "cur == \"c\"", "cur", "\"c\"", "if not c:\n print(\"C\")\n break\n ", "not c", "c", "print(\"C\")", "print", "\"C\"", "break", "cur = c.pop(0)", "cur", "c.pop(0)", "c.pop", "c", "pop", "0", "cur = b.pop(0)", "b.pop(0)", "cur", "c = list(input())", "list(input())", "c", "a = list(input())", "list(input())", "a", "cur = a.pop(0)", "a.pop(0)", "cur", "b = list(input())", "list(input())", "b", "cur = \"a\"", "\"a\"", "cur", "cur = c.pop(0)", "c.pop(0)", "cur" ]
a = list(input()) b = list(input()) c = list(input()) cur = "a" while(True): if cur == "a": if not a: print("A") break cur = a.pop(0) if cur == "b": if not b: print("B") break cur = b.pop(0) if cur == "c": if not c: print("C") break cur = c.pop(0)
[ 7, 15, 13, 15, 0, 13, 4, 13, 17, 15, 13, 4, 18, 13, 13, 2, 17, 17, 15, 13, 15, 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, 12, 13, 12, 13, 12, 13, 41, 28, 13, 4, 13, 13, 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, 4, 13, 12, 13, 23, 13, 12, 13, 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, 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, 14, 2, 13, 17, 4, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 4, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13 ]
[ [ 214, 5 ], [ 30, 29 ], [ 218, 35 ], [ 39, 39 ], [ 43, 42 ], [ 200, 48 ], [ 52, 52 ], [ 62, 61 ], [ 221, 66 ], [ 70, 70 ], [ 74, 73 ], [ 203, 79 ], [ 83, 83 ], [ 87, 86 ], [ 221, 94 ], [ 98, 98 ], [ 103, 102 ], [ 221, 106 ], [ 109, 108 ], [ 221, 112 ], [ 115, 114 ], [ 221, 118 ], [ 121, 120 ], [ 120, 126 ], [ 180, 126 ], [ 162, 126 ], [ 140, 126 ], [ 102, 132 ], [ 141, 140 ], [ 102, 143 ], [ 120, 148 ], [ 180, 148 ], [ 162, 148 ], [ 140, 148 ], [ 108, 154 ], [ 163, 162 ], [ 108, 165 ], [ 114, 172 ], [ 181, 180 ], [ 114, 183 ], [ 230, 191 ], [ 214, 215 ] ]
[ "import math\nfrom math import gcd,pi,sqrt\nINF = float(\"inf\")\n\nimport sys\nsys.setrecursionlimit(10**6)\nimport itertools\nfrom collections import Counter,deque\ndef i_input(): return int(input())\ndef i_map(): return map(int, input().split())\ndef i_list(): return list(i_map())\ndef i_row(N): return [i_input() for _ in range(N)]\ndef i_row_list(N): return [i_list() for _ in range(N)]\ndef s_input(): return input()\ndef s_map(): return input().split()\ndef s_list(): return list(s_map())\ndef s_row(N): return [s_input for _ in range(N)]\ndef s_row_str(N): return [s_list() for _ in range(N)]\ndef s_row_list(N): return [list(s_input()) for _ in range(N)]\n\n\ndef main():\n a = list(s_input())\n b = list(s_input())\n c = list(s_input())\n\n t = \"a\"\n\n while True:\n if t == \"a\":\n if len(a) == 0:\n print(\"A\")\n exit()\n\n t = a.pop(0)\n elif t == \"b\":\n if len(b) == 0:\n print(\"B\")\n exit()\n\n t = b.pop(0)\n else:\n if len(c) == 0:\n print(\"C\")\n exit()\n t = c.pop(0)\n\n\nif __name__==\"__main__\":\n main()", "import math", "math", "from math import gcd,pi,sqrt", "INF = float(\"inf\")", "INF", "float(\"inf\")", "float", "\"inf\"", "import sys", "sys", "sys.setrecursionlimit(10**6)", "sys.setrecursionlimit", "sys", "setrecursionlimit", "10**6", "10", "6", "import itertools", "itertools", "from collections import Counter,deque", "def i_input(): return int(input())", "i_input", "def i_map(): return map(int, input().split())", "i_map", "def i_list(): return list(i_map())", "i_list", "i_input() for _ in range(N)", "for _ in range(N)", "_", "range(N)", "range", "N", "for _ in range(N)", "i_input()", "i_input", "def i_row(N): return [i_input() for _ in range(N)]", "i_row", "N", "N", "i_list() for _ in range(N)", "for _ in range(N)", "_", "range(N)", "range", "N", "for _ in range(N)", "i_list()", "i_list", "def i_row_list(N): return [i_list() for _ in range(N)]", "i_row_list", "N", "N", "def s_input(): return input()", "s_input", "def s_map(): return input().split()", "s_map", "def s_list(): return list(s_map())", "s_list", "s_input for _ in range(N)", "for _ in range(N)", "_", "range(N)", "range", "N", "for _ in range(N)", "s_input", "def s_row(N): return [s_input for _ in range(N)]", "s_row", "N", "N", "s_list() for _ in range(N)", "for _ in range(N)", "_", "range(N)", "range", "N", "for _ in range(N)", "s_list()", "s_list", "def s_row_str(N): return [s_list() for _ in range(N)]", "s_row_str", "N", "N", "list(s_input()) for _ in range(N)", "for _ in range(N)", "_", "range(N)", "range", "N", "for _ in range(N)", "list(s_input())", "list", "s_input()", "s_input", "def s_row_list(N): return [list(s_input()) for _ in range(N)]", "s_row_list", "N", "N", "def main():\n a = list(s_input())\n b = list(s_input())\n c = list(s_input())\n\n t = \"a\"\n\n while True:\n if t == \"a\":\n if len(a) == 0:\n print(\"A\")\n exit()\n\n t = a.pop(0)\n elif t == \"b\":\n if len(b) == 0:\n print(\"B\")\n exit()\n\n t = b.pop(0)\n else:\n if len(c) == 0:\n print(\"C\")\n exit()\n t = c.pop(0)", "main", "a = list(s_input())", "a", "list(s_input())", "list", "s_input()", "s_input", "b = list(s_input())", "b", "list(s_input())", "list", "s_input()", "s_input", "c = list(s_input())", "c", "list(s_input())", "list", "s_input()", "s_input", "t = \"a\"", "t", "\"a\"", "while True:\n if t == \"a\":\n if len(a) == 0:\n print(\"A\")\n exit()\n\n t = a.pop(0)\n elif t == \"b\":\n if len(b) == 0:\n print(\"B\")\n exit()\n\n t = b.pop(0)\n else:\n if len(c) == 0:\n print(\"C\")\n exit()\n t = c.pop(0)", "True", "if t == \"a\":\n if len(a) == 0:\n print(\"A\")\n exit()\n\n t = a.pop(0)\n elif t == \"b\":\n if len(b) == 0:\n print(\"B\")\n exit()\n\n t = b.pop(0)\n else:\n if len(c) == 0:\n print(\"C\")\n exit()\n t = c.pop(0)", "t == \"a\"", "t", "\"a\"", "if len(a) == 0:\n print(\"A\")\n exit()\n\n ", "len(a) == 0", "len(a)", "len", "a", "0", "print(\"A\")", "print", "\"A\"", "exit()", "exit", "t = a.pop(0)", "t", "a.pop(0)", "a.pop", "a", "pop", "0", "elif t == \"b\":\n if len(b) == 0:\n print(\"B\")\n exit()\n\n t = b.pop(0)\n ", "t == \"b\"", "t", "\"b\"", "if len(b) == 0:\n print(\"B\")\n exit()\n\n ", "len(b) == 0", "len(b)", "len", "b", "0", "print(\"B\")", "print", "\"B\"", "exit()", "exit", "t = b.pop(0)", "t", "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", "t = c.pop(0)", "t", "c.pop(0)", "c.pop", "c", "pop", "0", "if __name__==\"__main__\":\n main()", "__name__==\"__main__\"", "__name__", "\"__main__\"", "main()", "main", "def i_row_list(N): return [i_list() for _ in range(N)]", "def i_row_list(N): return [i_list() for _ in range(N)]", "i_row_list", "def s_row_str(N): return [s_list() for _ in range(N)]", "def s_row_str(N): return [s_list() for _ in range(N)]", "s_row_str", "def i_list(): return list(i_map())", "def i_list(): return list(i_map())", "i_list", "def s_list(): return list(s_map())", "def s_list(): return list(s_map())", "s_list", "def i_map(): return map(int, input().split())", "def i_map(): return map(int, input().split())", "i_map", "def i_row(N): return [i_input() for _ in range(N)]", "def i_row(N): return [i_input() for _ in range(N)]", "i_row", "def s_row(N): return [s_input for _ in range(N)]", "def s_row(N): return [s_input for _ in range(N)]", "s_row", "INF = float(\"inf\")", "float(\"inf\")", "INF", "def i_input(): return int(input())", "def i_input(): return int(input())", "i_input", "def s_input(): return input()", "def s_input(): return input()", "s_input", "def s_row_list(N): return [list(s_input()) for _ in range(N)]", "def s_row_list(N): return [list(s_input()) for _ in range(N)]", "s_row_list", "def s_map(): return input().split()", "def s_map(): return input().split()", "s_map", "def main():\n a = list(s_input())\n b = list(s_input())\n c = list(s_input())\n\n t = \"a\"\n\n while True:\n if t == \"a\":\n if len(a) == 0:\n print(\"A\")\n exit()\n\n t = a.pop(0)\n elif t == \"b\":\n if len(b) == 0:\n print(\"B\")\n exit()\n\n t = b.pop(0)\n else:\n if len(c) == 0:\n print(\"C\")\n exit()\n t = c.pop(0)", "def main():\n a = list(s_input())\n b = list(s_input())\n c = list(s_input())\n\n t = \"a\"\n\n while True:\n if t == \"a\":\n if len(a) == 0:\n print(\"A\")\n exit()\n\n t = a.pop(0)\n elif t == \"b\":\n if len(b) == 0:\n print(\"B\")\n exit()\n\n t = b.pop(0)\n else:\n if len(c) == 0:\n print(\"C\")\n exit()\n t = c.pop(0)", "main" ]
import math from math import gcd,pi,sqrt INF = float("inf") import sys sys.setrecursionlimit(10**6) import itertools from collections import Counter,deque def i_input(): return int(input()) def i_map(): return map(int, input().split()) def i_list(): return list(i_map()) def i_row(N): return [i_input() for _ in range(N)] def i_row_list(N): return [i_list() for _ in range(N)] def s_input(): return input() def s_map(): return input().split() def s_list(): return list(s_map()) def s_row(N): return [s_input for _ in range(N)] def s_row_str(N): return [s_list() for _ in range(N)] def s_row_list(N): return [list(s_input()) for _ in range(N)] def main(): a = list(s_input()) b = list(s_input()) c = list(s_input()) t = "a" while True: if t == "a": if len(a) == 0: print("A") exit() t = a.pop(0) elif t == "b": if len(b) == 0: print("B") exit() t = b.pop(0) else: if len(c) == 0: print("C") exit() t = c.pop(0) if __name__=="__main__": main()
[ 7, 41, 28, 13, 4, 13, 17, 4, 4, 13, 0, 13, 13, 13, 13, 0, 13, 21, 22, 17, 13, 22, 17, 13, 22, 17, 13, 0, 13, 17, 42, 40, 4, 13, 18, 13, 13, 17, 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, 13, 13, 10, 13, 13, 10, 13, 13, 10, 13, 13, 10, 21, 13, 10, 17, 13 ]
[ [ 4, 3 ], [ 77, 11 ], [ 77, 13 ], [ 77, 14 ], [ 80, 16 ], [ 83, 28 ], [ 46, 34 ], [ 81, 35 ], [ 84, 36 ], [ 72, 36 ], [ 65, 39 ], [ 46, 41 ], [ 81, 42 ], [ 84, 43 ], [ 72, 43 ], [ 49, 46 ], [ 81, 47 ], [ 84, 48 ], [ 72, 48 ], [ 46, 50 ], [ 81, 51 ], [ 84, 52 ], [ 72, 52 ], [ 71, 56 ], [ 66, 57 ], [ 72, 62 ], [ 84, 62 ], [ 65, 66 ], [ 77, 69 ], [ 66, 71 ], [ 71, 72 ], [ 77, 75 ], [ 77, 78 ], [ 80, 81 ], [ 83, 84 ] ]
[ "a, b, c = (input() for _ in range(3))\nd = {\"a\": a, \"b\": b, \"c\": c}\nnex = \"a\"\n\nwhile len(d[nex]) != 0:\n tmp = d[nex][0]\n d[nex] = d[nex][1:]\n nex = tmp\n\nprint(nex.upper())", "input() for _ in range(3)", "for _ in range(3)", "_", "range(3)", "range", "3", "for _ in range(3)", "input()", "input", "a, b, c = (input() for _ in range(3))", "a", "(input() for _ in range(3))", "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", "nex = \"a\"", "nex", "\"a\"", "while len(d[nex]) != 0:\n tmp = d[nex][0]\n d[nex] = d[nex][1:]\n nex = tmp", "len(d[nex]) != 0", "len(d[nex])", "len", "d[nex]", "d", "nex", "0", "tmp = d[nex][0]", "tmp", "d[nex][0]", "[nex]", "d", "nex", "0", "d[nex] = d[nex][1:]", "d[nex]", "d", "nex", "d[nex][1:]", "[nex]", "d", "nex", "1:", "1", "nex = tmp", "nex", "tmp", "print(nex.upper())", "print", "nex.upper()", "nex.upper", "nex", "upper", "tmp = d[nex][0]", "d[nex][0]", "tmp", "b, c = (input() for _ in range(3))", "(input() for _ in range(3))", "b", "nex = tmp", "tmp", "nex", "c = (input() for _ in range(3))", "(input() for _ in range(3))", "c", "a, b, c = (input() for _ in range(3))", "(input() for _ in range(3))", "a", "d = {\"a\": a, \"b\": b, \"c\": c}", "{\"a\": a, \"b\": b, \"c\": c}", "d", "nex = \"a\"", "\"a\"", "nex" ]
a, b, c = (input() for _ in range(3)) d = {"a": a, "b": b, "c": c} nex = "a" while len(d[nex]) != 0: tmp = d[nex][0] d[nex] = d[nex][1:] nex = tmp print(nex.upper())
[ 7, 0, 13, 4, 13, 0, 18, 13, 17, 18, 4, 13, 4, 13, 39, 17, 0, 18, 13, 17, 18, 4, 13, 4, 13, 39, 17, 0, 18, 13, 17, 18, 4, 13, 4, 13, 39, 17, 0, 13, 17, 42, 18, 13, 13, 0, 13, 4, 18, 18, 13, 13, 13, 4, 13, 4, 18, 13, 13, 10, 17, 13, 10, 4, 13, 10, 4, 13 ]
[ [ 66, 2 ], [ 9, 6 ], [ 67, 7 ], [ 20, 17 ], [ 67, 18 ], [ 31, 28 ], [ 67, 29 ], [ 60, 39 ], [ 67, 43 ], [ 61, 44 ], [ 64, 44 ], [ 63, 46 ], [ 67, 50 ], [ 61, 51 ], [ 64, 51 ], [ 64, 57 ], [ 61, 57 ], [ 60, 61 ], [ 63, 64 ], [ 66, 67 ] ]
[ "S = dict()\nS['a'] = list(input())[::-1]\nS['b'] = list(input())[::-1]\nS['c'] = list(input())[::-1]\n\np = 'a'\nwhile S[p]:\n p = S[p].pop()\nprint(p.upper())", "S = dict()", "S", "dict()", "dict", "S['a'] = list(input())[::-1]", "S['a']", "S", "'a'", "list(input())[::-1]", "(input())", "list", "input()", "input", "::-1", "-1", "S['b'] = list(input())[::-1]", "S['b']", "S", "'b'", "list(input())[::-1]", "(input())", "list", "input()", "input", "::-1", "-1", "S['c'] = list(input())[::-1]", "S['c']", "S", "'c'", "list(input())[::-1]", "(input())", "list", "input()", "input", "::-1", "-1", "p = 'a'", "p", "'a'", "while S[p]:\n p = S[p].pop()", "S[p]", "S", "p", "p = S[p].pop()", "p", "S[p].pop()", "[p].pop", "[p]", "S", "p", "pop", "print(p.upper())", "print", "p.upper()", "p.upper", "p", "upper", "p = 'a'", "'a'", "p", "p = S[p].pop()", "S[p].pop()", "p", "S = dict()", "dict()", "S" ]
S = dict() S['a'] = list(input())[::-1] S['b'] = list(input())[::-1] S['c'] = list(input())[::-1] p = 'a' while S[p]: p = S[p].pop() print(p.upper())
[ 7, 0, 13, 17, 28, 13, 17, 41, 28, 13, 4, 13, 4, 13, 0, 18, 13, 13, 13, 0, 13, 17, 0, 13, 17, 0, 13, 4, 18, 4, 18, 18, 13, 17, 13, 17, 13, 42, 13, 14, 2, 18, 13, 13, 39, 0, 13, 13, 0, 13, 17, 0, 13, 4, 18, 4, 18, 18, 13, 13, 13, 17, 13, 4, 13, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 13, 13, 10, 17, 13, 10, 4, 13 ]
[ [ 73, 2 ], [ 6, 5 ], [ 10, 9 ], [ 9, 13 ], [ 18, 15 ], [ 74, 16 ], [ 5, 17 ], [ 70, 20 ], [ 67, 23 ], [ 76, 26 ], [ 74, 32 ], [ 74, 42 ], [ 77, 43 ], [ 86, 43 ], [ 79, 46 ], [ 77, 47 ], [ 86, 47 ], [ 82, 49 ], [ 85, 52 ], [ 74, 58 ], [ 77, 59 ], [ 86, 59 ], [ 80, 65 ], [ 71, 65 ], [ 67, 68 ], [ 70, 71 ], [ 73, 74 ], [ 76, 77 ], [ 77, 79 ], [ 86, 79 ], [ 79, 80 ], [ 82, 83 ], [ 85, 86 ] ]
[ "S = {}\nfor i in 'ABC':\n S[i] = [w for w in input()]\nans = ''\njudge = True\nturn = S['A'].pop(0).upper()\nwhile judge:\n if S[turn] == []:\n ans = turn\n judge = False\n else:\n turn = S[turn].pop(0).upper()\nprint(ans)", "S = {}", "S", "{}", "for i in 'ABC':\n S[i] = [w for w in input()]", "i", "'ABC'", "w for w in input()", "for w in input()", "w", "input()", "input", "for w in input()", "w", "S[i] = [w for w in input()]", "S[i]", "S", "i", "[w for w in input()]", "ans = ''", "ans", "''", "judge = True", "judge", "True", "turn = S['A'].pop(0).upper()", "turn", "S['A'].pop(0).upper()", "['A'].pop(0).upper", "['A'].pop(0)", "['A'].pop", "['A']", "S", "'A'", "pop", "0", "upper", "while judge:\n if S[turn] == []:\n ans = turn\n judge = False\n else:\n turn = S[turn].pop(0).upper()", "judge", "if S[turn] == []:\n ans = turn\n judge = False\n else:\n turn = S[turn].pop(0).upper()", "S[turn] == []", "S[turn]", "S", "turn", "[]", "ans = turn", "ans", "turn", "judge = False", "judge", "False", "turn = S[turn].pop(0).upper()", "turn", "S[turn].pop(0).upper()", "[turn].pop(0).upper", "[turn].pop(0)", "[turn].pop", "[turn]", "S", "turn", "pop", "0", "upper", "print(ans)", "print", "ans", "judge = True", "True", "judge", "ans = ''", "''", "ans", "S = {}", "{}", "S", "turn = S['A'].pop(0).upper()", "S['A'].pop(0).upper()", "turn", "ans = turn", "turn", "ans", "judge = False", "False", "judge", "turn = S[turn].pop(0).upper()", "S[turn].pop(0).upper()", "turn" ]
S = {} for i in 'ABC': S[i] = [w for w in input()] ans = '' judge = True turn = S['A'].pop(0).upper() while judge: if S[turn] == []: ans = turn judge = False else: turn = S[turn].pop(0).upper() print(ans)
[ 7, 0, 13, 17, 0, 18, 13, 17, 4, 13, 0, 18, 13, 17, 4, 13, 0, 18, 13, 17, 4, 13, 0, 13, 17, 42, 17, 0, 13, 18, 13, 13, 14, 2, 4, 13, 13, 17, 0, 18, 13, 13, 18, 13, 39, 17, 0, 13, 18, 13, 17, 4, 13, 4, 18, 13, 13, 10, 18, 13, 10, 18, 13, 10, 17, 13, 10, 17, 13 ]
[ [ 64, 2 ], [ 8, 5 ], [ 65, 6 ], [ 14, 11 ], [ 65, 12 ], [ 20, 17 ], [ 65, 18 ], [ 67, 23 ], [ 61, 28 ], [ 39, 29 ], [ 65, 30 ], [ 68, 31 ], [ 59, 31 ], [ 62, 36 ], [ 42, 39 ], [ 65, 40 ], [ 68, 41 ], [ 59, 41 ], [ 62, 43 ], [ 58, 47 ], [ 62, 49 ], [ 59, 55 ], [ 68, 55 ], [ 58, 59 ], [ 39, 61 ], [ 61, 62 ], [ 64, 65 ], [ 67, 68 ] ]
[ "S = {}\nS['a'] = input()\nS['b'] = input()\nS['c'] = input()\nturn = 'a'\nwhile True:\n hand = S[turn]\n if len(hand) == 0: break\n S[turn] = hand[1:]\n turn = hand[0]\n\nprint(turn.upper())", "S = {}", "S", "{}", "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 hand = S[turn]\n if len(hand) == 0: break\n S[turn] = hand[1:]\n turn = hand[0]", "True", "hand = S[turn]", "hand", "S[turn]", "S", "turn", "if len(hand) == 0: break\n ", "len(hand) == 0", "len(hand)", "len", "hand", "0", "S[turn] = hand[1:]", "S[turn]", "S", "turn", "hand[1:]", "hand", "1:", "1", "turn = hand[0]", "turn", "hand[0]", "hand", "0", "print(turn.upper())", "print", "turn.upper()", "turn.upper", "turn", "upper", "turn = hand[0]", "hand[0]", "turn", "hand = S[turn]", "S[turn]", "hand", "S = {}", "{}", "S", "turn = 'a'", "'a'", "turn" ]
S = {} S['a'] = input() S['b'] = input() S['c'] = input() turn = 'a' while True: hand = S[turn] if len(hand) == 0: break S[turn] = hand[1:] turn = hand[0] print(turn.upper())
[ 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, 4, 13, 10, 17, 13 ]
[ [ 4, 3 ], [ 3, 6 ], [ 37, 12 ], [ 43, 15 ], [ 38, 19 ], [ 44, 20 ], [ 41, 20 ], [ 40, 22 ], [ 38, 26 ], [ 44, 27 ], [ 41, 27 ], [ 41, 34 ], [ 44, 34 ], [ 37, 38 ], [ 40, 41 ], [ 43, 44 ] ]
[ "S = {i:list(input()) for i in \"abc\"}\nn = \"a\"\nwhile S[n]:\n n = S[n].pop(0)\n\nprint(n.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\"}", "n = \"a\"", "n", "\"a\"", "while S[n]:\n n = S[n].pop(0)", "S[n]", "S", "n", "n = S[n].pop(0)", "n", "S[n].pop(0)", "[n].pop", "[n]", "S", "n", "pop", "0", "print(n.upper())", "print", "n.upper()", "n.upper", "n", "upper", "S = {i:list(input()) for i in \"abc\"}", "{i:list(input()) for i in \"abc\"}", "S", "n = S[n].pop(0)", "S[n].pop(0)", "n", "n = \"a\"", "\"a\"", "n" ]
S = {i:list(input()) for i in "abc"} n = "a" while S[n]: n = S[n].pop(0) print(n.upper())
[ 7, 0, 13, 4, 13, 13, 4, 13, 13, 4, 13, 0, 13, 39, 13, 13, 13, 0, 13, 39, 17, 17, 17, 0, 13, 39, 17, 17, 17, 0, 13, 17, 42, 40, 18, 13, 13, 4, 13, 18, 13, 13, 0, 13, 18, 13, 13, 0, 18, 13, 13, 17, 14, 2, 18, 18, 13, 13, 13, 17, 14, 2, 18, 18, 13, 13, 13, 17, 4, 13, 18, 13, 13, 10, 4, 13, 10, 39, 13, 10, 18, 13, 10, 39, 13, 10, 17, 13, 10, 4, 13, 10, 4, 13, 10, 39, 13 ]
[ [ 74, 2 ], [ 89, 5 ], [ 92, 8 ], [ 95, 12 ], [ 77, 18 ], [ 83, 24 ], [ 86, 30 ], [ 48, 34 ], [ 84, 35 ], [ 87, 36 ], [ 96, 40 ], [ 87, 41 ], [ 80, 43 ], [ 48, 44 ], [ 84, 45 ], [ 87, 46 ], [ 51, 48 ], [ 84, 49 ], [ 87, 50 ], [ 96, 56 ], [ 87, 57 ], [ 81, 58 ], [ 96, 64 ], [ 87, 65 ], [ 81, 66 ], [ 78, 71 ], [ 87, 72 ], [ 74, 75 ], [ 77, 78 ], [ 48, 80 ], [ 80, 81 ], [ 83, 84 ], [ 86, 87 ], [ 89, 90 ], [ 92, 93 ], [ 95, 96 ] ]
[ "a,b,c=input(),input(),input()\nstring=[a,b,c]\nans=[\"A\",\"B\",\"C\"]\ns=[0,0,0]\nban=0\nwhile s[ban]!=len(string[ban]):\n temp=s[ban]\n s[ban]+=1\n if string[ban][temp]==\"a\": ban=0\n elif string[ban][temp]==\"b\": ban=1\n else: ban=2\nprint(ans[ban])", "a,b,c=input(),input(),input()", "a", "input()", "input", "b", "input()", "input", "c", "input()", "input", "string=[a,b,c]", "string", "[a,b,c]", "a", "b", "c", "ans=[\"A\",\"B\",\"C\"]", "ans", "[\"A\",\"B\",\"C\"]", "\"A\"", "\"B\"", "\"C\"", "s=[0,0,0]", "s", "[0,0,0]", "0", "0", "0", "ban=0", "ban", "0", "while s[ban]!=len(string[ban]):\n temp=s[ban]\n s[ban]+=1\n if string[ban][temp]==\"a\": ban=0\n elif string[ban][temp]==\"b\": ban=1\n else: ban=2", "s[ban]!=len(string[ban])", "s[ban]", "s", "ban", "len(string[ban])", "len", "string[ban]", "string", "ban", "temp=s[ban]", "temp", "s[ban]", "s", "ban", "s[ban]+=1", "s[ban]", "s", "ban", "1", "if string[ban][temp]==\"a\": ban=0\n elif string[ban][temp]==\"b\": ban=1\n else: ban=2", "string[ban][temp]==\"a\"", "string[ban][temp]", "[ban]", "string", "ban", "temp", "\"a\"", "elif string[ban][temp]==\"b\": ban=1\n ", "string[ban][temp]==\"b\"", "string[ban][temp]", "[ban]", "string", "ban", "temp", "\"b\"", "print(ans[ban])", "print", "ans[ban]", "ans", "ban", "a,b,c=input(),input(),input()", "input()", "a", "ans=[\"A\",\"B\",\"C\"]", "[\"A\",\"B\",\"C\"]", "ans", "temp=s[ban]", "s[ban]", "temp", "s=[0,0,0]", "[0,0,0]", "s", "ban=0", "0", "ban", "b,c=input(),input(),input()", "input()", "b", "c=input(),input(),input()", "input()", "c", "string=[a,b,c]", "[a,b,c]", "string" ]
a,b,c=input(),input(),input() string=[a,b,c] ans=["A","B","C"] s=[0,0,0] ban=0 while s[ban]!=len(string[ban]): temp=s[ban] s[ban]+=1 if string[ban][temp]=="a": ban=0 elif string[ban][temp]=="b": ban=1 else: ban=2 print(ans[ban])
[ 7, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 0, 13, 17, 0, 13, 17, 42, 17, 14, 2, 13, 17, 14, 2, 4, 13, 13, 13, 0, 13, 17, 3, 0, 13, 18, 13, 13, 0, 13, 17, 14, 2, 13, 17, 14, 2, 4, 13, 13, 13, 0, 13, 17, 3, 0, 13, 18, 13, 13, 0, 13, 17, 14, 2, 4, 13, 13, 13, 0, 13, 17, 3, 0, 13, 18, 13, 13, 0, 13, 17, 4, 13, 13, 10, 17, 13, 10, 17, 13, 10, 18, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 18, 13, 10, 17, 13, 10, 18, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13 ]
[ [ 123, 2 ], [ 105, 6 ], [ 138, 10 ], [ 108, 14 ], [ 111, 17 ], [ 129, 20 ], [ 144, 23 ], [ 114, 26 ], [ 145, 32 ], [ 103, 32 ], [ 133, 32 ], [ 127, 32 ], [ 124, 38 ], [ 109, 39 ], [ 100, 39 ], [ 135, 41 ], [ 126, 45 ], [ 124, 47 ], [ 109, 48 ], [ 100, 48 ], [ 99, 50 ], [ 145, 54 ], [ 103, 54 ], [ 133, 54 ], [ 127, 54 ], [ 106, 60 ], [ 112, 61 ], [ 121, 61 ], [ 96, 63 ], [ 132, 67 ], [ 106, 69 ], [ 112, 70 ], [ 121, 70 ], [ 120, 72 ], [ 139, 78 ], [ 130, 79 ], [ 142, 79 ], [ 117, 81 ], [ 102, 85 ], [ 139, 87 ], [ 130, 88 ], [ 142, 88 ], [ 141, 90 ], [ 118, 94 ], [ 97, 94 ], [ 136, 94 ], [ 115, 94 ], [ 96, 97 ], [ 99, 100 ], [ 102, 103 ], [ 105, 106 ], [ 108, 109 ], [ 111, 112 ], [ 114, 115 ], [ 117, 118 ], [ 120, 121 ], [ 123, 124 ], [ 126, 127 ], [ 129, 130 ], [ 132, 133 ], [ 135, 136 ], [ 138, 139 ], [ 141, 142 ], [ 144, 145 ] ]
[ "a = input()\nb = input()\nc = input()\nx = 0\ny = 0\nz = 0\nq = \"a\"\nans = 0\nwhile 1:\n \n if q == \"a\":\n if len(a) == x:\n ans = \"A\"\n break\n q = a[x]\n x += 1\n \n elif q == \"b\":\n if len(b) == y:\n ans = \"B\"\n break\n q = b[y]\n y += 1\n \n else:\n if len(c) == z:\n ans = \"C\"\n break\n q = c[z]\n z += 1\n \nprint(ans)", "a = input()", "a", "input()", "input", "b = input()", "b", "input()", "input", "c = input()", "c", "input()", "input", "x = 0", "x", "0", "y = 0", "y", "0", "z = 0", "z", "0", "q = \"a\"", "q", "\"a\"", "ans = 0", "ans", "0", "while 1:\n \n if q == \"a\":\n if len(a) == x:\n ans = \"A\"\n break\n q = a[x]\n x += 1\n \n elif q == \"b\":\n if len(b) == y:\n ans = \"B\"\n break\n q = b[y]\n y += 1\n \n else:\n if len(c) == z:\n ans = \"C\"\n break\n q = c[z]\n z += 1\n ", "1", "if q == \"a\":\n if len(a) == x:\n ans = \"A\"\n break\n q = a[x]\n x += 1\n \n elif q == \"b\":\n if len(b) == y:\n ans = \"B\"\n break\n q = b[y]\n y += 1\n \n else:\n if len(c) == z:\n ans = \"C\"\n break\n q = c[z]\n z += 1\n ", "q == \"a\"", "q", "\"a\"", "if len(a) == x:\n ans = \"A\"\n break\n ", "len(a) == x", "len(a)", "len", "a", "x", "ans = \"A\"", "ans", "\"A\"", "break", "q = a[x]", "q", "a[x]", "a", "x", "x += 1", "x", "1", "elif q == \"b\":\n if len(b) == y:\n ans = \"B\"\n break\n q = b[y]\n y += 1\n \n ", "q == \"b\"", "q", "\"b\"", "if len(b) == y:\n ans = \"B\"\n break\n ", "len(b) == y", "len(b)", "len", "b", "y", "ans = \"B\"", "ans", "\"B\"", "break", "q = b[y]", "q", "b[y]", "b", "y", "y += 1", "y", "1", "if len(c) == z:\n ans = \"C\"\n break\n ", "len(c) == z", "len(c)", "len", "c", "z", "ans = \"C\"", "ans", "\"C\"", "break", "q = c[z]", "q", "c[z]", "c", "z", "z += 1", "z", "1", "print(ans)", "print", "ans", "ans = \"B\"", "\"B\"", "ans", "x += 1", "1", "x", "q = c[z]", "c[z]", "q", "b = input()", "input()", "b", "x = 0", "0", "x", "y = 0", "0", "y", "ans = 0", "0", "ans", "ans = \"C\"", "\"C\"", "ans", "y += 1", "1", "y", "a = input()", "input()", "a", "q = a[x]", "a[x]", "q", "z = 0", "0", "z", "q = b[y]", "b[y]", "q", "ans = \"A\"", "\"A\"", "ans", "c = input()", "input()", "c", "z += 1", "1", "z", "q = \"a\"", "\"a\"", "q" ]
a = input() b = input() c = input() x = 0 y = 0 z = 0 q = "a" ans = 0 while 1: if q == "a": if len(a) == x: ans = "A" break q = a[x] x += 1 elif q == "b": if len(b) == y: ans = "B" break q = b[y] y += 1 else: if len(c) == z: ans = "C" break q = c[z] z += 1 print(ans)
[ 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, 18, 18, 13, 17, 17, 42, 17, 14, 2, 18, 13, 13, 17, 4, 13, 4, 18, 13, 13, 3, 0, 18, 13, 13, 18, 18, 13, 13, 39, 17, 13, 18, 18, 13, 13, 17, 10, 4, 13, 10, 4, 13, 10, 18, 13, 10, 4, 13, 10, 21, 13, 10, 18, 13 ]
[ [ 64, 2 ], [ 67, 6 ], [ 73, 10 ], [ 76, 14 ], [ 79, 26 ], [ 77, 29 ], [ 48, 36 ], [ 77, 37 ], [ 80, 38 ], [ 71, 38 ], [ 80, 44 ], [ 71, 44 ], [ 51, 48 ], [ 77, 49 ], [ 80, 50 ], [ 71, 50 ], [ 48, 52 ], [ 77, 53 ], [ 80, 54 ], [ 71, 54 ], [ 70, 57 ], [ 48, 59 ], [ 77, 60 ], [ 80, 61 ], [ 71, 61 ], [ 64, 65 ], [ 67, 68 ], [ 70, 71 ], [ 73, 74 ], [ 76, 77 ], [ 79, 80 ] ]
[ "SA = input()\nSB = input()\nSC = input()\nS = {'a' : SA, 'b' : SB, 'c' : SC}\ncard = S['a'][0]\nwhile True:\n if S[card] == '':\n print(card.upper())\n break\n S[card], card = S[card][1:], S[card][0]", "SA = input()", "SA", "input()", "input", "SB = input()", "SB", "input()", "input", "SC = input()", "SC", "input()", "input", "S = {'a' : SA, 'b' : SB, 'c' : SC}", "S", "{'a' : SA, 'b' : SB, 'c' : SC}", "'a'", "'a'", "SA", "'b'", "'b'", "SB", "'c'", "'c'", "SC", "card = S['a'][0]", "card", "S['a'][0]", "['a']", "S", "'a'", "0", "while True:\n if S[card] == '':\n print(card.upper())\n break\n S[card], card = S[card][1:], S[card][0]", "True", "if S[card] == '':\n print(card.upper())\n break\n ", "S[card] == ''", "S[card]", "S", "card", "''", "print(card.upper())", "print", "card.upper()", "card.upper", "card", "upper", "break", "S[card], card = S[card][1:], S[card][0]", "S[card]", "S", "card", "S[card][1:]", "[card]", "S", "card", "1:", "1", "card", "S[card][0]", "[card]", "S", "card", "0", "SA = input()", "input()", "SA", "SB = input()", "input()", "SB", "card = S[card][1:], S[card][0]", "S[card][0]", "card", "SC = input()", "input()", "SC", "S = {'a' : SA, 'b' : SB, 'c' : SC}", "{'a' : SA, 'b' : SB, 'c' : SC}", "S", "card = S['a'][0]", "S['a'][0]", "card" ]
SA = input() SB = input() SC = input() S = {'a' : SA, 'b' : SB, 'c' : SC} card = S['a'][0] while True: if S[card] == '': print(card.upper()) break S[card], card = S[card][1:], S[card][0]
[ 7, 0, 13, 4, 13, 4, 13, 0, 13, 4, 13, 4, 13, 0, 13, 4, 13, 4, 13, 0, 13, 18, 13, 17, 24, 18, 13, 17, 42, 17, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 4, 13, 17, 3, 0, 13, 18, 13, 17, 24, 18, 13, 17, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 4, 13, 17, 3, 0, 13, 18, 13, 17, 24, 18, 13, 17, 14, 2, 4, 13, 13, 17, 4, 13, 17, 3, 0, 13, 18, 13, 17, 24, 18, 13, 17, 10, 4, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 4, 13, 10, 18, 13, 10, 4, 13 ]
[ [ 96, 2 ], [ 114, 8 ], [ 108, 14 ], [ 99, 20 ], [ 97, 22 ], [ 97, 26 ], [ 100, 32 ], [ 112, 32 ], [ 103, 32 ], [ 106, 32 ], [ 97, 38 ], [ 105, 45 ], [ 97, 47 ], [ 97, 51 ], [ 100, 55 ], [ 112, 55 ], [ 103, 55 ], [ 106, 55 ], [ 115, 61 ], [ 102, 68 ], [ 115, 70 ], [ 115, 74 ], [ 109, 80 ], [ 111, 87 ], [ 109, 89 ], [ 109, 93 ], [ 96, 97 ], [ 99, 100 ], [ 102, 103 ], [ 105, 106 ], [ 108, 109 ], [ 111, 112 ], [ 114, 115 ] ]
[ "a = list(input())\nb = list(input())\nc = list(input())\n\ns = a[0]\n\ndel a[0]\n\nwhile True:\n if s is 'a':\n if len(a) == 0:\n print('A')\n break\n\n s = a[0]\n del a[0]\n \n elif s is 'b':\n if len(b) == 0:\n print('B')\n break\n \n s = b[0]\n del b[0]\n \n else:\n if len(c) == 0:\n print('C')\n break\n \n s = c[0]\n del 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", "s = a[0]", "s", "a[0]", "a", "0", "del a[0]", "a[0]", "a", "0", "while True:\n if s is 'a':\n if len(a) == 0:\n print('A')\n break\n\n s = a[0]\n del a[0]\n \n elif s is 'b':\n if len(b) == 0:\n print('B')\n break\n \n s = b[0]\n del b[0]\n \n else:\n if len(c) == 0:\n print('C')\n break\n \n s = c[0]\n del c[0]", "True", "if s is 'a':\n if len(a) == 0:\n print('A')\n break\n\n s = a[0]\n del a[0]\n \n elif s is 'b':\n if len(b) == 0:\n print('B')\n break\n \n s = b[0]\n del b[0]\n \n else:\n if len(c) == 0:\n print('C')\n break\n \n s = c[0]\n del c[0]", "s is 'a'", "s", "'a'", "if len(a) == 0:\n print('A')\n break\n\n ", "len(a) == 0", "len(a)", "len", "a", "0", "print('A')", "print", "'A'", "break", "s = a[0]", "s", "a[0]", "a", "0", "del a[0]", "a[0]", "a", "0", "elif s is 'b':\n if len(b) == 0:\n print('B')\n break\n \n s = b[0]\n del b[0]\n \n ", "s is 'b'", "s", "'b'", "if len(b) == 0:\n print('B')\n break\n \n ", "len(b) == 0", "len(b)", "len", "b", "0", "print('B')", "print", "'B'", "break", "s = b[0]", "s", "b[0]", "b", "0", "del b[0]", "b[0]", "b", "0", "if len(c) == 0:\n print('C')\n break\n \n ", "len(c) == 0", "len(c)", "len", "c", "0", "print('C')", "print", "'C'", "break", "s = c[0]", "s", "c[0]", "c", "0", "del c[0]", "c[0]", "c", "0", "a = list(input())", "list(input())", "a", "s = a[0]", "a[0]", "s", "s = b[0]", "b[0]", "s", "s = a[0]", "a[0]", "s", "c = list(input())", "list(input())", "c", "s = c[0]", "c[0]", "s", "b = list(input())", "list(input())", "b" ]
a = list(input()) b = list(input()) c = list(input()) s = a[0] del a[0] while True: if s is 'a': if len(a) == 0: print('A') break s = a[0] del a[0] elif s is 'b': if len(b) == 0: print('B') break s = b[0] del b[0] else: if len(c) == 0: print('C') break s = c[0] del c[0]
[ 7, 0, 13, 17, 41, 28, 13, 4, 13, 17, 4, 2, 4, 13, 18, 13, 13, 0, 13, 13, 0, 13, 18, 13, 17, 0, 13, 17, 0, 13, 39, 17, 17, 17, 28, 13, 4, 13, 17, 14, 2, 18, 13, 13, 17, 0, 13, 18, 13, 17, 0, 13, 18, 13, 17, 0, 18, 13, 17, 17, 14, 2, 18, 13, 13, 17, 0, 13, 18, 13, 17, 0, 13, 18, 13, 17, 0, 18, 13, 17, 17, 0, 13, 18, 13, 17, 0, 13, 18, 13, 17, 0, 18, 13, 17, 17, 14, 2, 18, 13, 13, 17, 4, 13, 17, 4, 13, 14, 2, 18, 13, 13, 17, 4, 13, 17, 4, 13, 14, 2, 18, 13, 13, 17, 4, 13, 17, 4, 13, 10, 18, 13, 10, 17, 13, 10, 39, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 17, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 13, 13 ]
[ [ 148, 2 ], [ 7, 6 ], [ 149, 15 ], [ 6, 16 ], [ 160, 18 ], [ 139, 21 ], [ 161, 23 ], [ 133, 26 ], [ 136, 29 ], [ 36, 35 ], [ 140, 42 ], [ 131, 42 ], [ 152, 42 ], [ 155, 42 ], [ 134, 43 ], [ 146, 43 ], [ 158, 43 ], [ 143, 43 ], [ 154, 46 ], [ 161, 48 ], [ 142, 51 ], [ 137, 53 ], [ 59, 56 ], [ 137, 57 ], [ 140, 63 ], [ 131, 63 ], [ 152, 63 ], [ 155, 63 ], [ 134, 64 ], [ 146, 64 ], [ 158, 64 ], [ 143, 64 ], [ 151, 67 ], [ 161, 69 ], [ 157, 72 ], [ 137, 74 ], [ 80, 77 ], [ 137, 78 ], [ 130, 82 ], [ 161, 84 ], [ 145, 87 ], [ 137, 89 ], [ 95, 92 ], [ 137, 93 ], [ 131, 99 ], [ 152, 99 ], [ 155, 99 ], [ 140, 99 ], [ 146, 100 ], [ 158, 100 ], [ 143, 100 ], [ 134, 100 ], [ 131, 110 ], [ 152, 110 ], [ 155, 110 ], [ 140, 110 ], [ 146, 111 ], [ 158, 111 ], [ 143, 111 ], [ 134, 111 ], [ 131, 121 ], [ 152, 121 ], [ 155, 121 ], [ 140, 121 ], [ 146, 122 ], [ 158, 122 ], [ 143, 122 ], [ 134, 122 ], [ 130, 131 ], [ 133, 134 ], [ 136, 137 ], [ 139, 140 ], [ 142, 143 ], [ 145, 146 ], [ 148, 149 ], [ 151, 152 ], [ 154, 155 ], [ 157, 158 ], [ 160, 161 ] ]
[ "ABC = \"ABC\"\ns = [input()+ABC[i] for i in range(3)]\nturn = s[0]\ncard = 0\ncount = [1, 0, 0]\n\nfor i in range(305):\n if turn[card] == \"a\":\n turn = s[0]\n card = count[0]\n count[0] += 1\n elif turn[card] == \"b\":\n turn = s[1]\n card = count[1]\n count[1] += 1\n else:\n turn = s[2]\n card = count[2]\n count[2] += 1\n \n if turn[card] == \"A\":\n print(\"A\")\n exit()\n if turn[card] == \"B\":\n print(\"B\")\n exit()\n if turn[card] == \"C\":\n print(\"C\")\n exit()", "ABC = \"ABC\"", "ABC", "\"ABC\"", "input()+ABC[i] for i in range(3)", "for i in range(3)", "i", "range(3)", "range", "3", "for i in range(3)", "input()+ABC[i]", "input()", "input", "ABC[i]", "ABC", "i", "s = [input()+ABC[i] for i in range(3)]", "s", "[input()+ABC[i] for i in range(3)]", "turn = s[0]", "turn", "s[0]", "s", "0", "card = 0", "card", "0", "count = [1, 0, 0]", "count", "[1, 0, 0]", "1", "0", "0", "for i in range(305):\n if turn[card] == \"a\":\n turn = s[0]\n card = count[0]\n count[0] += 1\n elif turn[card] == \"b\":\n turn = s[1]\n card = count[1]\n count[1] += 1\n else:\n turn = s[2]\n card = count[2]\n count[2] += 1\n \n if turn[card] == \"A\":\n print(\"A\")\n exit()\n if turn[card] == \"B\":\n print(\"B\")\n exit()\n if turn[card] == \"C\":\n print(\"C\")\n exit()", "i", "range(305)", "range", "305", "if turn[card] == \"a\":\n turn = s[0]\n card = count[0]\n count[0] += 1\n elif turn[card] == \"b\":\n turn = s[1]\n card = count[1]\n count[1] += 1\n else:\n turn = s[2]\n card = count[2]\n count[2] += 1\n \n ", "turn[card] == \"a\"", "turn[card]", "turn", "card", "\"a\"", "turn = s[0]", "turn", "s[0]", "s", "0", "card = count[0]", "card", "count[0]", "count", "0", "count[0] += 1", "count[0]", "count", "0", "1", "elif turn[card] == \"b\":\n turn = s[1]\n card = count[1]\n count[1] += 1\n ", "turn[card] == \"b\"", "turn[card]", "turn", "card", "\"b\"", "turn = s[1]", "turn", "s[1]", "s", "1", "card = count[1]", "card", "count[1]", "count", "1", "count[1] += 1", "count[1]", "count", "1", "1", "turn = s[2]", "turn", "s[2]", "s", "2", "card = count[2]", "card", "count[2]", "count", "2", "count[2] += 1", "count[2]", "count", "2", "1", "if turn[card] == \"A\":\n print(\"A\")\n exit()\n ", "turn[card] == \"A\"", "turn[card]", "turn", "card", "\"A\"", "print(\"A\")", "print", "\"A\"", "exit()", "exit", "if turn[card] == \"B\":\n print(\"B\")\n exit()\n ", "turn[card] == \"B\"", "turn[card]", "turn", "card", "\"B\"", "print(\"B\")", "print", "\"B\"", "exit()", "exit", "if turn[card] == \"C\":\n print(\"C\")\n exit()", "turn[card] == \"C\"", "turn[card]", "turn", "card", "\"C\"", "print(\"C\")", "print", "\"C\"", "exit()", "exit", "turn = s[2]", "s[2]", "turn", "card = 0", "0", "card", "count = [1, 0, 0]", "[1, 0, 0]", "count", "turn = s[0]", "s[0]", "turn", "card = count[0]", "count[0]", "card", "card = count[2]", "count[2]", "card", "ABC = \"ABC\"", "\"ABC\"", "ABC", "turn = s[1]", "s[1]", "turn", "turn = s[0]", "s[0]", "turn", "card = count[1]", "count[1]", "card", "s = [input()+ABC[i] for i in range(3)]", "[input()+ABC[i] for i in range(3)]", "s" ]
ABC = "ABC" s = [input()+ABC[i] for i in range(3)] turn = s[0] card = 0 count = [1, 0, 0] for i in range(305): if turn[card] == "a": turn = s[0] card = count[0] count[0] += 1 elif turn[card] == "b": turn = s[1] card = count[1] count[1] += 1 else: turn = s[2] card = count[2] count[2] += 1 if turn[card] == "A": print("A") exit() if turn[card] == "B": print("B") exit() if turn[card] == "C": print("C") exit()
[ 7, 41, 28, 13, 17, 4, 13, 4, 13, 4, 18, 4, 13, 13, 0, 13, 13, 0, 13, 17, 42, 18, 13, 13, 4, 13, 13, 10, 13, 13, 10, 17, 13 ]
[ [ 4, 3 ], [ 3, 6 ], [ 28, 15 ], [ 31, 18 ], [ 29, 22 ], [ 32, 23 ], [ 32, 26 ], [ 28, 29 ], [ 31, 32 ] ]
[ "S={p:list(input().upper())for p in'ABC'}\np='A'\nwhile S[p]:p=S[p].pop(0)\nprint(p)", "p:list(input().upper())for p in'ABC'", "for p in'ABC'", "p", "'ABC'", "for p in'ABC'", "p", "list(input().upper())", "list", "input().upper()", "().upper", "()", "input", "upper", "S={p:list(input().upper())for p in'ABC'}", "S", "{p:list(input().upper())for p in'ABC'}", "p='A'", "p", "'A'", "while S[p]:p=S[p].pop(0)", "S[p]", "S", "p", "print(p)", "print", "p", "S={p:list(input().upper())for p in'ABC'}", "{p:list(input().upper())for p in'ABC'}", "S", "p='A'", "'A'", "p" ]
S={p:list(input().upper())for p in'ABC'} p='A' while S[p]:p=S[p].pop(0) print(p)
[ 7, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 18, 13, 39, 17, 0, 13, 18, 13, 39, 17, 42, 17, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 4, 13, 17, 4, 13, 0, 13, 18, 13, 39, 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, 39, 17, 0, 13, 18, 13, 39, 17, 14, 2, 4, 13, 13, 17, 4, 13, 17, 4, 13, 0, 13, 18, 13, 39, 17, 0, 13, 18, 13, 39, 17, 10, 4, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 4, 13, 10, 18, 13, 10, 4, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13 ]
[ [ 126, 2 ], [ 105, 6 ], [ 120, 10 ], [ 132, 14 ], [ 127, 16 ], [ 123, 20 ], [ 127, 22 ], [ 133, 29 ], [ 136, 29 ], [ 115, 29 ], [ 118, 29 ], [ 124, 35 ], [ 127, 35 ], [ 130, 35 ], [ 117, 43 ], [ 124, 45 ], [ 127, 45 ], [ 130, 45 ], [ 129, 49 ], [ 124, 51 ], [ 127, 51 ], [ 130, 51 ], [ 133, 56 ], [ 136, 56 ], [ 115, 56 ], [ 118, 56 ], [ 106, 62 ], [ 109, 62 ], [ 114, 70 ], [ 106, 72 ], [ 109, 72 ], [ 108, 76 ], [ 106, 78 ], [ 109, 78 ], [ 121, 85 ], [ 112, 85 ], [ 135, 93 ], [ 121, 95 ], [ 112, 95 ], [ 111, 99 ], [ 121, 101 ], [ 112, 101 ], [ 105, 106 ], [ 108, 109 ], [ 111, 112 ], [ 114, 115 ], [ 117, 118 ], [ 120, 121 ], [ 123, 124 ], [ 126, 127 ], [ 129, 130 ], [ 132, 133 ], [ 135, 136 ] ]
[ "A = input()\nB = input()\nC = input()\n\nnow = A[:1]\nA = A[1:]\n\nwhile(1):\n if(now == 'a'):\n if(len(A) == 0):\n print(\"A\")\n exit()\n now = A[:1]\n A = A[1:]\n elif(now == 'b'):\n if(len(B) == 0):\n print(\"B\")\n exit()\n now = B[:1]\n B = B[1:]\n else:\n if(len(C) == 0):\n print(\"C\")\n exit()\n now = C[:1]\n C = C[1:]", "A = input()", "A", "input()", "input", "B = input()", "B", "input()", "input", "C = input()", "C", "input()", "input", "now = A[:1]", "now", "A[:1]", "A", ":1", "1", "A = A[1:]", "A", "A[1:]", "A", "1:", "1", "while(1):\n if(now == 'a'):\n if(len(A) == 0):\n print(\"A\")\n exit()\n now = A[:1]\n A = A[1:]\n elif(now == 'b'):\n if(len(B) == 0):\n print(\"B\")\n exit()\n now = B[:1]\n B = B[1:]\n else:\n if(len(C) == 0):\n print(\"C\")\n exit()\n now = C[:1]\n C = C[1:]", "1", "if(now == 'a'):\n if(len(A) == 0):\n print(\"A\")\n exit()\n now = A[:1]\n A = A[1:]\n elif(now == 'b'):\n if(len(B) == 0):\n print(\"B\")\n exit()\n now = B[:1]\n B = B[1:]\n else:\n if(len(C) == 0):\n print(\"C\")\n exit()\n now = C[:1]\n C = C[1:]", "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[:1]", "now", "A[:1]", "A", ":1", "1", "A = A[1:]", "A", "A[1:]", "A", "1:", "1", "elif(now == 'b'):\n if(len(B) == 0):\n print(\"B\")\n exit()\n now = B[:1]\n B = B[1:]\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[:1]", "now", "B[:1]", "B", ":1", "1", "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", "now = C[:1]", "now", "C[:1]", "C", ":1", "1", "C = C[1:]", "C", "C[1:]", "C", "1:", "1", "B = input()", "input()", "B", "B = B[1:]", "B[1:]", "B", "C = C[1:]", "C[1:]", "C", "now = B[:1]", "B[:1]", "now", "now = A[:1]", "A[:1]", "now", "C = input()", "input()", "C", "A = A[1:]", "A[1:]", "A", "A = input()", "input()", "A", "A = A[1:]", "A[1:]", "A", "now = A[:1]", "A[:1]", "now", "now = C[:1]", "C[:1]", "now" ]
A = input() B = input() C = input() now = A[:1] A = A[1:] while(1): if(now == 'a'): if(len(A) == 0): print("A") exit() now = A[:1] A = A[1:] elif(now == 'b'): if(len(B) == 0): print("B") exit() now = B[:1] B = B[1:] else: if(len(C) == 0): print("C") exit() now = C[:1] C = C[1:]
[ 7, 15, 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, 0, 13, 17, 42, 17, 14, 2, 13, 17, 0, 13, 17, 14, 2, 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, 3, 0, 13, 4, 18, 13, 13, 14, 2, 13, 17, 0, 13, 17, 14, 2, 13, 17, 0, 13, 17, 3, 0, 13, 4, 18, 13, 13, 4, 13, 13, 10, 17, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13 ]
[ [ 155, 3 ], [ 146, 9 ], [ 122, 15 ], [ 116, 21 ], [ 156, 24 ], [ 161, 26 ], [ 147, 29 ], [ 134, 31 ], [ 123, 34 ], [ 140, 36 ], [ 156, 39 ], [ 128, 42 ], [ 141, 48 ], [ 159, 48 ], [ 120, 48 ], [ 126, 48 ], [ 137, 51 ], [ 138, 55 ], [ 129, 55 ], [ 117, 55 ], [ 131, 58 ], [ 125, 62 ], [ 156, 65 ], [ 141, 69 ], [ 159, 69 ], [ 120, 69 ], [ 126, 69 ], [ 113, 72 ], [ 114, 76 ], [ 162, 76 ], [ 152, 79 ], [ 119, 83 ], [ 147, 86 ], [ 141, 90 ], [ 159, 90 ], [ 120, 90 ], [ 126, 90 ], [ 143, 93 ], [ 144, 97 ], [ 135, 97 ], [ 149, 100 ], [ 158, 104 ], [ 123, 107 ], [ 150, 111 ], [ 153, 111 ], [ 132, 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 ] ]
[ "from collections import deque\n\nsa = deque(input())\nsb = deque(input())\nsc = deque(input())\n\na = len(sa)\nb = len(sb)\nc = len(sc)\n\n\ns = sa.popleft()\na -= 1\nwhile True:\n if s == \"a\":\n a -= 1\n if a == -1:\n ans = \"A\"\n break\n else:\n s = sa.popleft()\n\n elif s == \"b\":\n b -= 1\n if b == -1:\n ans = \"B\"\n break\n else:\n s = sb.popleft()\n\n elif s == \"c\":\n c -= 1\n if c == -1:\n ans = \"C\"\n break\n else:\n s = sc.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", "a = len(sa)", "a", "len(sa)", "len", "sa", "b = len(sb)", "b", "len(sb)", "len", "sb", "c = len(sc)", "c", "len(sc)", "len", "sc", "s = sa.popleft()", "s", "sa.popleft()", "sa.popleft", "sa", "popleft", "a -= 1", "a", "1", "while True:\n if s == \"a\":\n a -= 1\n if a == -1:\n ans = \"A\"\n break\n else:\n s = sa.popleft()\n\n elif s == \"b\":\n b -= 1\n if b == -1:\n ans = \"B\"\n break\n else:\n s = sb.popleft()\n\n elif s == \"c\":\n c -= 1\n if c == -1:\n ans = \"C\"\n break\n else:\n s = sc.popleft()", "True", "if s == \"a\":\n a -= 1\n if a == -1:\n ans = \"A\"\n break\n else:\n s = sa.popleft()\n\n elif s == \"b\":\n b -= 1\n if b == -1:\n ans = \"B\"\n break\n else:\n s = sb.popleft()\n\n elif s == \"c\":\n c -= 1\n if c == -1:\n ans = \"C\"\n break\n else:\n s = sc.popleft()", "s == \"a\"", "s", "\"a\"", "a -= 1", "a", "1", "if a == -1:\n ans = \"A\"\n break\n else:\n s = sa.popleft()\n\n ", "a == -1", "a", "-1", "ans = \"A\"", "ans", "\"A\"", "break", "s = sa.popleft()", "s", "sa.popleft()", "sa.popleft", "sa", "popleft", "elif s == \"b\":\n b -= 1\n if b == -1:\n ans = \"B\"\n break\n else:\n s = sb.popleft()\n\n ", "s == \"b\"", "s", "\"b\"", "b -= 1", "b", "1", "if b == -1:\n ans = \"B\"\n break\n else:\n s = sb.popleft()\n\n ", "b == -1", "b", "-1", "ans = \"B\"", "ans", "\"B\"", "break", "s = sb.popleft()", "s", "sb.popleft()", "sb.popleft", "sb", "popleft", "elif s == \"c\":\n c -= 1\n if c == -1:\n ans = \"C\"\n break\n else:\n s = sc.popleft()", "s == \"c\"", "s", "\"c\"", "c -= 1", "c", "1", "if c == -1:\n ans = \"C\"\n break\n else:\n s = sc.popleft()", "c == -1", "c", "-1", "ans = \"C\"", "ans", "\"C\"", "break", "s = sc.popleft()", "s", "sc.popleft()", "sc.popleft", "sc", "popleft", "print(ans)", "print", "ans", "b -= 1", "1", "b", "a = len(sa)", "len(sa)", "a", "s = sb.popleft()", "sb.popleft()", "s", "sc = deque(input())", "deque(input())", "sc", "s = sa.popleft()", "sa.popleft()", "s", "a -= 1", "1", "a", "ans = \"A\"", "\"A\"", "ans", "c = len(sc)", "len(sc)", "c", "a -= 1", "1", "a", "s = sa.popleft()", "sa.popleft()", "s", "c -= 1", "1", "c", "sb = deque(input())", "deque(input())", "sb", "ans = \"C\"", "\"C\"", "ans", "ans = \"B\"", "\"B\"", "ans", "sa = deque(input())", "deque(input())", "sa", "s = sc.popleft()", "sc.popleft()", "s", "b = len(sb)", "len(sb)", "b" ]
from collections import deque sa = deque(input()) sb = deque(input()) sc = deque(input()) a = len(sa) b = len(sb) c = len(sc) s = sa.popleft() a -= 1 while True: if s == "a": a -= 1 if a == -1: ans = "A" break else: s = sa.popleft() elif s == "b": b -= 1 if b == -1: ans = "B" break else: s = sb.popleft() elif s == "c": c -= 1 if c == -1: ans = "C" break else: s = sc.popleft() print(ans)
[ 7, 15, 13, 0, 13, 4, 13, 4, 13, 0, 13, 4, 13, 4, 13, 0, 13, 4, 13, 4, 13, 12, 13, 14, 2, 4, 13, 13, 17, 4, 13, 13, 4, 18, 13, 13, 0, 13, 4, 18, 13, 13, 17, 14, 2, 13, 17, 4, 13, 13, 17, 14, 2, 13, 17, 4, 13, 13, 17, 14, 2, 13, 17, 4, 13, 13, 17, 23, 13, 23, 13, 4, 13, 13, 17, 10, 12, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13 ]
[ [ 79, 4 ], [ 82, 10 ], [ 85, 16 ], [ 68, 27 ], [ 70, 31 ], [ 38, 37 ], [ 68, 40 ], [ 37, 45 ], [ 80, 49 ], [ 37, 53 ], [ 83, 57 ], [ 37, 61 ], [ 86, 65 ], [ 68, 68 ], [ 70, 70 ], [ 77, 72 ], [ 80, 73 ], [ 79, 80 ], [ 82, 83 ], [ 85, 86 ] ]
[ "import sys\nsa = list(input())\nsb = list(input())\nsc = list(input())\n\ndef turn(s,n):\n if len(s)==0:\n print(n)\n sys.exit()\n tmp = s.pop(0)\n if tmp == \"a\":\n turn(sa,\"A\")\n elif tmp == \"b\":\n turn(sb,\"B\")\n elif tmp == \"c\":\n turn(sc,\"C\")\n \nturn(sa,\"A\")", "import sys", "sys", "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", "def turn(s,n):\n if len(s)==0:\n print(n)\n sys.exit()\n tmp = s.pop(0)\n if tmp == \"a\":\n turn(sa,\"A\")\n elif tmp == \"b\":\n turn(sb,\"B\")\n elif tmp == \"c\":\n turn(sc,\"C\")\n ", "turn", "if len(s)==0:\n print(n)\n sys.exit()\n ", "len(s)==0", "len(s)", "len", "s", "0", "print(n)", "print", "n", "sys.exit()", "sys.exit", "sys", "exit", "tmp = s.pop(0)", "tmp", "s.pop(0)", "s.pop", "s", "pop", "0", "if tmp == \"a\":\n turn(sa,\"A\")\n elif tmp == \"b\":\n turn(sb,\"B\")\n elif tmp == \"c\":\n turn(sc,\"C\")\n ", "tmp == \"a\"", "tmp", "\"a\"", "turn(sa,\"A\")", "turn", "sa", "\"A\"", "elif tmp == \"b\":\n turn(sb,\"B\")\n ", "tmp == \"b\"", "tmp", "\"b\"", "turn(sb,\"B\")", "turn", "sb", "\"B\"", "elif tmp == \"c\":\n turn(sc,\"C\")\n ", "tmp == \"c\"", "tmp", "\"c\"", "turn(sc,\"C\")", "turn", "sc", "\"C\"", "s", "s", "n", "n", "turn(sa,\"A\")", "turn", "sa", "\"A\"", "def turn(s,n):\n if len(s)==0:\n print(n)\n sys.exit()\n tmp = s.pop(0)\n if tmp == \"a\":\n turn(sa,\"A\")\n elif tmp == \"b\":\n turn(sb,\"B\")\n elif tmp == \"c\":\n turn(sc,\"C\")\n ", "def turn(s,n):\n if len(s)==0:\n print(n)\n sys.exit()\n tmp = s.pop(0)\n if tmp == \"a\":\n turn(sa,\"A\")\n elif tmp == \"b\":\n turn(sb,\"B\")\n elif tmp == \"c\":\n turn(sc,\"C\")\n ", "turn", "sa = list(input())", "list(input())", "sa", "sb = list(input())", "list(input())", "sb", "sc = list(input())", "list(input())", "sc" ]
import sys sa = list(input()) sb = list(input()) sc = list(input()) def turn(s,n): if len(s)==0: print(n) sys.exit() tmp = s.pop(0) if tmp == "a": turn(sa,"A") elif tmp == "b": turn(sb,"B") elif tmp == "c": turn(sc,"C") turn(sa,"A")
[ 7, 15, 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, 17, 42, 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, 4, 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 ]
[ [ 100, 3 ], [ 88, 9 ], [ 103, 15 ], [ 97, 21 ], [ 101, 24 ], [ 91, 26 ], [ 89, 29 ], [ 106, 31 ], [ 104, 34 ], [ 94, 36 ], [ 95, 42 ], [ 113, 42 ], [ 116, 42 ], [ 110, 42 ], [ 109, 47 ], [ 98, 50 ], [ 101, 50 ], [ 95, 59 ], [ 113, 59 ], [ 116, 59 ], [ 110, 59 ], [ 115, 64 ], [ 92, 67 ], [ 89, 67 ], [ 112, 77 ], [ 107, 80 ], [ 104, 80 ], [ 88, 89 ], [ 91, 92 ], [ 94, 95 ], [ 97, 98 ], [ 100, 101 ], [ 103, 104 ], [ 106, 107 ], [ 109, 110 ], [ 112, 113 ], [ 115, 116 ] ]
[ "from collections import deque\na = list(input())\nb = list(input())\nc = list(input())\n\na = deque(a)\nb = deque(b)\nc = deque(c)\n\nx = 'a'\nwhile True:\n if x == 'a':\n if a:\n x = a.popleft()\n else:\n print('A')\n exit()\n elif x == 'b':\n if b:\n x = b.popleft()\n else:\n print('B')\n exit()\n else:\n if c:\n x = c.popleft()\n else:\n print('C')\n exit()", "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", "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'", "x", "'a'", "while True:\n if x == 'a':\n if a:\n x = a.popleft()\n else:\n print('A')\n exit()\n elif x == 'b':\n if b:\n x = b.popleft()\n else:\n print('B')\n exit()\n else:\n if c:\n x = c.popleft()\n else:\n print('C')\n exit()", "True", "if x == 'a':\n if a:\n x = a.popleft()\n else:\n print('A')\n exit()\n elif x == 'b':\n if b:\n x = b.popleft()\n else:\n print('B')\n exit()\n else:\n if c:\n x = c.popleft()\n else:\n print('C')\n exit()", "x == 'a'", "x", "'a'", "if a:\n x = a.popleft()\n else:\n print('A')\n exit()\n ", "a", "x = a.popleft()", "x", "a.popleft()", "a.popleft", "a", "popleft", "print('A')", "print", "'A'", "exit()", "exit", "elif x == 'b':\n if b:\n x = b.popleft()\n else:\n print('B')\n exit()\n ", "x == 'b'", "x", "'b'", "if b:\n x = b.popleft()\n else:\n print('B')\n exit()\n ", "b", "x = b.popleft()", "x", "b.popleft()", "b.popleft", "b", "popleft", "print('B')", "print", "'B'", "exit()", "exit", "if c:\n x = c.popleft()\n else:\n print('C')\n exit()", "c", "x = c.popleft()", "x", "c.popleft()", "c.popleft", "c", "popleft", "print('C')", "print", "'C'", "exit()", "exit", "b = list(input())", "list(input())", "b", "b = deque(b)", "deque(b)", "b", "x = 'a'", "'a'", "x", "a = deque(a)", "deque(a)", "a", "a = list(input())", "list(input())", "a", "c = list(input())", "list(input())", "c", "c = deque(c)", "deque(c)", "c", "x = a.popleft()", "a.popleft()", "x", "x = c.popleft()", "c.popleft()", "x", "x = b.popleft()", "b.popleft()", "x" ]
from collections import deque a = list(input()) b = list(input()) c = list(input()) a = deque(a) b = deque(b) c = deque(c) x = 'a' while True: if x == 'a': if a: x = a.popleft() else: print('A') exit() elif x == 'b': if b: x = b.popleft() else: print('B') exit() else: if c: x = c.popleft() else: print('C') exit()
[ 7, 0, 13, 21, 22, 17, 4, 13, 22, 17, 4, 13, 22, 17, 4, 13, 0, 13, 17, 42, 40, 18, 13, 13, 17, 0, 13, 18, 18, 13, 13, 17, 0, 18, 13, 13, 18, 18, 13, 13, 39, 17, 0, 13, 4, 18, 13, 13, 4, 13, 13, 10, 4, 13, 10, 21, 13, 10, 18, 13, 10, 17, 13 ]
[ [ 55, 2 ], [ 61, 17 ], [ 33, 21 ], [ 56, 22 ], [ 62, 23 ], [ 53, 23 ], [ 58, 26 ], [ 33, 28 ], [ 56, 29 ], [ 62, 30 ], [ 53, 30 ], [ 36, 33 ], [ 56, 34 ], [ 62, 35 ], [ 53, 35 ], [ 33, 37 ], [ 56, 38 ], [ 62, 39 ], [ 53, 39 ], [ 52, 43 ], [ 59, 46 ], [ 53, 50 ], [ 62, 50 ], [ 52, 53 ], [ 55, 56 ], [ 58, 59 ], [ 61, 62 ] ]
[ "S = {'A': input(), 'B': input(), 'C': input()}\n\nturn = 'A'\n\nwhile S[turn] != '':\n next = S[turn][0]\n S[turn] = S[turn][1:]\n turn = next.upper()\n\nprint(turn)", "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", "turn = 'A'", "turn", "'A'", "while S[turn] != '':\n next = S[turn][0]\n S[turn] = S[turn][1:]\n turn = next.upper()", "S[turn] != ''", "S[turn]", "S", "turn", "''", "next = S[turn][0]", "next", "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.upper()", "turn", "next.upper()", "next.upper", "next", "upper", "print(turn)", "print", "turn", "turn = next.upper()", "next.upper()", "turn", "S = {'A': input(), 'B': input(), 'C': input()}", "{'A': input(), 'B': input(), 'C': input()}", "S", "next = S[turn][0]", "S[turn][0]", "next", "turn = 'A'", "'A'", "turn" ]
S = {'A': input(), 'B': input(), 'C': input()} turn = 'A' while S[turn] != '': next = S[turn][0] S[turn] = S[turn][1:] turn = next.upper() print(turn)
[ 7, 41, 28, 13, 4, 13, 17, 4, 4, 13, 4, 13, 0, 13, 13, 13, 13, 0, 13, 17, 42, 17, 38, 5, 4, 13, 4, 18, 18, 13, 2, 4, 13, 13, 17, 13, 3, 0, 13, 18, 13, 2, 4, 13, 13, 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, 14, 2, 13, 17, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 10, 18, 13, 10, 13, 13, 10, 13, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 13, 13, 10, 18, 13, 10, 17, 13, 10, 18, 13 ]
[ [ 4, 3 ], [ 113, 13 ], [ 113, 15 ], [ 113, 16 ], [ 119, 18 ], [ 120, 29 ], [ 111, 29 ], [ 93, 29 ], [ 117, 29 ], [ 120, 33 ], [ 111, 33 ], [ 93, 33 ], [ 117, 33 ], [ 104, 38 ], [ 120, 40 ], [ 111, 40 ], [ 93, 40 ], [ 117, 40 ], [ 120, 44 ], [ 111, 44 ], [ 93, 44 ], [ 117, 44 ], [ 105, 48 ], [ 116, 51 ], [ 96, 53 ], [ 123, 53 ], [ 122, 56 ], [ 96, 58 ], [ 123, 58 ], [ 105, 63 ], [ 92, 66 ], [ 114, 68 ], [ 108, 68 ], [ 107, 71 ], [ 114, 73 ], [ 108, 73 ], [ 105, 78 ], [ 110, 81 ], [ 99, 83 ], [ 102, 83 ], [ 101, 86 ], [ 99, 88 ], [ 102, 88 ], [ 92, 93 ], [ 113, 96 ], [ 113, 99 ], [ 101, 102 ], [ 104, 105 ], [ 107, 108 ], [ 110, 111 ], [ 113, 114 ], [ 116, 117 ], [ 119, 120 ], [ 122, 123 ] ]
[ "a,b,c = [str(input()) for i in range(3)]\ncurrent = 'a'\nwhile True:\n try:\n cur = current[len(current)-1]\n if cur == 'a':\n current+=a[0]\n a=a[1:]\n elif cur == 'b':\n current+=b[0]\n b=b[1:]\n elif cur == 'c':\n current+=c[0]\n c=c[1:]\n except:\n print(current[len(current)-1].upper())\n break", "str(input()) for i in range(3)", "for i in range(3)", "i", "range(3)", "range", "3", "for i in range(3)", "str(input())", "str", "input()", "input", "a,b,c = [str(input()) for i in range(3)]", "a", "[str(input()) for i in range(3)]", "b", "c", "current = 'a'", "current", "'a'", "while True:\n try:\n cur = current[len(current)-1]\n if cur == 'a':\n current+=a[0]\n a=a[1:]\n elif cur == 'b':\n current+=b[0]\n b=b[1:]\n elif cur == 'c':\n current+=c[0]\n c=c[1:]\n except:\n print(current[len(current)-1].upper())\n break", "True", "try:\n cur = current[len(current)-1]\n if cur == 'a':\n current+=a[0]\n a=a[1:]\n elif cur == 'b':\n current+=b[0]\n b=b[1:]\n elif cur == 'c':\n current+=c[0]\n c=c[1:]\n except:\n print(current[len(current)-1].upper())\n break", "except:\n print(current[len(current)-1].upper())\n break", "print(current[len(current)-1].upper())", "print", "current[len(current)-1].upper()", "[len(current)-1].upper", "[len(current)-1]", "current", "len(current)-1", "len(current)", "len", "current", "1", "upper", "break", "cur = current[len(current)-1]", "cur", "current[len(current)-1]", "current", "len(current)-1", "len(current)", "len", "current", "1", "if cur == 'a':\n current+=a[0]\n a=a[1:]\n elif cur == 'b':\n current+=b[0]\n b=b[1:]\n elif cur == 'c':\n current+=c[0]\n c=c[1:]\n ", "cur == 'a'", "cur", "'a'", "current+=a[0]", "current", "a[0]", "a", "0", "a=a[1:]", "a", "a[1:]", "a", "1:", "1", "elif cur == 'b':\n current+=b[0]\n b=b[1:]\n ", "cur == 'b'", "cur", "'b'", "current+=b[0]", "current", "b[0]", "b", "0", "b=b[1:]", "b", "b[1:]", "b", "1:", "1", "elif cur == 'c':\n current+=c[0]\n c=c[1:]\n ", "cur == 'c'", "cur", "'c'", "current+=c[0]", "current", "c[0]", "c", "0", "c=c[1:]", "c", "c[1:]", "c", "1:", "1", "current+=b[0]", "b[0]", "current", "a,b,c = [str(input()) for i in range(3)]", "[str(input()) for i in range(3)]", "a", "c = [str(input()) for i in range(3)]", "[str(input()) for i in range(3)]", "c", "c=c[1:]", "c[1:]", "c", "cur = current[len(current)-1]", "current[len(current)-1]", "cur", "b=b[1:]", "b[1:]", "b", "current+=c[0]", "c[0]", "current", "b,c = [str(input()) for i in range(3)]", "[str(input()) for i in range(3)]", "b", "current+=a[0]", "a[0]", "current", "current = 'a'", "'a'", "current", "a=a[1:]", "a[1:]", "a" ]
a,b,c = [str(input()) for i in range(3)] current = 'a' while True: try: cur = current[len(current)-1] if cur == 'a': current+=a[0] a=a[1:] elif cur == 'b': current+=b[0] b=b[1:] elif cur == 'c': current+=c[0] c=c[1:] except: print(current[len(current)-1].upper()) break
[ 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, 0, 13, 17, 42, 2, 13, 17, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 0, 13, 17, 0, 13, 18, 13, 17, 24, 18, 13, 17, 0, 13, 13, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 0, 13, 17, 0, 13, 18, 13, 17, 24, 18, 13, 17, 0, 13, 13, 14, 2, 4, 13, 13, 17, 0, 13, 17, 0, 13, 18, 13, 17, 24, 18, 13, 17, 0, 13, 13, 4, 13, 13, 10, 13, 13, 10, 4, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 13, 13, 10, 13, 13, 10, 4, 13, 10, 18, 13, 10, 18, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 4, 13, 10, 18, 13, 10, 4, 13 ]
[ [ 155, 2 ], [ 161, 6 ], [ 156, 9 ], [ 152, 11 ], [ 134, 15 ], [ 153, 18 ], [ 116, 20 ], [ 122, 24 ], [ 117, 27 ], [ 143, 29 ], [ 149, 32 ], [ 144, 36 ], [ 126, 36 ], [ 147, 36 ], [ 120, 36 ], [ 150, 40 ], [ 114, 40 ], [ 132, 40 ], [ 129, 40 ], [ 162, 46 ], [ 156, 46 ], [ 119, 49 ], [ 137, 52 ], [ 162, 54 ], [ 156, 54 ], [ 162, 58 ], [ 156, 58 ], [ 128, 61 ], [ 138, 62 ], [ 141, 62 ], [ 159, 62 ], [ 150, 65 ], [ 114, 65 ], [ 132, 65 ], [ 129, 65 ], [ 135, 71 ], [ 153, 71 ], [ 146, 74 ], [ 158, 77 ], [ 135, 79 ], [ 153, 79 ], [ 135, 83 ], [ 153, 83 ], [ 131, 86 ], [ 159, 87 ], [ 141, 87 ], [ 138, 87 ], [ 123, 92 ], [ 117, 92 ], [ 125, 95 ], [ 140, 98 ], [ 123, 100 ], [ 117, 100 ], [ 123, 104 ], [ 117, 104 ], [ 113, 107 ], [ 141, 108 ], [ 159, 108 ], [ 138, 108 ], [ 126, 111 ], [ 147, 111 ], [ 120, 111 ], [ 144, 111 ], [ 141, 113 ], [ 159, 113 ], [ 138, 113 ], [ 113, 114 ], [ 116, 117 ], [ 119, 120 ], [ 122, 123 ], [ 125, 126 ], [ 138, 128 ], [ 141, 128 ], [ 159, 128 ], [ 128, 129 ], [ 159, 131 ], [ 141, 131 ], [ 138, 131 ], [ 131, 132 ], [ 134, 135 ], [ 137, 138 ], [ 140, 141 ], [ 143, 144 ], [ 146, 147 ], [ 149, 150 ], [ 152, 153 ], [ 155, 156 ], [ 158, 159 ], [ 161, 162 ] ]
[ "a_line = input()\na_line = list(a_line)\n#print(a_line)\nb_line = input()\nb_line = list(b_line)\n\nc_line = input()\nc_line = list(c_line)\n\nend = 0\nturn = \"a\"\n\nwhile(end == 0):\n if turn==\"a\":\n if len(a_line) == 0:\n end = \"A\"\n else:\n temp = a_line[0]\n del a_line[0]\n #print(a_line)\n turn = temp\n \n \n elif turn==\"b\":\n if len(b_line) == 0:\n end = \"B\"\n else:\n temp = b_line[0]\n del b_line[0]\n #print(b_line)\n turn = temp \n \n else:\n if len(c_line) == 0:\n end = \"C\"\n else:\n temp = c_line[0]\n del c_line[0]\n #print(b_line)\n turn = temp \n \n \nprint(end) ", "a_line = input()", "a_line", "input()", "input", "a_line = list(a_line)", "a_line", "list(a_line)", "list", "a_line", "b_line = input()", "b_line", "input()", "input", "b_line = list(b_line)", "b_line", "list(b_line)", "list", "b_line", "c_line = input()", "c_line", "input()", "input", "c_line = list(c_line)", "c_line", "list(c_line)", "list", "c_line", "end = 0", "end", "0", "turn = \"a\"", "turn", "\"a\"", "while(end == 0):\n if turn==\"a\":\n if len(a_line) == 0:\n end = \"A\"\n else:\n temp = a_line[0]\n del a_line[0]\n #print(a_line)\n turn = temp\n \n \n elif turn==\"b\":\n if len(b_line) == 0:\n end = \"B\"\n else:\n temp = b_line[0]\n del b_line[0]\n #print(b_line)\n turn = temp \n \n else:\n if len(c_line) == 0:\n end = \"C\"\n else:\n temp = c_line[0]\n del c_line[0]\n #print(b_line)\n turn = temp \n \n ", "end == 0", "end", "0", "if turn==\"a\":\n if len(a_line) == 0:\n end = \"A\"\n else:\n temp = a_line[0]\n del a_line[0]\n #print(a_line)\n turn = temp\n \n \n elif turn==\"b\":\n if len(b_line) == 0:\n end = \"B\"\n else:\n temp = b_line[0]\n del b_line[0]\n #print(b_line)\n turn = temp \n \n else:\n if len(c_line) == 0:\n end = \"C\"\n else:\n temp = c_line[0]\n del c_line[0]\n #print(b_line)\n turn = temp \n \n ", "turn==\"a\"", "turn", "\"a\"", "if len(a_line) == 0:\n end = \"A\"\n else:\n temp = a_line[0]\n del a_line[0]\n #print(a_line)\n turn = temp\n \n \n ", "len(a_line) == 0", "len(a_line)", "len", "a_line", "0", "end = \"A\"", "end", "\"A\"", "temp = a_line[0]", "temp", "a_line[0]", "a_line", "0", "del a_line[0]", "a_line[0]", "a_line", "0", "turn = temp", "turn", "temp", "elif turn==\"b\":\n if len(b_line) == 0:\n end = \"B\"\n else:\n temp = b_line[0]\n del b_line[0]\n #print(b_line)\n turn = temp \n \n ", "turn==\"b\"", "turn", "\"b\"", "if len(b_line) == 0:\n end = \"B\"\n else:\n temp = b_line[0]\n del b_line[0]\n #print(b_line)\n turn = temp \n \n ", "len(b_line) == 0", "len(b_line)", "len", "b_line", "0", "end = \"B\"", "end", "\"B\"", "temp = b_line[0]", "temp", "b_line[0]", "b_line", "0", "del b_line[0]", "b_line[0]", "b_line", "0", "turn = temp", "turn", "temp", "if len(c_line) == 0:\n end = \"C\"\n else:\n temp = c_line[0]\n del c_line[0]\n #print(b_line)\n turn = temp \n \n ", "len(c_line) == 0", "len(c_line)", "len", "c_line", "0", "end = \"C\"", "end", "\"C\"", "temp = c_line[0]", "temp", "c_line[0]", "c_line", "0", "del c_line[0]", "c_line[0]", "c_line", "0", "turn = temp", "turn", "temp", "print(end)", "print", "end", "turn = temp", "temp", "turn", "c_line = input()", "input()", "c_line", "end = \"A\"", "\"A\"", "end", "c_line = list(c_line)", "list(c_line)", "c_line", "end = \"C\"", "\"C\"", "end", "turn = temp", "temp", "turn", "turn = temp", "temp", "turn", "b_line = list(b_line)", "list(b_line)", "b_line", "temp = a_line[0]", "a_line[0]", "temp", "temp = c_line[0]", "c_line[0]", "temp", "end = 0", "0", "end", "end = \"B\"", "\"B\"", "end", "turn = \"a\"", "\"a\"", "turn", "b_line = input()", "input()", "b_line", "a_line = input()", "input()", "a_line", "temp = b_line[0]", "b_line[0]", "temp", "a_line = list(a_line)", "list(a_line)", "a_line" ]
a_line = input() a_line = list(a_line) #print(a_line) b_line = input() b_line = list(b_line) c_line = input() c_line = list(c_line) end = 0 turn = "a" while(end == 0): if turn=="a": if len(a_line) == 0: end = "A" else: temp = a_line[0] del a_line[0] #print(a_line) turn = temp elif turn=="b": if len(b_line) == 0: end = "B" else: temp = b_line[0] del b_line[0] #print(b_line) turn = temp else: if len(c_line) == 0: end = "C" else: temp = c_line[0] del c_line[0] #print(b_line) turn = temp print(end)
[ 7, 15, 15, 13, 15, 13, 12, 13, 29, 4, 13, 4, 18, 4, 18, 13, 13, 13, 12, 13, 29, 4, 13, 4, 18, 13, 13, 12, 13, 29, 4, 13, 4, 13, 13, 4, 18, 4, 18, 13, 13, 13, 12, 13, 29, 4, 13, 13, 4, 18, 4, 18, 13, 13, 13, 12, 13, 4, 18, 13, 13, 2, 4, 13, 13, 17, 23, 13, 12, 13, 0, 13, 2, 39, 17, 2, 13, 17, 0, 13, 39, 28, 13, 4, 13, 17, 2, 13, 17, 14, 18, 13, 13, 28, 13, 4, 13, 2, 13, 13, 2, 13, 17, 13, 0, 18, 13, 13, 17, 28, 13, 4, 13, 17, 2, 13, 17, 14, 18, 13, 13, 4, 18, 13, 13, 13, 29, 13, 23, 13, 12, 13, 0, 13, 2, 4, 13, 2, 13, 17, 17, 0, 13, 4, 13, 13, 0, 13, 2, 2, 13, 13, 17, 0, 13, 2, 39, 17, 2, 13, 17, 28, 13, 4, 13, 4, 13, 13, 0, 13, 2, 2, 13, 18, 13, 13, 18, 13, 13, 14, 2, 13, 13, 0, 13, 18, 13, 13, 14, 2, 13, 18, 13, 13, 0, 13, 18, 13, 13, 28, 13, 4, 13, 13, 2, 13, 17, 18, 13, 13, 0, 18, 13, 2, 13, 13, 17, 28, 13, 4, 13, 13, 2, 13, 17, 14, 40, 18, 13, 2, 13, 13, 14, 40, 13, 17, 4, 13, 13, 23, 13, 23, 13, 12, 13, 42, 13, 0, 13, 2, 13, 13, 0, 13, 13, 13, 13, 29, 13, 23, 13, 23, 13, 12, 13, 0, 13, 17, 42, 13, 14, 2, 13, 17, 0, 13, 2, 13, 13, 0, 13, 13, 0, 13, 2, 13, 17, 29, 13, 23, 13, 23, 13, 12, 13, 0, 13, 4, 13, 4, 13, 0, 13, 4, 13, 4, 13, 0, 13, 4, 13, 4, 13, 0, 13, 13, 42, 17, 14, 2, 4, 13, 13, 17, 4, 13, 13, 3, 0, 13, 4, 18, 13, 13, 17, 14, 2, 13, 17, 0, 13, 13, 0, 13, 17, 14, 2, 13, 17, 0, 13, 13, 0, 13, 17, 0, 13, 13, 0, 13, 17, 28, 13, 4, 13, 17, 4, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13 ]
[ [ 67, 64 ], [ 67, 67 ], [ 72, 71 ], [ 129, 76 ], [ 80, 79 ], [ 83, 82 ], [ 129, 87 ], [ 71, 91 ], [ 82, 92 ], [ 95, 94 ], [ 82, 98 ], [ 82, 99 ], [ 129, 101 ], [ 82, 103 ], [ 108, 105 ], [ 71, 106 ], [ 94, 107 ], [ 111, 110 ], [ 129, 115 ], [ 71, 119 ], [ 110, 120 ], [ 79, 123 ], [ 110, 125 ], [ 79, 127 ], [ 129, 129 ], [ 134, 133 ], [ 242, 138 ], [ 143, 142 ], [ 388, 144 ], [ 133, 145 ], [ 148, 147 ], [ 242, 150 ], [ 240, 151 ], [ 155, 154 ], [ 147, 159 ], [ 163, 162 ], [ 142, 167 ], [ 170, 169 ], [ 240, 172 ], [ 142, 174 ], [ 162, 175 ], [ 142, 177 ], [ 162, 178 ], [ 169, 181 ], [ 195, 181 ], [ 184, 181 ], [ 240, 182 ], [ 185, 184 ], [ 142, 186 ], [ 162, 187 ], [ 184, 190 ], [ 169, 190 ], [ 195, 190 ], [ 142, 192 ], [ 162, 193 ], [ 196, 195 ], [ 142, 197 ], [ 162, 198 ], [ 201, 200 ], [ 195, 203 ], [ 184, 203 ], [ 169, 203 ], [ 242, 205 ], [ 142, 208 ], [ 162, 209 ], [ 216, 211 ], [ 154, 212 ], [ 200, 214 ], [ 240, 215 ], [ 219, 218 ], [ 240, 221 ], [ 242, 223 ], [ 154, 228 ], [ 218, 230 ], [ 240, 231 ], [ 218, 234 ], [ 218, 238 ], [ 240, 240 ], [ 242, 242 ], [ 249, 248 ], [ 260, 250 ], [ 255, 250 ], [ 248, 250 ], [ 262, 251 ], [ 253, 251 ], [ 254, 253 ], [ 248, 254 ], [ 260, 254 ], [ 255, 254 ], [ 256, 255 ], [ 253, 256 ], [ 262, 256 ], [ 255, 258 ], [ 248, 258 ], [ 260, 258 ], [ 260, 260 ], [ 262, 262 ], [ 267, 266 ], [ 292, 272 ], [ 283, 272 ], [ 276, 275 ], [ 266, 277 ], [ 275, 277 ], [ 290, 278 ], [ 280, 278 ], [ 281, 280 ], [ 280, 281 ], [ 290, 281 ], [ 284, 283 ], [ 292, 285 ], [ 283, 285 ], [ 275, 288 ], [ 266, 288 ], [ 290, 290 ], [ 292, 292 ], [ 297, 296 ], [ 303, 302 ], [ 309, 308 ], [ 315, 314 ], [ 296, 315 ], [ 314, 322 ], [ 356, 322 ], [ 350, 322 ], [ 340, 322 ], [ 359, 326 ], [ 353, 326 ], [ 343, 326 ], [ 330, 329 ], [ 314, 332 ], [ 356, 332 ], [ 350, 332 ], [ 340, 332 ], [ 329, 337 ], [ 341, 340 ], [ 296, 341 ], [ 344, 343 ], [ 329, 347 ], [ 351, 350 ], [ 302, 351 ], [ 354, 353 ], [ 357, 356 ], [ 308, 357 ], [ 360, 359 ], [ 363, 362 ], [ 373, 367 ] ]
[ "from sys import stdin,stdout\n\nimport bisect\n\nimport math\n\ndef st():\n return list(stdin.readline().strip())\n\ndef inp():\n return int(stdin.readline())\n\ndef li():\n return list(map(int,stdin.readline().split()))\n\ndef mp():\n return map(int,stdin.readline().split())\n\ndef pr(n):\n stdout.write(str(n)+\"\\n\")\n\ndef soe(limit):\n l=[1]*(limit+1)\n prime=[]\n for i in range(2,limit+1):\n if l[i]:\n for j in range(i*i,limit+1,i):\n l[j]=0\n\n for i in range(2,limit+1):\n if l[i]:\n prime.append(i)\n return prime\n\ndef segsoe(low,high):\n limit=int(high**0.5)+1\n prime=soe(limit)\n n=high-low+1\n l=[0]*(n+1)\n for i in range(len(prime)):\n lowlimit=(low//prime[i])*prime[i]\n if lowlimit<low:\n lowlimit+=prime[i]\n if lowlimit==prime[i]:\n lowlimit+=prime[i]\n for j in range(lowlimit,high+1,prime[i]):\n l[j-low]=1\n for i in range(low,high+1):\n if not l[i-low]:\n if i!=1:\n print(i)\n \ndef gcd(a,b):\n while b:\n a=a%b\n b,a=a,b\n return a\n\ndef power(a,n):\n r=1\n while n:\n if n&1:\n r=(r*a)\n a*=a\n n=n>>1\n return r\n \ndef solve():\n a=list(input())\n b=list(input())\n c=list(input())\n s=a\n while True:\n if len(s)==0:\n print(ans)\n break\n \n x=s.pop(0)\n if x=='a':\n s=a\n ans='A'\n elif x=='b':\n s=b\n ans='B'\n else:\n s=c\n ans='C'\n \n\n\nfor _ in range(1):\n solve()\n ", "from sys import stdin,stdout", "import bisect", "bisect", "import math", "math", "def st():\n return list(stdin.readline().strip())", "st", "return list(stdin.readline().strip())", "list(stdin.readline().strip())", "list", "stdin.readline().strip()", "stdin.readline().strip", "stdin.readline()", "stdin.readline", "stdin", "readline", "strip", "def inp():\n return int(stdin.readline())", "inp", "return int(stdin.readline())", "int(stdin.readline())", "int", "stdin.readline()", "stdin.readline", "stdin", "readline", "def li():\n return list(map(int,stdin.readline().split()))", "li", "return list(map(int,stdin.readline().split()))", "list(map(int,stdin.readline().split()))", "list", "map(int,stdin.readline().split())", "map", "int", "stdin.readline().split()", "stdin.readline().split", "stdin.readline()", "stdin.readline", "stdin", "readline", "split", "def mp():\n return map(int,stdin.readline().split())", "mp", "return map(int,stdin.readline().split())", "map(int,stdin.readline().split())", "map", "int", "stdin.readline().split()", "stdin.readline().split", "stdin.readline()", "stdin.readline", "stdin", "readline", "split", "def pr(n):\n stdout.write(str(n)+\"\\n\")", "pr", "stdout.write(str(n)+\"\\n\")", "stdout.write", "stdout", "write", "str(n)+\"\\n\"", "str(n)", "str", "n", "\"\\n\"", "n", "n", "def soe(limit):\n l=[1]*(limit+1)\n prime=[]\n for i in range(2,limit+1):\n if l[i]:\n for j in range(i*i,limit+1,i):\n l[j]=0\n\n for i in range(2,limit+1):\n if l[i]:\n prime.append(i)\n return prime", "soe", "l=[1]*(limit+1)", "l", "[1]*(limit+1)", "[1]", "1", "limit+1", "limit", "1", "prime=[]", "prime", "[]", "for i in range(2,limit+1):\n if l[i]:\n for j in range(i*i,limit+1,i):\n l[j]=0\n\n ", "i", "range(2,limit+1)", "range", "2", "limit+1", "limit", "1", "if l[i]:\n for j in range(i*i,limit+1,i):\n l[j]=0\n\n ", "l[i]", "l", "i", "for j in range(i*i,limit+1,i):\n l[j]=0\n\n ", "j", "range(i*i,limit+1,i)", "range", "i*i", "i", "i", "limit+1", "limit", "1", "i", "l[j]=0", "l[j]", "l", "j", "0", "for i in range(2,limit+1):\n if l[i]:\n prime.append(i)\n ", "i", "range(2,limit+1)", "range", "2", "limit+1", "limit", "1", "if l[i]:\n prime.append(i)\n ", "l[i]", "l", "i", "prime.append(i)", "prime.append", "prime", "append", "i", "return prime", "prime", "limit", "limit", "def segsoe(low,high):\n limit=int(high**0.5)+1\n prime=soe(limit)\n n=high-low+1\n l=[0]*(n+1)\n for i in range(len(prime)):\n lowlimit=(low//prime[i])*prime[i]\n if lowlimit<low:\n lowlimit+=prime[i]\n if lowlimit==prime[i]:\n lowlimit+=prime[i]\n for j in range(lowlimit,high+1,prime[i]):\n l[j-low]=1\n for i in range(low,high+1):\n if not l[i-low]:\n if i!=1:\n print(i)\n ", "segsoe", "limit=int(high**0.5)+1", "limit", "int(high**0.5)+1", "int(high**0.5)", "int", "high**0.5", "high", "0.5", "1", "prime=soe(limit)", "prime", "soe(limit)", "soe", "limit", "n=high-low+1", "n", "high-low+1", "high-low", "high", "low", "1", "l=[0]*(n+1)", "l", "[0]*(n+1)", "[0]", "0", "n+1", "n", "1", "for i in range(len(prime)):\n lowlimit=(low//prime[i])*prime[i]\n if lowlimit<low:\n lowlimit+=prime[i]\n if lowlimit==prime[i]:\n lowlimit+=prime[i]\n for j in range(lowlimit,high+1,prime[i]):\n l[j-low]=1\n ", "i", "range(len(prime))", "range", "len(prime)", "len", "prime", "lowlimit=(low//prime[i])*prime[i]", "lowlimit", "(low//prime[i])*prime[i]", "low//prime[i]", "low", "prime[i]", "prime", "i", "prime[i]", "prime", "i", "if lowlimit<low:\n lowlimit+=prime[i]\n ", "lowlimit<low", "lowlimit", "low", "lowlimit+=prime[i]", "lowlimit", "prime[i]", "prime", "i", "if lowlimit==prime[i]:\n lowlimit+=prime[i]\n ", "lowlimit==prime[i]", "lowlimit", "prime[i]", "prime", "i", "lowlimit+=prime[i]", "lowlimit", "prime[i]", "prime", "i", "for j in range(lowlimit,high+1,prime[i]):\n l[j-low]=1\n ", "j", "range(lowlimit,high+1,prime[i])", "range", "lowlimit", "high+1", "high", "1", "prime[i]", "prime", "i", "l[j-low]=1", "l[j-low]", "l", "j-low", "j", "low", "1", "for i in range(low,high+1):\n if not l[i-low]:\n if i!=1:\n print(i)\n ", "i", "range(low,high+1)", "range", "low", "high+1", "high", "1", "if not l[i-low]:\n if i!=1:\n print(i)\n ", "not l[i-low]", "l[i-low]", "l", "i-low", "i", "low", "if i!=1:\n print(i)\n ", "i!=1", "i", "1", "print(i)", "print", "i", "low", "low", "high", "high", "def gcd(a,b):\n while b:\n a=a%b\n b,a=a,b\n return a", "gcd", "while b:\n a=a%b\n b,a=a,b\n ", "b", "a=a%b", "a", "a%b", "a", "b", "b,a=a,b", "b", "a", "a", "b", "return a", "a", "a", "a", "b", "b", "def power(a,n):\n r=1\n while n:\n if n&1:\n r=(r*a)\n a*=a\n n=n>>1\n return r\n ", "power", "r=1", "r", "1", "while n:\n if n&1:\n r=(r*a)\n a*=a\n n=n>>1\n ", "n", "if n&1:\n r=(r*a)\n ", "n&1", "n", "1", "r=(r*a)", "r", "r*a", "r", "a", "a*=a", "a", "a", "n=n>>1", "n", "n>>1", "n", "1", "return r", "r", "a", "a", "n", "n", "def solve():\n a=list(input())\n b=list(input())\n c=list(input())\n s=a\n while True:\n if len(s)==0:\n print(ans)\n break\n \n x=s.pop(0)\n if x=='a':\n s=a\n ans='A'\n elif x=='b':\n s=b\n ans='B'\n else:\n s=c\n ans='C'\n ", "solve", "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", "s", "a", "while True:\n if len(s)==0:\n print(ans)\n break\n \n x=s.pop(0)\n if x=='a':\n s=a\n ans='A'\n elif x=='b':\n s=b\n ans='B'\n else:\n s=c\n ans='C'\n ", "True", "if len(s)==0:\n print(ans)\n break\n \n ", "len(s)==0", "len(s)", "len", "s", "0", "print(ans)", "print", "ans", "break", "x=s.pop(0)", "x", "s.pop(0)", "s.pop", "s", "pop", "0", "if x=='a':\n s=a\n ans='A'\n elif x=='b':\n s=b\n ans='B'\n else:\n s=c\n ans='C'\n ", "x=='a'", "x", "'a'", "s=a", "s", "a", "ans='A'", "ans", "'A'", "elif x=='b':\n s=b\n ans='B'\n ", "x=='b'", "x", "'b'", "s=b", "s", "b", "ans='B'", "ans", "'B'", "s=c", "s", "c", "ans='C'", "ans", "'C'", "for _ in range(1):\n solve()\n ", "_", "range(1)", "range", "1", "solve()", "solve", "def li():\n return list(map(int,stdin.readline().split()))", "def li():\n return list(map(int,stdin.readline().split()))", "li", "def solve():\n a=list(input())\n b=list(input())\n c=list(input())\n s=a\n while True:\n if len(s)==0:\n print(ans)\n break\n \n x=s.pop(0)\n if x=='a':\n s=a\n ans='A'\n elif x=='b':\n s=b\n ans='B'\n else:\n s=c\n ans='C'\n ", "def solve():\n a=list(input())\n b=list(input())\n c=list(input())\n s=a\n while True:\n if len(s)==0:\n print(ans)\n break\n \n x=s.pop(0)\n if x=='a':\n s=a\n ans='A'\n elif x=='b':\n s=b\n ans='B'\n else:\n s=c\n ans='C'\n ", "solve", "def gcd(a,b):\n while b:\n a=a%b\n b,a=a,b\n return a", "def gcd(a,b):\n while b:\n a=a%b\n b,a=a,b\n return a", "gcd", "def segsoe(low,high):\n limit=int(high**0.5)+1\n prime=soe(limit)\n n=high-low+1\n l=[0]*(n+1)\n for i in range(len(prime)):\n lowlimit=(low//prime[i])*prime[i]\n if lowlimit<low:\n lowlimit+=prime[i]\n if lowlimit==prime[i]:\n lowlimit+=prime[i]\n for j in range(lowlimit,high+1,prime[i]):\n l[j-low]=1\n for i in range(low,high+1):\n if not l[i-low]:\n if i!=1:\n print(i)\n ", "def segsoe(low,high):\n limit=int(high**0.5)+1\n prime=soe(limit)\n n=high-low+1\n l=[0]*(n+1)\n for i in range(len(prime)):\n lowlimit=(low//prime[i])*prime[i]\n if lowlimit<low:\n lowlimit+=prime[i]\n if lowlimit==prime[i]:\n lowlimit+=prime[i]\n for j in range(lowlimit,high+1,prime[i]):\n l[j-low]=1\n for i in range(low,high+1):\n if not l[i-low]:\n if i!=1:\n print(i)\n ", "segsoe", "def mp():\n return map(int,stdin.readline().split())", "def mp():\n return map(int,stdin.readline().split())", "mp", "def pr(n):\n stdout.write(str(n)+\"\\n\")", "def pr(n):\n stdout.write(str(n)+\"\\n\")", "pr", "def soe(limit):\n l=[1]*(limit+1)\n prime=[]\n for i in range(2,limit+1):\n if l[i]:\n for j in range(i*i,limit+1,i):\n l[j]=0\n\n for i in range(2,limit+1):\n if l[i]:\n prime.append(i)\n return prime", "def soe(limit):\n l=[1]*(limit+1)\n prime=[]\n for i in range(2,limit+1):\n if l[i]:\n for j in range(i*i,limit+1,i):\n l[j]=0\n\n for i in range(2,limit+1):\n if l[i]:\n prime.append(i)\n return prime", "soe", "def st():\n return list(stdin.readline().strip())", "def st():\n return list(stdin.readline().strip())", "st", "def inp():\n return int(stdin.readline())", "def inp():\n return int(stdin.readline())", "inp", "def power(a,n):\n r=1\n while n:\n if n&1:\n r=(r*a)\n a*=a\n n=n>>1\n return r\n ", "def power(a,n):\n r=1\n while n:\n if n&1:\n r=(r*a)\n a*=a\n n=n>>1\n return r\n ", "power" ]
from sys import stdin,stdout import bisect import math def st(): return list(stdin.readline().strip()) def inp(): return int(stdin.readline()) def li(): return list(map(int,stdin.readline().split())) def mp(): return map(int,stdin.readline().split()) def pr(n): stdout.write(str(n)+"\n") def soe(limit): l=[1]*(limit+1) prime=[] for i in range(2,limit+1): if l[i]: for j in range(i*i,limit+1,i): l[j]=0 for i in range(2,limit+1): if l[i]: prime.append(i) return prime def segsoe(low,high): limit=int(high**0.5)+1 prime=soe(limit) n=high-low+1 l=[0]*(n+1) for i in range(len(prime)): lowlimit=(low//prime[i])*prime[i] if lowlimit<low: lowlimit+=prime[i] if lowlimit==prime[i]: lowlimit+=prime[i] for j in range(lowlimit,high+1,prime[i]): l[j-low]=1 for i in range(low,high+1): if not l[i-low]: if i!=1: print(i) def gcd(a,b): while b: a=a%b b,a=a,b return a def power(a,n): r=1 while n: if n&1: r=(r*a) a*=a n=n>>1 return r def solve(): a=list(input()) b=list(input()) c=list(input()) s=a while True: if len(s)==0: print(ans) break x=s.pop(0) if x=='a': s=a ans='A' elif x=='b': s=b ans='B' else: s=c ans='C' for _ in range(1): solve()
[ 7, 15, 13, 4, 18, 13, 13, 17, 0, 13, 2, 2, 17, 17, 17, 12, 13, 29, 18, 4, 18, 18, 13, 13, 13, 39, 17, 12, 13, 29, 4, 13, 13, 4, 18, 4, 13, 13, 12, 13, 29, 4, 13, 4, 13, 12, 13, 41, 28, 13, 4, 13, 13, 4, 4, 13, 4, 13, 0, 13, 13, 41, 28, 13, 4, 13, 31, 13, 4, 4, 13, 13, 29, 13, 23, 13, 12, 13, 0, 13, 21, 22, 17, 4, 13, 4, 13, 22, 17, 4, 13, 4, 13, 22, 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, 14, 2, 13, 17, 4, 13, 10, 12, 13, 10, 12, 13, 10, 2, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13 ]
[ [ 134, 9 ], [ 141, 36 ], [ 141, 44 ], [ 50, 49 ], [ 75, 52 ], [ 129, 57 ], [ 60, 59 ], [ 64, 63 ], [ 59, 67 ], [ 63, 71 ], [ 75, 75 ], [ 80, 79 ], [ 101, 100 ], [ 79, 104 ], [ 100, 105 ], [ 107, 105 ], [ 108, 107 ], [ 79, 111 ], [ 100, 112 ], [ 107, 112 ], [ 107, 119 ], [ 100, 119 ], [ 138, 126 ], [ 134, 135 ] ]
[ "import sys\nsys.setrecursionlimit(500000)\nMOD = 10**9+7\n\ndef input():\n return sys.stdin.readline()[:-1]\n\ndef mi():\n return map(int, input().split())\n\ndef ii():\n return int(input())\n\ndef i2(n):\n tmp = [list(mi()) for i in range(n)]\n return [list(i) for i in zip(*tmp)]\n\n\ndef main():\n S = {\n 'a': list(input()),\n 'b': list(input()),\n 'c': list(input())\n }\n turn = 'a'\n while S[turn]:\n turn = S[turn].pop(0)\n print(turn.upper())\n\nif __name__ == '__main__':\n main()", "import sys", "sys", "sys.setrecursionlimit(500000)", "sys.setrecursionlimit", "sys", "setrecursionlimit", "500000", "MOD = 10**9+7", "MOD", "10**9+7", "10**9", "10", "9", "7", "def input():\n return sys.stdin.readline()[:-1]", "input", "return sys.stdin.readline()[:-1]", "sys.stdin.readline()[:-1]", "sys.stdin.readline()", "sys.stdin.readline", "sys.stdin", "sys", "stdin", "readline", ":-1", "-1", "def mi():\n return map(int, input().split())", "mi", "return map(int, input().split())", "map(int, input().split())", "map", "int", "input().split()", "().split", "()", "input", "split", "def ii():\n return int(input())", "ii", "return int(input())", "int(input())", "int", "input()", "input", "def i2(n):\n tmp = [list(mi()) for i in range(n)]\n return [list(i) for i in zip(*tmp)]", "i2", "list(mi()) for i in range(n)", "for i in range(n)", "i", "range(n)", "range", "n", "for i in range(n)", "list(mi())", "list", "mi()", "mi", "tmp = [list(mi()) for i in range(n)]", "tmp", "[list(mi()) for i in range(n)]", "list(i) for i in zip(*tmp)", "for i in zip(*tmp)", "i", "zip(*tmp)", "zip", "*tmp", "tmp", "for i in zip(*tmp)", "list(i)", "list", "i", "return [list(i) for i in zip(*tmp)]", "[list(i) for i in zip(*tmp)]", "n", "n", "def main():\n S = {\n 'a': list(input()),\n 'b': list(input()),\n 'c': list(input())\n }\n turn = 'a'\n while S[turn]:\n turn = S[turn].pop(0)\n print(turn.upper())", "main", "S = {\n 'a': list(input()),\n 'b': list(input()),\n 'c': list(input())\n }", "S", "{\n 'a': list(input()),\n 'b': list(input()),\n 'c': list(input())\n }", "'a'", "'a'", "list(input())", "list", "input()", "input", "'b'", "'b'", "list(input())", "list", "input()", "input", "'c'", "'c'", "list(input())", "list", "input()", "input", "turn = 'a'", "turn", "'a'", "while S[turn]:\n turn = S[turn].pop(0)\n ", "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", "if __name__ == '__main__':\n main()", "__name__ == '__main__'", "__name__", "'__main__'", "main()", "main", "def mi():\n return map(int, input().split())", "def mi():\n return map(int, input().split())", "mi", "def ii():\n return int(input())", "def ii():\n return int(input())", "ii", "MOD = 10**9+7", "10**9+7", "MOD", "def main():\n S = {\n 'a': list(input()),\n 'b': list(input()),\n 'c': list(input())\n }\n turn = 'a'\n while S[turn]:\n turn = S[turn].pop(0)\n print(turn.upper())", "def main():\n S = {\n 'a': list(input()),\n 'b': list(input()),\n 'c': list(input())\n }\n turn = 'a'\n while S[turn]:\n turn = S[turn].pop(0)\n print(turn.upper())", "main", "def input():\n return sys.stdin.readline()[:-1]", "def input():\n return sys.stdin.readline()[:-1]", "input", "def i2(n):\n tmp = [list(mi()) for i in range(n)]\n return [list(i) for i in zip(*tmp)]", "def i2(n):\n tmp = [list(mi()) for i in range(n)]\n return [list(i) for i in zip(*tmp)]", "i2" ]
import sys sys.setrecursionlimit(500000) MOD = 10**9+7 def input(): return sys.stdin.readline()[:-1] def mi(): return map(int, input().split()) def ii(): return int(input()) def i2(n): tmp = [list(mi()) for i in range(n)] return [list(i) for i in zip(*tmp)] def main(): S = { 'a': list(input()), 'b': list(input()), 'c': list(input()) } turn = 'a' while S[turn]: turn = S[turn].pop(0) print(turn.upper()) if __name__ == '__main__': main()
[ 7, 15, 13, 12, 13, 29, 18, 4, 18, 18, 13, 13, 13, 39, 17, 12, 13, 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, 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, 10, 12, 13, 10, 12, 13 ]
[ [ 19, 18 ], [ 117, 20 ], [ 23, 22 ], [ 117, 24 ], [ 27, 26 ], [ 117, 28 ], [ 31, 30 ], [ 30, 36 ], [ 96, 36 ], [ 72, 36 ], [ 48, 36 ], [ 18, 40 ], [ 53, 40 ], [ 49, 48 ], [ 18, 50 ], [ 53, 50 ], [ 54, 53 ], [ 18, 55 ], [ 53, 55 ], [ 48, 60 ], [ 30, 60 ], [ 96, 60 ], [ 72, 60 ], [ 22, 64 ], [ 77, 64 ], [ 73, 72 ], [ 22, 74 ], [ 77, 74 ], [ 78, 77 ], [ 22, 79 ], [ 77, 79 ], [ 72, 84 ], [ 48, 84 ], [ 30, 84 ], [ 96, 84 ], [ 26, 88 ], [ 101, 88 ], [ 97, 96 ], [ 26, 98 ], [ 101, 98 ], [ 102, 101 ], [ 26, 103 ], [ 101, 103 ], [ 114, 111 ] ]
[ "#!/usr/bin/env python3\nimport sys\ndef input():\n return sys.stdin.readline()[:-1]\n\ndef main():\n A = input()\n B = input()\n C = input()\n\n w = 'a'\n while True:\n if w == 'a':\n if A == '':\n print('A')\n exit()\n w = A[0]\n A = A[1:]\n if w == 'b':\n if B == '':\n print('B')\n exit()\n w = B[0]\n B = B[1:]\n if w == 'c':\n if C == '':\n print('C')\n exit()\n w = C[0]\n C = C[1:]\n\n\nif __name__ == '__main__':\n main()", "import sys", "sys", "def input():\n return sys.stdin.readline()[:-1]", "input", "return sys.stdin.readline()[:-1]", "sys.stdin.readline()[:-1]", "sys.stdin.readline()", "sys.stdin.readline", "sys.stdin", "sys", "stdin", "readline", ":-1", "-1", "def main():\n A = input()\n B = input()\n C = input()\n\n w = 'a'\n while True:\n if w == 'a':\n if A == '':\n print('A')\n exit()\n w = A[0]\n A = A[1:]\n if w == 'b':\n if B == '':\n print('B')\n exit()\n w = B[0]\n B = B[1:]\n if w == 'c':\n if C == '':\n print('C')\n exit()\n w = C[0]\n C = C[1:]", "main", "A = input()", "A", "input()", "input", "B = input()", "B", "input()", "input", "C = input()", "C", "input()", "input", "w = 'a'", "w", "'a'", "while True:\n if w == 'a':\n if A == '':\n print('A')\n exit()\n w = A[0]\n A = A[1:]\n if w == 'b':\n if B == '':\n print('B')\n exit()\n w = B[0]\n B = B[1:]\n if w == 'c':\n if C == '':\n print('C')\n exit()\n w = C[0]\n C = C[1:]", "True", "if w == 'a':\n if A == '':\n print('A')\n exit()\n w = A[0]\n A = A[1:]\n ", "w == 'a'", "w", "'a'", "if A == '':\n print('A')\n exit()\n ", "A == ''", "A", "''", "print('A')", "print", "'A'", "exit()", "exit", "w = A[0]", "w", "A[0]", "A", "0", "A = A[1:]", "A", "A[1:]", "A", "1:", "1", "if w == 'b':\n if B == '':\n print('B')\n exit()\n w = B[0]\n B = B[1:]\n ", "w == 'b'", "w", "'b'", "if B == '':\n print('B')\n exit()\n ", "B == ''", "B", "''", "print('B')", "print", "'B'", "exit()", "exit", "w = B[0]", "w", "B[0]", "B", "0", "B = B[1:]", "B", "B[1:]", "B", "1:", "1", "if w == 'c':\n if C == '':\n print('C')\n exit()\n w = C[0]\n C = C[1:]", "w == 'c'", "w", "'c'", "if C == '':\n print('C')\n exit()\n ", "C == ''", "C", "''", "print('C')", "print", "'C'", "exit()", "exit", "w = C[0]", "w", "C[0]", "C", "0", "C = C[1:]", "C", "C[1:]", "C", "1:", "1", "if __name__ == '__main__':\n main()", "__name__ == '__main__'", "__name__", "'__main__'", "main()", "main", "def main():\n A = input()\n B = input()\n C = input()\n\n w = 'a'\n while True:\n if w == 'a':\n if A == '':\n print('A')\n exit()\n w = A[0]\n A = A[1:]\n if w == 'b':\n if B == '':\n print('B')\n exit()\n w = B[0]\n B = B[1:]\n if w == 'c':\n if C == '':\n print('C')\n exit()\n w = C[0]\n C = C[1:]", "def main():\n A = input()\n B = input()\n C = input()\n\n w = 'a'\n while True:\n if w == 'a':\n if A == '':\n print('A')\n exit()\n w = A[0]\n A = A[1:]\n if w == 'b':\n if B == '':\n print('B')\n exit()\n w = B[0]\n B = B[1:]\n if w == 'c':\n if C == '':\n print('C')\n exit()\n w = C[0]\n C = C[1:]", "main", "def input():\n return sys.stdin.readline()[:-1]", "def input():\n return sys.stdin.readline()[:-1]", "input" ]
#!/usr/bin/env python3 import sys def input(): return sys.stdin.readline()[:-1] def main(): A = input() B = input() C = input() w = 'a' while True: if w == 'a': if A == '': print('A') exit() w = A[0] A = A[1:] if w == 'b': if B == '': print('B') exit() w = B[0] B = B[1:] if w == 'c': if C == '': print('C') exit() w = C[0] C = C[1:] 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, 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, 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, 17, 13, 10, 4, 13, 10, 4, 13 ]
[ [ 100, 2 ], [ 91, 8 ], [ 82, 14 ], [ 94, 20 ], [ 95, 26 ], [ 86, 26 ], [ 98, 26 ], [ 89, 26 ], [ 101, 30 ], [ 88, 37 ], [ 101, 40 ], [ 89, 45 ], [ 95, 45 ], [ 86, 45 ], [ 98, 45 ], [ 92, 49 ], [ 97, 56 ], [ 92, 59 ], [ 98, 64 ], [ 89, 64 ], [ 95, 64 ], [ 86, 64 ], [ 83, 68 ], [ 85, 75 ], [ 83, 78 ], [ 82, 83 ], [ 85, 86 ], [ 88, 89 ], [ 91, 92 ], [ 94, 95 ], [ 97, 98 ], [ 100, 101 ] ]
[ "a = list(input())\nb = list(input())\nc = list(input())\n# print('a',a)\n# print('b',b)\n# print('c',c)\n# exit()\nptr = 'a'\nwhile (True):\n\tif ptr == 'a':\n\t\tif a == []:\n\t\t\tprint('A')\n\t\t\tbreak\n\t\tptr = a.pop(0)\n\tif ptr == 'b':\n\t\tif b == []:\n\t\t\tprint('B')\n\t\t\tbreak\n\t\tptr = b.pop(0)\n\tif ptr == 'c':\n\t\tif c == []:\n\t\t\tprint('C')\n\t\t\tbreak\n\t\tptr = 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", "ptr = 'a'", "ptr", "'a'", "while (True):\n\tif ptr == 'a':\n\t\tif a == []:\n\t\t\tprint('A')\n\t\t\tbreak\n\t\tptr = a.pop(0)\n\tif ptr == 'b':\n\t\tif b == []:\n\t\t\tprint('B')\n\t\t\tbreak\n\t\tptr = b.pop(0)\n\tif ptr == 'c':\n\t\tif c == []:\n\t\t\tprint('C')\n\t\t\tbreak\n\t\tptr = c.pop(0)", "True", "if ptr == 'a':\n\t\tif a == []:\n\t\t\tprint('A')\n\t\t\tbreak\n\t\tptr = a.pop(0)\n\t", "ptr == 'a'", "ptr", "'a'", "if a == []:\n\t\t\tprint('A')\n\t\t\tbreak\n\t\t", "a == []", "a", "[]", "print('A')", "print", "'A'", "break", "ptr = a.pop(0)", "ptr", "a.pop(0)", "a.pop", "a", "pop", "0", "if ptr == 'b':\n\t\tif b == []:\n\t\t\tprint('B')\n\t\t\tbreak\n\t\tptr = b.pop(0)\n\t", "ptr == 'b'", "ptr", "'b'", "if b == []:\n\t\t\tprint('B')\n\t\t\tbreak\n\t\t", "b == []", "b", "[]", "print('B')", "print", "'B'", "break", "ptr = b.pop(0)", "ptr", "b.pop(0)", "b.pop", "b", "pop", "0", "if ptr == 'c':\n\t\tif c == []:\n\t\t\tprint('C')\n\t\t\tbreak\n\t\tptr = c.pop(0)", "ptr == 'c'", "ptr", "'c'", "if c == []:\n\t\t\tprint('C')\n\t\t\tbreak\n\t\t", "c == []", "c", "[]", "print('C')", "print", "'C'", "break", "ptr = c.pop(0)", "ptr", "c.pop(0)", "c.pop", "c", "pop", "0", "c = list(input())", "list(input())", "c", "ptr = c.pop(0)", "c.pop(0)", "ptr", "ptr = a.pop(0)", "a.pop(0)", "ptr", "b = list(input())", "list(input())", "b", "ptr = 'a'", "'a'", "ptr", "ptr = b.pop(0)", "b.pop(0)", "ptr", "a = list(input())", "list(input())", "a" ]
a = list(input()) b = list(input()) c = list(input()) # print('a',a) # print('b',b) # print('c',c) # exit() ptr = 'a' while (True): if ptr == 'a': if a == []: print('A') break ptr = a.pop(0) if ptr == 'b': if b == []: print('B') break ptr = b.pop(0) if ptr == 'c': if c == []: print('C') break ptr = c.pop(0)
[ 7, 15, 13, 15, 15, 13, 0, 13, 18, 18, 13, 13, 13, 0, 13, 12, 4, 18, 4, 13, 13, 0, 13, 12, 4, 13, 4, 13, 0, 13, 12, 4, 13, 4, 13, 13, 4, 18, 4, 13, 13, 41, 28, 13, 4, 18, 4, 13, 13, 4, 2, 4, 13, 13, 17, 0, 13, 12, 13, 0, 13, 2, 17, 17, 0, 13, 2, 2, 17, 17, 17, 12, 13, 29, 4, 13, 13, 2, 13, 17, 13, 23, 13, 12, 13, 0, 13, 39, 17, 28, 13, 4, 13, 17, 2, 13, 17, 4, 18, 13, 13, 2, 2, 2, 18, 13, 17, 2, 2, 13, 17, 13, 4, 13, 13, 13, 29, 13, 23, 13, 12, 13, 0, 13, 39, 17, 28, 13, 4, 13, 17, 2, 13, 17, 4, 18, 13, 13, 2, 2, 18, 13, 17, 17, 13, 29, 13, 23, 13, 12, 13, 0, 13, 21, 22, 17, 17, 22, 17, 17, 22, 17, 17, 41, 28, 13, 4, 13, 17, 4, 4, 13, 0, 13, 13, 41, 28, 13, 4, 13, 17, 4, 17, 0, 13, 13, 0, 13, 17, 42, 17, 38, 5, 4, 13, 18, 17, 13, 29, 0, 13, 18, 13, 18, 18, 13, 13, 18, 13, 13, 0, 18, 13, 13, 17, 0, 13, 13, 12, 13, 0, 13, 4, 13, 28, 13, 4, 13, 13, 4, 13, 14, 2, 13, 17, 4, 13, 10, 12, 13, 10, 12, 13, 10, 2, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 2, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 18, 13 ]
[ [ 271, 7 ], [ 259, 14 ], [ 272, 19 ], [ 241, 22 ], [ 272, 27 ], [ 262, 29 ], [ 272, 39 ], [ 44, 43 ], [ 272, 47 ], [ 43, 53 ], [ 238, 56 ], [ 256, 60 ], [ 244, 65 ], [ 82, 76 ], [ 245, 78 ], [ 245, 80 ], [ 82, 82 ], [ 87, 86 ], [ 91, 90 ], [ 119, 95 ], [ 86, 99 ], [ 86, 105 ], [ 119, 109 ], [ 90, 111 ], [ 251, 113 ], [ 90, 114 ], [ 245, 115 ], [ 86, 117 ], [ 119, 119 ], [ 124, 123 ], [ 128, 127 ], [ 148, 132 ], [ 123, 136 ], [ 123, 141 ], [ 245, 144 ], [ 123, 146 ], [ 148, 148 ], [ 153, 152 ], [ 166, 165 ], [ 260, 171 ], [ 174, 173 ], [ 178, 177 ], [ 185, 184 ], [ 188, 187 ], [ 187, 197 ], [ 216, 197 ], [ 201, 200 ], [ 152, 202 ], [ 173, 205 ], [ 187, 206 ], [ 216, 206 ], [ 211, 207 ], [ 184, 208 ], [ 187, 209 ], [ 216, 209 ], [ 214, 211 ], [ 184, 212 ], [ 187, 213 ], [ 216, 213 ], [ 217, 216 ], [ 200, 217 ], [ 222, 221 ], [ 242, 223 ], [ 226, 225 ], [ 221, 228 ], [ 266, 230 ], [ 266, 236 ], [ 238, 239 ], [ 241, 242 ], [ 244, 245 ], [ 256, 257 ], [ 259, 260 ], [ 262, 263 ], [ 271, 272 ] ]
[ "import sys\nfrom collections import defaultdict, deque\nimport math\n\n# import copy\n# from bisect import bisect_left, bisect_right\n# import heapq\n\n# sys.setrecursionlimit(1000000)\n\n# input aliases\ninput = sys.stdin.readline\n\ngetS = lambda: input().strip()\ngetN = lambda: int(input())\ngetList = lambda: list(map(int, input().split()))\ngetZList = lambda: [int(x) - 1 for x in input().split()]\n\nINF = 10 ** 20\nMOD = 10**9 + 7\n\ndef divide(k):\n return pow(k, MOD-2, MOD)\n\n\ndef make_nck(n):\n ret = [1]\n for i in range(1, n+1):\n ret.append((ret[-1] * (n + 1 - i) * divide(i)) % MOD)\n\n # print(ret)\n return ret\n\ndef make_nigojyo(n):\n ret = [1]\n\n for i in range(1, n+1):\n ret.append((ret[-1] * 25) % MOD)\n\n # print(ret)\n return ret\n\n\ndef solve():\n nx = {\"a\": 0, \"b\": 1, \"c\": 2}\n\n cards = [getS() for i in range(3)]\n idxs = [0 for i in range(3)]\n cur = 0\n while True:\n try:\n # print(cur, idxs)\n nxt = nx[cards[cur][idxs[cur]]]\n idxs[cur] += 1\n cur = nxt\n except:\n print(\"ABC\"[cur])\n return\n\n\n\ndef main():\n n = getN()\n for _ in range(n):\n solve()\n\n\nif __name__ == \"__main__\":\n # main()\n solve()", "import sys", "sys", "from collections import defaultdict, deque", "import math", "math", "input = sys.stdin.readline", "input", "sys.stdin.readline", "sys.stdin", "sys", "stdin", "readline", "getS = lambda: input().strip()", "getS", "lambda: input().strip()", "input().strip()", "().strip", "()", "input", "strip", "getN = lambda: int(input())", "getN", "lambda: int(input())", "int(input())", "int", "input()", "input", "getList = lambda: list(map(int, input().split()))", "getList", "lambda: list(map(int, input().split()))", "list(map(int, input().split()))", "list", "map(int, input().split())", "map", "int", "input().split()", "().split", "()", "input", "split", "int(x) - 1 for x in input().split()", "for x in input().split()", "x", "input().split()", "().split", "()", "input", "split", "for x in input().split()", "int(x) - 1", "int(x)", "int", "x", "1", "getZList = lambda: [int(x) - 1 for x in input().split()]", "getZList", "lambda: [int(x) - 1 for x in input().split()]", "[int(x) - 1 for x in input().split()]", "INF = 10 ** 20", "INF", "10 ** 20", "10", "20", "MOD = 10**9 + 7", "MOD", "10**9 + 7", "10**9", "10", "9", "7", "def divide(k):\n return pow(k, MOD-2, MOD)", "divide", "return pow(k, MOD-2, MOD)", "pow(k, MOD-2, MOD)", "pow", "k", "MOD-2", "MOD", "2", "MOD", "k", "k", "def make_nck(n):\n ret = [1]\n for i in range(1, n+1):\n ret.append((ret[-1] * (n + 1 - i) * divide(i)) % MOD)\n\n # print(ret)\n return ret", "make_nck", "ret = [1]", "ret", "[1]", "1", "for i in range(1, n+1):\n ret.append((ret[-1] * (n + 1 - i) * divide(i)) % MOD)\n\n # print(ret)\n ", "i", "range(1, n+1)", "range", "1", "n+1", "n", "1", "ret.append((ret[-1] * (n + 1 - i) * divide(i)) % MOD)", "ret.append", "ret", "append", "(ret[-1] * (n + 1 - i) * divide(i)) % MOD", "ret[-1] * (n + 1 - i) * divide(i)", "ret[-1] * (n + 1 - i)", "ret[-1]", "ret", "-1", "n + 1 - i", "n + 1", "n", "1", "i", "divide(i)", "divide", "i", "MOD", "return ret", "ret", "n", "n", "def make_nigojyo(n):\n ret = [1]\n\n for i in range(1, n+1):\n ret.append((ret[-1] * 25) % MOD)\n\n # print(ret)\n return ret", "make_nigojyo", "ret = [1]", "ret", "[1]", "1", "for i in range(1, n+1):\n ret.append((ret[-1] * 25) % MOD)\n\n # print(ret)\n ", "i", "range(1, n+1)", "range", "1", "n+1", "n", "1", "ret.append((ret[-1] * 25) % MOD)", "ret.append", "ret", "append", "(ret[-1] * 25) % MOD", "ret[-1] * 25", "ret[-1]", "ret", "-1", "25", "MOD", "return ret", "ret", "n", "n", "def solve():\n nx = {\"a\": 0, \"b\": 1, \"c\": 2}\n\n cards = [getS() for i in range(3)]\n idxs = [0 for i in range(3)]\n cur = 0\n while True:\n try:\n # print(cur, idxs)\n nxt = nx[cards[cur][idxs[cur]]]\n idxs[cur] += 1\n cur = nxt\n except:\n print(\"ABC\"[cur])\n return", "solve", "nx = {\"a\": 0, \"b\": 1, \"c\": 2}", "nx", "{\"a\": 0, \"b\": 1, \"c\": 2}", "\"a\"", "\"a\"", "0", "\"b\"", "\"b\"", "1", "\"c\"", "\"c\"", "2", "getS() for i in range(3)", "for i in range(3)", "i", "range(3)", "range", "3", "for i in range(3)", "getS()", "getS", "cards = [getS() for i in range(3)]", "cards", "[getS() for i in range(3)]", "0 for i in range(3)", "for i in range(3)", "i", "range(3)", "range", "3", "for i in range(3)", "0", "idxs = [0 for i in range(3)]", "idxs", "[0 for i in range(3)]", "cur = 0", "cur", "0", "while True:\n try:\n # print(cur, idxs)\n nxt = nx[cards[cur][idxs[cur]]]\n idxs[cur] += 1\n cur = nxt\n except:\n print(\"ABC\"[cur])\n return", "True", "try:\n # print(cur, idxs)\n nxt = nx[cards[cur][idxs[cur]]]\n idxs[cur] += 1\n cur = nxt\n except:\n print(\"ABC\"[cur])\n return", "except:\n print(\"ABC\"[cur])\n return", "print(\"ABC\"[cur])", "print", "\"ABC\"[cur]", "\"ABC\"", "cur", "return", "nxt = nx[cards[cur][idxs[cur]]]", "nxt", "nx[cards[cur][idxs[cur]]]", "nx", "cards[cur][idxs[cur]]", "[cur]", "cards", "cur", "idxs[cur]", "idxs", "cur", "idxs[cur] += 1", "idxs[cur]", "idxs", "cur", "1", "cur = nxt", "cur", "nxt", "def main():\n n = getN()\n for _ in range(n):\n solve()", "main", "n = getN()", "n", "getN()", "getN", "for _ in range(n):\n solve()", "_", "range(n)", "range", "n", "solve()", "solve", "if __name__ == \"__main__\":\n # main()\n solve()", "__name__ == \"__main__\"", "__name__", "\"__main__\"", "solve()", "solve", "getZList = lambda: [int(x) - 1 for x in input().split()]", "lambda: [int(x) - 1 for x in input().split()]", "getZList", "getN = lambda: int(input())", "lambda: int(input())", "getN", "MOD = 10**9 + 7", "10**9 + 7", "MOD", "def main():\n n = getN()\n for _ in range(n):\n solve()", "def main():\n n = getN()\n for _ in range(n):\n solve()", "main", "def divide(k):\n return pow(k, MOD-2, MOD)", "def divide(k):\n return pow(k, MOD-2, MOD)", "divide", "def make_nck(n):\n ret = [1]\n for i in range(1, n+1):\n ret.append((ret[-1] * (n + 1 - i) * divide(i)) % MOD)\n\n # print(ret)\n return ret", "def make_nck(n):\n ret = [1]\n for i in range(1, n+1):\n ret.append((ret[-1] * (n + 1 - i) * divide(i)) % MOD)\n\n # print(ret)\n return ret", "make_nck", "INF = 10 ** 20", "10 ** 20", "INF", "getS = lambda: input().strip()", "lambda: input().strip()", "getS", "getList = lambda: list(map(int, input().split()))", "lambda: list(map(int, input().split()))", "getList", "def solve():\n nx = {\"a\": 0, \"b\": 1, \"c\": 2}\n\n cards = [getS() for i in range(3)]\n idxs = [0 for i in range(3)]\n cur = 0\n while True:\n try:\n # print(cur, idxs)\n nxt = nx[cards[cur][idxs[cur]]]\n idxs[cur] += 1\n cur = nxt\n except:\n print(\"ABC\"[cur])\n return", "def solve():\n nx = {\"a\": 0, \"b\": 1, \"c\": 2}\n\n cards = [getS() for i in range(3)]\n idxs = [0 for i in range(3)]\n cur = 0\n while True:\n try:\n # print(cur, idxs)\n nxt = nx[cards[cur][idxs[cur]]]\n idxs[cur] += 1\n cur = nxt\n except:\n print(\"ABC\"[cur])\n return", "solve", "def make_nigojyo(n):\n ret = [1]\n\n for i in range(1, n+1):\n ret.append((ret[-1] * 25) % MOD)\n\n # print(ret)\n return ret", "def make_nigojyo(n):\n ret = [1]\n\n for i in range(1, n+1):\n ret.append((ret[-1] * 25) % MOD)\n\n # print(ret)\n return ret", "make_nigojyo", "input = sys.stdin.readline", "sys.stdin.readline", "input" ]
import sys from collections import defaultdict, deque import math # import copy # from bisect import bisect_left, bisect_right # import heapq # sys.setrecursionlimit(1000000) # input aliases input = sys.stdin.readline getS = lambda: input().strip() getN = lambda: int(input()) getList = lambda: list(map(int, input().split())) getZList = lambda: [int(x) - 1 for x in input().split()] INF = 10 ** 20 MOD = 10**9 + 7 def divide(k): return pow(k, MOD-2, MOD) def make_nck(n): ret = [1] for i in range(1, n+1): ret.append((ret[-1] * (n + 1 - i) * divide(i)) % MOD) # print(ret) return ret def make_nigojyo(n): ret = [1] for i in range(1, n+1): ret.append((ret[-1] * 25) % MOD) # print(ret) return ret def solve(): nx = {"a": 0, "b": 1, "c": 2} cards = [getS() for i in range(3)] idxs = [0 for i in range(3)] cur = 0 while True: try: # print(cur, idxs) nxt = nx[cards[cur][idxs[cur]]] idxs[cur] += 1 cur = nxt except: print("ABC"[cur]) return def main(): n = getN() for _ in range(n): solve() if __name__ == "__main__": # main() solve()
[ 7, 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, 18, 13, 17, 0, 13, 17, 0, 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, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 4, 13, 10, 17, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13, 10, 18, 13, 10, 17, 13 ]
[ [ 131, 2 ], [ 119, 6 ], [ 134, 10 ], [ 122, 14 ], [ 132, 17 ], [ 128, 19 ], [ 120, 22 ], [ 110, 24 ], [ 135, 27 ], [ 101, 29 ], [ 132, 31 ], [ 125, 34 ], [ 140, 37 ], [ 113, 40 ], [ 102, 46 ], [ 144, 46 ], [ 108, 46 ], [ 105, 46 ], [ 126, 50 ], [ 117, 50 ], [ 123, 51 ], [ 104, 57 ], [ 132, 59 ], [ 126, 60 ], [ 117, 60 ], [ 116, 62 ], [ 102, 66 ], [ 144, 66 ], [ 108, 66 ], [ 105, 66 ], [ 141, 70 ], [ 138, 70 ], [ 129, 71 ], [ 107, 77 ], [ 120, 79 ], [ 141, 80 ], [ 138, 80 ], [ 137, 82 ], [ 114, 86 ], [ 147, 86 ], [ 111, 87 ], [ 143, 93 ], [ 135, 95 ], [ 114, 96 ], [ 147, 96 ], [ 146, 98 ], [ 101, 102 ], [ 104, 105 ], [ 107, 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 ] ]
[ "SA = input()\nSB = input()\nSC = input()\nla = len(SA)\nlb = len(SB)\nlc = len(SC)\nturn = SA[0]\nai = 0\nbi = 0\nci = 0\nwhile True:\n if turn == 'a':\n if ai == la:\n print('A')\n break\n turn = SA[ai]\n ai += 1\n elif turn == 'b':\n if bi == lb:\n print('B')\n break\n turn = SB[bi]\n bi += 1\n else:\n if ci == lc:\n print('C')\n break\n turn = SC[ci]\n ci += 1\n\n", "SA = input()", "SA", "input()", "input", "SB = input()", "SB", "input()", "input", "SC = input()", "SC", "input()", "input", "la = len(SA)", "la", "len(SA)", "len", "SA", "lb = len(SB)", "lb", "len(SB)", "len", "SB", "lc = len(SC)", "lc", "len(SC)", "len", "SC", "turn = SA[0]", "turn", "SA[0]", "SA", "0", "ai = 0", "ai", "0", "bi = 0", "bi", "0", "ci = 0", "ci", "0", "while True:\n if turn == 'a':\n if ai == la:\n print('A')\n break\n turn = SA[ai]\n ai += 1\n elif turn == 'b':\n if bi == lb:\n print('B')\n break\n turn = SB[bi]\n bi += 1\n else:\n if ci == lc:\n print('C')\n break\n turn = SC[ci]\n ci += 1", "True", "if turn == 'a':\n if ai == la:\n print('A')\n break\n turn = SA[ai]\n ai += 1\n elif turn == 'b':\n if bi == lb:\n print('B')\n break\n turn = SB[bi]\n bi += 1\n else:\n if ci == lc:\n print('C')\n break\n turn = SC[ci]\n ci += 1", "turn == 'a'", "turn", "'a'", "if ai == la:\n print('A')\n break\n ", "ai == la", "ai", "la", "print('A')", "print", "'A'", "break", "turn = SA[ai]", "turn", "SA[ai]", "SA", "ai", "ai += 1", "ai", "1", "elif turn == 'b':\n if bi == lb:\n print('B')\n break\n turn = SB[bi]\n bi += 1\n ", "turn == 'b'", "turn", "'b'", "if bi == lb:\n print('B')\n break\n ", "bi == lb", "bi", "lb", "print('B')", "print", "'B'", "break", "turn = SB[bi]", "turn", "SB[bi]", "SB", "bi", "bi += 1", "bi", "1", "if ci == lc:\n print('C')\n break\n ", "ci == lc", "ci", "lc", "print('C')", "print", "'C'", "break", "turn = SC[ci]", "turn", "SC[ci]", "SC", "ci", "ci += 1", "ci", "1", "turn = SA[0]", "SA[0]", "turn", "turn = SA[ai]", "SA[ai]", "turn", "turn = SB[bi]", "SB[bi]", "turn", "lc = len(SC)", "len(SC)", "lc", "ci = 0", "0", "ci", "ai += 1", "1", "ai", "SB = input()", "input()", "SB", "la = len(SA)", "len(SA)", "la", "ai = 0", "0", "ai", "lb = len(SB)", "len(SB)", "lb", "SA = input()", "input()", "SA", "SC = input()", "input()", "SC", "bi += 1", "1", "bi", "bi = 0", "0", "bi", "turn = SC[ci]", "SC[ci]", "turn", "ci += 1", "1", "ci" ]
SA = input() SB = input() SC = input() la = len(SA) lb = len(SB) lc = len(SC) turn = SA[0] ai = 0 bi = 0 ci = 0 while True: if turn == 'a': if ai == la: print('A') break turn = SA[ai] ai += 1 elif turn == 'b': if bi == lb: print('B') break turn = SB[bi] bi += 1 else: if ci == lc: print('C') break turn = SC[ci] ci += 1
[ 7, 15, 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, 40, 13, 4, 13, 17, 4, 13, 0, 13, 4, 18, 13, 13, 14, 2, 13, 17, 14, 40, 13, 4, 13, 17, 4, 13, 0, 13, 4, 18, 13, 13, 14, 2, 13, 17, 14, 40, 13, 4, 13, 17, 4, 13, 0, 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, 10, 4, 13, 10, 4, 13, 10, 4, 13 ]
[ [ 110, 3 ], [ 104, 9 ], [ 113, 15 ], [ 107, 21 ], [ 111, 24 ], [ 101, 26 ], [ 105, 29 ], [ 119, 31 ], [ 114, 34 ], [ 122, 36 ], [ 108, 39 ], [ 123, 45 ], [ 117, 45 ], [ 99, 45 ], [ 126, 45 ], [ 108, 49 ], [ 125, 56 ], [ 108, 59 ], [ 126, 63 ], [ 123, 63 ], [ 117, 63 ], [ 99, 63 ], [ 102, 67 ], [ 98, 74 ], [ 102, 77 ], [ 99, 81 ], [ 126, 81 ], [ 123, 81 ], [ 117, 81 ], [ 120, 85 ], [ 116, 92 ], [ 120, 95 ], [ 98, 99 ], [ 101, 102 ], [ 104, 105 ], [ 107, 108 ], [ 110, 111 ], [ 113, 114 ], [ 116, 117 ], [ 119, 120 ], [ 122, 123 ], [ 125, 126 ] ]
[ "from collections import deque\nsa=list(input())\nsb=list(input())\nsc=list(input())\na=deque(sa)\nb=deque(sb)\nc=deque(sc)\nk=a.popleft()\nwhile True:\n if k==\"a\":\n if not a:\n print(\"A\")\n exit()\n else:\n k=a.popleft()\n if k==\"b\":\n if not b:\n print(\"B\")\n exit()\n else:\n k=b.popleft()\n if k==\"c\":\n if not c:\n print(\"C\")\n exit()\n else:\n k=c.popleft()", "from collections import deque", "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", "k=a.popleft()", "k", "a.popleft()", "a.popleft", "a", "popleft", "while True:\n if k==\"a\":\n if not a:\n print(\"A\")\n exit()\n else:\n k=a.popleft()\n if k==\"b\":\n if not b:\n print(\"B\")\n exit()\n else:\n k=b.popleft()\n if k==\"c\":\n if not c:\n print(\"C\")\n exit()\n else:\n k=c.popleft()", "True", "if k==\"a\":\n if not a:\n print(\"A\")\n exit()\n else:\n k=a.popleft()\n ", "k==\"a\"", "k", "\"a\"", "if not a:\n print(\"A\")\n exit()\n else:\n k=a.popleft()\n ", "not a", "a", "print(\"A\")", "print", "\"A\"", "exit()", "exit", "k=a.popleft()", "k", "a.popleft()", "a.popleft", "a", "popleft", "if k==\"b\":\n if not b:\n print(\"B\")\n exit()\n else:\n k=b.popleft()\n ", "k==\"b\"", "k", "\"b\"", "if not b:\n print(\"B\")\n exit()\n else:\n k=b.popleft()\n ", "not b", "b", "print(\"B\")", "print", "\"B\"", "exit()", "exit", "k=b.popleft()", "k", "b.popleft()", "b.popleft", "b", "popleft", "if k==\"c\":\n if not c:\n print(\"C\")\n exit()\n else:\n k=c.popleft()", "k==\"c\"", "k", "\"c\"", "if not c:\n print(\"C\")\n exit()\n else:\n k=c.popleft()", "not c", "c", "print(\"C\")", "print", "\"C\"", "exit()", "exit", "k=c.popleft()", "k", "c.popleft()", "c.popleft", "c", "popleft", "k=b.popleft()", "b.popleft()", "k", "b=deque(sb)", "deque(sb)", "b", "sb=list(input())", "list(input())", "sb", "a=deque(sa)", "deque(sa)", "a", "sa=list(input())", "list(input())", "sa", "sc=list(input())", "list(input())", "sc", "k=c.popleft()", "c.popleft()", "k", "c=deque(sc)", "deque(sc)", "c", "k=a.popleft()", "a.popleft()", "k", "k=a.popleft()", "a.popleft()", "k" ]
from collections import deque sa=list(input()) sb=list(input()) sc=list(input()) a=deque(sa) b=deque(sb) c=deque(sc) k=a.popleft() while True: if k=="a": if not a: print("A") exit() else: k=a.popleft() if k=="b": if not b: print("B") exit() else: k=b.popleft() if k=="c": if not c: print("C") exit() else: k=c.popleft()
[ 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, 17, 13, 39, 17, 17, 17, 28, 13, 4, 13, 4, 13, 4, 13, 13, 0, 13, 13, 0, 13, 18, 13, 18, 18, 13, 13, 18, 13, 13, 0, 18, 13, 13, 17, 14, 40, 4, 13, 18, 13, 13, 18, 13, 13, 4, 13, 18, 39, 17, 17, 17, 13, 3, 10, 17, 13, 10, 39, 13, 10, 13, 13, 10, 13, 13, 10, 18, 13, 10, 21, 13 ]
[ [ 4, 3 ], [ 87, 11 ], [ 96, 14 ], [ 81, 26 ], [ 84, 28 ], [ 35, 34 ], [ 90, 43 ], [ 82, 44 ], [ 94, 44 ], [ 93, 46 ], [ 97, 48 ], [ 88, 51 ], [ 91, 52 ], [ 57, 53 ], [ 85, 54 ], [ 91, 55 ], [ 60, 57 ], [ 85, 58 ], [ 91, 59 ], [ 88, 66 ], [ 94, 67 ], [ 82, 67 ], [ 85, 69 ], [ 94, 70 ], [ 82, 70 ], [ 94, 78 ], [ 82, 78 ], [ 81, 82 ], [ 84, 85 ], [ 87, 88 ], [ 82, 90 ], [ 94, 90 ], [ 90, 91 ], [ 93, 94 ], [ 96, 97 ] ]
[ "s = [input() for _ in range(3)]\n\nd = {'a': 0, 'b': 1, 'c': 2}\nnxt, cnt = 0, [0, 0, 0]\nfor _ in range(sum(len(si) for si in s)):\n now = nxt\n nxt = d[s[now][cnt[now]]]\n cnt[now] += 1\n if len(s[nxt]) <= cnt[nxt]:\n print(['A', 'B', 'C'][nxt])\n break", "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", "nxt, cnt = 0, [0, 0, 0]", "nxt", "0", "cnt", "[0, 0, 0]", "0", "0", "0", "for _ in range(sum(len(si) for si in s)):\n now = nxt\n nxt = d[s[now][cnt[now]]]\n cnt[now] += 1\n if len(s[nxt]) <= cnt[nxt]:\n print(['A', 'B', 'C'][nxt])\n break", "_", "range(sum(len(si) for si in s))", "range", "sum(len(si) for si in s)", "sum", "len(si)", "len", "si", "now = nxt", "now", "nxt", "nxt = d[s[now][cnt[now]]]", "nxt", "d[s[now][cnt[now]]]", "d", "s[now][cnt[now]]", "[now]", "s", "now", "cnt[now]", "cnt", "now", "cnt[now] += 1", "cnt[now]", "cnt", "now", "1", "if len(s[nxt]) <= cnt[nxt]:\n print(['A', 'B', 'C'][nxt])\n break", "len(s[nxt]) <= cnt[nxt]", "len(s[nxt])", "len", "s[nxt]", "s", "nxt", "cnt[nxt]", "cnt", "nxt", "print(['A', 'B', 'C'][nxt])", "print", "['A', 'B', 'C'][nxt]", "['A', 'B', 'C']", "'A'", "'B'", "'C'", "nxt", "break", "nxt, cnt = 0, [0, 0, 0]", "0", "nxt", "cnt = 0, [0, 0, 0]", "[0, 0, 0]", "cnt", "s = [input() for _ in range(3)]", "[input() for _ in range(3)]", "s", "now = nxt", "nxt", "now", "nxt = d[s[now][cnt[now]]]", "d[s[now][cnt[now]]]", "nxt", "d = {'a': 0, 'b': 1, 'c': 2}", "{'a': 0, 'b': 1, 'c': 2}", "d" ]
s = [input() for _ in range(3)] d = {'a': 0, 'b': 1, 'c': 2} nxt, cnt = 0, [0, 0, 0] for _ in range(sum(len(si) for si in s)): now = nxt nxt = d[s[now][cnt[now]]] cnt[now] += 1 if len(s[nxt]) <= cnt[nxt]: print(['A', 'B', 'C'][nxt]) break
[ 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, 4, 13, 10, 17, 13, 10, 18, 13, 10, 18, 13, 10, 4, 13, 10, 4, 13, 10, 18, 13, 10, 18, 13 ]
[ [ 96, 2 ], [ 111, 6 ], [ 108, 10 ], [ 99, 14 ], [ 100, 20 ], [ 103, 20 ], [ 94, 20 ], [ 91, 20 ], [ 97, 26 ], [ 115, 26 ], [ 90, 33 ], [ 97, 35 ], [ 115, 35 ], [ 114, 38 ], [ 97, 40 ], [ 115, 40 ], [ 100, 45 ], [ 103, 45 ], [ 94, 45 ], [ 91, 45 ], [ 112, 51 ], [ 106, 51 ], [ 93, 58 ], [ 112, 60 ], [ 106, 60 ], [ 105, 63 ], [ 112, 65 ], [ 106, 65 ], [ 109, 72 ], [ 118, 72 ], [ 102, 79 ], [ 109, 81 ], [ 118, 81 ], [ 117, 84 ], [ 109, 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()\n\ncur = \"a\"\n\nwhile True:\n if cur == \"a\":\n if len(a) == 0:\n print(\"A\")\n break\n else:\n cur = a[0]\n a = a[1:]\n elif cur == \"b\":\n if len(b) == 0:\n print(\"B\")\n break\n else:\n cur = b[0]\n b = b[1:]\n else:\n if len(c) == 0:\n print(\"C\")\n break\n else:\n cur = c[0]\n c = c[1:]", "a = input()", "a", "input()", "input", "b = input()", "b", "input()", "input", "c = input()", "c", "input()", "input", "cur = \"a\"", "cur", "\"a\"", "while True:\n if cur == \"a\":\n if len(a) == 0:\n print(\"A\")\n break\n else:\n cur = a[0]\n a = a[1:]\n elif cur == \"b\":\n if len(b) == 0:\n print(\"B\")\n break\n else:\n cur = b[0]\n b = b[1:]\n else:\n if len(c) == 0:\n print(\"C\")\n break\n else:\n cur = c[0]\n c = c[1:]", "True", "if cur == \"a\":\n if len(a) == 0:\n print(\"A\")\n break\n else:\n cur = a[0]\n a = a[1:]\n elif cur == \"b\":\n if len(b) == 0:\n print(\"B\")\n break\n else:\n cur = b[0]\n b = b[1:]\n else:\n if len(c) == 0:\n print(\"C\")\n break\n else:\n cur = c[0]\n c = c[1:]", "cur == \"a\"", "cur", "\"a\"", "if len(a) == 0:\n print(\"A\")\n break\n else:\n cur = a[0]\n a = a[1:]\n ", "len(a) == 0", "len(a)", "len", "a", "0", "print(\"A\")", "print", "\"A\"", "break", "cur = a[0]", "cur", "a[0]", "a", "0", "a = a[1:]", "a", "a[1:]", "a", "1:", "1", "elif cur == \"b\":\n if len(b) == 0:\n print(\"B\")\n break\n else:\n cur = b[0]\n b = b[1:]\n ", "cur == \"b\"", "cur", "\"b\"", "if len(b) == 0:\n print(\"B\")\n break\n else:\n cur = b[0]\n b = b[1:]\n ", "len(b) == 0", "len(b)", "len", "b", "0", "print(\"B\")", "print", "\"B\"", "break", "cur = b[0]", "cur", "b[0]", "b", "0", "b = b[1:]", "b", "b[1:]", "b", "1:", "1", "if len(c) == 0:\n print(\"C\")\n break\n else:\n cur = c[0]\n c = c[1:]", "len(c) == 0", "len(c)", "len", "c", "0", "print(\"C\")", "print", "\"C\"", "break", "cur = c[0]", "cur", "c[0]", "c", "0", "c = c[1:]", "c", "c[1:]", "c", "1:", "1", "cur = a[0]", "a[0]", "cur", "cur = b[0]", "b[0]", "cur", "a = input()", "input()", "a", "cur = \"a\"", "\"a\"", "cur", "cur = c[0]", "c[0]", "cur", "b = b[1:]", "b[1:]", "b", "c = input()", "input()", "c", "b = input()", "input()", "b", "a = a[1:]", "a[1:]", "a", "c = c[1:]", "c[1:]", "c" ]
a = input() b = input() c = input() cur = "a" while True: if cur == "a": if len(a) == 0: print("A") break else: cur = a[0] a = a[1:] elif cur == "b": if len(b) == 0: print("B") break else: cur = b[0] b = b[1:] else: if len(c) == 0: print("C") break else: cur = c[0] c = c[1:]
[ 7, 15, 41, 28, 13, 4, 13, 17, 4, 4, 13, 13, 0, 13, 13, 0, 13, 17, 42, 17, 14, 40, 18, 13, 13, 4, 13, 18, 17, 13, 3, 0, 13, 4, 18, 18, 13, 13, 13, 10, 13, 13, 10, 17, 13, 10, 4, 13 ]
[ [ 5, 4 ], [ 40, 13 ], [ 43, 16 ], [ 41, 23 ], [ 44, 24 ], [ 47, 24 ], [ 44, 29 ], [ 47, 29 ], [ 46, 32 ], [ 41, 36 ], [ 44, 37 ], [ 47, 37 ], [ 40, 41 ], [ 43, 44 ], [ 46, 47 ] ]
[ "from collections import deque\ns = [deque([ord(a) - ord('a') for a in list(input())]) for i in range(3)]\n\nnow = 0\nwhile True:\n if not s[now]:\n print('ABC'[now])\n break\n else:\n now = s[now].popleft()", "from collections import deque", "deque([ord(a) - ord('a') for a in list(input())]) for i in range(3)", "for i in range(3)", "i", "range(3)", "range", "3", "for i in range(3)", "deque([ord(a) - ord('a') for a in list(input())])", "deque", "[ord(a) - ord('a') for a in list(input())]", "s = [deque([ord(a) - ord('a') for a in list(input())]) for i in range(3)]", "s", "[deque([ord(a) - ord('a') for a in list(input())]) for i in range(3)]", "now = 0", "now", "0", "while True:\n if not s[now]:\n print('ABC'[now])\n break\n else:\n now = s[now].popleft()", "True", "if not s[now]:\n print('ABC'[now])\n break\n else:\n now = s[now].popleft()", "not s[now]", "s[now]", "s", "now", "print('ABC'[now])", "print", "'ABC'[now]", "'ABC'", "now", "break", "now = s[now].popleft()", "now", "s[now].popleft()", "[now].popleft", "[now]", "s", "now", "popleft", "s = [deque([ord(a) - ord('a') for a in list(input())]) for i in range(3)]", "[deque([ord(a) - ord('a') for a in list(input())]) for i in range(3)]", "s", "now = 0", "0", "now", "now = s[now].popleft()", "s[now].popleft()", "now" ]
from collections import deque s = [deque([ord(a) - ord('a') for a in list(input())]) for i in range(3)] now = 0 while True: if not s[now]: print('ABC'[now]) break else: now = s[now].popleft()
[ 7, 41, 28, 13, 17, 4, 13, 4, 13, 4, 18, 4, 13, 13, 0, 13, 13, 0, 13, 17, 42, 18, 13, 13, 0, 13, 4, 18, 18, 13, 13, 13, 17, 4, 13, 13, 10, 13, 13, 10, 17, 13, 10, 4, 13 ]
[ [ 4, 3 ], [ 3, 6 ], [ 37, 15 ], [ 40, 18 ], [ 38, 22 ], [ 41, 23 ], [ 44, 23 ], [ 43, 25 ], [ 38, 29 ], [ 41, 30 ], [ 44, 30 ], [ 44, 35 ], [ 41, 35 ], [ 37, 38 ], [ 40, 41 ], [ 43, 44 ] ]
[ "S = {p:list(input().upper()) for p in 'ABC'}\np = 'A'\nwhile S[p]:\n p = S[p].pop(0)\nprint(p)", "p:list(input().upper()) for p in 'ABC'", "for p in 'ABC'", "p", "'ABC'", "for p in 'ABC'", "p", "list(input().upper())", "list", "input().upper()", "().upper", "()", "input", "upper", "S = {p:list(input().upper()) for p in 'ABC'}", "S", "{p:list(input().upper()) for p in 'ABC'}", "p = 'A'", "p", "'A'", "while S[p]:\n p = S[p].pop(0)", "S[p]", "S", "p", "p = S[p].pop(0)", "p", "S[p].pop(0)", "[p].pop", "[p]", "S", "p", "pop", "0", "print(p)", "print", "p", "S = {p:list(input().upper()) for p in 'ABC'}", "{p:list(input().upper()) for p in 'ABC'}", "S", "p = 'A'", "'A'", "p", "p = S[p].pop(0)", "S[p].pop(0)", "p" ]
S = {p:list(input().upper()) for p in 'ABC'} p = 'A' while S[p]: p = S[p].pop(0) print(p)
[ 7, 0, 13, 4, 13, 4, 13, 0, 13, 17, 42, 17, 14, 2, 18, 13, 13, 17, 4, 13, 4, 13, 2, 13, 17, 4, 13, 0, 13, 18, 18, 13, 13, 17, 0, 18, 13, 13, 18, 18, 13, 13, 39, 17, 0, 13, 2, 4, 13, 13, 17, 10, 2, 13, 10, 4, 13, 10, 17, 13, 10, 18, 13 ]
[ [ 55, 2 ], [ 58, 8 ], [ 35, 14 ], [ 56, 15 ], [ 59, 16 ], [ 53, 16 ], [ 59, 23 ], [ 53, 23 ], [ 61, 28 ], [ 35, 30 ], [ 56, 31 ], [ 59, 32 ], [ 53, 32 ], [ 38, 35 ], [ 56, 36 ], [ 59, 37 ], [ 53, 37 ], [ 35, 39 ], [ 56, 40 ], [ 59, 41 ], [ 53, 41 ], [ 52, 45 ], [ 62, 49 ], [ 52, 53 ], [ 55, 56 ], [ 58, 59 ], [ 61, 62 ] ]
[ "S=list(input() for i in range(3))\ni=0\nwhile True:\n if S[i]=='':\n print(chr(i+65))\n exit()\n c=S[i][0]\n S[i]=S[i][1:]\n i=ord(c)-97", "S=list(input() for i in range(3))", "S", "list(input() for i in range(3))", "list", "input()", "input", "i=0", "i", "0", "while True:\n if S[i]=='':\n print(chr(i+65))\n exit()\n c=S[i][0]\n S[i]=S[i][1:]\n i=ord(c)-97", "True", "if S[i]=='':\n print(chr(i+65))\n exit()\n ", "S[i]==''", "S[i]", "S", "i", "''", "print(chr(i+65))", "print", "chr(i+65)", "chr", "i+65", "i", "65", "exit()", "exit", "c=S[i][0]", "c", "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=ord(c)-97", "i", "ord(c)-97", "ord(c)", "ord", "c", "97", "i=ord(c)-97", "ord(c)-97", "i", "S=list(input() for i in range(3))", "list(input() for i in range(3))", "S", "i=0", "0", "i", "c=S[i][0]", "S[i][0]", "c" ]
S=list(input() for i in range(3)) i=0 while True: if S[i]=='': print(chr(i+65)) exit() c=S[i][0] S[i]=S[i][1:] i=ord(c)-97
[ 7, 15, 13, 13, 13, 15, 15, 15, 15, 15, 15, 15, 15, 12, 13, 12, 13, 12, 13, 12, 13, 12, 13, 12, 13, 4, 18, 13, 13, 2, 17, 17, 0, 13, 4, 13, 17, 0, 13, 2, 2, 17, 17, 17, 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, 42, 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, 12, 13, 10, 4, 13, 10, 12, 13, 10, 4, 13, 10, 12, 13, 10, 2, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 12, 13, 10, 12, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 12, 13 ]
[ [ 179, 33 ], [ 155, 38 ], [ 149, 45 ], [ 147, 51 ], [ 158, 53 ], [ 147, 59 ], [ 143, 61 ], [ 147, 67 ], [ 161, 69 ], [ 150, 72 ], [ 162, 78 ], [ 177, 78 ], [ 174, 78 ], [ 165, 78 ], [ 150, 84 ], [ 164, 92 ], [ 150, 95 ], [ 165, 99 ], [ 162, 99 ], [ 177, 99 ], [ 174, 99 ], [ 159, 105 ], [ 173, 113 ], [ 159, 116 ], [ 174, 120 ], [ 165, 120 ], [ 162, 120 ], [ 177, 120 ], [ 144, 126 ], [ 176, 134 ], [ 144, 137 ], [ 143, 144 ], [ 149, 150 ], [ 155, 156 ], [ 158, 159 ], [ 161, 162 ], [ 164, 165 ], [ 173, 174 ], [ 176, 177 ], [ 179, 180 ] ]
[ "import sys, re, os\nfrom collections import deque, defaultdict, Counter\nfrom math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians\nfrom itertools import permutations, combinations, product, accumulate\nfrom operator import itemgetter, mul\nfrom copy import deepcopy\nfrom string import ascii_lowercase, ascii_uppercase, digits\nfrom fractions import gcd\nfrom bisect import bisect, bisect_left, bisect_right\n\ndef input(): return sys.stdin.readline().strip()\ndef INT(): return int(input())\ndef MAP(): return map(int, input().split())\ndef S_MAP(): return map(str, input().split())\ndef LIST(): return list(map(int, input().split()))\ndef S_LIST(): return list(map(str, input().split()))\n \nsys.setrecursionlimit(10 ** 9)\nINF = float('inf')\nmod = 10 ** 9 + 7\n\nA = deque(list(input()))\nB = deque(list(input()))\nC = deque(list(input()))\n\n# while len(A) == 0 or len(B) == 0 or len(C) == 0:\np = A.popleft()\nwhile 1:\n if p == \"a\":\n if len(A) == 0:\n print(\"A\")\n exit()\n else:\n p = A.popleft()\n if p == \"b\":\n if len(B) == 0:\n print(\"B\")\n exit()\n else:\n p = B.popleft()\n\n if p == \"c\":\n if len(C) == 0:\n print(\"C\")\n exit()\n else:\n p = C.popleft()\n \n \n", "import sys, re, os", "sys", "re", "os", "from collections import deque, defaultdict, Counter", "from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians", "from itertools import permutations, combinations, product, accumulate", "from operator import itemgetter, mul", "from copy import deepcopy", "from string import ascii_lowercase, ascii_uppercase, digits", "from fractions import gcd", "from bisect import bisect, bisect_left, bisect_right", "def input(): return sys.stdin.readline().strip()", "input", "def INT(): return int(input())", "INT", "def MAP(): return map(int, input().split())", "MAP", "def S_MAP(): return map(str, input().split())", "S_MAP", "def LIST(): return list(map(int, input().split()))", "LIST", "def S_LIST(): return list(map(str, input().split()))\n ", "S_LIST", "sys.setrecursionlimit(10 ** 9)", "sys.setrecursionlimit", "sys", "setrecursionlimit", "10 ** 9", "10", "9", "INF = float('inf')", "INF", "float('inf')", "float", "'inf'", "mod = 10 ** 9 + 7", "mod", "10 ** 9 + 7", "10 ** 9", "10", "9", "7", "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", "p = A.popleft()", "p", "A.popleft()", "A.popleft", "A", "popleft", "while 1:\n if p == \"a\":\n if len(A) == 0:\n print(\"A\")\n exit()\n else:\n p = A.popleft()\n if p == \"b\":\n if len(B) == 0:\n print(\"B\")\n exit()\n else:\n p = B.popleft()\n\n if p == \"c\":\n if len(C) == 0:\n print(\"C\")\n exit()\n else:\n p = C.popleft()\n \n ", "1", "if p == \"a\":\n if len(A) == 0:\n print(\"A\")\n exit()\n else:\n p = A.popleft()\n ", "p == \"a\"", "p", "\"a\"", "if len(A) == 0:\n print(\"A\")\n exit()\n else:\n p = A.popleft()\n ", "len(A) == 0", "len(A)", "len", "A", "0", "print(\"A\")", "print", "\"A\"", "exit()", "exit", "p = A.popleft()", "p", "A.popleft()", "A.popleft", "A", "popleft", "if p == \"b\":\n if len(B) == 0:\n print(\"B\")\n exit()\n else:\n p = B.popleft()\n\n ", "p == \"b\"", "p", "\"b\"", "if len(B) == 0:\n print(\"B\")\n exit()\n else:\n p = B.popleft()\n\n ", "len(B) == 0", "len(B)", "len", "B", "0", "print(\"B\")", "print", "\"B\"", "exit()", "exit", "p = B.popleft()", "p", "B.popleft()", "B.popleft", "B", "popleft", "if p == \"c\":\n if len(C) == 0:\n print(\"C\")\n exit()\n else:\n p = C.popleft()\n \n ", "p == \"c\"", "p", "\"c\"", "if len(C) == 0:\n print(\"C\")\n exit()\n else:\n p = C.popleft()\n \n ", "len(C) == 0", "len(C)", "len", "C", "0", "print(\"C\")", "print", "\"C\"", "exit()", "exit", "p = C.popleft()", "p", "C.popleft()", "C.popleft", "C", "popleft", "def MAP(): return map(int, input().split())", "def MAP(): return map(int, input().split())", "MAP", "C = deque(list(input()))", "deque(list(input()))", "C", "def input(): return sys.stdin.readline().strip()", "def input(): return sys.stdin.readline().strip()", "input", "A = deque(list(input()))", "deque(list(input()))", "A", "def S_LIST(): return list(map(str, input().split()))\n ", "def S_LIST(): return list(map(str, input().split()))\n ", "S_LIST", "mod = 10 ** 9 + 7", "10 ** 9 + 7", "mod", "B = deque(list(input()))", "deque(list(input()))", "B", "p = A.popleft()", "A.popleft()", "p", "p = A.popleft()", "A.popleft()", "p", "def INT(): return int(input())", "def INT(): return int(input())", "INT", "def S_MAP(): return map(str, input().split())", "def S_MAP(): return map(str, input().split())", "S_MAP", "p = B.popleft()", "B.popleft()", "p", "p = C.popleft()", "C.popleft()", "p", "INF = float('inf')", "float('inf')", "INF", "def LIST(): return list(map(int, input().split()))", "def LIST(): return list(map(int, input().split()))", "LIST" ]
import sys, re, os from collections import deque, defaultdict, Counter from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians from itertools import permutations, combinations, product, accumulate from operator import itemgetter, mul from copy import deepcopy from string import ascii_lowercase, ascii_uppercase, digits from fractions import gcd from bisect import bisect, bisect_left, bisect_right def input(): return sys.stdin.readline().strip() def INT(): return int(input()) def MAP(): return map(int, input().split()) def S_MAP(): return map(str, input().split()) def LIST(): return list(map(int, input().split())) def S_LIST(): return list(map(str, input().split())) sys.setrecursionlimit(10 ** 9) INF = float('inf') mod = 10 ** 9 + 7 A = deque(list(input())) B = deque(list(input())) C = deque(list(input())) # while len(A) == 0 or len(B) == 0 or len(C) == 0: p = A.popleft() while 1: if p == "a": if len(A) == 0: print("A") exit() else: p = A.popleft() if p == "b": if len(B) == 0: print("B") exit() else: p = B.popleft() if p == "c": if len(C) == 0: print("C") exit() else: p = C.popleft()
[ 7, 0, 13, 17, 4, 18, 13, 13, 17, 2, 4, 13, 4, 13, 17, 4, 18, 13, 13, 17, 2, 4, 13, 4, 13, 17, 4, 18, 13, 13, 17, 2, 4, 13, 4, 13, 17, 0, 13, 18, 18, 13, 17, 17, 0, 18, 13, 17, 18, 18, 13, 17, 39, 17, 42, 2, 2, 2, 4, 13, 18, 13, 17, 17, 2, 4, 13, 18, 13, 17, 17, 2, 4, 13, 18, 13, 17, 17, 0, 13, 18, 18, 13, 13, 17, 0, 18, 13, 13, 18, 18, 13, 13, 39, 17, 0, 13, 13, 4, 13, 13, 10, 13, 13, 10, 18, 13, 10, 17, 13, 10, 18, 13 ]
[ [ 108, 2 ], [ 109, 6 ], [ 109, 17 ], [ 109, 28 ], [ 105, 38 ], [ 109, 41 ], [ 48, 45 ], [ 109, 46 ], [ 109, 50 ], [ 109, 61 ], [ 109, 68 ], [ 109, 75 ], [ 111, 79 ], [ 86, 81 ], [ 109, 82 ], [ 106, 83 ], [ 103, 83 ], [ 89, 86 ], [ 109, 87 ], [ 106, 88 ], [ 103, 88 ], [ 86, 90 ], [ 109, 91 ], [ 106, 92 ], [ 103, 92 ], [ 102, 96 ], [ 112, 97 ], [ 103, 100 ], [ 106, 100 ], [ 112, 102 ], [ 102, 103 ], [ 105, 106 ], [ 108, 109 ], [ 111, 112 ] ]
[ "dic = {}\ndic.setdefault('a',str(input())+'A')\ndic.setdefault('b',str(input())+'B')\ndic.setdefault('c',str(input())+'C')\ndare = dic['a'][0]\ndic['a'] = dic['a'][1:]\nwhile len(dic['a'])>0 and len(dic['b'])>0 and len(dic['c'])>0:\n tmp = dic[dare][0]\n dic[dare] = dic[dare][1:]\n dare = tmp\nprint(dare)", "dic = {}", "dic", "{}", "dic.setdefault('a',str(input())+'A')", "dic.setdefault", "dic", "setdefault", "'a'", "str(input())+'A'", "str(input())", "str", "input()", "input", "'A'", "dic.setdefault('b',str(input())+'B')", "dic.setdefault", "dic", "setdefault", "'b'", "str(input())+'B'", "str(input())", "str", "input()", "input", "'B'", "dic.setdefault('c',str(input())+'C')", "dic.setdefault", "dic", "setdefault", "'c'", "str(input())+'C'", "str(input())", "str", "input()", "input", "'C'", "dare = dic['a'][0]", "dare", "dic['a'][0]", "['a']", "dic", "'a'", "0", "dic['a'] = dic['a'][1:]", "dic['a']", "dic", "'a'", "dic['a'][1:]", "['a']", "dic", "'a'", "1:", "1", "while len(dic['a'])>0 and len(dic['b'])>0 and len(dic['c'])>0:\n tmp = dic[dare][0]\n dic[dare] = dic[dare][1:]\n dare = tmp", "len(dic['a'])>0 and len(dic['b'])>0 and len(dic['c'])>0", "len(dic['a'])>0 and len(dic['b'])>0", "len(dic['a'])>0", "len(dic['a'])", "len", "dic['a']", "dic", "'a'", "0", "len(dic['b'])>0", "len(dic['b'])", "len", "dic['b']", "dic", "'b'", "0", "len(dic['c'])>0", "len(dic['c'])", "len", "dic['c']", "dic", "'c'", "0", "tmp = dic[dare][0]", "tmp", "dic[dare][0]", "[dare]", "dic", "dare", "0", "dic[dare] = dic[dare][1:]", "dic[dare]", "dic", "dare", "dic[dare][1:]", "[dare]", "dic", "dare", "1:", "1", "dare = tmp", "dare", "tmp", "print(dare)", "print", "dare", "dare = tmp", "tmp", "dare", "dare = dic['a'][0]", "dic['a'][0]", "dare", "dic = {}", "{}", "dic", "tmp = dic[dare][0]", "dic[dare][0]", "tmp" ]
dic = {} dic.setdefault('a',str(input())+'A') dic.setdefault('b',str(input())+'B') dic.setdefault('c',str(input())+'C') dare = dic['a'][0] dic['a'] = dic['a'][1:] while len(dic['a'])>0 and len(dic['b'])>0 and len(dic['c'])>0: tmp = dic[dare][0] dic[dare] = dic[dare][1:] dare = tmp print(dare)
[ 7, 0, 13, 17, 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, 0, 13, 13, 3, 14, 2, 18, 18, 13, 13, 17, 17, 0, 13, 17, 14, 2, 18, 18, 13, 13, 17, 17, 0, 13, 17, 14, 2, 18, 18, 13, 13, 17, 17, 0, 13, 17, 0, 18, 13, 13, 18, 18, 13, 13, 39, 17, 0, 13, 13, 4, 13, 13, 10, 13, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 13, 13, 10, 17, 13, 10, 17, 13 ]
[ [ 98, 2 ], [ 8, 5 ], [ 99, 6 ], [ 14, 11 ], [ 99, 12 ], [ 20, 17 ], [ 99, 18 ], [ 92, 23 ], [ 73, 31 ], [ 99, 32 ], [ 93, 33 ], [ 90, 33 ], [ 101, 36 ], [ 93, 37 ], [ 90, 37 ], [ 73, 42 ], [ 99, 43 ], [ 93, 44 ], [ 90, 44 ], [ 104, 48 ], [ 73, 53 ], [ 99, 54 ], [ 93, 55 ], [ 90, 55 ], [ 107, 59 ], [ 73, 64 ], [ 99, 65 ], [ 93, 66 ], [ 90, 66 ], [ 95, 70 ], [ 76, 73 ], [ 99, 74 ], [ 93, 75 ], [ 90, 75 ], [ 73, 77 ], [ 99, 78 ], [ 93, 79 ], [ 90, 79 ], [ 89, 83 ], [ 96, 84 ], [ 108, 84 ], [ 105, 84 ], [ 102, 87 ], [ 96, 89 ], [ 108, 89 ], [ 105, 89 ], [ 89, 90 ], [ 92, 93 ], [ 95, 96 ], [ 98, 99 ], [ 93, 101 ], [ 90, 101 ], [ 101, 102 ], [ 104, 105 ], [ 107, 108 ] ]
[ "D = {}\nD[\"A\"] = input()\nD[\"B\"] = input()\nD[\"C\"] = input()\n\nt = \"A\"\nwhile 1:\n if len(D[t]) == 0:\n winner = t\n break\n if D[t][0] == \"a\":\n u = \"A\"\n elif D[t][0] == \"b\":\n u = \"B\"\n elif D[t][0] == \"c\":\n u = \"C\"\n D[t] = D[t][1:]\n t = u\nprint(winner)", "D = {}", "D", "{}", "D[\"A\"] = input()", "D[\"A\"]", "D", "\"A\"", "input()", "input", "D[\"B\"] = input()", "D[\"B\"]", "D", "\"B\"", "input()", "input", "D[\"C\"] = input()", "D[\"C\"]", "D", "\"C\"", "input()", "input", "t = \"A\"", "t", "\"A\"", "while 1:\n if len(D[t]) == 0:\n winner = t\n break\n if D[t][0] == \"a\":\n u = \"A\"\n elif D[t][0] == \"b\":\n u = \"B\"\n elif D[t][0] == \"c\":\n u = \"C\"\n D[t] = D[t][1:]\n t = u", "1", "if len(D[t]) == 0:\n winner = t\n break\n ", "len(D[t]) == 0", "len(D[t])", "len", "D[t]", "D", "t", "0", "winner = t", "winner", "t", "break", "if D[t][0] == \"a\":\n u = \"A\"\n elif D[t][0] == \"b\":\n u = \"B\"\n elif D[t][0] == \"c\":\n u = \"C\"\n ", "D[t][0] == \"a\"", "D[t][0]", "[t]", "D", "t", "0", "\"a\"", "u = \"A\"", "u", "\"A\"", "elif D[t][0] == \"b\":\n u = \"B\"\n ", "D[t][0] == \"b\"", "D[t][0]", "[t]", "D", "t", "0", "\"b\"", "u = \"B\"", "u", "\"B\"", "elif D[t][0] == \"c\":\n u = \"C\"\n ", "D[t][0] == \"c\"", "D[t][0]", "[t]", "D", "t", "0", "\"c\"", "u = \"C\"", "u", "\"C\"", "D[t] = D[t][1:]", "D[t]", "D", "t", "D[t][1:]", "[t]", "D", "t", "1:", "1", "t = u", "t", "u", "print(winner)", "print", "winner", "t = u", "u", "t", "t = \"A\"", "\"A\"", "t", "u = \"C\"", "\"C\"", "u", "D = {}", "{}", "D", "winner = t", "t", "winner", "u = \"A\"", "\"A\"", "u", "u = \"B\"", "\"B\"", "u" ]
D = {} D["A"] = input() D["B"] = input() D["C"] = input() t = "A" while 1: if len(D[t]) == 0: winner = t break if D[t][0] == "a": u = "A" elif D[t][0] == "b": u = "B" elif D[t][0] == "c": u = "C" D[t] = D[t][1:] t = u print(winner)
[ 7, 15, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 4, 13, 4, 13, 13, 0, 13, 4, 13, 4, 13, 13, 0, 13, 4, 13, 4, 13, 13, 0, 13, 17, 42, 17, 14, 2, 13, 17, 14, 40, 13, 0, 13, 4, 18, 13, 13, 14, 2, 13, 17, 14, 40, 13, 0, 13, 4, 18, 13, 13, 14, 2, 13, 17, 14, 40, 13, 0, 13, 4, 18, 13, 13, 14, 2, 13, 17, 4, 13, 17, 14, 2, 13, 17, 4, 13, 17, 4, 13, 17, 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 ]
[ [ 109, 3 ], [ 97, 7 ], [ 103, 11 ], [ 124, 15 ], [ 110, 20 ], [ 100, 22 ], [ 98, 27 ], [ 121, 29 ], [ 104, 34 ], [ 115, 36 ], [ 116, 42 ], [ 113, 42 ], [ 119, 42 ], [ 107, 42 ], [ 125, 46 ], [ 106, 48 ], [ 125, 51 ], [ 116, 55 ], [ 113, 55 ], [ 119, 55 ], [ 107, 55 ], [ 101, 59 ], [ 118, 61 ], [ 101, 64 ], [ 116, 68 ], [ 113, 68 ], [ 119, 68 ], [ 107, 68 ], [ 122, 72 ], [ 112, 74 ], [ 122, 77 ], [ 113, 81 ], [ 119, 81 ], [ 107, 81 ], [ 116, 81 ], [ 113, 88 ], [ 119, 88 ], [ 107, 88 ], [ 116, 88 ], [ 97, 98 ], [ 100, 101 ], [ 103, 104 ], [ 106, 107 ], [ 109, 110 ], [ 112, 113 ], [ 115, 116 ], [ 118, 119 ], [ 121, 122 ], [ 124, 125 ] ]
[ "from collections import deque\nSa = input()\nSb = input()\nSc = input()\na = deque(list(Sa))\nb = deque(list(Sb))\nc = deque(list(Sc))\n\nx = 'a'\nwhile True:\n if x == 'a':\n if not a:break\n x = a.popleft()\n elif x == 'b':\n if not b:break\n x = b.popleft()\n elif x == 'c':\n if not c:break\n x = c.popleft()\nif x == 'a':\n print('A')\nelif x == 'b':\n print('B')\nelse:\n print('C')", "from collections import deque", "Sa = input()", "Sa", "input()", "input", "Sb = input()", "Sb", "input()", "input", "Sc = input()", "Sc", "input()", "input", "a = deque(list(Sa))", "a", "deque(list(Sa))", "deque", "list(Sa)", "list", "Sa", "b = deque(list(Sb))", "b", "deque(list(Sb))", "deque", "list(Sb)", "list", "Sb", "c = deque(list(Sc))", "c", "deque(list(Sc))", "deque", "list(Sc)", "list", "Sc", "x = 'a'", "x", "'a'", "while True:\n if x == 'a':\n if not a:break\n x = a.popleft()\n elif x == 'b':\n if not b:break\n x = b.popleft()\n elif x == 'c':\n if not c:break\n x = c.popleft()", "True", "if x == 'a':\n if not a:break\n x = a.popleft()\n elif x == 'b':\n if not b:break\n x = b.popleft()\n elif x == 'c':\n if not c:break\n x = c.popleft()", "x == 'a'", "x", "'a'", "if not a:break\n ", "not a", "a", "x = a.popleft()", "x", "a.popleft()", "a.popleft", "a", "popleft", "elif x == 'b':\n if not b:break\n x = b.popleft()\n ", "x == 'b'", "x", "'b'", "if not b:break\n ", "not b", "b", "x = b.popleft()", "x", "b.popleft()", "b.popleft", "b", "popleft", "elif x == 'c':\n if not c:break\n x = c.popleft()", "x == 'c'", "x", "'c'", "if not c:break\n ", "not c", "c", "x = c.popleft()", "x", "c.popleft()", "c.popleft", "c", "popleft", "if x == 'a':\n print('A')\nelif x == 'b':\n print('B')\nelse:\n print('C')", "x == 'a'", "x", "'a'", "print('A')", "print", "'A'", "elif x == 'b':\n print('B')", "x == 'b'", "x", "'b'", "print('B')", "print", "'B'", "print('C')", "print", "'C'", "Sb = input()", "input()", "Sb", "b = deque(list(Sb))", "deque(list(Sb))", "b", "Sc = input()", "input()", "Sc", "x = a.popleft()", "a.popleft()", "x", "Sa = input()", "input()", "Sa", "x = c.popleft()", "c.popleft()", "x", "x = 'a'", "'a'", "x", "x = b.popleft()", "b.popleft()", "x", "c = deque(list(Sc))", "deque(list(Sc))", "c", "a = deque(list(Sa))", "deque(list(Sa))", "a" ]
from collections import deque Sa = input() Sb = input() Sc = input() a = deque(list(Sa)) b = deque(list(Sb)) c = deque(list(Sc)) x = 'a' while True: if x == 'a': if not a:break x = a.popleft() elif x == 'b': if not b:break x = b.popleft() elif x == 'c': if not c:break x = c.popleft() if x == 'a': print('A') elif x == 'b': print('B') else: print('C')
[ 7, 12, 13, 42, 40, 4, 13, 18, 13, 13, 17, 0, 13, 4, 18, 18, 13, 13, 13, 17, 29, 13, 23, 13, 23, 13, 17, 12, 13, 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, 4, 13, 4, 13, 13, 29, 14, 2, 13, 17, 4, 13, 10, 12, 13, 10, 12, 13 ]
[ [ 23, 8 ], [ 25, 9 ], [ 12, 9 ], [ 13, 12 ], [ 23, 16 ], [ 25, 17 ], [ 12, 17 ], [ 12, 21 ], [ 25, 21 ], [ 23, 23 ], [ 26, 25 ], [ 31, 30 ], [ 36, 33 ], [ 30, 34 ], [ 47, 44 ], [ 30, 45 ], [ 58, 55 ], [ 30, 56 ], [ 82, 68 ], [ 30, 69 ], [ 79, 76 ] ]
[ "#!/usr/bin/env python3\n\n# from numba import njit\n\n# input = stdin.readline\n\n# @njit\ndef solve(d,next=\"A\"):\n while len(d[next]) != 0:\n next = d[next].pop(0)\n return next\n\n\n\ndef main():\n d = {}\n d[\"A\"] = list(input().upper())\n d[\"B\"] = list(input().upper())\n d[\"C\"] = list(input().upper())\n print(solve(d))\n return\n\nif __name__ == '__main__':\n main()", "def solve(d,next=\"A\"):\n while len(d[next]) != 0:\n next = d[next].pop(0)\n return next", "solve", "while len(d[next]) != 0:\n next = d[next].pop(0)\n ", "len(d[next]) != 0", "len(d[next])", "len", "d[next]", "d", "next", "0", "next = d[next].pop(0)", "next", "d[next].pop(0)", "[next].pop", "[next]", "d", "next", "pop", "0", "return next", "next", "d", "d", "next=\"A\"", "next", "\"A\"", "def main():\n d = {}\n d[\"A\"] = list(input().upper())\n d[\"B\"] = list(input().upper())\n d[\"C\"] = list(input().upper())\n print(solve(d))\n return", "main", "d = {}", "d", "{}", "d[\"A\"] = list(input().upper())", "d[\"A\"]", "d", "\"A\"", "list(input().upper())", "list", "input().upper()", "().upper", "()", "input", "upper", "d[\"B\"] = list(input().upper())", "d[\"B\"]", "d", "\"B\"", "list(input().upper())", "list", "input().upper()", "().upper", "()", "input", "upper", "d[\"C\"] = list(input().upper())", "d[\"C\"]", "d", "\"C\"", "list(input().upper())", "list", "input().upper()", "().upper", "()", "input", "upper", "print(solve(d))", "print", "solve(d)", "solve", "d", "return", "if __name__ == '__main__':\n main()", "__name__ == '__main__'", "__name__", "'__main__'", "main()", "main", "def main():\n d = {}\n d[\"A\"] = list(input().upper())\n d[\"B\"] = list(input().upper())\n d[\"C\"] = list(input().upper())\n print(solve(d))\n return", "def main():\n d = {}\n d[\"A\"] = list(input().upper())\n d[\"B\"] = list(input().upper())\n d[\"C\"] = list(input().upper())\n print(solve(d))\n return", "main", "def solve(d,next=\"A\"):\n while len(d[next]) != 0:\n next = d[next].pop(0)\n return next", "def solve(d,next=\"A\"):\n while len(d[next]) != 0:\n next = d[next].pop(0)\n return next", "solve" ]
#!/usr/bin/env python3 # from numba import njit # input = stdin.readline # @njit def solve(d,next="A"): while len(d[next]) != 0: next = d[next].pop(0) return next def main(): d = {} d["A"] = list(input().upper()) d["B"] = list(input().upper()) d["C"] = list(input().upper()) print(solve(d)) return 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, 42, 17, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 4, 13, 17, 3, 0, 13, 18, 13, 17, 4, 18, 13, 13, 17, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 4, 13, 17, 3, 0, 13, 18, 13, 17, 4, 18, 13, 13, 17, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 4, 13, 17, 3, 0, 13, 18, 13, 17, 4, 18, 13, 13, 17, 10, 4, 13, 10, 17, 13, 10, 18, 13, 10, 18, 13, 10, 4, 13, 10, 4, 13, 10, 18, 13 ]
[ [ 109, 2 ], [ 97, 8 ], [ 112, 14 ], [ 100, 20 ], [ 101, 26 ], [ 104, 26 ], [ 107, 26 ], [ 116, 26 ], [ 110, 32 ], [ 115, 39 ], [ 110, 41 ], [ 110, 45 ], [ 116, 50 ], [ 101, 50 ], [ 104, 50 ], [ 107, 50 ], [ 98, 56 ], [ 106, 63 ], [ 98, 65 ], [ 98, 69 ], [ 107, 74 ], [ 116, 74 ], [ 101, 74 ], [ 104, 74 ], [ 113, 80 ], [ 103, 87 ], [ 113, 89 ], [ 113, 93 ], [ 97, 98 ], [ 100, 101 ], [ 103, 104 ], [ 106, 107 ], [ 109, 110 ], [ 112, 113 ], [ 115, 116 ] ]
[ "a = list(input())\nb = list(input())\nc = list(input())\ncheck = \"a\"\nwhile True:\n if check == \"a\":\n if len(a) == 0:\n print(\"A\")\n break\n else:\n check = a[0]\n a.pop(0)\n if check == \"b\":\n if len(b) == 0:\n print(\"B\")\n break\n else:\n check = b[0]\n b.pop(0)\n if check == \"c\":\n if len(c) == 0:\n print(\"C\")\n break\n else:\n check = c[0]\n 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", "check = \"a\"", "check", "\"a\"", "while True:\n if check == \"a\":\n if len(a) == 0:\n print(\"A\")\n break\n else:\n check = a[0]\n a.pop(0)\n if check == \"b\":\n if len(b) == 0:\n print(\"B\")\n break\n else:\n check = b[0]\n b.pop(0)\n if check == \"c\":\n if len(c) == 0:\n print(\"C\")\n break\n else:\n check = c[0]\n c.pop(0)", "True", "if check == \"a\":\n if len(a) == 0:\n print(\"A\")\n break\n else:\n check = a[0]\n a.pop(0)\n ", "check == \"a\"", "check", "\"a\"", "if len(a) == 0:\n print(\"A\")\n break\n else:\n check = a[0]\n a.pop(0)\n ", "len(a) == 0", "len(a)", "len", "a", "0", "print(\"A\")", "print", "\"A\"", "break", "check = a[0]", "check", "a[0]", "a", "0", "a.pop(0)", "a.pop", "a", "pop", "0", "if check == \"b\":\n if len(b) == 0:\n print(\"B\")\n break\n else:\n check = b[0]\n b.pop(0)\n ", "check == \"b\"", "check", "\"b\"", "if len(b) == 0:\n print(\"B\")\n break\n else:\n check = b[0]\n b.pop(0)\n ", "len(b) == 0", "len(b)", "len", "b", "0", "print(\"B\")", "print", "\"B\"", "break", "check = b[0]", "check", "b[0]", "b", "0", "b.pop(0)", "b.pop", "b", "pop", "0", "if check == \"c\":\n if len(c) == 0:\n print(\"C\")\n break\n else:\n check = c[0]\n c.pop(0)", "check == \"c\"", "check", "\"c\"", "if len(c) == 0:\n print(\"C\")\n break\n else:\n check = c[0]\n c.pop(0)", "len(c) == 0", "len(c)", "len", "c", "0", "print(\"C\")", "print", "\"C\"", "break", "check = c[0]", "check", "c[0]", "c", "0", "c.pop(0)", "c.pop", "c", "pop", "0", "b = list(input())", "list(input())", "b", "check = \"a\"", "\"a\"", "check", "check = c[0]", "c[0]", "check", "check = b[0]", "b[0]", "check", "a = list(input())", "list(input())", "a", "c = list(input())", "list(input())", "c", "check = a[0]", "a[0]", "check" ]
a = list(input()) b = list(input()) c = list(input()) check = "a" while True: if check == "a": if len(a) == 0: print("A") break else: check = a[0] a.pop(0) if check == "b": if len(b) == 0: print("B") break else: check = b[0] b.pop(0) if check == "c": if len(c) == 0: print("C") break else: check = c[0] c.pop(0)
[ 7, 15, 13, 12, 13, 0, 13, 4, 13, 13, 4, 13, 13, 4, 13, 0, 13, 17, 13, 17, 13, 17, 0, 13, 17, 42, 2, 2, 40, 13, 4, 13, 13, 40, 13, 4, 13, 13, 40, 13, 4, 13, 13, 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, 4, 13, 10, 18, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 4, 13, 10, 17, 13, 10, 18, 13, 10, 12, 13, 10, 17, 13, 10, 18, 13, 10, 17, 13 ]
[ [ 127, 6 ], [ 137, 8 ], [ 124, 9 ], [ 137, 11 ], [ 106, 12 ], [ 137, 14 ], [ 130, 16 ], [ 112, 18 ], [ 121, 20 ], [ 145, 23 ], [ 131, 29 ], [ 140, 29 ], [ 128, 32 ], [ 113, 34 ], [ 119, 34 ], [ 125, 37 ], [ 122, 39 ], [ 116, 39 ], [ 107, 42 ], [ 146, 45 ], [ 143, 45 ], [ 110, 45 ], [ 134, 45 ], [ 131, 49 ], [ 140, 49 ], [ 128, 52 ], [ 133, 58 ], [ 128, 60 ], [ 131, 61 ], [ 140, 61 ], [ 139, 63 ], [ 146, 67 ], [ 143, 67 ], [ 110, 67 ], [ 134, 67 ], [ 113, 71 ], [ 119, 71 ], [ 125, 74 ], [ 109, 80 ], [ 125, 82 ], [ 113, 83 ], [ 119, 83 ], [ 118, 85 ], [ 122, 89 ], [ 116, 89 ], [ 107, 92 ], [ 142, 98 ], [ 107, 100 ], [ 122, 101 ], [ 116, 101 ], [ 115, 103 ], [ 106, 107 ], [ 109, 110 ], [ 112, 113 ], [ 115, 116 ], [ 118, 119 ], [ 121, 122 ], [ 124, 125 ], [ 127, 128 ], [ 130, 131 ], [ 133, 134 ], [ 139, 140 ], [ 142, 143 ], [ 145, 146 ] ]
[ "import sys\ndef LS2(): return list(sys.stdin.readline().rstrip()) #空白なし\n\nSA,SB,SC = LS2(),LS2(),LS2()\na,b,c = 0,0,0\nturn = 'a'\nwhile a <= len(SA) and b <= len(SB) and c <= len(SC):\n if turn == 'a':\n if a == len(SA):\n print('A')\n break\n else:\n turn = SA[a]\n a += 1\n elif turn == 'b':\n if b == len(SB):\n print('B')\n break\n else:\n turn = SB[b]\n b += 1\n else:\n if c == len(SC):\n print('C')\n break\n else:\n turn = SC[c]\n c += 1", "import sys", "sys", "def LS2(): return list(sys.stdin.readline().rstrip()) #空白なし", "LS2", "SA,SB,SC = LS2(),LS2(),LS2()", "SA", "LS2()", "LS2", "SB", "LS2()", "LS2", "SC", "LS2()", "LS2", "a,b,c = 0,0,0", "a", "0", "b", "0", "c", "0", "turn = 'a'", "turn", "'a'", "while a <= len(SA) and b <= len(SB) and c <= len(SC):\n if turn == 'a':\n if a == len(SA):\n print('A')\n break\n else:\n turn = SA[a]\n a += 1\n elif turn == 'b':\n if b == len(SB):\n print('B')\n break\n else:\n turn = SB[b]\n b += 1\n else:\n if c == len(SC):\n print('C')\n break\n else:\n turn = SC[c]\n c += 1", "a <= len(SA) and b <= len(SB) and c <= len(SC)", "a <= len(SA) and b <= len(SB)", "a <= len(SA)", "a", "len(SA)", "len", "SA", "b <= len(SB)", "b", "len(SB)", "len", "SB", "c <= len(SC)", "c", "len(SC)", "len", "SC", "if turn == 'a':\n if a == len(SA):\n print('A')\n break\n else:\n turn = SA[a]\n a += 1\n elif turn == 'b':\n if b == len(SB):\n print('B')\n break\n else:\n turn = SB[b]\n b += 1\n else:\n if c == len(SC):\n print('C')\n break\n else:\n turn = SC[c]\n c += 1", "turn == 'a'", "turn", "'a'", "if a == len(SA):\n print('A')\n break\n else:\n turn = SA[a]\n a += 1\n ", "a == len(SA)", "a", "len(SA)", "len", "SA", "print('A')", "print", "'A'", "break", "turn = SA[a]", "turn", "SA[a]", "SA", "a", "a += 1", "a", "1", "elif turn == 'b':\n if b == len(SB):\n print('B')\n break\n else:\n turn = SB[b]\n b += 1\n ", "turn == 'b'", "turn", "'b'", "if b == len(SB):\n print('B')\n break\n else:\n turn = SB[b]\n b += 1\n ", "b == len(SB)", "b", "len(SB)", "len", "SB", "print('B')", "print", "'B'", "break", "turn = SB[b]", "turn", "SB[b]", "SB", "b", "b += 1", "b", "1", "if c == len(SC):\n print('C')\n break\n else:\n turn = SC[c]\n c += 1", "c == len(SC)", "c", "len(SC)", "len", "SC", "print('C')", "print", "'C'", "break", "turn = SC[c]", "turn", "SC[c]", "SC", "c", "c += 1", "c", "1", "SC = LS2(),LS2(),LS2()", "LS2()", "SC", "turn = SB[b]", "SB[b]", "turn", "b,c = 0,0,0", "0", "b", "c += 1", "1", "c", "b += 1", "1", "b", "c = 0,0,0", "0", "c", "SB,SC = LS2(),LS2(),LS2()", "LS2()", "SB", "SA,SB,SC = LS2(),LS2(),LS2()", "LS2()", "SA", "a,b,c = 0,0,0", "0", "a", "turn = SA[a]", "SA[a]", "turn", "def LS2(): return list(sys.stdin.readline().rstrip()) #空白なし", "def LS2(): return list(sys.stdin.readline().rstrip()) #空白なし", "LS2", "a += 1", "1", "a", "turn = SC[c]", "SC[c]", "turn", "turn = 'a'", "'a'", "turn" ]
import sys def LS2(): return list(sys.stdin.readline().rstrip()) #空白なし SA,SB,SC = LS2(),LS2(),LS2() a,b,c = 0,0,0 turn = 'a' while a <= len(SA) and b <= len(SB) and c <= len(SC): if turn == 'a': if a == len(SA): print('A') break else: turn = SA[a] a += 1 elif turn == 'b': if b == len(SB): print('B') break else: turn = SB[b] b += 1 else: if c == len(SC): print('C') break else: turn = SC[c] c += 1
[ 7, 0, 13, 21, 22, 17, 4, 13, 4, 13, 22, 17, 4, 13, 4, 13, 22, 17, 4, 13, 4, 13, 0, 13, 17, 42, 17, 14, 2, 4, 13, 18, 13, 13, 17, 4, 13, 4, 18, 13, 13, 3, 0, 13, 4, 18, 18, 13, 13, 13, 17, 10, 17, 13, 10, 4, 13, 10, 21, 13 ]
[ [ 58, 2 ], [ 52, 23 ], [ 59, 32 ], [ 53, 33 ], [ 56, 33 ], [ 53, 39 ], [ 56, 39 ], [ 55, 43 ], [ 59, 47 ], [ 53, 48 ], [ 56, 48 ], [ 52, 53 ], [ 55, 56 ], [ 58, 59 ] ]
[ "#辞書型リスト作成\ndic ={\n \"a\":list(input()),\n \"b\":list(input()),\n \"c\":list(input())\n}\n#print(dic)\n\nnow = \"a\"\nwhile True:\n if len(dic[now]) == 0:\n print(now.upper()) #大文字変換\n break\n now = dic[now].pop(0) #値削除", "dic ={\n \"a\":list(input()),\n \"b\":list(input()),\n \"c\":list(input())\n}", "dic", "{\n \"a\":list(input()),\n \"b\":list(input()),\n \"c\":list(input())\n}", "\"a\"", "\"a\"", "list(input())", "list", "input()", "input", "\"b\"", "\"b\"", "list(input())", "list", "input()", "input", "\"c\"", "\"c\"", "list(input())", "list", "input()", "input", "now = \"a\"", "now", "\"a\"", "while True:\n if len(dic[now]) == 0:\n print(now.upper()) #大文字変換\n break\n now = dic[now].pop(0) #値削除", "True", "if len(dic[now]) == 0:\n print(now.upper()) #大文字変換\n break\n ", "len(dic[now]) == 0", "len(dic[now])", "len", "dic[now]", "dic", "now", "0", "print(now.upper())", "print", "now.upper()", "now.upper", "now", "upper", "break", "now = dic[now].pop(0)", "now", "dic[now].pop(0)", "[now].pop", "[now]", "dic", "now", "pop", "0", "now = \"a\"", "\"a\"", "now", "now = dic[now].pop(0)", "dic[now].pop(0)", "now", "dic ={\n \"a\":list(input()),\n \"b\":list(input()),\n \"c\":list(input())\n}", "{\n \"a\":list(input()),\n \"b\":list(input()),\n \"c\":list(input())\n}", "dic" ]
#辞書型リスト作成 dic ={ "a":list(input()), "b":list(input()), "c":list(input()) } #print(dic) now = "a" while True: if len(dic[now]) == 0: print(now.upper()) #大文字変換 break now = dic[now].pop(0) #値削除
[ 7, 0, 13, 17, 0, 13, 39, 17, 17, 17, 28, 13, 13, 0, 18, 13, 13, 4, 13, 4, 13, 0, 13, 18, 13, 17, 42, 17, 14, 2, 4, 13, 18, 13, 13, 17, 4, 13, 4, 18, 13, 13, 3, 0, 13, 4, 18, 18, 13, 13, 13, 17, 10, 17, 13, 10, 39, 13, 10, 18, 13, 10, 4, 13 ]
[ [ 53, 2 ], [ 56, 5 ], [ 12, 11 ], [ 57, 11 ], [ 17, 14 ], [ 54, 15 ], [ 11, 16 ], [ 59, 22 ], [ 57, 24 ], [ 54, 33 ], [ 60, 34 ], [ 63, 34 ], [ 60, 40 ], [ 63, 40 ], [ 62, 44 ], [ 54, 48 ], [ 60, 49 ], [ 63, 49 ], [ 53, 54 ], [ 56, 57 ], [ 59, 60 ], [ 62, 63 ] ]
[ "G = {}\nl =[\"a\",\"b\",\"c\"]\nfor i in l:\n G[i] = list(input())\ns = l[0]\nwhile(True):\n if len(G[s]) ==0:\n print(s.upper())\n break\n s = G[s].pop(0)", "G = {}", "G", "{}", "l =[\"a\",\"b\",\"c\"]", "l", "[\"a\",\"b\",\"c\"]", "\"a\"", "\"b\"", "\"c\"", "for i in l:\n G[i] = list(input())", "i", "l", "G[i] = list(input())", "G[i]", "G", "i", "list(input())", "list", "input()", "input", "s = l[0]", "s", "l[0]", "l", "0", "while(True):\n if len(G[s]) ==0:\n print(s.upper())\n break\n s = G[s].pop(0)", "True", "if len(G[s]) ==0:\n print(s.upper())\n break\n ", "len(G[s]) ==0", "len(G[s])", "len", "G[s]", "G", "s", "0", "print(s.upper())", "print", "s.upper()", "s.upper", "s", "upper", "break", "s = G[s].pop(0)", "s", "G[s].pop(0)", "[s].pop", "[s]", "G", "s", "pop", "0", "G = {}", "{}", "G", "l =[\"a\",\"b\",\"c\"]", "[\"a\",\"b\",\"c\"]", "l", "s = l[0]", "l[0]", "s", "s = G[s].pop(0)", "G[s].pop(0)", "s" ]
G = {} l =["a","b","c"] for i in l: G[i] = list(input()) s = l[0] while(True): if len(G[s]) ==0: print(s.upper()) break s = G[s].pop(0)
[ 7, 12, 13, 41, 28, 13, 4, 13, 17, 4, 4, 13, 0, 13, 13, 0, 13, 39, 17, 17, 17, 0, 13, 18, 18, 13, 17, 17, 0, 18, 13, 17, 18, 18, 13, 17, 39, 17, 28, 13, 4, 13, 17, 0, 13, 4, 18, 13, 13, 13, 14, 2, 4, 13, 18, 13, 13, 17, 4, 13, 4, 18, 18, 13, 13, 13, 29, 0, 13, 18, 18, 13, 13, 17, 0, 18, 13, 13, 18, 18, 13, 13, 39, 17, 4, 13, 10, 12, 13 ]
[ [ 6, 5 ], [ 14, 13 ], [ 17, 16 ], [ 23, 22 ], [ 13, 25 ], [ 32, 29 ], [ 13, 30 ], [ 13, 34 ], [ 40, 39 ], [ 45, 44 ], [ 16, 47 ], [ 22, 49 ], [ 68, 49 ], [ 75, 54 ], [ 13, 55 ], [ 44, 56 ], [ 16, 63 ], [ 44, 64 ], [ 69, 68 ], [ 75, 70 ], [ 13, 71 ], [ 44, 72 ], [ 78, 75 ], [ 13, 76 ], [ 44, 77 ], [ 75, 79 ], [ 13, 80 ], [ 44, 81 ], [ 88, 85 ] ]
[ "def resolve():\n s = [input() for i in range(3)]\n player_list = [\"a\", \"b\", \"c\"]\n current_card = s[0][0]\n s[0] = s[0][1:]\n # カードは全部で300枚以内\n for i in range(300):\n current_player_index = player_list.index(current_card)\n\n # カードが0枚で捨てられなければ勝ち\n if len(s[current_player_index]) == 0:\n print(player_list[current_player_index].upper())\n return\n\n # カードを捨てる\n current_card = s[current_player_index][0]\n s[current_player_index] = s[current_player_index][1:]\n\nresolve()", "def resolve():\n s = [input() for i in range(3)]\n player_list = [\"a\", \"b\", \"c\"]\n current_card = s[0][0]\n s[0] = s[0][1:]\n # カードは全部で300枚以内\n for i in range(300):\n current_player_index = player_list.index(current_card)\n\n # カードが0枚で捨てられなければ勝ち\n if len(s[current_player_index]) == 0:\n print(player_list[current_player_index].upper())\n return\n\n # カードを捨てる\n current_card = s[current_player_index][0]\n s[current_player_index] = s[current_player_index][1:]", "resolve", "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)]", "player_list = [\"a\", \"b\", \"c\"]", "player_list", "[\"a\", \"b\", \"c\"]", "\"a\"", "\"b\"", "\"c\"", "current_card = s[0][0]", "current_card", "s[0][0]", "[0]", "s", "0", "0", "s[0] = s[0][1:]", "s[0]", "s", "0", "s[0][1:]", "[0]", "s", "0", "1:", "1", "for i in range(300):\n current_player_index = player_list.index(current_card)\n\n # カードが0枚で捨てられなければ勝ち\n if len(s[current_player_index]) == 0:\n print(player_list[current_player_index].upper())\n return\n\n # カードを捨てる\n current_card = s[current_player_index][0]\n s[current_player_index] = s[current_player_index][1:]", "i", "range(300)", "range", "300", "current_player_index = player_list.index(current_card)", "current_player_index", "player_list.index(current_card)", "player_list.index", "player_list", "index", "current_card", "if len(s[current_player_index]) == 0:\n print(player_list[current_player_index].upper())\n return\n\n # カードを捨てる\n ", "len(s[current_player_index]) == 0", "len(s[current_player_index])", "len", "s[current_player_index]", "s", "current_player_index", "0", "print(player_list[current_player_index].upper())", "print", "player_list[current_player_index].upper()", "[current_player_index].upper", "[current_player_index]", "player_list", "current_player_index", "upper", "return", "current_card = s[current_player_index][0]", "current_card", "s[current_player_index][0]", "[current_player_index]", "s", "current_player_index", "0", "s[current_player_index] = s[current_player_index][1:]", "s[current_player_index]", "s", "current_player_index", "s[current_player_index][1:]", "[current_player_index]", "s", "current_player_index", "1:", "1", "resolve()", "resolve", "def resolve():\n s = [input() for i in range(3)]\n player_list = [\"a\", \"b\", \"c\"]\n current_card = s[0][0]\n s[0] = s[0][1:]\n # カードは全部で300枚以内\n for i in range(300):\n current_player_index = player_list.index(current_card)\n\n # カードが0枚で捨てられなければ勝ち\n if len(s[current_player_index]) == 0:\n print(player_list[current_player_index].upper())\n return\n\n # カードを捨てる\n current_card = s[current_player_index][0]\n s[current_player_index] = s[current_player_index][1:]", "def resolve():\n s = [input() for i in range(3)]\n player_list = [\"a\", \"b\", \"c\"]\n current_card = s[0][0]\n s[0] = s[0][1:]\n # カードは全部で300枚以内\n for i in range(300):\n current_player_index = player_list.index(current_card)\n\n # カードが0枚で捨てられなければ勝ち\n if len(s[current_player_index]) == 0:\n print(player_list[current_player_index].upper())\n return\n\n # カードを捨てる\n current_card = s[current_player_index][0]\n s[current_player_index] = s[current_player_index][1:]", "resolve" ]
def resolve(): s = [input() for i in range(3)] player_list = ["a", "b", "c"] current_card = s[0][0] s[0] = s[0][1:] # カードは全部で300枚以内 for i in range(300): current_player_index = player_list.index(current_card) # カードが0枚で捨てられなければ勝ち if len(s[current_player_index]) == 0: print(player_list[current_player_index].upper()) return # カードを捨てる current_card = s[current_player_index][0] s[current_player_index] = s[current_player_index][1:] resolve()
[ 7, 0, 13, 2, 4, 13, 17, 0, 13, 2, 4, 13, 17, 0, 13, 2, 4, 13, 17, 0, 13, 17, 0, 13, 17, 0, 13, 17, 0, 13, 17, 42, 2, 2, 2, 13, 4, 13, 13, 2, 13, 4, 13, 13, 2, 13, 4, 13, 13, 14, 2, 13, 17, 0, 13, 18, 13, 13, 0, 13, 17, 14, 2, 13, 17, 0, 13, 18, 13, 13, 0, 13, 17, 0, 13, 18, 13, 13, 0, 13, 17, 14, 2, 13, 4, 13, 13, 4, 13, 17, 14, 2, 13, 4, 13, 13, 4, 13, 17, 4, 13, 17, 10, 18, 13, 10, 17, 13, 10, 18, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 2, 13, 10, 2, 13, 10, 17, 13, 10, 18, 13, 10, 17, 13, 10, 17, 13, 10, 2, 13 ]
[ [ 139, 2 ], [ 121, 8 ], [ 124, 14 ], [ 136, 20 ], [ 118, 23 ], [ 115, 26 ], [ 133, 29 ], [ 119, 35 ], [ 128, 35 ], [ 140, 38 ], [ 116, 40 ], [ 113, 40 ], [ 122, 43 ], [ 134, 45 ], [ 107, 45 ], [ 125, 48 ], [ 137, 51 ], [ 131, 51 ], [ 110, 51 ], [ 104, 51 ], [ 103, 54 ], [ 140, 56 ], [ 119, 57 ], [ 128, 57 ], [ 127, 59 ], [ 137, 63 ], [ 131, 63 ], [ 110, 63 ], [ 104, 63 ], [ 109, 66 ], [ 122, 68 ], [ 116, 69 ], [ 113, 69 ], [ 112, 71 ], [ 130, 74 ], [ 125, 76 ], [ 134, 77 ], [ 107, 77 ], [ 106, 79 ], [ 128, 83 ], [ 119, 83 ], [ 140, 86 ], [ 113, 92 ], [ 116, 92 ], [ 122, 95 ], [ 103, 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 ] ]
[ "sa=input()+'a'\nsb=input()+'b'\nsc=input()+'c'\nst='a'\na=0\nb=0\nc=0\nwhile a<len(sa) and b<len(sb) and c<len(sc):\n if st=='a':\n st=sa[a]\n a+=1\n elif st=='b':\n st=sb[b]\n b+=1\n else:\n st=sc[c]\n c+=1\nif a==len(sa):\n print('A')\nelif b==len(sb):\n print('B')\nelse:\n print('C')", "sa=input()+'a'", "sa", "input()+'a'", "input()", "input", "'a'", "sb=input()+'b'", "sb", "input()+'b'", "input()", "input", "'b'", "sc=input()+'c'", "sc", "input()+'c'", "input()", "input", "'c'", "st='a'", "st", "'a'", "a=0", "a", "0", "b=0", "b", "0", "c=0", "c", "0", "while a<len(sa) and b<len(sb) and c<len(sc):\n if st=='a':\n st=sa[a]\n a+=1\n elif st=='b':\n st=sb[b]\n b+=1\n else:\n st=sc[c]\n c+=1", "a<len(sa) and b<len(sb) and c<len(sc)", "a<len(sa) and b<len(sb)", "a<len(sa)", "a", "len(sa)", "len", "sa", "b<len(sb)", "b", "len(sb)", "len", "sb", "c<len(sc)", "c", "len(sc)", "len", "sc", "if st=='a':\n st=sa[a]\n a+=1\n elif st=='b':\n st=sb[b]\n b+=1\n else:\n st=sc[c]\n c+=1", "st=='a'", "st", "'a'", "st=sa[a]", "st", "sa[a]", "sa", "a", "a+=1", "a", "1", "elif st=='b':\n st=sb[b]\n b+=1\n ", "st=='b'", "st", "'b'", "st=sb[b]", "st", "sb[b]", "sb", "b", "b+=1", "b", "1", "st=sc[c]", "st", "sc[c]", "sc", "c", "c+=1", "c", "1", "if a==len(sa):\n print('A')\nelif b==len(sb):\n print('B')\nelse:\n print('C')", "a==len(sa)", "a", "len(sa)", "len", "sa", "print('A')", "print", "'A'", "elif b==len(sb):\n print('B')", "b==len(sb)", "b", "len(sb)", "len", "sb", "print('B')", "print", "'B'", "print('C')", "print", "'C'", "st=sa[a]", "sa[a]", "st", "c+=1", "1", "c", "st=sb[b]", "sb[b]", "st", "b+=1", "1", "b", "b=0", "0", "b", "a=0", "0", "a", "sb=input()+'b'", "input()+'b'", "sb", "sc=input()+'c'", "input()+'c'", "sc", "a+=1", "1", "a", "st=sc[c]", "sc[c]", "st", "c=0", "0", "c", "st='a'", "'a'", "st", "sa=input()+'a'", "input()+'a'", "sa" ]
sa=input()+'a' sb=input()+'b' sc=input()+'c' st='a' a=0 b=0 c=0 while a<len(sa) and b<len(sb) and c<len(sc): if st=='a': st=sa[a] a+=1 elif st=='b': st=sb[b] b+=1 else: st=sc[c] c+=1 if a==len(sa): print('A') elif b==len(sb): print('B') else: print('C')
[ 7, 41, 28, 13, 4, 13, 17, 4, 4, 13, 0, 13, 13, 0, 13, 39, 17, 17, 17, 0, 13, 17, 42, 2, 4, 13, 18, 13, 13, 17, 0, 13, 18, 18, 13, 13, 17, 0, 18, 13, 13, 18, 18, 13, 13, 39, 17, 0, 13, 4, 18, 13, 13, 13, 4, 13, 4, 18, 18, 13, 13, 13, 10, 4, 13, 10, 13, 13, 10, 39, 13, 10, 18, 13, 10, 17, 13 ]
[ [ 4, 3 ], [ 66, 11 ], [ 69, 14 ], [ 75, 20 ], [ 38, 26 ], [ 67, 27 ], [ 76, 28 ], [ 64, 28 ], [ 72, 31 ], [ 38, 33 ], [ 67, 34 ], [ 76, 35 ], [ 64, 35 ], [ 41, 38 ], [ 67, 39 ], [ 76, 40 ], [ 64, 40 ], [ 38, 42 ], [ 67, 43 ], [ 76, 44 ], [ 64, 44 ], [ 63, 48 ], [ 70, 51 ], [ 73, 53 ], [ 70, 59 ], [ 64, 60 ], [ 76, 60 ], [ 63, 64 ], [ 66, 67 ], [ 69, 70 ], [ 72, 73 ], [ 75, 76 ] ]
[ "s = [input() for i in range(3)]\nt = [\"a\", \"b\", \"c\"]\ncur = 0\nwhile len(s[cur]) > 0:\n next = s[cur][0]\n s[cur] = s[cur][1:]\n cur = t.index(next)\nprint(t[cur].upper())", "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)]", "t = [\"a\", \"b\", \"c\"]", "t", "[\"a\", \"b\", \"c\"]", "\"a\"", "\"b\"", "\"c\"", "cur = 0", "cur", "0", "while len(s[cur]) > 0:\n next = s[cur][0]\n s[cur] = s[cur][1:]\n cur = t.index(next)", "len(s[cur]) > 0", "len(s[cur])", "len", "s[cur]", "s", "cur", "0", "next = s[cur][0]", "next", "s[cur][0]", "[cur]", "s", "cur", "0", "s[cur] = s[cur][1:]", "s[cur]", "s", "cur", "s[cur][1:]", "[cur]", "s", "cur", "1:", "1", "cur = t.index(next)", "cur", "t.index(next)", "t.index", "t", "index", "next", "print(t[cur].upper())", "print", "t[cur].upper()", "[cur].upper", "[cur]", "t", "cur", "upper", "cur = t.index(next)", "t.index(next)", "cur", "s = [input() for i in range(3)]", "[input() for i in range(3)]", "s", "t = [\"a\", \"b\", \"c\"]", "[\"a\", \"b\", \"c\"]", "t", "next = s[cur][0]", "s[cur][0]", "next", "cur = 0", "0", "cur" ]
s = [input() for i in range(3)] t = ["a", "b", "c"] cur = 0 while len(s[cur]) > 0: next = s[cur][0] s[cur] = s[cur][1:] cur = t.index(next) print(t[cur].upper())
[ 7, 15, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 4, 13, 12, 13, 0, 13, 4, 13, 13, 0, 13, 4, 13, 13, 0, 13, 4, 13, 13, 0, 13, 4, 13, 28, 13, 13, 4, 18, 13, 13, 13, 0, 13, 4, 13, 28, 13, 13, 4, 18, 13, 13, 13, 0, 13, 4, 13, 28, 13, 13, 4, 18, 13, 13, 13, 0, 13, 39, 13, 13, 13, 0, 13, 39, 17, 17, 17, 0, 13, 17, 42, 40, 13, 17, 14, 2, 4, 13, 18, 13, 13, 17, 3, 0, 13, 4, 18, 18, 13, 13, 13, 14, 2, 13, 17, 0, 13, 17, 9, 14, 2, 13, 17, 0, 13, 17, 9, 14, 2, 13, 17, 0, 13, 17, 9, 4, 13, 18, 13, 13, 23, 13, 23, 13, 23, 13, 4, 13, 13, 13, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 12, 13 ]
[ [ 150, 3 ], [ 144, 7 ], [ 147, 11 ], [ 18, 17 ], [ 133, 20 ], [ 23, 22 ], [ 135, 25 ], [ 28, 27 ], [ 137, 30 ], [ 33, 32 ], [ 37, 36 ], [ 17, 36 ], [ 32, 40 ], [ 36, 42 ], [ 45, 44 ], [ 49, 48 ], [ 22, 48 ], [ 44, 52 ], [ 48, 54 ], [ 57, 56 ], [ 61, 60 ], [ 27, 60 ], [ 56, 64 ], [ 60, 66 ], [ 69, 68 ], [ 75, 74 ], [ 81, 80 ], [ 80, 84 ], [ 124, 84 ], [ 116, 84 ], [ 108, 84 ], [ 68, 91 ], [ 80, 92 ], [ 124, 92 ], [ 116, 92 ], [ 108, 92 ], [ 97, 96 ], [ 68, 100 ], [ 80, 101 ], [ 124, 101 ], [ 116, 101 ], [ 108, 101 ], [ 96, 105 ], [ 109, 108 ], [ 96, 113 ], [ 117, 116 ], [ 96, 121 ], [ 125, 124 ], [ 74, 130 ], [ 124, 131 ], [ 116, 131 ], [ 108, 131 ], [ 80, 131 ], [ 133, 133 ], [ 135, 135 ], [ 137, 137 ], [ 154, 139 ], [ 151, 140 ], [ 145, 141 ], [ 148, 142 ], [ 144, 145 ], [ 147, 148 ], [ 150, 151 ] ]
[ "from collections import deque\nSA = input()\nSB = input()\nSC = input()\n\ndef calculate(SA,SB,SC):\n a1 = list(SA)\n a2 = list(SB)\n a3 = list(SC)\n\n q1 = deque()\n for a in a1:\n q1.append(a)\n\n q2 = deque()\n\n for a in a2:\n q2.append(a)\n\n q3 = deque()\n\n for a in a3:\n q3.append(a)\n\n arr = [q1,q2,q3]\n stt = [\"A\",\"B\",\"C\"]\n\n currentIndex = 0\n\n while currentIndex >= 0:\n if len(arr[currentIndex]) == 0:\n break\n\n currentValue = arr[currentIndex].popleft()\n\n if currentValue == \"a\":\n currentIndex = 0\n continue\n\n if currentValue == \"b\":\n currentIndex = 1\n continue\n\n if currentValue == \"c\":\n currentIndex = 2\n continue\n\n print(stt[currentIndex])\n\n\ncalculate(SA,SB,SC)", "from collections import deque", "SA = input()", "SA", "input()", "input", "SB = input()", "SB", "input()", "input", "SC = input()", "SC", "input()", "input", "def calculate(SA,SB,SC):\n a1 = list(SA)\n a2 = list(SB)\n a3 = list(SC)\n\n q1 = deque()\n for a in a1:\n q1.append(a)\n\n q2 = deque()\n\n for a in a2:\n q2.append(a)\n\n q3 = deque()\n\n for a in a3:\n q3.append(a)\n\n arr = [q1,q2,q3]\n stt = [\"A\",\"B\",\"C\"]\n\n currentIndex = 0\n\n while currentIndex >= 0:\n if len(arr[currentIndex]) == 0:\n break\n\n currentValue = arr[currentIndex].popleft()\n\n if currentValue == \"a\":\n currentIndex = 0\n continue\n\n if currentValue == \"b\":\n currentIndex = 1\n continue\n\n if currentValue == \"c\":\n currentIndex = 2\n continue\n\n print(stt[currentIndex])", "calculate", "a1 = list(SA)", "a1", "list(SA)", "list", "SA", "a2 = list(SB)", "a2", "list(SB)", "list", "SB", "a3 = list(SC)", "a3", "list(SC)", "list", "SC", "q1 = deque()", "q1", "deque()", "deque", "for a in a1:\n q1.append(a)\n\n ", "a", "a1", "q1.append(a)", "q1.append", "q1", "append", "a", "q2 = deque()", "q2", "deque()", "deque", "for a in a2:\n q2.append(a)\n\n ", "a", "a2", "q2.append(a)", "q2.append", "q2", "append", "a", "q3 = deque()", "q3", "deque()", "deque", "for a in a3:\n q3.append(a)\n\n ", "a", "a3", "q3.append(a)", "q3.append", "q3", "append", "a", "arr = [q1,q2,q3]", "arr", "[q1,q2,q3]", "q1", "q2", "q3", "stt = [\"A\",\"B\",\"C\"]", "stt", "[\"A\",\"B\",\"C\"]", "\"A\"", "\"B\"", "\"C\"", "currentIndex = 0", "currentIndex", "0", "while currentIndex >= 0:\n if len(arr[currentIndex]) == 0:\n break\n\n currentValue = arr[currentIndex].popleft()\n\n if currentValue == \"a\":\n currentIndex = 0\n continue\n\n if currentValue == \"b\":\n currentIndex = 1\n continue\n\n if currentValue == \"c\":\n currentIndex = 2\n continue\n\n ", "currentIndex >= 0", "currentIndex", "0", "if len(arr[currentIndex]) == 0:\n break\n\n ", "len(arr[currentIndex]) == 0", "len(arr[currentIndex])", "len", "arr[currentIndex]", "arr", "currentIndex", "0", "break", "currentValue = arr[currentIndex].popleft()", "currentValue", "arr[currentIndex].popleft()", "[currentIndex].popleft", "[currentIndex]", "arr", "currentIndex", "popleft", "if currentValue == \"a\":\n currentIndex = 0\n continue\n\n ", "currentValue == \"a\"", "currentValue", "\"a\"", "currentIndex = 0", "currentIndex", "0", "continue", "if currentValue == \"b\":\n currentIndex = 1\n continue\n\n ", "currentValue == \"b\"", "currentValue", "\"b\"", "currentIndex = 1", "currentIndex", "1", "continue", "if currentValue == \"c\":\n currentIndex = 2\n continue\n\n ", "currentValue == \"c\"", "currentValue", "\"c\"", "currentIndex = 2", "currentIndex", "2", "continue", "print(stt[currentIndex])", "print", "stt[currentIndex]", "stt", "currentIndex", "SA", "SA", "SB", "SB", "SC", "SC", "calculate(SA,SB,SC)", "calculate", "SA", "SB", "SC", "SB = input()", "input()", "SB", "SC = input()", "input()", "SC", "SA = input()", "input()", "SA", "def calculate(SA,SB,SC):\n a1 = list(SA)\n a2 = list(SB)\n a3 = list(SC)\n\n q1 = deque()\n for a in a1:\n q1.append(a)\n\n q2 = deque()\n\n for a in a2:\n q2.append(a)\n\n q3 = deque()\n\n for a in a3:\n q3.append(a)\n\n arr = [q1,q2,q3]\n stt = [\"A\",\"B\",\"C\"]\n\n currentIndex = 0\n\n while currentIndex >= 0:\n if len(arr[currentIndex]) == 0:\n break\n\n currentValue = arr[currentIndex].popleft()\n\n if currentValue == \"a\":\n currentIndex = 0\n continue\n\n if currentValue == \"b\":\n currentIndex = 1\n continue\n\n if currentValue == \"c\":\n currentIndex = 2\n continue\n\n print(stt[currentIndex])", "def calculate(SA,SB,SC):\n a1 = list(SA)\n a2 = list(SB)\n a3 = list(SC)\n\n q1 = deque()\n for a in a1:\n q1.append(a)\n\n q2 = deque()\n\n for a in a2:\n q2.append(a)\n\n q3 = deque()\n\n for a in a3:\n q3.append(a)\n\n arr = [q1,q2,q3]\n stt = [\"A\",\"B\",\"C\"]\n\n currentIndex = 0\n\n while currentIndex >= 0:\n if len(arr[currentIndex]) == 0:\n break\n\n currentValue = arr[currentIndex].popleft()\n\n if currentValue == \"a\":\n currentIndex = 0\n continue\n\n if currentValue == \"b\":\n currentIndex = 1\n continue\n\n if currentValue == \"c\":\n currentIndex = 2\n continue\n\n print(stt[currentIndex])", "calculate" ]
from collections import deque SA = input() SB = input() SC = input() def calculate(SA,SB,SC): a1 = list(SA) a2 = list(SB) a3 = list(SC) q1 = deque() for a in a1: q1.append(a) q2 = deque() for a in a2: q2.append(a) q3 = deque() for a in a3: q3.append(a) arr = [q1,q2,q3] stt = ["A","B","C"] currentIndex = 0 while currentIndex >= 0: if len(arr[currentIndex]) == 0: break currentValue = arr[currentIndex].popleft() if currentValue == "a": currentIndex = 0 continue if currentValue == "b": currentIndex = 1 continue if currentValue == "c": currentIndex = 2 continue print(stt[currentIndex]) calculate(SA,SB,SC)
[ 7, 41, 28, 13, 4, 13, 17, 4, 4, 13, 0, 13, 13, 0, 13, 39, 17, 17, 17, 0, 13, 17, 42, 17, 14, 2, 18, 13, 13, 4, 13, 18, 13, 13, 4, 13, 4, 13, 2, 13, 4, 13, 17, 4, 13, 0, 18, 13, 13, 17, 0, 13, 2, 4, 13, 18, 18, 13, 13, 2, 18, 13, 13, 17, 4, 13, 17, 10, 39, 13, 10, 2, 13, 10, 13, 13, 10, 17, 13 ]
[ [ 4, 3 ], [ 74, 11 ], [ 68, 14 ], [ 77, 20 ], [ 46, 26 ], [ 69, 27 ], [ 78, 28 ], [ 72, 28 ], [ 75, 32 ], [ 78, 33 ], [ 72, 33 ], [ 78, 39 ], [ 72, 39 ], [ 49, 46 ], [ 69, 47 ], [ 78, 48 ], [ 72, 48 ], [ 71, 51 ], [ 75, 57 ], [ 78, 58 ], [ 72, 58 ], [ 46, 60 ], [ 69, 61 ], [ 78, 62 ], [ 72, 62 ], [ 68, 69 ], [ 71, 72 ], [ 74, 75 ], [ 77, 78 ] ]
[ "S = [input() for _ in range(3)]\ni = [0,0,0]\nt = 0\nwhile True:\n if i[t] == len(S[t]):\n print(chr(t+ord('A')))\n exit()\n i[t] += 1\n t = ord(S[t][i[t]-1]) - ord('a')", "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)]", "i = [0,0,0]", "i", "[0,0,0]", "0", "0", "0", "t = 0", "t", "0", "while True:\n if i[t] == len(S[t]):\n print(chr(t+ord('A')))\n exit()\n i[t] += 1\n t = ord(S[t][i[t]-1]) - ord('a')", "True", "if i[t] == len(S[t]):\n print(chr(t+ord('A')))\n exit()\n ", "i[t] == len(S[t])", "i[t]", "i", "t", "len(S[t])", "len", "S[t]", "S", "t", "print(chr(t+ord('A')))", "print", "chr(t+ord('A'))", "chr", "t+ord('A')", "t", "ord('A')", "ord", "'A'", "exit()", "exit", "i[t] += 1", "i[t]", "i", "t", "1", "t = ord(S[t][i[t]-1]) - ord('a')", "t", "ord(S[t][i[t]-1]) - ord('a')", "ord(S[t][i[t]-1])", "ord", "S[t][i[t]-1]", "[t]", "S", "t", "i[t]-1", "i[t]", "i", "t", "1", "ord('a')", "ord", "'a'", "i = [0,0,0]", "[0,0,0]", "i", "t = ord(S[t][i[t]-1]) - ord('a')", "ord(S[t][i[t]-1]) - ord('a')", "t", "S = [input() for _ in range(3)]", "[input() for _ in range(3)]", "S", "t = 0", "0", "t" ]
S = [input() for _ in range(3)] i = [0,0,0] t = 0 while True: if i[t] == len(S[t]): print(chr(t+ord('A'))) exit() i[t] += 1 t = ord(S[t][i[t]-1]) - ord('a')
[ 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, 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 ]
[ [ 109, 2 ], [ 103, 10 ], [ 115, 18 ], [ 94, 26 ], [ 110, 29 ], [ 112, 33 ], [ 95, 39 ], [ 101, 39 ], [ 107, 39 ], [ 98, 39 ], [ 110, 45 ], [ 97, 49 ], [ 110, 52 ], [ 95, 57 ], [ 101, 57 ], [ 107, 57 ], [ 98, 57 ], [ 104, 63 ], [ 106, 67 ], [ 104, 70 ], [ 116, 77 ], [ 100, 81 ], [ 116, 84 ], [ 101, 91 ], [ 107, 91 ], [ 98, 91 ], [ 95, 91 ], [ 94, 95 ], [ 97, 98 ], [ 100, 101 ], [ 103, 104 ], [ 106, 107 ], [ 109, 110 ], [ 112, 113 ], [ 115, 116 ] ]
[ "a = list(str(input()))\nb = list(str(input()))\nc = list(str(input()))\nn = a.pop(0)\nm = 0\nwhile True:\n if n == 'a':\n if len(a) == 0:\n break\n n = a.pop(0)\n elif n == 'b':\n if len(b) == 0:\n break\n n = b.pop(0)\n else:\n if len(c) == 0:\n break\n n = c.pop(0)\nprint(n.upper())", "a = list(str(input()))", "a", "list(str(input()))", "list", "str(input())", "str", "input()", "input", "b = list(str(input()))", "b", "list(str(input()))", "list", "str(input())", "str", "input()", "input", "c = list(str(input()))", "c", "list(str(input()))", "list", "str(input())", "str", "input()", "input", "n = a.pop(0)", "n", "a.pop(0)", "a.pop", "a", "pop", "0", "m = 0", "m", "0", "while True:\n if n == 'a':\n if len(a) == 0:\n break\n n = a.pop(0)\n elif n == 'b':\n if len(b) == 0:\n break\n n = b.pop(0)\n else:\n if len(c) == 0:\n break\n n = c.pop(0)", "True", "if n == 'a':\n if len(a) == 0:\n break\n n = a.pop(0)\n elif n == 'b':\n if len(b) == 0:\n break\n n = b.pop(0)\n else:\n if len(c) == 0:\n break\n n = c.pop(0)", "n == 'a'", "n", "'a'", "if len(a) == 0:\n break\n ", "len(a) == 0", "len(a)", "len", "a", "0", "break", "n = a.pop(0)", "n", "a.pop(0)", "a.pop", "a", "pop", "0", "elif n == 'b':\n if len(b) == 0:\n break\n n = b.pop(0)\n ", "n == 'b'", "n", "'b'", "if len(b) == 0:\n break\n ", "len(b) == 0", "len(b)", "len", "b", "0", "break", "n = b.pop(0)", "n", "b.pop(0)", "b.pop", "b", "pop", "0", "if len(c) == 0:\n break\n ", "len(c) == 0", "len(c)", "len", "c", "0", "break", "n = c.pop(0)", "n", "c.pop(0)", "c.pop", "c", "pop", "0", "print(n.upper())", "print", "n.upper()", "n.upper", "n", "upper", "n = a.pop(0)", "a.pop(0)", "n", "n = a.pop(0)", "a.pop(0)", "n", "n = c.pop(0)", "c.pop(0)", "n", "b = list(str(input()))", "list(str(input()))", "b", "n = b.pop(0)", "b.pop(0)", "n", "a = list(str(input()))", "list(str(input()))", "a", "m = 0", "0", "m", "c = list(str(input()))", "list(str(input()))", "c" ]
a = list(str(input())) b = list(str(input())) c = list(str(input())) n = a.pop(0) m = 0 while True: if n == 'a': if len(a) == 0: break n = a.pop(0) elif n == 'b': if len(b) == 0: break n = b.pop(0) else: if len(c) == 0: break n = c.pop(0) print(n.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, 13, 17, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 14, 2, 13, 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, 14, 2, 13, 17, 4, 13, 17, 14, 2, 13, 17, 4, 13, 17, 4, 13, 17, 10, 18, 13, 10, 17, 13, 10, 4, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 4, 13, 10, 18, 13, 10, 4, 13, 10, 18, 13 ]
[ [ 113, 2 ], [ 107, 6 ], [ 95, 10 ], [ 92, 14 ], [ 93, 20 ], [ 102, 20 ], [ 105, 20 ], [ 111, 20 ], [ 114, 24 ], [ 99, 24 ], [ 110, 27 ], [ 114, 29 ], [ 99, 29 ], [ 98, 32 ], [ 114, 34 ], [ 99, 34 ], [ 93, 39 ], [ 102, 39 ], [ 105, 39 ], [ 111, 39 ], [ 108, 43 ], [ 117, 43 ], [ 104, 46 ], [ 108, 48 ], [ 117, 48 ], [ 116, 51 ], [ 108, 53 ], [ 117, 53 ], [ 96, 58 ], [ 90, 58 ], [ 101, 61 ], [ 96, 63 ], [ 90, 63 ], [ 89, 66 ], [ 96, 68 ], [ 90, 68 ], [ 102, 73 ], [ 105, 73 ], [ 111, 73 ], [ 93, 73 ], [ 102, 80 ], [ 105, 80 ], [ 111, 80 ], [ 93, 80 ], [ 89, 90 ], [ 92, 93 ], [ 95, 96 ], [ 98, 99 ], [ 101, 102 ], [ 104, 105 ], [ 107, 108 ], [ 110, 111 ], [ 113, 114 ], [ 116, 117 ] ]
[ "sa = input()\nsb = input()\nsc = input()\n\nnext = \"a\"\nwhile True:\n if next == \"a\":\n if sa == \"\": break\n next = sa[0]\n sa = sa[1:]\n elif next == \"b\":\n if sb == \"\": break\n next = sb[0]\n sb = sb[1:]\n else:\n if sc == \"\": break\n next = sc[0]\n sc = sc[1:]\nif next == \"a\":\n print(\"A\")\nelif next == \"b\":\n print(\"B\")\nelse:\n print(\"C\")", "sa = input()", "sa", "input()", "input", "sb = input()", "sb", "input()", "input", "sc = input()", "sc", "input()", "input", "next = \"a\"", "next", "\"a\"", "while True:\n if next == \"a\":\n if sa == \"\": break\n next = sa[0]\n sa = sa[1:]\n elif next == \"b\":\n if sb == \"\": break\n next = sb[0]\n sb = sb[1:]\n else:\n if sc == \"\": break\n next = sc[0]\n sc = sc[1:]", "True", "if next == \"a\":\n if sa == \"\": break\n next = sa[0]\n sa = sa[1:]\n elif next == \"b\":\n if sb == \"\": break\n next = sb[0]\n sb = sb[1:]\n else:\n if sc == \"\": break\n next = sc[0]\n sc = sc[1:]", "next == \"a\"", "next", "\"a\"", "if sa == \"\": break\n ", "sa == \"\"", "sa", "\"\"", "next = sa[0]", "next", "sa[0]", "sa", "0", "sa = sa[1:]", "sa", "sa[1:]", "sa", "1:", "1", "elif next == \"b\":\n if sb == \"\": break\n next = sb[0]\n sb = sb[1:]\n ", "next == \"b\"", "next", "\"b\"", "if sb == \"\": break\n ", "sb == \"\"", "sb", "\"\"", "next = sb[0]", "next", "sb[0]", "sb", "0", "sb = sb[1:]", "sb", "sb[1:]", "sb", "1:", "1", "if sc == \"\": break\n ", "sc == \"\"", "sc", "\"\"", "next = sc[0]", "next", "sc[0]", "sc", "0", "sc = sc[1:]", "sc", "sc[1:]", "sc", "1:", "1", "if next == \"a\":\n print(\"A\")\nelif next == \"b\":\n print(\"B\")\nelse:\n print(\"C\")", "next == \"a\"", "next", "\"a\"", "print(\"A\")", "print", "\"A\"", "elif next == \"b\":\n print(\"B\")", "next == \"b\"", "next", "\"b\"", "print(\"B\")", "print", "\"B\"", "print(\"C\")", "print", "\"C\"", "sc = sc[1:]", "sc[1:]", "sc", "next = \"a\"", "\"a\"", "next", "sc = input()", "input()", "sc", "sa = sa[1:]", "sa[1:]", "sa", "next = sc[0]", "sc[0]", "next", "next = sb[0]", "sb[0]", "next", "sb = input()", "input()", "sb", "next = sa[0]", "sa[0]", "next", "sa = input()", "input()", "sa", "sb = sb[1:]", "sb[1:]", "sb" ]
sa = input() sb = input() sc = input() next = "a" while True: if next == "a": if sa == "": break next = sa[0] sa = sa[1:] elif next == "b": if sb == "": break next = sb[0] sb = sb[1:] else: if sc == "": break next = sc[0] sc = sc[1:] if next == "a": print("A") elif next == "b": print("B") else: print("C")
[ 7, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 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, 18, 13, 10, 18, 13, 10, 4, 13, 10, 18, 13, 10, 4, 13, 10, 4, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13 ]
[ [ 117, 2 ], [ 111, 6 ], [ 120, 10 ], [ 132, 14 ], [ 118, 16 ], [ 123, 19 ], [ 118, 21 ], [ 133, 28 ], [ 115, 28 ], [ 136, 28 ], [ 127, 28 ], [ 124, 34 ], [ 118, 34 ], [ 106, 34 ], [ 126, 42 ], [ 124, 44 ], [ 118, 44 ], [ 106, 44 ], [ 105, 47 ], [ 124, 49 ], [ 118, 49 ], [ 106, 49 ], [ 133, 54 ], [ 115, 54 ], [ 136, 54 ], [ 127, 54 ], [ 112, 60 ], [ 109, 60 ], [ 135, 68 ], [ 112, 70 ], [ 109, 70 ], [ 108, 73 ], [ 112, 75 ], [ 109, 75 ], [ 133, 80 ], [ 115, 80 ], [ 136, 80 ], [ 127, 80 ], [ 121, 86 ], [ 130, 86 ], [ 114, 94 ], [ 121, 96 ], [ 130, 96 ], [ 129, 99 ], [ 121, 101 ], [ 130, 101 ], [ 105, 106 ], [ 108, 109 ], [ 111, 112 ], [ 114, 115 ], [ 117, 118 ], [ 120, 121 ], [ 123, 124 ], [ 126, 127 ], [ 129, 130 ], [ 132, 133 ], [ 135, 136 ] ]
[ "#!/usr/bin/env python\n\nsa = input()\nsb = input()\nsc = input()\n\nch = sa[0]\nsa = sa[1:]\n\nwhile True:\n if ch == 'a':\n if len(sa) == 0:\n print('A')\n exit()\n ch = sa[0]\n sa = sa[1:]\n elif ch == 'b':\n if len(sb) == 0:\n print('B')\n exit()\n ch = sb[0]\n sb = sb[1:]\n elif ch == 'c':\n if len(sc) == 0:\n print('C')\n exit()\n ch = sc[0]\n sc = sc[1:]", "sa = input()", "sa", "input()", "input", "sb = input()", "sb", "input()", "input", "sc = input()", "sc", "input()", "input", "ch = sa[0]", "ch", "sa[0]", "sa", "0", "sa = sa[1:]", "sa", "sa[1:]", "sa", "1:", "1", "while True:\n if ch == 'a':\n if len(sa) == 0:\n print('A')\n exit()\n ch = sa[0]\n sa = sa[1:]\n elif ch == 'b':\n if len(sb) == 0:\n print('B')\n exit()\n ch = sb[0]\n sb = sb[1:]\n elif ch == 'c':\n if len(sc) == 0:\n print('C')\n exit()\n ch = sc[0]\n sc = sc[1:]", "True", "if ch == 'a':\n if len(sa) == 0:\n print('A')\n exit()\n ch = sa[0]\n sa = sa[1:]\n elif ch == 'b':\n if len(sb) == 0:\n print('B')\n exit()\n ch = sb[0]\n sb = sb[1:]\n elif ch == 'c':\n if len(sc) == 0:\n print('C')\n exit()\n ch = sc[0]\n sc = sc[1:]", "ch == 'a'", "ch", "'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", "ch = sa[0]", "ch", "sa[0]", "sa", "0", "sa = sa[1:]", "sa", "sa[1:]", "sa", "1:", "1", "elif ch == 'b':\n if len(sb) == 0:\n print('B')\n exit()\n ch = sb[0]\n sb = sb[1:]\n ", "ch == 'b'", "ch", "'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", "ch = sb[0]", "ch", "sb[0]", "sb", "0", "sb = sb[1:]", "sb", "sb[1:]", "sb", "1:", "1", "elif ch == 'c':\n if len(sc) == 0:\n print('C')\n exit()\n ch = sc[0]\n sc = sc[1:]", "ch == 'c'", "ch", "'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", "ch = sc[0]", "ch", "sc[0]", "sc", "0", "sc = sc[1:]", "sc", "sc[1:]", "sc", "1:", "1", "sa = sa[1:]", "sa[1:]", "sa", "sb = sb[1:]", "sb[1:]", "sb", "sb = input()", "input()", "sb", "ch = sc[0]", "sc[0]", "ch", "sa = input()", "input()", "sa", "sc = input()", "input()", "sc", "sa = sa[1:]", "sa[1:]", "sa", "ch = sa[0]", "sa[0]", "ch", "sc = sc[1:]", "sc[1:]", "sc", "ch = sa[0]", "sa[0]", "ch", "ch = sb[0]", "sb[0]", "ch" ]
#!/usr/bin/env python sa = input() sb = input() sc = input() ch = sa[0] sa = sa[1:] while True: if ch == 'a': if len(sa) == 0: print('A') exit() ch = sa[0] sa = sa[1:] elif ch == 'b': if len(sb) == 0: print('B') exit() ch = sb[0] sb = sb[1:] elif ch == 'c': if len(sc) == 0: print('C') exit() ch = sc[0] sc = sc[1:]
[ 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, 13, 42, 4, 13, 13, 0, 13, 4, 18, 13, 13, 14, 2, 13, 17, 14, 2, 13, 17, 4, 13, 4, 18, 13, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 13, 13, 10, 4, 13 ]
[ [ 59, 2 ], [ 68, 11 ], [ 62, 20 ], [ 65, 29 ], [ 60, 30 ], [ 66, 34 ], [ 56, 36 ], [ 66, 39 ], [ 57, 43 ], [ 57, 47 ], [ 57, 53 ], [ 56, 57 ], [ 59, 60 ], [ 62, 63 ], [ 60, 65 ], [ 65, 66 ], [ 68, 69 ] ]
[ "a = list(input()[::-1])\nb = list(input()[::-1])\nc = list(input()[::-1])\n\nnow = a\nwhile len(now):\n next_ = now.pop()\n if next_ == 'a':now=a\n elif next_ == 'b':now=b\n else:now=c\n \nprint(next_.upper())", "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", "now = a", "now", "a", "while len(now):\n next_ = now.pop()\n if next_ == 'a':now=a\n elif next_ == 'b':now=b\n else:now=c\n ", "len(now)", "len", "now", "next_ = now.pop()", "next_", "now.pop()", "now.pop", "now", "pop", "if next_ == 'a':now=a\n elif next_ == 'b':now=b\n else:now=c\n ", "next_ == 'a'", "next_", "'a'", "elif next_ == 'b':now=b\n ", "next_ == 'b'", "next_", "'b'", "print(next_.upper())", "print", "next_.upper()", "next_.upper", "next_", "upper", "next_ = now.pop()", "now.pop()", "next_", "a = list(input()[::-1])", "list(input()[::-1])", "a", "c = list(input()[::-1])", "list(input()[::-1])", "c", "now = a", "a", "now", "b = list(input()[::-1])", "list(input()[::-1])", "b" ]
a = list(input()[::-1]) b = list(input()[::-1]) c = list(input()[::-1]) now = a while len(now): next_ = now.pop() if next_ == 'a':now=a elif next_ == 'b':now=b else:now=c print(next_.upper())
[ 7, 0, 13, 21, 22, 17, 4, 13, 22, 17, 4, 13, 22, 17, 4, 13, 0, 13, 17, 42, 40, 18, 13, 13, 17, 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, 21, 13, 10, 17, 13, 10, 18, 13, 10, 13, 13 ]
[ [ 52, 2 ], [ 55, 17 ], [ 33, 21 ], [ 53, 22 ], [ 56, 23 ], [ 62, 23 ], [ 58, 26 ], [ 33, 28 ], [ 53, 29 ], [ 56, 30 ], [ 62, 30 ], [ 36, 33 ], [ 53, 34 ], [ 56, 35 ], [ 62, 35 ], [ 33, 37 ], [ 53, 38 ], [ 56, 39 ], [ 62, 39 ], [ 61, 43 ], [ 59, 44 ], [ 62, 49 ], [ 56, 49 ], [ 52, 53 ], [ 55, 56 ], [ 58, 59 ], [ 59, 61 ], [ 61, 62 ] ]
[ "s = {'a': input(), 'b': input(), 'c': input()}\n \nnow = 'a'\nwhile s[now] != '':\n next = s[now][0]\n s[now] = s[now][1:]\n now = next\nprint(now.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", "now = 'a'", "now", "'a'", "while s[now] != '':\n next = s[now][0]\n s[now] = s[now][1:]\n now = next", "s[now] != ''", "s[now]", "s", "now", "''", "next = s[now][0]", "next", "s[now][0]", "[now]", "s", "now", "0", "s[now] = s[now][1:]", "s[now]", "s", "now", "s[now][1:]", "[now]", "s", "now", "1:", "1", "now = next", "now", "next", "print(now.upper())", "print", "now.upper()", "now.upper", "now", "upper", "s = {'a': input(), 'b': input(), 'c': input()}", "{'a': input(), 'b': input(), 'c': input()}", "s", "now = 'a'", "'a'", "now", "next = s[now][0]", "s[now][0]", "next", "now = next", "next", "now" ]
s = {'a': input(), 'b': input(), 'c': input()} now = 'a' while s[now] != '': next = s[now][0] s[now] = s[now][1:] now = next print(now.upper())
[ 7, 12, 13, 0, 13, 17, 42, 17, 14, 2, 4, 13, 18, 13, 13, 17, 3, 0, 13, 4, 18, 18, 13, 13, 13, 17, 29, 4, 18, 13, 13, 23, 13, 0, 13, 4, 13, 0, 18, 13, 17, 4, 13, 4, 13, 0, 18, 13, 17, 4, 13, 4, 13, 0, 18, 13, 17, 4, 13, 4, 13, 4, 13, 4, 13, 13, 10, 12, 13, 10, 4, 13 ]
[ [ 5, 4 ], [ 32, 13 ], [ 4, 14 ], [ 18, 14 ], [ 19, 18 ], [ 32, 22 ], [ 4, 23 ], [ 18, 23 ], [ 18, 29 ], [ 4, 29 ], [ 32, 32 ], [ 70, 34 ], [ 41, 38 ], [ 71, 39 ], [ 49, 46 ], [ 71, 47 ], [ 57, 54 ], [ 71, 55 ], [ 68, 64 ], [ 71, 65 ], [ 70, 71 ] ]
[ "def game(card) : \n player = 'a'\n while True :\n if len(card[player]) == 0 : \n break\n player = card[player].pop(0)\n return player.upper()\n\n\ncard = dict()\n\ncard['a'] = list(input())\ncard['b'] = list(input())\ncard['c'] = list(input())\n\nprint(game(card))", "def game(card) : \n player = 'a'\n while True :\n if len(card[player]) == 0 : \n break\n player = card[player].pop(0)\n return player.upper()", "game", "player = 'a'", "player", "'a'", "while True :\n if len(card[player]) == 0 : \n break\n player = card[player].pop(0)\n ", "True", "if len(card[player]) == 0 : \n break\n ", "len(card[player]) == 0", "len(card[player])", "len", "card[player]", "card", "player", "0", "break", "player = card[player].pop(0)", "player", "card[player].pop(0)", "[player].pop", "[player]", "card", "player", "pop", "0", "return player.upper()", "player.upper()", "player.upper", "player", "upper", "card", "card", "card = dict()", "card", "dict()", "dict", "card['a'] = list(input())", "card['a']", "card", "'a'", "list(input())", "list", "input()", "input", "card['b'] = list(input())", "card['b']", "card", "'b'", "list(input())", "list", "input()", "input", "card['c'] = list(input())", "card['c']", "card", "'c'", "list(input())", "list", "input()", "input", "print(game(card))", "print", "game(card)", "game", "card", "def game(card) : \n player = 'a'\n while True :\n if len(card[player]) == 0 : \n break\n player = card[player].pop(0)\n return player.upper()", "def game(card) : \n player = 'a'\n while True :\n if len(card[player]) == 0 : \n break\n player = card[player].pop(0)\n return player.upper()", "game", "card = dict()", "dict()", "card" ]
def game(card) : player = 'a' while True : if len(card[player]) == 0 : break player = card[player].pop(0) return player.upper() card = dict() card['a'] = list(input()) card['b'] = list(input()) card['c'] = list(input()) print(game(card))
[ 7, 41, 28, 13, 4, 13, 17, 4, 4, 13, 4, 13, 0, 13, 13, 13, 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, 13, 13, 10, 18, 13, 10, 18, 13, 10, 13, 13, 10, 18, 13, 10, 17, 13, 10, 13, 13 ]
[ [ 4, 3 ], [ 116, 13 ], [ 116, 15 ], [ 116, 16 ], [ 113, 18 ], [ 114, 24 ], [ 102, 24 ], [ 111, 24 ], [ 105, 24 ], [ 108, 30 ], [ 104, 38 ], [ 108, 40 ], [ 108, 44 ], [ 105, 46 ], [ 114, 46 ], [ 102, 46 ], [ 111, 46 ], [ 114, 49 ], [ 102, 49 ], [ 111, 49 ], [ 105, 49 ], [ 99, 55 ], [ 110, 63 ], [ 99, 65 ], [ 99, 69 ], [ 111, 71 ], [ 105, 71 ], [ 114, 71 ], [ 102, 71 ], [ 114, 74 ], [ 102, 74 ], [ 111, 74 ], [ 105, 74 ], [ 117, 80 ], [ 101, 88 ], [ 117, 90 ], [ 117, 94 ], [ 102, 96 ], [ 111, 96 ], [ 105, 96 ], [ 114, 96 ], [ 116, 99 ], [ 101, 102 ], [ 104, 105 ], [ 116, 108 ], [ 110, 111 ], [ 113, 114 ], [ 116, 117 ] ]
[ "A, B, C = [list(input()) for _ in range(3)]\nx = 'a'\nwhile True:\n if x == 'a':\n if len(A) == 0:\n print('A')\n exit()\n x = A[0]\n A.remove(x)\n elif x == 'b':\n if len(B) == 0:\n print('B')\n exit()\n x = B[0]\n B.remove(x) \n elif x == 'c':\n if len(C) == 0:\n print('C')\n exit()\n x = C[0]\n C.remove(x) ", "list(input()) for _ in range(3)", "for _ in range(3)", "_", "range(3)", "range", "3", "for _ in range(3)", "list(input())", "list", "input()", "input", "A, B, C = [list(input()) for _ in range(3)]", "A", "[list(input()) for _ in range(3)]", "B", "C", "x = 'a'", "x", "'a'", "while True:\n if x == 'a':\n if len(A) == 0:\n print('A')\n exit()\n x = A[0]\n A.remove(x)\n elif x == 'b':\n if len(B) == 0:\n print('B')\n exit()\n x = B[0]\n B.remove(x) \n elif x == 'c':\n if len(C) == 0:\n print('C')\n exit()\n x = C[0]\n C.remove(x) ", "True", "if x == 'a':\n if len(A) == 0:\n print('A')\n exit()\n x = A[0]\n A.remove(x)\n elif x == 'b':\n if len(B) == 0:\n print('B')\n exit()\n x = B[0]\n B.remove(x) \n elif x == 'c':\n if len(C) == 0:\n print('C')\n exit()\n x = C[0]\n C.remove(x) ", "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[0]", "x", "A[0]", "A", "0", "A.remove(x)", "A.remove", "A", "remove", "x", "elif x == 'b':\n if len(B) == 0:\n print('B')\n exit()\n x = B[0]\n B.remove(x) \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[0]", "x", "B[0]", "B", "0", "B.remove(x)", "B.remove", "B", "remove", "x", "elif x == 'c':\n if len(C) == 0:\n print('C')\n exit()\n x = C[0]\n C.remove(x) ", "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[0]", "x", "C[0]", "C", "0", "C.remove(x)", "C.remove", "C", "remove", "x", "B, C = [list(input()) for _ in range(3)]", "[list(input()) for _ in range(3)]", "B", "x = C[0]", "C[0]", "x", "x = A[0]", "A[0]", "x", "A, B, C = [list(input()) for _ in range(3)]", "[list(input()) for _ in range(3)]", "A", "x = B[0]", "B[0]", "x", "x = 'a'", "'a'", "x", "C = [list(input()) for _ in range(3)]", "[list(input()) for _ in range(3)]", "C" ]
A, B, C = [list(input()) for _ in range(3)] x = 'a' while True: if x == 'a': if len(A) == 0: print('A') exit() x = A[0] A.remove(x) elif x == 'b': if len(B) == 0: print('B') exit() x = B[0] B.remove(x) elif x == 'c': if len(C) == 0: print('C') exit() x = C[0] C.remove(x)
[ 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, 4, 18, 13, 13, 42, 17, 14, 2, 13, 17, 14, 40, 13, 0, 13, 4, 18, 13, 13, 14, 2, 13, 17, 14, 40, 13, 0, 13, 4, 18, 13, 13, 14, 40, 13, 0, 13, 4, 18, 13, 13, 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 ]
[ [ 88, 3 ], [ 82, 11 ], [ 94, 19 ], [ 91, 27 ], [ 89, 30 ], [ 92, 36 ], [ 77, 36 ], [ 86, 36 ], [ 80, 36 ], [ 89, 40 ], [ 79, 42 ], [ 89, 45 ], [ 92, 49 ], [ 77, 49 ], [ 86, 49 ], [ 80, 49 ], [ 83, 53 ], [ 85, 55 ], [ 83, 58 ], [ 95, 62 ], [ 76, 64 ], [ 95, 67 ], [ 77, 73 ], [ 86, 73 ], [ 80, 73 ], [ 92, 73 ], [ 76, 77 ], [ 79, 80 ], [ 82, 83 ], [ 85, 86 ], [ 88, 89 ], [ 91, 92 ], [ 94, 95 ] ]
[ "from collections import deque\na = deque(reversed(input()))\nb = deque(reversed(input()))\nc = deque(reversed(input()))\nne = a.pop()\nwhile(True):\n if ne == 'a':\n if not a: break\n ne = a.pop()\n elif ne == 'b':\n if not b: break\n ne = b.pop()\n else:\n if not c: break\n ne = c.pop()\nprint(ne.upper())", "from collections import deque", "a = deque(reversed(input()))", "a", "deque(reversed(input()))", "deque", "reversed(input())", "reversed", "input()", "input", "b = deque(reversed(input()))", "b", "deque(reversed(input()))", "deque", "reversed(input())", "reversed", "input()", "input", "c = deque(reversed(input()))", "c", "deque(reversed(input()))", "deque", "reversed(input())", "reversed", "input()", "input", "ne = a.pop()", "ne", "a.pop()", "a.pop", "a", "pop", "while(True):\n if ne == 'a':\n if not a: break\n ne = a.pop()\n elif ne == 'b':\n if not b: break\n ne = b.pop()\n else:\n if not c: break\n ne = c.pop()", "True", "if ne == 'a':\n if not a: break\n ne = a.pop()\n elif ne == 'b':\n if not b: break\n ne = b.pop()\n else:\n if not c: break\n ne = c.pop()", "ne == 'a'", "ne", "'a'", "if not a: break\n ", "not a", "a", "ne = a.pop()", "ne", "a.pop()", "a.pop", "a", "pop", "elif ne == 'b':\n if not b: break\n ne = b.pop()\n ", "ne == 'b'", "ne", "'b'", "if not b: break\n ", "not b", "b", "ne = b.pop()", "ne", "b.pop()", "b.pop", "b", "pop", "if not c: break\n ", "not c", "c", "ne = c.pop()", "ne", "c.pop()", "c.pop", "c", "pop", "print(ne.upper())", "print", "ne.upper()", "ne.upper", "ne", "upper", "ne = c.pop()", "c.pop()", "ne", "ne = a.pop()", "a.pop()", "ne", "b = deque(reversed(input()))", "deque(reversed(input()))", "b", "ne = b.pop()", "b.pop()", "ne", "a = deque(reversed(input()))", "deque(reversed(input()))", "a", "ne = a.pop()", "a.pop()", "ne", "c = deque(reversed(input()))", "deque(reversed(input()))", "c" ]
from collections import deque a = deque(reversed(input())) b = deque(reversed(input())) c = deque(reversed(input())) ne = a.pop() while(True): if ne == 'a': if not a: break ne = a.pop() elif ne == 'b': if not b: break ne = b.pop() else: if not c: break ne = c.pop() print(ne.upper())
[ 7, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 39, 0, 13, 39, 0, 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, 4, 18, 13, 13, 17, 4, 18, 13, 13, 17, 4, 18, 13, 13, 17, 0, 13, 4, 18, 13, 13, 17, 42, 2, 2, 2, 4, 13, 13, 17, 2, 4, 13, 13, 17, 2, 4, 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, 0, 13, 4, 18, 13, 13, 17, 14, 2, 4, 13, 13, 17, 4, 13, 17, 14, 2, 4, 13, 13, 17, 4, 13, 17, 4, 13, 17, 10, 4, 13, 10, 39, 13, 10, 4, 13, 10, 4, 13, 10, 39, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 39, 13 ]
[ [ 137, 2 ], [ 146, 6 ], [ 161, 10 ], [ 164, 14 ], [ 140, 17 ], [ 149, 20 ], [ 24, 23 ], [ 138, 23 ], [ 165, 27 ], [ 23, 29 ], [ 32, 31 ], [ 147, 31 ], [ 141, 35 ], [ 31, 37 ], [ 40, 39 ], [ 162, 39 ], [ 150, 43 ], [ 39, 45 ], [ 165, 48 ], [ 141, 53 ], [ 150, 58 ], [ 152, 62 ], [ 165, 65 ], [ 165, 74 ], [ 141, 79 ], [ 150, 84 ], [ 153, 88 ], [ 159, 88 ], [ 144, 88 ], [ 156, 88 ], [ 155, 91 ], [ 165, 94 ], [ 153, 99 ], [ 159, 99 ], [ 144, 99 ], [ 156, 99 ], [ 143, 102 ], [ 141, 105 ], [ 158, 109 ], [ 150, 112 ], [ 165, 119 ], [ 141, 128 ], [ 137, 138 ], [ 140, 141 ], [ 143, 144 ], [ 146, 147 ], [ 149, 150 ], [ 152, 153 ], [ 155, 156 ], [ 158, 159 ], [ 161, 162 ], [ 164, 165 ] ]
[ "a= input()\nb= input()\nc= input()\nqa=[]\nqb=[]\nqc=[]\nfor i in a:\n\tqa.append(i)\nfor i in b:\n\tqb.append(i)\nfor i in c:\n\tqc.append(i)\nqa.append('d')\nqb.append('d')\nqc.append('d')\nt=qa.pop(0)\nwhile len(qa)>0 and len(qb)>0 and len(qc)>0:\n\tif t=='a':\n\t\tt=qa.pop(0)\n\telif t=='b':\n\t\tt=qb.pop(0)\n\telse :\n\t\tt=qc.pop(0)\n\nif len(qa)==0:\n\tprint('A')\nelif len(qb)==0:\n\tprint('B')\nelse:\n\tprint('C')", "a= input()", "a", "input()", "input", "b= input()", "b", "input()", "input", "c= input()", "c", "input()", "input", "qa=[]", "qa", "[]", "qb=[]", "qb", "[]", "qc=[]", "qc", "[]", "for i in a:\n\tqa.append(i)", "i", "a", "qa.append(i)", "qa.append", "qa", "append", "i", "for i in b:\n\tqb.append(i)", "i", "b", "qb.append(i)", "qb.append", "qb", "append", "i", "for i in c:\n\tqc.append(i)", "i", "c", "qc.append(i)", "qc.append", "qc", "append", "i", "qa.append('d')", "qa.append", "qa", "append", "'d'", "qb.append('d')", "qb.append", "qb", "append", "'d'", "qc.append('d')", "qc.append", "qc", "append", "'d'", "t=qa.pop(0)", "t", "qa.pop(0)", "qa.pop", "qa", "pop", "0", "while len(qa)>0 and len(qb)>0 and len(qc)>0:\n\tif t=='a':\n\t\tt=qa.pop(0)\n\telif t=='b':\n\t\tt=qb.pop(0)\n\telse :\n\t\tt=qc.pop(0)", "len(qa)>0 and len(qb)>0 and len(qc)>0", "len(qa)>0 and len(qb)>0", "len(qa)>0", "len(qa)", "len", "qa", "0", "len(qb)>0", "len(qb)", "len", "qb", "0", "len(qc)>0", "len(qc)", "len", "qc", "0", "if t=='a':\n\t\tt=qa.pop(0)\n\telif t=='b':\n\t\tt=qb.pop(0)\n\telse :\n\t\tt=qc.pop(0)", "t=='a'", "t", "'a'", "t=qa.pop(0)", "t", "qa.pop(0)", "qa.pop", "qa", "pop", "0", "elif t=='b':\n\t\tt=qb.pop(0)\n\t", "t=='b'", "t", "'b'", "t=qb.pop(0)", "t", "qb.pop(0)", "qb.pop", "qb", "pop", "0", "t=qc.pop(0)", "t", "qc.pop(0)", "qc.pop", "qc", "pop", "0", "if len(qa)==0:\n\tprint('A')\nelif len(qb)==0:\n\tprint('B')\nelse:\n\tprint('C')", "len(qa)==0", "len(qa)", "len", "qa", "0", "print('A')", "print", "'A'", "elif len(qb)==0:\n\tprint('B')", "len(qb)==0", "len(qb)", "len", "qb", "0", "print('B')", "print", "'B'", "print('C')", "print", "'C'", "a= input()", "input()", "a", "qb=[]", "[]", "qb", "t=qb.pop(0)", "qb.pop(0)", "t", "b= input()", "input()", "b", "qc=[]", "[]", "qc", "t=qa.pop(0)", "qa.pop(0)", "t", "t=qa.pop(0)", "qa.pop(0)", "t", "t=qc.pop(0)", "qc.pop(0)", "t", "c= input()", "input()", "c", "qa=[]", "[]", "qa" ]
a= input() b= input() c= input() qa=[] qb=[] qc=[] for i in a: qa.append(i) for i in b: qb.append(i) for i in c: qc.append(i) qa.append('d') qb.append('d') qc.append('d') t=qa.pop(0) while len(qa)>0 and len(qb)>0 and len(qc)>0: if t=='a': t=qa.pop(0) elif t=='b': t=qb.pop(0) else : t=qc.pop(0) if len(qa)==0: print('A') elif len(qb)==0: print('B') else: print('C')
[ 7, 15, 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, 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, 17, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13 ]
[ [ 85, 3 ], [ 94, 9 ], [ 88, 15 ], [ 82, 21 ], [ 83, 27 ], [ 101, 27 ], [ 98, 27 ], [ 92, 27 ], [ 86, 33 ], [ 91, 40 ], [ 86, 43 ], [ 83, 47 ], [ 101, 47 ], [ 98, 47 ], [ 92, 47 ], [ 95, 53 ], [ 97, 60 ], [ 95, 63 ], [ 89, 69 ], [ 100, 76 ], [ 89, 79 ], [ 82, 83 ], [ 85, 86 ], [ 88, 89 ], [ 91, 92 ], [ 94, 95 ], [ 97, 98 ], [ 100, 101 ] ]
[ "from collections import deque\nsa = deque(input())\nsb = deque(input())\nsc = deque(input())\n\nplayer = \"a\"\nwhile True:\n if player == \"a\":\n if len(sa) == 0:\n print(\"A\")\n break\n player = sa.popleft()\n elif player == \"b\":\n if len(sb) == 0:\n print(\"B\")\n break\n player = sb.popleft()\n else:\n if len(sc) == 0:\n print(\"C\")\n break\n player = sc.popleft()", "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", "player = \"a\"", "player", "\"a\"", "while True:\n if player == \"a\":\n if len(sa) == 0:\n print(\"A\")\n break\n player = sa.popleft()\n elif player == \"b\":\n if len(sb) == 0:\n print(\"B\")\n break\n player = sb.popleft()\n else:\n if len(sc) == 0:\n print(\"C\")\n break\n player = sc.popleft()", "True", "if player == \"a\":\n if len(sa) == 0:\n print(\"A\")\n break\n player = sa.popleft()\n elif player == \"b\":\n if len(sb) == 0:\n print(\"B\")\n break\n player = sb.popleft()\n else:\n if len(sc) == 0:\n print(\"C\")\n break\n player = sc.popleft()", "player == \"a\"", "player", "\"a\"", "if len(sa) == 0:\n print(\"A\")\n break\n ", "len(sa) == 0", "len(sa)", "len", "sa", "0", "print(\"A\")", "print", "\"A\"", "break", "player = sa.popleft()", "player", "sa.popleft()", "sa.popleft", "sa", "popleft", "elif player == \"b\":\n if len(sb) == 0:\n print(\"B\")\n break\n player = sb.popleft()\n ", "player == \"b\"", "player", "\"b\"", "if len(sb) == 0:\n print(\"B\")\n break\n ", "len(sb) == 0", "len(sb)", "len", "sb", "0", "print(\"B\")", "print", "\"B\"", "break", "player = sb.popleft()", "player", "sb.popleft()", "sb.popleft", "sb", "popleft", "if len(sc) == 0:\n print(\"C\")\n break\n ", "len(sc) == 0", "len(sc)", "len", "sc", "0", "print(\"C\")", "print", "\"C\"", "break", "player = sc.popleft()", "player", "sc.popleft()", "sc.popleft", "sc", "popleft", "player = \"a\"", "\"a\"", "player", "sa = deque(input())", "deque(input())", "sa", "sc = deque(input())", "deque(input())", "sc", "player = sa.popleft()", "sa.popleft()", "player", "sb = deque(input())", "deque(input())", "sb", "player = sb.popleft()", "sb.popleft()", "player", "player = sc.popleft()", "sc.popleft()", "player" ]
from collections import deque sa = deque(input()) sb = deque(input()) sc = deque(input()) player = "a" while True: if player == "a": if len(sa) == 0: print("A") break player = sa.popleft() elif player == "b": if len(sb) == 0: print("B") break player = sb.popleft() else: if len(sc) == 0: print("C") break player = sc.popleft()
[ 7, 41, 28, 13, 4, 13, 17, 4, 4, 13, 4, 13, 0, 13, 13, 0, 13, 17, 42, 17, 14, 2, 4, 13, 18, 13, 13, 17, 0, 13, 4, 18, 18, 13, 13, 13, 17, 0, 13, 8, 2, 13, 17, 17, 8, 2, 13, 17, 17, 17, 3, 4, 13, 18, 17, 13, 10, 13, 13, 10, 17, 13, 10, 4, 13, 10, 8, 13 ]
[ [ 4, 3 ], [ 57, 13 ], [ 60, 16 ], [ 58, 25 ], [ 61, 26 ], [ 67, 26 ], [ 63, 29 ], [ 58, 33 ], [ 61, 34 ], [ 67, 34 ], [ 66, 38 ], [ 64, 41 ], [ 64, 46 ], [ 67, 55 ], [ 61, 55 ], [ 57, 58 ], [ 60, 61 ], [ 63, 64 ], [ 66, 67 ] ]
[ "s=[list(input()) for i in range(3)]\nk=0\nwhile 1:\n\tif len(s[k])>0:\n\t\tt=s[k].pop(0)\n\t\tk=0 if t=='a' else 1 if t=='b' else 2\n\telse:\n\t\tbreak\nprint('ABC'[k])", "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", "s=[list(input()) for i in range(3)]", "s", "[list(input()) for i in range(3)]", "k=0", "k", "0", "while 1:\n\tif len(s[k])>0:\n\t\tt=s[k].pop(0)\n\t\tk=0 if t=='a' else 1 if t=='b' else 2\n\telse:\n\t\tbreak", "1", "if len(s[k])>0:\n\t\tt=s[k].pop(0)\n\t\tk=0 if t=='a' else 1 if t=='b' else 2\n\telse:\n\t\tbreak", "len(s[k])>0", "len(s[k])", "len", "s[k]", "s", "k", "0", "t=s[k].pop(0)", "t", "s[k].pop(0)", "[k].pop", "[k]", "s", "k", "pop", "0", "k=0 if t=='a' else 1 if t=='b' else 2", "k", "0 if t=='a' else 1 if t=='b' else 2", "t=='a'", "t", "'a'", "0", "1 if t=='b' else 2", "t=='b'", "t", "'b'", "1", "2", "break", "print('ABC'[k])", "print", "'ABC'[k]", "'ABC'", "k", "s=[list(input()) for i in range(3)]", "[list(input()) for i in range(3)]", "s", "k=0", "0", "k", "t=s[k].pop(0)", "s[k].pop(0)", "t", "k=0 if t=='a' else 1 if t=='b' else 2", "0 if t=='a' else 1 if t=='b' else 2", "k" ]
s=[list(input()) for i in range(3)] k=0 while 1: if len(s[k])>0: t=s[k].pop(0) k=0 if t=='a' else 1 if t=='b' else 2 else: break print('ABC'[k])
[ 7, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 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, 14, 2, 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, 18, 13, 10, 18, 13, 10, 18, 13, 10, 4, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 4, 13 ]
[ [ 129, 2 ], [ 99, 6 ], [ 117, 10 ], [ 102, 14 ], [ 130, 16 ], [ 120, 19 ], [ 130, 21 ], [ 103, 28 ], [ 127, 28 ], [ 112, 28 ], [ 115, 28 ], [ 121, 32 ], [ 130, 32 ], [ 124, 32 ], [ 114, 40 ], [ 121, 42 ], [ 130, 42 ], [ 124, 42 ], [ 123, 45 ], [ 121, 47 ], [ 130, 47 ], [ 124, 47 ], [ 115, 52 ], [ 103, 52 ], [ 127, 52 ], [ 112, 52 ], [ 100, 56 ], [ 109, 56 ], [ 111, 64 ], [ 100, 66 ], [ 109, 66 ], [ 108, 69 ], [ 100, 71 ], [ 109, 71 ], [ 112, 76 ], [ 115, 76 ], [ 103, 76 ], [ 127, 76 ], [ 118, 80 ], [ 106, 80 ], [ 126, 88 ], [ 118, 90 ], [ 106, 90 ], [ 105, 93 ], [ 118, 95 ], [ 106, 95 ], [ 99, 100 ], [ 102, 103 ], [ 105, 106 ], [ 108, 109 ], [ 111, 112 ], [ 114, 115 ], [ 117, 118 ], [ 120, 121 ], [ 123, 124 ], [ 126, 127 ], [ 129, 130 ] ]
[ "A = input()\nB = input()\nC = input()\n\n\norder = A[0]\nA = A[1:]\n\nwhile True:\n if order == \"a\":\n if A == \"\":\n print('A')\n exit()\n order = A[0]\n A = A[1:]\n\n if order == \"b\":\n if B == \"\":\n print('B')\n exit()\n order = B[0]\n B = B[1:]\n\n if order == \"c\":\n if C == \"\":\n print('C')\n exit()\n order = C[0]\n C = C[1:]", "A = input()", "A", "input()", "input", "B = input()", "B", "input()", "input", "C = input()", "C", "input()", "input", "order = A[0]", "order", "A[0]", "A", "0", "A = A[1:]", "A", "A[1:]", "A", "1:", "1", "while True:\n if order == \"a\":\n if A == \"\":\n print('A')\n exit()\n order = A[0]\n A = A[1:]\n\n if order == \"b\":\n if B == \"\":\n print('B')\n exit()\n order = B[0]\n B = B[1:]\n\n if order == \"c\":\n if C == \"\":\n print('C')\n exit()\n order = C[0]\n C = C[1:]", "True", "if order == \"a\":\n if A == \"\":\n print('A')\n exit()\n order = A[0]\n A = A[1:]\n\n ", "order == \"a\"", "order", "\"a\"", "if A == \"\":\n print('A')\n exit()\n ", "A == \"\"", "A", "\"\"", "print('A')", "print", "'A'", "exit()", "exit", "order = A[0]", "order", "A[0]", "A", "0", "A = A[1:]", "A", "A[1:]", "A", "1:", "1", "if order == \"b\":\n if B == \"\":\n print('B')\n exit()\n order = B[0]\n B = B[1:]\n\n ", "order == \"b\"", "order", "\"b\"", "if B == \"\":\n print('B')\n exit()\n ", "B == \"\"", "B", "\"\"", "print('B')", "print", "'B'", "exit()", "exit", "order = B[0]", "order", "B[0]", "B", "0", "B = B[1:]", "B", "B[1:]", "B", "1:", "1", "if order == \"c\":\n if C == \"\":\n print('C')\n exit()\n order = C[0]\n C = C[1:]", "order == \"c\"", "order", "\"c\"", "if C == \"\":\n print('C')\n exit()\n ", "C == \"\"", "C", "\"\"", "print('C')", "print", "'C'", "exit()", "exit", "order = C[0]", "order", "C[0]", "C", "0", "C = C[1:]", "C", "C[1:]", "C", "1:", "1", "B = input()", "input()", "B", "order = A[0]", "A[0]", "order", "C = C[1:]", "C[1:]", "C", "B = B[1:]", "B[1:]", "B", "order = B[0]", "B[0]", "order", "order = A[0]", "A[0]", "order", "C = input()", "input()", "C", "A = A[1:]", "A[1:]", "A", "A = A[1:]", "A[1:]", "A", "order = C[0]", "C[0]", "order", "A = input()", "input()", "A" ]
A = input() B = input() C = input() order = A[0] A = A[1:] while True: if order == "a": if A == "": print('A') exit() order = A[0] A = A[1:] if order == "b": if B == "": print('B') exit() order = B[0] B = B[1:] if order == "c": if C == "": print('C') exit() order = C[0] C = C[1:]
[ 7, 0, 13, 2, 4, 13, 4, 13, 17, 0, 13, 2, 4, 13, 4, 13, 17, 0, 13, 2, 4, 13, 4, 13, 17, 0, 13, 17, 13, 17, 13, 17, 0, 13, 17, 0, 13, 18, 13, 17, 42, 2, 13, 4, 13, 2, 2, 13, 13, 13, 14, 2, 13, 17, 0, 13, 18, 13, 13, 0, 13, 17, 14, 2, 13, 17, 0, 13, 18, 13, 13, 0, 13, 17, 14, 2, 13, 17, 0, 13, 18, 13, 13, 0, 13, 17, 14, 2, 13, 4, 13, 13, 0, 13, 17, 3, 14, 2, 13, 4, 13, 13, 0, 13, 17, 3, 14, 2, 13, 4, 13, 13, 0, 13, 17, 3, 0, 13, 17, 4, 13, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 18, 13, 10, 18, 13, 10, 17, 13, 10, 17, 13, 10, 2, 13, 10, 17, 13, 10, 18, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 2, 13, 10, 17, 13, 10, 18, 13, 10, 2, 13 ]
[ [ 174, 2 ], [ 165, 10 ], [ 147, 18 ], [ 132, 26 ], [ 168, 28 ], [ 126, 30 ], [ 156, 33 ], [ 135, 36 ], [ 175, 38 ], [ 157, 42 ], [ 130, 42 ], [ 175, 47 ], [ 166, 48 ], [ 148, 49 ], [ 136, 52 ], [ 172, 52 ], [ 154, 52 ], [ 139, 52 ], [ 138, 55 ], [ 175, 57 ], [ 133, 58 ], [ 151, 58 ], [ 150, 60 ], [ 136, 64 ], [ 172, 64 ], [ 154, 64 ], [ 139, 64 ], [ 153, 67 ], [ 166, 69 ], [ 169, 70 ], [ 124, 70 ], [ 123, 72 ], [ 136, 76 ], [ 172, 76 ], [ 154, 76 ], [ 139, 76 ], [ 171, 79 ], [ 148, 81 ], [ 127, 82 ], [ 142, 82 ], [ 141, 84 ], [ 151, 88 ], [ 133, 88 ], [ 175, 91 ], [ 159, 93 ], [ 124, 98 ], [ 169, 98 ], [ 166, 101 ], [ 162, 103 ], [ 142, 108 ], [ 127, 108 ], [ 148, 111 ], [ 144, 113 ], [ 129, 117 ], [ 145, 121 ], [ 163, 121 ], [ 160, 121 ], [ 123, 124 ], [ 126, 127 ], [ 129, 130 ], [ 132, 133 ], [ 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 ] ]
[ "SA=str(input())+\"f\"\nSB=str(input())+\"f\"\nSC=str(input())+\"f\"\nA,B,C=1,0,0\ni=0\nx=SA[0]\n\nwhile i < len(SA + SB + SC):\n if x == \"a\":\n x = SA[A]\n A+=1\n elif x == \"b\":\n x = SB[B]\n B+=1\n elif x == \"c\":\n x = SC[C]\n C+=1\n \n if A==len(SA):\n ans=\"A\"\n break\n elif B==len(SB):\n ans=\"B\"\n break\n elif C==len(SC):\n ans=\"C\"\n break\n i+=1\nprint(ans)", "SA=str(input())+\"f\"", "SA", "str(input())+\"f\"", "str(input())", "str", "input()", "input", "\"f\"", "SB=str(input())+\"f\"", "SB", "str(input())+\"f\"", "str(input())", "str", "input()", "input", "\"f\"", "SC=str(input())+\"f\"", "SC", "str(input())+\"f\"", "str(input())", "str", "input()", "input", "\"f\"", "A,B,C=1,0,0", "A", "1", "B", "0", "C", "0", "i=0", "i", "0", "x=SA[0]", "x", "SA[0]", "SA", "0", "while i < len(SA + SB + SC):\n if x == \"a\":\n x = SA[A]\n A+=1\n elif x == \"b\":\n x = SB[B]\n B+=1\n elif x == \"c\":\n x = SC[C]\n C+=1\n \n if A==len(SA):\n ans=\"A\"\n break\n elif B==len(SB):\n ans=\"B\"\n break\n elif C==len(SC):\n ans=\"C\"\n break\n i+=1", "i < len(SA + SB + SC)", "i", "len(SA + SB + SC)", "len", "SA + SB + SC", "SA + SB", "SA", "SB", "SC", "if x == \"a\":\n x = SA[A]\n A+=1\n elif x == \"b\":\n x = SB[B]\n B+=1\n elif x == \"c\":\n x = SC[C]\n C+=1\n \n ", "x == \"a\"", "x", "\"a\"", "x = SA[A]", "x", "SA[A]", "SA", "A", "A+=1", "A", "1", "elif x == \"b\":\n x = SB[B]\n B+=1\n ", "x == \"b\"", "x", "\"b\"", "x = SB[B]", "x", "SB[B]", "SB", "B", "B+=1", "B", "1", "elif x == \"c\":\n x = SC[C]\n C+=1\n \n ", "x == \"c\"", "x", "\"c\"", "x = SC[C]", "x", "SC[C]", "SC", "C", "C+=1", "C", "1", "if A==len(SA):\n ans=\"A\"\n break\n elif B==len(SB):\n ans=\"B\"\n break\n elif C==len(SC):\n ans=\"C\"\n break\n ", "A==len(SA)", "A", "len(SA)", "len", "SA", "ans=\"A\"", "ans", "\"A\"", "break", "elif B==len(SB):\n ans=\"B\"\n break\n ", "B==len(SB)", "B", "len(SB)", "len", "SB", "ans=\"B\"", "ans", "\"B\"", "break", "elif C==len(SC):\n ans=\"C\"\n break\n ", "C==len(SC)", "C", "len(SC)", "len", "SC", "ans=\"C\"", "ans", "\"C\"", "break", "i+=1", "i", "1", "print(ans)", "print", "ans", "B+=1", "1", "B", "C=1,0,0", "0", "C", "i+=1", "1", "i", "A,B,C=1,0,0", "1", "A", "x=SA[0]", "SA[0]", "x", "x = SA[A]", "SA[A]", "x", "C+=1", "1", "C", "ans=\"C\"", "\"C\"", "ans", "SC=str(input())+\"f\"", "str(input())+\"f\"", "SC", "A+=1", "1", "A", "x = SB[B]", "SB[B]", "x", "i=0", "0", "i", "ans=\"A\"", "\"A\"", "ans", "ans=\"B\"", "\"B\"", "ans", "SB=str(input())+\"f\"", "str(input())+\"f\"", "SB", "B,C=1,0,0", "0", "B", "x = SC[C]", "SC[C]", "x", "SA=str(input())+\"f\"", "str(input())+\"f\"", "SA" ]
SA=str(input())+"f" SB=str(input())+"f" SC=str(input())+"f" A,B,C=1,0,0 i=0 x=SA[0] while i < len(SA + SB + SC): if x == "a": x = SA[A] A+=1 elif x == "b": x = SB[B] B+=1 elif x == "c": x = SC[C] C+=1 if A==len(SA): ans="A" break elif B==len(SB): ans="B" break elif C==len(SC): ans="C" break i+=1 print(ans)
[ 7, 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, 18, 13, 17, 28, 13, 4, 13, 2, 2, 4, 13, 13, 4, 13, 13, 4, 13, 13, 14, 2, 13, 17, 14, 2, 13, 39, 4, 13, 17, 3, 0, 13, 18, 13, 17, 4, 18, 13, 13, 17, 14, 2, 13, 17, 14, 2, 13, 39, 4, 13, 17, 3, 0, 13, 18, 13, 17, 4, 18, 13, 13, 17, 14, 2, 13, 39, 4, 13, 17, 3, 0, 13, 18, 13, 17, 4, 18, 13, 13, 17, 10, 18, 13, 10, 18, 13, 10, 4, 13, 10, 18, 13, 10, 18, 13, 10, 4, 13, 10, 4, 13 ]
[ [ 126, 2 ], [ 129, 11 ], [ 117, 20 ], [ 123, 29 ], [ 127, 31 ], [ 35, 34 ], [ 127, 41 ], [ 130, 44 ], [ 118, 47 ], [ 124, 50 ], [ 115, 50 ], [ 121, 50 ], [ 112, 50 ], [ 127, 54 ], [ 111, 61 ], [ 127, 63 ], [ 127, 67 ], [ 124, 72 ], [ 115, 72 ], [ 121, 72 ], [ 112, 72 ], [ 130, 76 ], [ 120, 83 ], [ 130, 85 ], [ 130, 89 ], [ 118, 94 ], [ 114, 101 ], [ 118, 103 ], [ 118, 107 ], [ 111, 112 ], [ 114, 115 ], [ 117, 118 ], [ 120, 121 ], [ 123, 124 ], [ 126, 127 ], [ 129, 130 ] ]
[ "a = list(map(str,(input())))\nb = list(map(str,(input())))\nc = list(map(str,(input())))\n \ncard = a[0]\n \nfor i in range(len(a) + len(b) + len(c)):\n if card == 'a':\n if a == []:\n print(\"A\")\n break\n else:\n card = a[0]\n a.pop(0)\n \n elif card == 'b':\n if b == []:\n print(\"B\")\n break\n else:\n card = b[0]\n b.pop(0)\n \n else:\n if c == []:\n print(\"C\")\n break\n else:\n card = c[0]\n c.pop(0)", "a = list(map(str,(input())))", "a", "list(map(str,(input())))", "list", "map(str,(input()))", "map", "str", "input()", "input", "b = list(map(str,(input())))", "b", "list(map(str,(input())))", "list", "map(str,(input()))", "map", "str", "input()", "input", "c = list(map(str,(input())))", "c", "list(map(str,(input())))", "list", "map(str,(input()))", "map", "str", "input()", "input", "card = a[0]", "card", "a[0]", "a", "0", "for i in range(len(a) + len(b) + len(c)):\n if card == 'a':\n if a == []:\n print(\"A\")\n break\n else:\n card = a[0]\n a.pop(0)\n \n elif card == 'b':\n if b == []:\n print(\"B\")\n break\n else:\n card = b[0]\n b.pop(0)\n \n else:\n if c == []:\n print(\"C\")\n break\n else:\n card = c[0]\n c.pop(0)", "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 card == 'a':\n if a == []:\n print(\"A\")\n break\n else:\n card = a[0]\n a.pop(0)\n \n elif card == 'b':\n if b == []:\n print(\"B\")\n break\n else:\n card = b[0]\n b.pop(0)\n \n else:\n if c == []:\n print(\"C\")\n break\n else:\n card = c[0]\n c.pop(0)", "card == 'a'", "card", "'a'", "if a == []:\n print(\"A\")\n break\n else:\n card = a[0]\n a.pop(0)\n \n ", "a == []", "a", "[]", "print(\"A\")", "print", "\"A\"", "break", "card = a[0]", "card", "a[0]", "a", "0", "a.pop(0)", "a.pop", "a", "pop", "0", "elif card == 'b':\n if b == []:\n print(\"B\")\n break\n else:\n card = b[0]\n b.pop(0)\n \n ", "card == 'b'", "card", "'b'", "if b == []:\n print(\"B\")\n break\n else:\n card = b[0]\n b.pop(0)\n \n ", "b == []", "b", "[]", "print(\"B\")", "print", "\"B\"", "break", "card = b[0]", "card", "b[0]", "b", "0", "b.pop(0)", "b.pop", "b", "pop", "0", "if c == []:\n print(\"C\")\n break\n else:\n card = c[0]\n c.pop(0)", "c == []", "c", "[]", "print(\"C\")", "print", "\"C\"", "break", "card = c[0]", "card", "c[0]", "c", "0", "c.pop(0)", "c.pop", "c", "pop", "0", "card = a[0]", "a[0]", "card", "card = c[0]", "c[0]", "card", "c = list(map(str,(input())))", "list(map(str,(input())))", "c", "card = b[0]", "b[0]", "card", "card = a[0]", "a[0]", "card", "a = list(map(str,(input())))", "list(map(str,(input())))", "a", "b = list(map(str,(input())))", "list(map(str,(input())))", "b" ]
a = list(map(str,(input()))) b = list(map(str,(input()))) c = list(map(str,(input()))) card = a[0] for i in range(len(a) + len(b) + len(c)): if card == 'a': if a == []: print("A") break else: card = a[0] a.pop(0) elif card == 'b': if b == []: print("B") break else: card = b[0] b.pop(0) else: if c == []: print("C") break else: card = c[0] c.pop(0)
[ 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, 0, 13, 17, 42, 17, 14, 2, 13, 17, 14, 40, 13, 0, 13, 17, 3, 0, 13, 4, 18, 13, 13, 14, 2, 13, 17, 14, 40, 13, 0, 13, 17, 3, 0, 13, 4, 18, 13, 13, 14, 40, 13, 0, 13, 17, 3, 0, 13, 4, 18, 13, 13, 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, 17, 13, 10, 17, 13, 10, 4, 13, 10, 4, 13 ]
[ [ 94, 3 ], [ 112, 11 ], [ 100, 19 ], [ 109, 27 ], [ 85, 30 ], [ 110, 36 ], [ 89, 36 ], [ 116, 36 ], [ 104, 36 ], [ 95, 40 ], [ 97, 42 ], [ 103, 46 ], [ 95, 49 ], [ 110, 53 ], [ 89, 53 ], [ 116, 53 ], [ 104, 53 ], [ 113, 57 ], [ 106, 59 ], [ 115, 63 ], [ 113, 66 ], [ 101, 70 ], [ 91, 72 ], [ 88, 76 ], [ 101, 79 ], [ 92, 83 ], [ 107, 83 ], [ 98, 83 ], [ 86, 83 ], [ 85, 86 ], [ 88, 89 ], [ 91, 92 ], [ 94, 95 ], [ 97, 98 ], [ 100, 101 ], [ 103, 104 ], [ 106, 107 ], [ 109, 110 ], [ 112, 113 ], [ 115, 116 ] ]
[ "from collections import deque\na = deque(list(input()))\nb = deque(list(input()))\nc = deque(list(input()))\nnow = \"a\"\nwin = None\nwhile 1:\n if now == \"a\":\n if not a:\n win = \"A\"\n break\n now = a.popleft()\n elif now == \"b\":\n if not b:\n win = \"B\"\n break\n now = b.popleft()\n else:\n if not c:\n win = \"C\"\n break\n now = c.popleft()\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", "now = \"a\"", "now", "\"a\"", "win = None", "win", "None", "while 1:\n if now == \"a\":\n if not a:\n win = \"A\"\n break\n now = a.popleft()\n elif now == \"b\":\n if not b:\n win = \"B\"\n break\n now = b.popleft()\n else:\n if not c:\n win = \"C\"\n break\n now = c.popleft()", "1", "if now == \"a\":\n if not a:\n win = \"A\"\n break\n now = a.popleft()\n elif now == \"b\":\n if not b:\n win = \"B\"\n break\n now = b.popleft()\n else:\n if not c:\n win = \"C\"\n break\n now = c.popleft()", "now == \"a\"", "now", "\"a\"", "if not a:\n win = \"A\"\n break\n ", "not a", "a", "win = \"A\"", "win", "\"A\"", "break", "now = a.popleft()", "now", "a.popleft()", "a.popleft", "a", "popleft", "elif now == \"b\":\n if not b:\n win = \"B\"\n break\n now = b.popleft()\n ", "now == \"b\"", "now", "\"b\"", "if not b:\n win = \"B\"\n break\n ", "not b", "b", "win = \"B\"", "win", "\"B\"", "break", "now = b.popleft()", "now", "b.popleft()", "b.popleft", "b", "popleft", "if not c:\n win = \"C\"\n break\n ", "not c", "c", "win = \"C\"", "win", "\"C\"", "break", "now = c.popleft()", "now", "c.popleft()", "c.popleft", "c", "popleft", "print(win)", "print", "win", "win = None", "None", "win", "now = c.popleft()", "c.popleft()", "now", "win = \"C\"", "\"C\"", "win", "a = deque(list(input()))", "deque(list(input()))", "a", "win = \"A\"", "\"A\"", "win", "c = deque(list(input()))", "deque(list(input()))", "c", "now = a.popleft()", "a.popleft()", "now", "win = \"B\"", "\"B\"", "win", "now = \"a\"", "\"a\"", "now", "b = deque(list(input()))", "deque(list(input()))", "b", "now = b.popleft()", "b.popleft()", "now" ]
from collections import deque a = deque(list(input())) b = deque(list(input())) c = deque(list(input())) now = "a" win = None while 1: if now == "a": if not a: win = "A" break now = a.popleft() elif now == "b": if not b: win = "B" break now = b.popleft() else: if not c: win = "C" break now = c.popleft() print(win)
[ 7, 15, 13, 0, 13, 4, 18, 13, 13, 4, 13, 0, 13, 4, 18, 13, 13, 4, 13, 0, 13, 4, 18, 13, 13, 4, 13, 0, 13, 17, 42, 17, 14, 2, 13, 17, 38, 5, 4, 13, 17, 4, 13, 0, 13, 4, 18, 13, 13, 14, 2, 13, 17, 38, 5, 4, 13, 17, 4, 13, 0, 13, 4, 18, 13, 13, 38, 5, 4, 13, 17, 4, 13, 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 ]
[ [ 95, 4 ], [ 86, 12 ], [ 92, 20 ], [ 80, 28 ], [ 81, 34 ], [ 99, 34 ], [ 84, 34 ], [ 90, 34 ], [ 89, 44 ], [ 96, 47 ], [ 81, 51 ], [ 99, 51 ], [ 84, 51 ], [ 90, 51 ], [ 83, 61 ], [ 87, 64 ], [ 98, 74 ], [ 93, 77 ], [ 80, 81 ], [ 83, 84 ], [ 86, 87 ], [ 89, 90 ], [ 92, 93 ], [ 95, 96 ], [ 98, 99 ] ]
[ "import collections\n\nsa = collections.deque(input())\nsb = collections.deque(input())\nsc = collections.deque(input())\n\n\ntmp = \"a\"\nwhile True:\n if tmp == \"a\":\n try:\n tmp = sa.popleft()\n except(IndexError):\n print(\"A\")\n exit()\n elif tmp == \"b\":\n try:\n tmp = sb.popleft()\n except(IndexError):\n print(\"B\")\n exit()\n else:\n try:\n tmp = sc.popleft()\n except(IndexError):\n print(\"C\")\n exit()\n ", "import collections", "collections", "sa = collections.deque(input())", "sa", "collections.deque(input())", "collections.deque", "collections", "deque", "input()", "input", "sb = collections.deque(input())", "sb", "collections.deque(input())", "collections.deque", "collections", "deque", "input()", "input", "sc = collections.deque(input())", "sc", "collections.deque(input())", "collections.deque", "collections", "deque", "input()", "input", "tmp = \"a\"", "tmp", "\"a\"", "while True:\n if tmp == \"a\":\n try:\n tmp = sa.popleft()\n except(IndexError):\n print(\"A\")\n exit()\n elif tmp == \"b\":\n try:\n tmp = sb.popleft()\n except(IndexError):\n print(\"B\")\n exit()\n else:\n try:\n tmp = sc.popleft()\n except(IndexError):\n print(\"C\")\n exit()\n ", "True", "if tmp == \"a\":\n try:\n tmp = sa.popleft()\n except(IndexError):\n print(\"A\")\n exit()\n elif tmp == \"b\":\n try:\n tmp = sb.popleft()\n except(IndexError):\n print(\"B\")\n exit()\n else:\n try:\n tmp = sc.popleft()\n except(IndexError):\n print(\"C\")\n exit()\n ", "tmp == \"a\"", "tmp", "\"a\"", "try:\n tmp = sa.popleft()\n except(IndexError):\n print(\"A\")\n exit()\n ", "except(IndexError):\n print(\"A\")\n exit()\n ", "print(\"A\")", "print", "\"A\"", "exit()", "exit", "tmp = sa.popleft()", "tmp", "sa.popleft()", "sa.popleft", "sa", "popleft", "elif tmp == \"b\":\n try:\n tmp = sb.popleft()\n except(IndexError):\n print(\"B\")\n exit()\n ", "tmp == \"b\"", "tmp", "\"b\"", "try:\n tmp = sb.popleft()\n except(IndexError):\n print(\"B\")\n exit()\n ", "except(IndexError):\n print(\"B\")\n exit()\n ", "print(\"B\")", "print", "\"B\"", "exit()", "exit", "tmp = sb.popleft()", "tmp", "sb.popleft()", "sb.popleft", "sb", "popleft", "try:\n tmp = sc.popleft()\n except(IndexError):\n print(\"C\")\n exit()\n ", "except(IndexError):\n print(\"C\")\n exit()\n ", "print(\"C\")", "print", "\"C\"", "exit()", "exit", "tmp = sc.popleft()", "tmp", "sc.popleft()", "sc.popleft", "sc", "popleft", "tmp = \"a\"", "\"a\"", "tmp", "tmp = sb.popleft()", "sb.popleft()", "tmp", "sb = collections.deque(input())", "collections.deque(input())", "sb", "tmp = sa.popleft()", "sa.popleft()", "tmp", "sc = collections.deque(input())", "collections.deque(input())", "sc", "sa = collections.deque(input())", "collections.deque(input())", "sa", "tmp = sc.popleft()", "sc.popleft()", "tmp" ]
import collections sa = collections.deque(input()) sb = collections.deque(input()) sc = collections.deque(input()) tmp = "a" while True: if tmp == "a": try: tmp = sa.popleft() except(IndexError): print("A") exit() elif tmp == "b": try: tmp = sb.popleft() except(IndexError): print("B") exit() else: try: tmp = sc.popleft() except(IndexError): print("C") exit()
[ 7, 0, 13, 17, 0, 18, 13, 17, 18, 4, 13, 4, 13, 39, 17, 0, 18, 13, 17, 18, 4, 13, 4, 13, 39, 17, 0, 18, 13, 17, 18, 4, 13, 4, 13, 39, 17, 0, 13, 17, 42, 18, 13, 13, 0, 13, 4, 18, 18, 13, 13, 13, 4, 13, 4, 18, 13, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13 ]
[ [ 62, 2 ], [ 8, 5 ], [ 63, 6 ], [ 19, 16 ], [ 63, 17 ], [ 30, 27 ], [ 63, 28 ], [ 65, 38 ], [ 63, 42 ], [ 66, 43 ], [ 60, 43 ], [ 59, 45 ], [ 63, 49 ], [ 66, 50 ], [ 60, 50 ], [ 60, 56 ], [ 66, 56 ], [ 59, 60 ], [ 62, 63 ], [ 65, 66 ] ]
[ "D = {}\nD[\"a\"] = list(input())[::-1]\nD[\"b\"] = list(input())[::-1]\nD[\"c\"] = list(input())[::-1]\np = \"a\"\n\nwhile D[p]:\n p = D[p].pop()\n\nprint(p.upper())", "D = {}", "D", "{}", "D[\"a\"] = list(input())[::-1]", "D[\"a\"]", "D", "\"a\"", "list(input())[::-1]", "(input())", "list", "input()", "input", "::-1", "-1", "D[\"b\"] = list(input())[::-1]", "D[\"b\"]", "D", "\"b\"", "list(input())[::-1]", "(input())", "list", "input()", "input", "::-1", "-1", "D[\"c\"] = list(input())[::-1]", "D[\"c\"]", "D", "\"c\"", "list(input())[::-1]", "(input())", "list", "input()", "input", "::-1", "-1", "p = \"a\"", "p", "\"a\"", "while D[p]:\n p = D[p].pop()", "D[p]", "D", "p", "p = D[p].pop()", "p", "D[p].pop()", "[p].pop", "[p]", "D", "p", "pop", "print(p.upper())", "print", "p.upper()", "p.upper", "p", "upper", "p = D[p].pop()", "D[p].pop()", "p", "D = {}", "{}", "D", "p = \"a\"", "\"a\"", "p" ]
D = {} D["a"] = list(input())[::-1] D["b"] = list(input())[::-1] D["c"] = list(input())[::-1] p = "a" while D[p]: p = D[p].pop() print(p.upper())
[ 7, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 13, 0, 13, 13, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 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, 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, 13, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 13, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13 ]
[ [ 136, 2 ], [ 133, 6 ], [ 139, 10 ], [ 121, 14 ], [ 134, 15 ], [ 142, 17 ], [ 140, 18 ], [ 145, 20 ], [ 137, 22 ], [ 157, 25 ], [ 137, 27 ], [ 32, 31 ], [ 137, 38 ], [ 134, 41 ], [ 140, 44 ], [ 146, 47 ], [ 125, 47 ], [ 155, 47 ], [ 152, 47 ], [ 158, 53 ], [ 128, 53 ], [ 151, 60 ], [ 158, 62 ], [ 128, 62 ], [ 127, 65 ], [ 158, 67 ], [ 128, 67 ], [ 146, 72 ], [ 125, 72 ], [ 155, 72 ], [ 152, 72 ], [ 122, 78 ], [ 149, 78 ], [ 154, 85 ], [ 122, 87 ], [ 149, 87 ], [ 148, 90 ], [ 122, 92 ], [ 149, 92 ], [ 146, 97 ], [ 125, 97 ], [ 155, 97 ], [ 152, 97 ], [ 143, 103 ], [ 131, 103 ], [ 124, 110 ], [ 143, 112 ], [ 131, 112 ], [ 130, 115 ], [ 143, 117 ], [ 131, 117 ], [ 134, 121 ], [ 121, 122 ], [ 124, 125 ], [ 127, 128 ], [ 130, 131 ], [ 133, 134 ], [ 136, 137 ], [ 139, 140 ], [ 140, 142 ], [ 142, 143 ], [ 145, 146 ], [ 148, 149 ], [ 151, 152 ], [ 154, 155 ], [ 157, 158 ] ]
[ "Sa = input()\nSb = input()\nSc = input()\n\nb = Sb\nc = Sc\ns = Sa[0]\na = Sa[1:]\n\nfor i in range(len(Sa)+len(Sb)+len(Sc)):\n if s == \"a\":\n if len(a) == 0:\n print(\"A\")\n break\n s = a[0]\n a = a[1:]\n elif s == \"b\":\n if len(b) == 0:\n print(\"B\")\n break\n s = b[0]\n b = b[1:]\n elif s == \"c\":\n if len(c) == 0:\n print(\"C\")\n break\n s = c[0]\n c = c[1:]", "Sa = input()", "Sa", "input()", "input", "Sb = input()", "Sb", "input()", "input", "Sc = input()", "Sc", "input()", "input", "b = Sb", "b", "Sb", "c = Sc", "c", "Sc", "s = Sa[0]", "s", "Sa[0]", "Sa", "0", "a = Sa[1:]", "a", "Sa[1:]", "Sa", "1:", "1", "for i in range(len(Sa)+len(Sb)+len(Sc)):\n if s == \"a\":\n if len(a) == 0:\n print(\"A\")\n break\n s = a[0]\n a = a[1:]\n elif s == \"b\":\n if len(b) == 0:\n print(\"B\")\n break\n s = b[0]\n b = b[1:]\n elif s == \"c\":\n if len(c) == 0:\n print(\"C\")\n break\n s = c[0]\n c = c[1:]", "i", "range(len(Sa)+len(Sb)+len(Sc))", "range", "len(Sa)+len(Sb)+len(Sc)", "len(Sa)+len(Sb)", "len(Sa)", "len", "Sa", "len(Sb)", "len", "Sb", "len(Sc)", "len", "Sc", "if s == \"a\":\n if len(a) == 0:\n print(\"A\")\n break\n s = a[0]\n a = a[1:]\n elif s == \"b\":\n if len(b) == 0:\n print(\"B\")\n break\n s = b[0]\n b = b[1:]\n elif s == \"c\":\n if len(c) == 0:\n print(\"C\")\n break\n s = c[0]\n c = c[1:]", "s == \"a\"", "s", "\"a\"", "if len(a) == 0:\n print(\"A\")\n break\n ", "len(a) == 0", "len(a)", "len", "a", "0", "print(\"A\")", "print", "\"A\"", "break", "s = a[0]", "s", "a[0]", "a", "0", "a = a[1:]", "a", "a[1:]", "a", "1:", "1", "elif s == \"b\":\n if len(b) == 0:\n print(\"B\")\n break\n s = b[0]\n b = b[1:]\n ", "s == \"b\"", "s", "\"b\"", "if len(b) == 0:\n print(\"B\")\n break\n ", "len(b) == 0", "len(b)", "len", "b", "0", "print(\"B\")", "print", "\"B\"", "break", "s = b[0]", "s", "b[0]", "b", "0", "b = b[1:]", "b", "b[1:]", "b", "1:", "1", "elif s == \"c\":\n if len(c) == 0:\n print(\"C\")\n break\n s = c[0]\n c = c[1:]", "s == \"c\"", "s", "\"c\"", "if len(c) == 0:\n print(\"C\")\n break\n ", "len(c) == 0", "len(c)", "len", "c", "0", "print(\"C\")", "print", "\"C\"", "break", "s = c[0]", "s", "c[0]", "c", "0", "c = c[1:]", "c", "c[1:]", "c", "1:", "1", "b = Sb", "Sb", "b", "s = c[0]", "c[0]", "s", "a = a[1:]", "a[1:]", "a", "c = c[1:]", "c[1:]", "c", "Sb = input()", "input()", "Sb", "Sa = input()", "input()", "Sa", "Sc = input()", "input()", "Sc", "c = Sc", "Sc", "c", "s = Sa[0]", "Sa[0]", "s", "b = b[1:]", "b[1:]", "b", "s = a[0]", "a[0]", "s", "s = b[0]", "b[0]", "s", "a = Sa[1:]", "Sa[1:]", "a" ]
Sa = input() Sb = input() Sc = input() b = Sb c = Sc s = Sa[0] a = Sa[1:] for i in range(len(Sa)+len(Sb)+len(Sc)): if s == "a": if len(a) == 0: print("A") break s = a[0] a = a[1:] elif s == "b": if len(b) == 0: print("B") break s = b[0] b = b[1:] elif s == "c": if len(c) == 0: print("C") break s = c[0] c = c[1:]
[ 7, 17, 15, 13, 15, 13, 12, 13, 12, 13, 12, 13, 23, 12, 13, 23, 12, 13, 23, 0, 13, 4, 13, 2, 17, 17, 0, 13, 17, 0, 13, 17, 14, 40, 13, 0, 18, 13, 13, 4, 13, 17, 17, 0, 18, 13, 13, 4, 13, 17, 17, 0, 18, 13, 13, 4, 13, 17, 17, 15, 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, 42, 17, 14, 2, 4, 13, 18, 13, 13, 17, 4, 13, 4, 13, 2, 13, 4, 13, 17, 3, 0, 13, 2, 4, 13, 4, 18, 18, 13, 13, 13, 4, 13, 17, 17, 10, 4, 13, 10, 12, 13, 10, 12, 13, 10, 2, 13, 10, 17, 13, 10, 4, 13, 10, 4, 13, 10, 12, 13, 10, 12, 13, 10, 17, 13, 10, 39, 13, 10, 4, 13, 10, 17, 13, 10, 12, 13 ]
[ [ 156, 20 ], [ 135, 27 ], [ 150, 30 ], [ 151, 34 ], [ 39, 36 ], [ 47, 44 ], [ 55, 52 ], [ 138, 61 ], [ 145, 65 ], [ 141, 67 ], [ 145, 71 ], [ 123, 73 ], [ 145, 77 ], [ 153, 79 ], [ 159, 85 ], [ 154, 94 ], [ 160, 95 ], [ 133, 95 ], [ 160, 102 ], [ 133, 102 ], [ 132, 108 ], [ 154, 115 ], [ 160, 116 ], [ 133, 116 ], [ 123, 124 ], [ 132, 133 ], [ 135, 136 ], [ 138, 139 ], [ 141, 142 ], [ 150, 151 ], [ 153, 154 ], [ 156, 157 ], [ 159, 160 ] ]
[ "''' ## ## ####### # # ######\n ## ## ## ## ### ##\n ## ## ## # # # ##\n ######### ####### # # ## '''\n\nimport sys\nimport math\n# sys.setrecursionlimit(10**6)\n\ndef get_ints(): return map(int, input().strip().split())\ndef get_list(): return list(input())\n\ndef printspx(*args): return print(*args, end=\"\")\ndef printsp(*args): return print(*args, end=\" \")\ndef printchk(*args): return print(*args, end=\" \\ \")\n\nMODPRIME = int(1e9+7); BABYMODPR = 998244353;\n\nONLINE_JUDGE = 1\nif not ONLINE_JUDGE:\n sys.stdin = open(\"input.txt\",\"r\")\n sys.stdout = open(\"output.txt\",\"w\")\n sys.stderr = open(\"output.txt\",\"w\")\n\n# for _testcases_ in range(int(input())):\nfrom collections import deque\na = deque(get_list())\nb = deque(get_list())\nc = deque(get_list())\nli = [a, b, c]\ncurr = 0\nwhile True:\n if len(li[curr]) == 0:\n print(chr(curr+ord('A')))\n break\n curr = ord(li[curr].popleft())-ord('a')\n\n\n\n\n\n'''\n>>> COMMENT THE STDIN!! CHANGE ONLINE JUDGE !!\nTHE LOGIC AND APPROACH IS BY ME @luctivud ( UDIT GUPTA )\nSOME PARTS OF THE CODE HAS BEEN TAKEN FROM WEBSITES LIKE::\n(I Own the code if no link is provided here or I may have missed mentioning it)\nDO NOT PLAGIARISE.\nTESTCASES:\n>>> COMMENT THE STDIN!! CHANGE ONLINE JUDGE !!\n'''", "''' ## ## ####### # # ######\n ## ## ## ## ### ##\n ## ## ## # # # ##\n ######### ####### # # ## '''", "import sys", "sys", "import math", "math", "def get_ints(): return map(int, input().strip().split())", "get_ints", "def get_list(): return list(input())", "get_list", "def printspx(*args): return print(*args, end=\"\")", "printspx", "*args", "def printsp(*args): return print(*args, end=\" \")", "printsp", "*args", "def printchk(*args): return print(*args, end=\" \\ \")", "printchk", "*args", "MODPRIME = int(1e9+7)", "MODPRIME", "int(1e9+7)", "int", "1e9+7", "1e9", "7", "BABYMODPR = 998244353", "BABYMODPR", "998244353", "ONLINE_JUDGE = 1", "ONLINE_JUDGE", "1", "if not ONLINE_JUDGE:\n sys.stdin = open(\"input.txt\",\"r\")\n sys.stdout = open(\"output.txt\",\"w\")\n sys.stderr = open(\"output.txt\",\"w\")\n\n# for _testcases_ in range(int(input())):", "not ONLINE_JUDGE", "ONLINE_JUDGE", "sys.stdin = open(\"input.txt\",\"r\")", "sys.stdin", "sys", "stdin", "open(\"input.txt\",\"r\")", "open", "\"input.txt\"", "\"r\"", "sys.stdout = open(\"output.txt\",\"w\")", "sys.stdout", "sys", "stdout", "open(\"output.txt\",\"w\")", "open", "\"output.txt\"", "\"w\"", "sys.stderr = open(\"output.txt\",\"w\")", "sys.stderr", "sys", "stderr", "open(\"output.txt\",\"w\")", "open", "\"output.txt\"", "\"w\"", "from collections import deque", "a = deque(get_list())", "a", "deque(get_list())", "deque", "get_list()", "get_list", "b = deque(get_list())", "b", "deque(get_list())", "deque", "get_list()", "get_list", "c = deque(get_list())", "c", "deque(get_list())", "deque", "get_list()", "get_list", "li = [a, b, c]", "li", "[a, b, c]", "a", "b", "c", "curr = 0", "curr", "0", "while True:\n if len(li[curr]) == 0:\n print(chr(curr+ord('A')))\n break\n curr = ord(li[curr].popleft())-ord('a')", "True", "if len(li[curr]) == 0:\n print(chr(curr+ord('A')))\n break\n ", "len(li[curr]) == 0", "len(li[curr])", "len", "li[curr]", "li", "curr", "0", "print(chr(curr+ord('A')))", "print", "chr(curr+ord('A'))", "chr", "curr+ord('A')", "curr", "ord('A')", "ord", "'A'", "break", "curr = ord(li[curr].popleft())-ord('a')", "curr", "ord(li[curr].popleft())-ord('a')", "ord(li[curr].popleft())", "ord", "li[curr].popleft()", "[curr].popleft", "[curr]", "li", "curr", "popleft", "ord('a')", "ord", "'a'", "'''\n>>> COMMENT THE STDIN!! CHANGE ONLINE JUDGE !!\nTHE LOGIC AND APPROACH IS BY ME @luctivud ( UDIT GUPTA )\nSOME PARTS OF THE CODE HAS BEEN TAKEN FROM WEBSITES LIKE::\n(I Own the code if no link is provided here or I may have missed mentioning it)\nDO NOT PLAGIARISE.\nTESTCASES:\n>>> COMMENT THE STDIN!! CHANGE ONLINE JUDGE !!\n'''", "c = deque(get_list())", "deque(get_list())", "c", "def printspx(*args): return print(*args, end=\"\")", "def printspx(*args): return print(*args, end=\"\")", "printspx", "def printchk(*args): return print(*args, end=\" \\ \")", "def printchk(*args): return print(*args, end=\" \\ \")", "printchk", "curr = ord(li[curr].popleft())-ord('a')", "ord(li[curr].popleft())-ord('a')", "curr", "BABYMODPR = 998244353", "998244353", "BABYMODPR", "a = deque(get_list())", "deque(get_list())", "a", "b = deque(get_list())", "deque(get_list())", "b", "def get_list(): return list(input())", "def get_list(): return list(input())", "get_list", "def printsp(*args): return print(*args, end=\" \")", "def printsp(*args): return print(*args, end=\" \")", "printsp", "ONLINE_JUDGE = 1", "1", "ONLINE_JUDGE", "li = [a, b, c]", "[a, b, c]", "li", "MODPRIME = int(1e9+7)", "int(1e9+7)", "MODPRIME", "curr = 0", "0", "curr", "def get_ints(): return map(int, input().strip().split())", "def get_ints(): return map(int, input().strip().split())", "get_ints" ]
''' ## ## ####### # # ###### ## ## ## ## ### ## ## ## ## # # # ## ######### ####### # # ## ''' import sys import math # sys.setrecursionlimit(10**6) def get_ints(): return map(int, input().strip().split()) def get_list(): return list(input()) def printspx(*args): return print(*args, end="") def printsp(*args): return print(*args, end=" ") def printchk(*args): return print(*args, end=" \ ") MODPRIME = int(1e9+7); BABYMODPR = 998244353; ONLINE_JUDGE = 1 if not ONLINE_JUDGE: sys.stdin = open("input.txt","r") sys.stdout = open("output.txt","w") sys.stderr = open("output.txt","w") # for _testcases_ in range(int(input())): from collections import deque a = deque(get_list()) b = deque(get_list()) c = deque(get_list()) li = [a, b, c] curr = 0 while True: if len(li[curr]) == 0: print(chr(curr+ord('A'))) break curr = ord(li[curr].popleft())-ord('a') ''' >>> COMMENT THE STDIN!! CHANGE ONLINE JUDGE !! THE LOGIC AND APPROACH IS BY ME @luctivud ( UDIT GUPTA ) SOME PARTS OF THE CODE HAS BEEN TAKEN FROM WEBSITES LIKE:: (I Own the code if no link is provided here or I may have missed mentioning it) DO NOT PLAGIARISE. TESTCASES: >>> COMMENT THE STDIN!! CHANGE ONLINE JUDGE !! '''
[ 7, 0, 13, 39, 17, 17, 17, 41, 28, 13, 4, 13, 17, 4, 4, 13, 4, 13, 0, 13, 13, 0, 13, 17, 42, 17, 14, 2, 18, 13, 13, 39, 0, 13, 4, 18, 13, 13, 4, 18, 18, 13, 13, 13, 17, 4, 13, 4, 18, 18, 13, 13, 13, 10, 17, 13, 10, 13, 13, 10, 4, 13, 10, 39, 13 ]
[ [ 63, 2 ], [ 10, 9 ], [ 57, 19 ], [ 54, 22 ], [ 58, 29 ], [ 55, 30 ], [ 61, 30 ], [ 60, 33 ], [ 64, 36 ], [ 58, 41 ], [ 55, 42 ], [ 61, 42 ], [ 64, 50 ], [ 61, 51 ], [ 55, 51 ], [ 54, 55 ], [ 57, 58 ], [ 60, 61 ], [ 63, 64 ] ]
[ "p=['a','b','c']\nl=[list(input()) for _ in range(3)]\nx=0\nwhile True:\n if l[x]==[]:break\n x=p.index(l[x].pop(0))\nprint(p[x].upper())", "p=['a','b','c']", "p", "['a','b','c']", "'a'", "'b'", "'c'", "list(input()) for _ in range(3)", "for _ in range(3)", "_", "range(3)", "range", "3", "for _ in range(3)", "list(input())", "list", "input()", "input", "l=[list(input()) for _ in range(3)]", "l", "[list(input()) for _ in range(3)]", "x=0", "x", "0", "while True:\n if l[x]==[]:break\n x=p.index(l[x].pop(0))", "True", "if l[x]==[]:break\n ", "l[x]==[]", "l[x]", "l", "x", "[]", "x=p.index(l[x].pop(0))", "x", "p.index(l[x].pop(0))", "p.index", "p", "index", "l[x].pop(0)", "[x].pop", "[x]", "l", "x", "pop", "0", "print(p[x].upper())", "print", "p[x].upper()", "[x].upper", "[x]", "p", "x", "upper", "x=0", "0", "x", "l=[list(input()) for _ in range(3)]", "[list(input()) for _ in range(3)]", "l", "x=p.index(l[x].pop(0))", "p.index(l[x].pop(0))", "x", "p=['a','b','c']", "['a','b','c']", "p" ]
p=['a','b','c'] l=[list(input()) for _ in range(3)] x=0 while True: if l[x]==[]:break x=p.index(l[x].pop(0)) print(p[x].upper())
[ 7, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 42, 17, 14, 2, 13, 17, 14, 2, 13, 17, 4, 13, 17, 3, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 14, 2, 13, 17, 14, 2, 13, 17, 4, 13, 17, 3, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 14, 2, 13, 17, 14, 2, 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, 18, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13 ]
[ [ 96, 2 ], [ 99, 6 ], [ 102, 10 ], [ 111, 14 ], [ 97, 16 ], [ 123, 19 ], [ 97, 21 ], [ 112, 28 ], [ 118, 28 ], [ 127, 28 ], [ 109, 28 ], [ 124, 32 ], [ 97, 32 ], [ 115, 32 ], [ 108, 39 ], [ 124, 41 ], [ 97, 41 ], [ 115, 41 ], [ 114, 44 ], [ 124, 46 ], [ 97, 46 ], [ 115, 46 ], [ 112, 51 ], [ 118, 51 ], [ 127, 51 ], [ 109, 51 ], [ 100, 55 ], [ 106, 55 ], [ 126, 62 ], [ 100, 64 ], [ 106, 64 ], [ 105, 67 ], [ 100, 69 ], [ 106, 69 ], [ 112, 74 ], [ 118, 74 ], [ 127, 74 ], [ 109, 74 ], [ 103, 78 ], [ 121, 78 ], [ 117, 85 ], [ 103, 87 ], [ 121, 87 ], [ 120, 90 ], [ 103, 92 ], [ 121, 92 ], [ 96, 97 ], [ 99, 100 ], [ 102, 103 ], [ 105, 106 ], [ 108, 109 ], [ 111, 112 ], [ 114, 115 ], [ 117, 118 ], [ 120, 121 ], [ 123, 124 ], [ 126, 127 ] ]
[ "sa = input()\nsb = input()\nsc = input()\n\nturn = sa[0]\nsa = sa[1:]\nwhile True:\n if turn == \"a\":\n if sa == \"\":\n print(\"A\")\n break\n else:\n turn = sa[0]\n sa = sa[1:]\n elif turn == \"b\":\n if sb == \"\":\n print(\"B\")\n break\n else:\n turn = sb[0]\n sb = sb[1:]\n elif turn == \"c\":\n if sc == \"\":\n print(\"C\")\n break\n else:\n turn = sc[0]\n sc = sc[1:]", "sa = input()", "sa", "input()", "input", "sb = input()", "sb", "input()", "input", "sc = input()", "sc", "input()", "input", "turn = sa[0]", "turn", "sa[0]", "sa", "0", "sa = sa[1:]", "sa", "sa[1:]", "sa", "1:", "1", "while True:\n if turn == \"a\":\n if sa == \"\":\n print(\"A\")\n break\n else:\n turn = sa[0]\n sa = sa[1:]\n elif turn == \"b\":\n if sb == \"\":\n print(\"B\")\n break\n else:\n turn = sb[0]\n sb = sb[1:]\n elif turn == \"c\":\n if sc == \"\":\n print(\"C\")\n break\n else:\n turn = sc[0]\n sc = sc[1:]", "True", "if turn == \"a\":\n if sa == \"\":\n print(\"A\")\n break\n else:\n turn = sa[0]\n sa = sa[1:]\n elif turn == \"b\":\n if sb == \"\":\n print(\"B\")\n break\n else:\n turn = sb[0]\n sb = sb[1:]\n elif turn == \"c\":\n if sc == \"\":\n print(\"C\")\n break\n else:\n turn = sc[0]\n sc = sc[1:]", "turn == \"a\"", "turn", "\"a\"", "if sa == \"\":\n print(\"A\")\n break\n else:\n turn = sa[0]\n sa = sa[1:]\n ", "sa == \"\"", "sa", "\"\"", "print(\"A\")", "print", "\"A\"", "break", "turn = sa[0]", "turn", "sa[0]", "sa", "0", "sa = sa[1:]", "sa", "sa[1:]", "sa", "1:", "1", "elif turn == \"b\":\n if sb == \"\":\n print(\"B\")\n break\n else:\n turn = sb[0]\n sb = sb[1:]\n ", "turn == \"b\"", "turn", "\"b\"", "if sb == \"\":\n print(\"B\")\n break\n else:\n turn = sb[0]\n sb = sb[1:]\n ", "sb == \"\"", "sb", "\"\"", "print(\"B\")", "print", "\"B\"", "break", "turn = sb[0]", "turn", "sb[0]", "sb", "0", "sb = sb[1:]", "sb", "sb[1:]", "sb", "1:", "1", "elif turn == \"c\":\n if sc == \"\":\n print(\"C\")\n break\n else:\n turn = sc[0]\n sc = sc[1:]", "turn == \"c\"", "turn", "\"c\"", "if sc == \"\":\n print(\"C\")\n break\n else:\n turn = sc[0]\n sc = sc[1:]", "sc == \"\"", "sc", "\"\"", "print(\"C\")", "print", "\"C\"", "break", "turn = sc[0]", "turn", "sc[0]", "sc", "0", "sc = sc[1:]", "sc", "sc[1:]", "sc", "1:", "1", "sa = input()", "input()", "sa", "sb = input()", "input()", "sb", "sc = input()", "input()", "sc", "sb = sb[1:]", "sb[1:]", "sb", "turn = sa[0]", "sa[0]", "turn", "turn = sa[0]", "sa[0]", "turn", "sa = sa[1:]", "sa[1:]", "sa", "turn = sc[0]", "sc[0]", "turn", "sc = sc[1:]", "sc[1:]", "sc", "sa = sa[1:]", "sa[1:]", "sa", "turn = sb[0]", "sb[0]", "turn" ]
sa = input() sb = input() sc = input() turn = sa[0] sa = sa[1:] while True: if turn == "a": if sa == "": print("A") break else: turn = sa[0] sa = sa[1:] elif turn == "b": if sb == "": print("B") break else: turn = sb[0] sb = sb[1:] elif turn == "c": if sc == "": print("C") break else: turn = sc[0] sc = sc[1:]
[ 7, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 42, 17, 14, 2, 13, 17, 14, 2, 13, 17, 4, 13, 17, 3, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 14, 2, 13, 17, 14, 2, 13, 17, 4, 13, 17, 3, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 14, 2, 13, 17, 4, 13, 17, 3, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 10, 4, 13, 10, 18, 13, 10, 18, 13, 10, 4, 13, 10, 4, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13 ]
[ [ 92, 2 ], [ 101, 6 ], [ 104, 10 ], [ 116, 14 ], [ 93, 16 ], [ 107, 19 ], [ 93, 21 ], [ 117, 28 ], [ 99, 28 ], [ 114, 28 ], [ 120, 28 ], [ 108, 32 ], [ 93, 32 ], [ 96, 32 ], [ 119, 39 ], [ 108, 41 ], [ 93, 41 ], [ 96, 41 ], [ 95, 44 ], [ 108, 46 ], [ 93, 46 ], [ 96, 46 ], [ 117, 51 ], [ 99, 51 ], [ 114, 51 ], [ 120, 51 ], [ 102, 55 ], [ 123, 55 ], [ 113, 62 ], [ 102, 64 ], [ 123, 64 ], [ 122, 67 ], [ 102, 69 ], [ 123, 69 ], [ 105, 74 ], [ 111, 74 ], [ 98, 81 ], [ 105, 83 ], [ 111, 83 ], [ 110, 86 ], [ 105, 88 ], [ 111, 88 ], [ 92, 93 ], [ 95, 96 ], [ 98, 99 ], [ 101, 102 ], [ 104, 105 ], [ 107, 108 ], [ 110, 111 ], [ 113, 114 ], [ 116, 117 ], [ 119, 120 ], [ 122, 123 ] ]
[ "a = input()\nb = input()\nc = input()\nnext = a[0]\na = a[1:]\nwhile True:\n if next == \"a\":\n if a == \"\":\n print(\"A\")\n break\n else:\n next = a[0]\n a = a[1:]\n elif next == \"b\":\n if b == \"\":\n print(\"B\")\n break\n else:\n next = b[0]\n b = b[1:]\n else:\n if c == \"\":\n print(\"C\")\n break\n else:\n next = c[0]\n c = c[1:]", "a = input()", "a", "input()", "input", "b = input()", "b", "input()", "input", "c = input()", "c", "input()", "input", "next = a[0]", "next", "a[0]", "a", "0", "a = a[1:]", "a", "a[1:]", "a", "1:", "1", "while True:\n if next == \"a\":\n if a == \"\":\n print(\"A\")\n break\n else:\n next = a[0]\n a = a[1:]\n elif next == \"b\":\n if b == \"\":\n print(\"B\")\n break\n else:\n next = b[0]\n b = b[1:]\n else:\n if c == \"\":\n print(\"C\")\n break\n else:\n next = c[0]\n c = c[1:]", "True", "if next == \"a\":\n if a == \"\":\n print(\"A\")\n break\n else:\n next = a[0]\n a = a[1:]\n elif next == \"b\":\n if b == \"\":\n print(\"B\")\n break\n else:\n next = b[0]\n b = b[1:]\n else:\n if c == \"\":\n print(\"C\")\n break\n else:\n next = c[0]\n c = c[1:]", "next == \"a\"", "next", "\"a\"", "if a == \"\":\n print(\"A\")\n break\n else:\n next = a[0]\n a = a[1:]\n ", "a == \"\"", "a", "\"\"", "print(\"A\")", "print", "\"A\"", "break", "next = a[0]", "next", "a[0]", "a", "0", "a = a[1:]", "a", "a[1:]", "a", "1:", "1", "elif next == \"b\":\n if b == \"\":\n print(\"B\")\n break\n else:\n next = b[0]\n b = b[1:]\n ", "next == \"b\"", "next", "\"b\"", "if b == \"\":\n print(\"B\")\n break\n else:\n next = b[0]\n b = b[1:]\n ", "b == \"\"", "b", "\"\"", "print(\"B\")", "print", "\"B\"", "break", "next = b[0]", "next", "b[0]", "b", "0", "b = b[1:]", "b", "b[1:]", "b", "1:", "1", "if c == \"\":\n print(\"C\")\n break\n else:\n next = c[0]\n c = c[1:]", "c == \"\"", "c", "\"\"", "print(\"C\")", "print", "\"C\"", "break", "next = c[0]", "next", "c[0]", "c", "0", "c = c[1:]", "c", "c[1:]", "c", "1:", "1", "a = input()", "input()", "a", "a = a[1:]", "a[1:]", "a", "next = c[0]", "c[0]", "next", "b = input()", "input()", "b", "c = input()", "input()", "c", "a = a[1:]", "a[1:]", "a", "c = c[1:]", "c[1:]", "c", "next = b[0]", "b[0]", "next", "next = a[0]", "a[0]", "next", "next = a[0]", "a[0]", "next", "b = b[1:]", "b[1:]", "b" ]
a = input() b = input() c = input() next = a[0] a = a[1:] while True: if next == "a": if a == "": print("A") break else: next = a[0] a = a[1:] elif next == "b": if b == "": print("B") break else: next = b[0] b = b[1:] else: if c == "": print("C") break else: next = c[0] c = 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, 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, 17, 13, 10, 18, 13, 10, 18, 13, 10, 4, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 4, 13, 10, 18, 13, 10, 4, 13 ]
[ [ 114, 2 ], [ 120, 6 ], [ 102, 10 ], [ 93, 14 ], [ 94, 20 ], [ 118, 20 ], [ 112, 20 ], [ 100, 20 ], [ 115, 26 ], [ 106, 26 ], [ 99, 34 ], [ 115, 36 ], [ 106, 36 ], [ 105, 39 ], [ 115, 41 ], [ 106, 41 ], [ 94, 46 ], [ 118, 46 ], [ 112, 46 ], [ 100, 46 ], [ 121, 52 ], [ 109, 52 ], [ 111, 60 ], [ 121, 62 ], [ 109, 62 ], [ 108, 65 ], [ 121, 67 ], [ 109, 67 ], [ 103, 74 ], [ 97, 74 ], [ 117, 82 ], [ 103, 84 ], [ 97, 84 ], [ 96, 87 ], [ 103, 89 ], [ 97, 89 ], [ 93, 94 ], [ 96, 97 ], [ 99, 100 ], [ 102, 103 ], [ 105, 106 ], [ 108, 109 ], [ 111, 112 ], [ 114, 115 ], [ 117, 118 ], [ 120, 121 ] ]
[ "a=input()\nb=input()\nc=input()\n\n#l=a+b+c\n\n#n=a[0]\n#a=a.lstrip(n)\nn='a'\nwhile True: \n if n=='a':\n if len(a)==0:\n print('A')\n exit()\n \n n=a[0]\n #a=a.lstrip(n)\n a=a[1:]\n \n elif n=='b':\n if len(b)==0:\n print('B')\n exit()\n \n n=b[0]\n #b=b.lstrip(n)\n b=b[1:]\n \n else:\n if len(c)==0:\n print('C')\n exit()\n \n n=c[0]\n #c=c.lstrip(n)\n c=c[1:]\n", "a=input()", "a", "input()", "input", "b=input()", "b", "input()", "input", "c=input()", "c", "input()", "input", "n='a'", "n", "'a'", "while True: \n if n=='a':\n if len(a)==0:\n print('A')\n exit()\n \n n=a[0]\n #a=a.lstrip(n)\n a=a[1:]\n \n elif n=='b':\n if len(b)==0:\n print('B')\n exit()\n \n n=b[0]\n #b=b.lstrip(n)\n b=b[1:]\n \n else:\n if len(c)==0:\n print('C')\n exit()\n \n n=c[0]\n #c=c.lstrip(n)\n c=c[1:]", "True", "if n=='a':\n if len(a)==0:\n print('A')\n exit()\n \n n=a[0]\n #a=a.lstrip(n)\n a=a[1:]\n \n elif n=='b':\n if len(b)==0:\n print('B')\n exit()\n \n n=b[0]\n #b=b.lstrip(n)\n b=b[1:]\n \n else:\n if len(c)==0:\n print('C')\n exit()\n \n n=c[0]\n #c=c.lstrip(n)\n c=c[1:]", "n=='a'", "n", "'a'", "if len(a)==0:\n print('A')\n exit()\n \n ", "len(a)==0", "len(a)", "len", "a", "0", "print('A')", "print", "'A'", "exit()", "exit", "n=a[0]", "n", "a[0]", "a", "0", "a=a[1:]", "a", "a[1:]", "a", "1:", "1", "elif n=='b':\n if len(b)==0:\n print('B')\n exit()\n \n n=b[0]\n #b=b.lstrip(n)\n b=b[1:]\n \n ", "n=='b'", "n", "'b'", "if len(b)==0:\n print('B')\n exit()\n \n ", "len(b)==0", "len(b)", "len", "b", "0", "print('B')", "print", "'B'", "exit()", "exit", "n=b[0]", "n", "b[0]", "b", "0", "b=b[1:]", "b", "b[1:]", "b", "1:", "1", "if len(c)==0:\n print('C')\n exit()\n \n ", "len(c)==0", "len(c)", "len", "c", "0", "print('C')", "print", "'C'", "exit()", "exit", "n=c[0]", "n", "c[0]", "c", "0", "c=c[1:]", "c", "c[1:]", "c", "1:", "1", "n='a'", "'a'", "n", "c=c[1:]", "c[1:]", "c", "n=a[0]", "a[0]", "n", "c=input()", "input()", "c", "a=a[1:]", "a[1:]", "a", "b=b[1:]", "b[1:]", "b", "n=b[0]", "b[0]", "n", "a=input()", "input()", "a", "n=c[0]", "c[0]", "n", "b=input()", "input()", "b" ]
a=input() b=input() c=input() #l=a+b+c #n=a[0] #a=a.lstrip(n) n='a' while True: if n=='a': if len(a)==0: print('A') exit() n=a[0] #a=a.lstrip(n) a=a[1:] elif n=='b': if len(b)==0: print('B') exit() n=b[0] #b=b.lstrip(n) b=b[1:] else: if len(c)==0: print('C') exit() n=c[0] #c=c.lstrip(n) c=c[1:]
[ 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, 17, 0, 13, 4, 18, 18, 13, 13, 13, 17, 14, 2, 4, 13, 18, 13, 13, 17, 3, 4, 13, 4, 18, 13, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13 ]
[ [ 58, 2 ], [ 8, 5 ], [ 59, 6 ], [ 16, 13 ], [ 59, 14 ], [ 24, 21 ], [ 59, 22 ], [ 61, 29 ], [ 64, 34 ], [ 59, 38 ], [ 62, 39 ], [ 65, 39 ], [ 59, 47 ], [ 65, 48 ], [ 62, 48 ], [ 65, 55 ], [ 62, 55 ], [ 58, 59 ], [ 61, 62 ], [ 64, 65 ] ]
[ "card = {}\ncard['a'] = list(input())\ncard['b'] = list(input())\ncard['c'] = list(input())\n\ncrd = 'a'\n\nwhile True:\n crd = card[crd].pop(0)\n\n if len(card[crd]) == 0:\n break\n\nprint(crd.upper())", "card = {}", "card", "{}", "card['a'] = list(input())", "card['a']", "card", "'a'", "list(input())", "list", "input()", "input", "card['b'] = list(input())", "card['b']", "card", "'b'", "list(input())", "list", "input()", "input", "card['c'] = list(input())", "card['c']", "card", "'c'", "list(input())", "list", "input()", "input", "crd = 'a'", "crd", "'a'", "while True:\n crd = card[crd].pop(0)\n\n if len(card[crd]) == 0:\n break", "True", "crd = card[crd].pop(0)", "crd", "card[crd].pop(0)", "[crd].pop", "[crd]", "card", "crd", "pop", "0", "if len(card[crd]) == 0:\n break", "len(card[crd]) == 0", "len(card[crd])", "len", "card[crd]", "card", "crd", "0", "break", "print(crd.upper())", "print", "crd.upper()", "crd.upper", "crd", "upper", "card = {}", "{}", "card", "crd = 'a'", "'a'", "crd", "crd = card[crd].pop(0)", "card[crd].pop(0)", "crd" ]
card = {} card['a'] = list(input()) card['b'] = list(input()) card['c'] = list(input()) crd = 'a' while True: crd = card[crd].pop(0) if len(card[crd]) == 0: break print(crd.upper())
[ 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, 42, 17, 14, 2, 4, 13, 18, 13, 13, 17, 4, 13, 8, 2, 13, 17, 17, 8, 2, 13, 17, 17, 17, 4, 13, 0, 13, 4, 18, 18, 13, 13, 13, 17, 0, 13, 8, 2, 13, 17, 17, 8, 2, 13, 17, 17, 17, 10, 4, 13, 10, 17, 13, 10, 4, 13, 10, 4, 13, 10, 39, 13, 10, 8, 13, 10, 4, 13 ]
[ [ 85, 2 ], [ 82, 8 ], [ 76, 14 ], [ 88, 20 ], [ 79, 26 ], [ 89, 35 ], [ 80, 36 ], [ 92, 36 ], [ 80, 42 ], [ 92, 42 ], [ 80, 47 ], [ 92, 47 ], [ 94, 54 ], [ 89, 58 ], [ 80, 59 ], [ 92, 59 ], [ 91, 63 ], [ 95, 66 ], [ 95, 71 ], [ 76, 77 ], [ 79, 80 ], [ 82, 83 ], [ 85, 86 ], [ 88, 89 ], [ 91, 92 ], [ 94, 95 ] ]
[ "a = list(input())\nb = list(input())\nc = list(input())\n\nnum_li = [a,b,c]\n\nnow = 0\nwhile True:\n if len(num_li[now])==0:\n print('A' if now==0 else 'B' if now==1 else 'C');exit()\n\n x = num_li[now].pop(0)\n now = 0 if x=='a' else 1 if x=='b' else 2", "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", "num_li = [a,b,c]", "num_li", "[a,b,c]", "a", "b", "c", "now = 0", "now", "0", "while True:\n if len(num_li[now])==0:\n print('A' if now==0 else 'B' if now==1 else 'C');exit()\n\n x = num_li[now].pop(0)\n now = 0 if x=='a' else 1 if x=='b' else 2", "True", "if len(num_li[now])==0:\n print('A' if now==0 else 'B' if now==1 else 'C');exit()\n\n ", "len(num_li[now])==0", "len(num_li[now])", "len", "num_li[now]", "num_li", "now", "0", "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'", "exit()", "exit", "x = num_li[now].pop(0)", "x", "num_li[now].pop(0)", "[now].pop", "[now]", "num_li", "now", "pop", "0", "now = 0 if x=='a' else 1 if x=='b' else 2", "now", "0 if x=='a' else 1 if x=='b' else 2", "x=='a'", "x", "'a'", "0", "1 if x=='b' else 2", "x=='b'", "x", "'b'", "1", "2", "c = list(input())", "list(input())", "c", "now = 0", "0", "now", "b = list(input())", "list(input())", "b", "a = list(input())", "list(input())", "a", "num_li = [a,b,c]", "[a,b,c]", "num_li", "now = 0 if x=='a' else 1 if x=='b' else 2", "0 if x=='a' else 1 if x=='b' else 2", "now", "x = num_li[now].pop(0)", "num_li[now].pop(0)", "x" ]
a = list(input()) b = list(input()) c = list(input()) num_li = [a,b,c] now = 0 while True: if len(num_li[now])==0: print('A' if now==0 else 'B' if now==1 else 'C');exit() x = num_li[now].pop(0) now = 0 if x=='a' else 1 if x=='b' else 2
[ 7, 15, 13, 15, 13, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 12, 13, 12, 13, 12, 13, 12, 13, 4, 18, 13, 13, 2, 17, 17, 0, 13, 4, 13, 17, 0, 13, 2, 2, 17, 17, 17, 41, 28, 13, 4, 13, 17, 4, 4, 13, 4, 18, 4, 18, 4, 18, 4, 13, 13, 17, 17, 13, 17, 17, 13, 17, 17, 0, 13, 13, 0, 13, 17, 42, 17, 0, 13, 18, 13, 4, 13, 13, 14, 2, 4, 13, 13, 17, 0, 13, 13, 3, 0, 13, 4, 18, 13, 13, 14, 2, 13, 17, 4, 13, 17, 14, 2, 13, 17, 4, 13, 17, 4, 13, 17, 10, 2, 13, 10, 12, 13, 10, 13, 13, 10, 12, 13, 10, 13, 13, 10, 4, 13, 10, 12, 13, 10, 17, 13, 10, 18, 13, 10, 12, 13, 10, 4, 13 ]
[ [ 132, 31 ], [ 117, 36 ], [ 45, 44 ], [ 145, 58 ], [ 129, 69 ], [ 138, 72 ], [ 141, 77 ], [ 130, 79 ], [ 139, 82 ], [ 148, 82 ], [ 142, 87 ], [ 123, 90 ], [ 139, 91 ], [ 148, 91 ], [ 147, 94 ], [ 142, 97 ], [ 124, 101 ], [ 124, 108 ], [ 117, 118 ], [ 139, 123 ], [ 148, 123 ], [ 123, 124 ], [ 129, 130 ], [ 132, 133 ], [ 138, 139 ], [ 141, 142 ], [ 147, 148 ] ]
[ "import sys\nimport re\nfrom collections import deque, defaultdict, Counter\nfrom math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians\nfrom itertools import accumulate, permutations, combinations, product\nfrom operator import itemgetter, mul\nfrom copy import deepcopy\nfrom string import ascii_lowercase, ascii_uppercase, digits\nfrom bisect import bisect, bisect_left\nfrom fractions import gcd\nfrom heapq import heappush, heappop\nfrom functools import reduce\ndef input(): return sys.stdin.readline().strip()\ndef INT(): return int(input())\ndef MAP(): return map(int, input().split())\ndef LIST(): return list(map(int, input().split()))\nsys.setrecursionlimit(10 ** 9)\nINF = float('inf')\nmod = 10 ** 9 + 7\n\nS = [deque(input().replace('a', '0').replace('b', '1').replace('c', '2')) for _ in range(3)]\n\nnext = '0'\nwhile True:\n tmp = S[int(next)]\n if len(tmp) == 0:\n ans = next\n break\n else:\n next = tmp.popleft()\n\nif ans == '0':\n print('A')\nelif ans == '1':\n print('B')\nelse:\n print('C')", "import sys", "sys", "import re", "re", "from collections import deque, defaultdict, Counter", "from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians", "from itertools import accumulate, permutations, combinations, product", "from operator import itemgetter, mul", "from copy import deepcopy", "from string import ascii_lowercase, ascii_uppercase, digits", "from bisect import bisect, bisect_left", "from fractions import gcd", "from heapq import heappush, heappop", "from functools import reduce", "def input(): return sys.stdin.readline().strip()", "input", "def INT(): return int(input())", "INT", "def MAP(): return map(int, input().split())", "MAP", "def LIST(): return list(map(int, input().split()))", "LIST", "sys.setrecursionlimit(10 ** 9)", "sys.setrecursionlimit", "sys", "setrecursionlimit", "10 ** 9", "10", "9", "INF = float('inf')", "INF", "float('inf')", "float", "'inf'", "mod = 10 ** 9 + 7", "mod", "10 ** 9 + 7", "10 ** 9", "10", "9", "7", "deque(input().replace('a', '0').replace('b', '1').replace('c', '2')) for _ in range(3)", "for _ in range(3)", "_", "range(3)", "range", "3", "for _ in range(3)", "deque(input().replace('a', '0').replace('b', '1').replace('c', '2'))", "deque", "input().replace('a', '0').replace('b', '1').replace('c', '2')", "().replace('a', '0').replace('b', '1').replace", "().replace('a', '0').replace('b', '1')", "().replace('a', '0').replace", "().replace('a', '0')", "().replace", "()", "input", "replace", "'a'", "'0'", "replace", "'b'", "'1'", "replace", "'c'", "'2'", "S = [deque(input().replace('a', '0').replace('b', '1').replace('c', '2')) for _ in range(3)]", "S", "[deque(input().replace('a', '0').replace('b', '1').replace('c', '2')) for _ in range(3)]", "next = '0'", "next", "'0'", "while True:\n tmp = S[int(next)]\n if len(tmp) == 0:\n ans = next\n break\n else:\n next = tmp.popleft()", "True", "tmp = S[int(next)]", "tmp", "S[int(next)]", "S", "int(next)", "int", "next", "if len(tmp) == 0:\n ans = next\n break\n else:\n next = tmp.popleft()", "len(tmp) == 0", "len(tmp)", "len", "tmp", "0", "ans = next", "ans", "next", "break", "next = tmp.popleft()", "next", "tmp.popleft()", "tmp.popleft", "tmp", "popleft", "if ans == '0':\n print('A')\nelif ans == '1':\n print('B')\nelse:\n print('C')", "ans == '0'", "ans", "'0'", "print('A')", "print", "'A'", "elif ans == '1':\n print('B')", "ans == '1'", "ans", "'1'", "print('B')", "print", "'B'", "print('C')", "print", "'C'", "mod = 10 ** 9 + 7", "10 ** 9 + 7", "mod", "def INT(): return int(input())", "def INT(): return int(input())", "INT", "ans = next", "next", "ans", "def LIST(): return list(map(int, input().split()))", "def LIST(): return list(map(int, input().split()))", "LIST", "S = [deque(input().replace('a', '0').replace('b', '1').replace('c', '2')) for _ in range(3)]", "[deque(input().replace('a', '0').replace('b', '1').replace('c', '2')) for _ in range(3)]", "S", "INF = float('inf')", "float('inf')", "INF", "def MAP(): return map(int, input().split())", "def MAP(): return map(int, input().split())", "MAP", "next = '0'", "'0'", "next", "tmp = S[int(next)]", "S[int(next)]", "tmp", "def input(): return sys.stdin.readline().strip()", "def input(): return sys.stdin.readline().strip()", "input", "next = tmp.popleft()", "tmp.popleft()", "next" ]
import sys import re from collections import deque, defaultdict, Counter from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians from itertools import accumulate, permutations, combinations, product from operator import itemgetter, mul from copy import deepcopy from string import ascii_lowercase, ascii_uppercase, digits from bisect import bisect, bisect_left from fractions import gcd from heapq import heappush, heappop from functools import reduce def input(): return sys.stdin.readline().strip() def INT(): return int(input()) def MAP(): return map(int, input().split()) def LIST(): return list(map(int, input().split())) sys.setrecursionlimit(10 ** 9) INF = float('inf') mod = 10 ** 9 + 7 S = [deque(input().replace('a', '0').replace('b', '1').replace('c', '2')) for _ in range(3)] next = '0' while True: tmp = S[int(next)] if len(tmp) == 0: ans = next break else: next = tmp.popleft() if ans == '0': print('A') elif ans == '1': print('B') else: print('C')
[ 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, 4, 13, 18, 13, 13, 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, 21, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 13, 13, 10, 17, 13, 10, 17, 13 ]
[ [ 4, 3 ], [ 84, 13 ], [ 78, 16 ], [ 72, 19 ], [ 85, 34 ], [ 79, 35 ], [ 91, 35 ], [ 76, 35 ], [ 88, 35 ], [ 81, 37 ], [ 85, 41 ], [ 79, 42 ], [ 91, 42 ], [ 76, 42 ], [ 88, 42 ], [ 82, 47 ], [ 87, 50 ], [ 82, 54 ], [ 75, 57 ], [ 82, 61 ], [ 90, 64 ], [ 73, 69 ], [ 91, 70 ], [ 76, 70 ], [ 88, 70 ], [ 79, 70 ], [ 72, 73 ], [ 75, 76 ], [ 78, 79 ], [ 81, 82 ], [ 84, 85 ], [ 87, 88 ], [ 90, 91 ] ]
[ "s = [list(input()) for _ in range(3)]\n\nn_row = 0\n\ndic = {0:\"A\",1:\"B\",2:\"C\"}\n\nwhile len(s[n_row]):\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 len(s[n_row]):\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", "len(s[n_row])", "len", "s[n_row]", "s", "n_row", "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", "dic = {0:\"A\",1:\"B\",2:\"C\"}", "{0:\"A\",1:\"B\",2:\"C\"}", "dic", "n_row = 1", "1", "n_row", "n_row = 0", "0", "n_row", "s_num = s[n_row].pop(0)", "s[n_row].pop(0)", "s_num", "s = [list(input()) for _ in range(3)]", "[list(input()) for _ in range(3)]", "s", "n_row = 0", "0", "n_row", "n_row = 2", "2", "n_row" ]
s = [list(input()) for _ in range(3)] n_row = 0 dic = {0:"A",1:"B",2:"C"} while len(s[n_row]): 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, 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, 4, 18, 13, 13, 17, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 4, 13, 17, 3, 0, 13, 18, 13, 17, 4, 18, 13, 13, 17, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 4, 13, 17, 3, 0, 13, 18, 13, 17, 4, 18, 13, 13, 17, 10, 4, 13, 10, 17, 13, 10, 18, 13, 10, 4, 13, 10, 18, 13, 10, 4, 13, 10, 18, 13 ]
[ [ 112, 2 ], [ 97, 8 ], [ 106, 14 ], [ 100, 20 ], [ 101, 26 ], [ 104, 26 ], [ 116, 26 ], [ 110, 26 ], [ 113, 32 ], [ 109, 39 ], [ 113, 41 ], [ 113, 45 ], [ 110, 50 ], [ 101, 50 ], [ 104, 50 ], [ 116, 50 ], [ 98, 56 ], [ 115, 63 ], [ 98, 65 ], [ 98, 69 ], [ 116, 74 ], [ 110, 74 ], [ 101, 74 ], [ 104, 74 ], [ 107, 80 ], [ 103, 87 ], [ 107, 89 ], [ 107, 93 ], [ 97, 98 ], [ 100, 101 ], [ 103, 104 ], [ 106, 107 ], [ 109, 110 ], [ 112, 113 ], [ 115, 116 ] ]
[ "Sa = list(input())\nSb = list(input())\nSc = list(input())\n\na = \"a\"\n\nwhile True:\n if a == \"a\":\n if len(Sa) == 0:\n print(\"A\")\n break\n a = Sa[0]\n Sa.pop(0)\n if a == \"b\":\n if len(Sb) == 0:\n print(\"B\")\n break\n a = Sb[0]\n Sb.pop(0)\n if a == \"c\":\n if len(Sc) == 0:\n print(\"C\")\n break\n a = 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", "a = \"a\"", "a", "\"a\"", "while True:\n if a == \"a\":\n if len(Sa) == 0:\n print(\"A\")\n break\n a = Sa[0]\n Sa.pop(0)\n if a == \"b\":\n if len(Sb) == 0:\n print(\"B\")\n break\n a = Sb[0]\n Sb.pop(0)\n if a == \"c\":\n if len(Sc) == 0:\n print(\"C\")\n break\n a = Sc[0]\n Sc.pop(0)", "True", "if a == \"a\":\n if len(Sa) == 0:\n print(\"A\")\n break\n a = Sa[0]\n Sa.pop(0)\n ", "a == \"a\"", "a", "\"a\"", "if len(Sa) == 0:\n print(\"A\")\n break\n ", "len(Sa) == 0", "len(Sa)", "len", "Sa", "0", "print(\"A\")", "print", "\"A\"", "break", "a = Sa[0]", "a", "Sa[0]", "Sa", "0", "Sa.pop(0)", "Sa.pop", "Sa", "pop", "0", "if a == \"b\":\n if len(Sb) == 0:\n print(\"B\")\n break\n a = Sb[0]\n Sb.pop(0)\n ", "a == \"b\"", "a", "\"b\"", "if len(Sb) == 0:\n print(\"B\")\n break\n ", "len(Sb) == 0", "len(Sb)", "len", "Sb", "0", "print(\"B\")", "print", "\"B\"", "break", "a = Sb[0]", "a", "Sb[0]", "Sb", "0", "Sb.pop(0)", "Sb.pop", "Sb", "pop", "0", "if a == \"c\":\n if len(Sc) == 0:\n print(\"C\")\n break\n a = Sc[0]\n Sc.pop(0)", "a == \"c\"", "a", "\"c\"", "if len(Sc) == 0:\n print(\"C\")\n break\n ", "len(Sc) == 0", "len(Sc)", "len", "Sc", "0", "print(\"C\")", "print", "\"C\"", "break", "a = Sc[0]", "a", "Sc[0]", "Sc", "0", "Sc.pop(0)", "Sc.pop", "Sc", "pop", "0", "Sb = list(input())", "list(input())", "Sb", "a = \"a\"", "\"a\"", "a", "a = Sc[0]", "Sc[0]", "a", "Sc = list(input())", "list(input())", "Sc", "a = Sa[0]", "Sa[0]", "a", "Sa = list(input())", "list(input())", "Sa", "a = Sb[0]", "Sb[0]", "a" ]
Sa = list(input()) Sb = list(input()) Sc = list(input()) a = "a" while True: if a == "a": if len(Sa) == 0: print("A") break a = Sa[0] Sa.pop(0) if a == "b": if len(Sb) == 0: print("B") break a = Sb[0] Sb.pop(0) if a == "c": if len(Sc) == 0: print("C") break a = Sc[0] Sc.pop(0)
[ 7, 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, 17, 42, 17, 0, 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, 14, 2, 13, 17, 0, 13, 17, 14, 2, 13, 17, 0, 13, 17, 0, 13, 17, 10, 4, 13, 10, 4, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 4, 13 ]
[ [ 119, 2 ], [ 131, 11 ], [ 125, 20 ], [ 140, 29 ], [ 122, 34 ], [ 141, 38 ], [ 138, 38 ], [ 129, 38 ], [ 135, 38 ], [ 120, 44 ], [ 143, 47 ], [ 120, 50 ], [ 141, 60 ], [ 138, 60 ], [ 129, 60 ], [ 135, 60 ], [ 132, 66 ], [ 146, 69 ], [ 132, 72 ], [ 126, 84 ], [ 116, 87 ], [ 126, 90 ], [ 117, 100 ], [ 147, 100 ], [ 144, 100 ], [ 123, 100 ], [ 134, 103 ], [ 117, 107 ], [ 147, 107 ], [ 144, 107 ], [ 123, 107 ], [ 128, 110 ], [ 137, 113 ], [ 116, 117 ], [ 119, 120 ], [ 122, 123 ], [ 125, 126 ], [ 128, 129 ], [ 131, 132 ], [ 134, 135 ], [ 137, 138 ], [ 140, 141 ], [ 143, 144 ], [ 146, 147 ] ]
[ "sa = list(map(str, input()))\nsb = list(map(str, input()))\nsc = list(map(str, input()))\n\nturn = 0\n\nwhile True:\n s = \"\"\n if turn == 0:\n if len(sa) != 0:\n s = sa.pop(0)\n else:\n print(\"A\")\n exit()\n elif turn == 1:\n if len(sb) != 0:\n s = sb.pop(0)\n else:\n print(\"B\")\n exit()\n else:\n if len(sc) != 0:\n s = sc.pop(0)\n else:\n print(\"C\")\n exit()\n\n if s == \"a\":\n turn = 0\n elif s == \"b\":\n turn = 1\n else:\n turn = 2", "sa = list(map(str, input()))", "sa", "list(map(str, input()))", "list", "map(str, input())", "map", "str", "input()", "input", "sb = list(map(str, input()))", "sb", "list(map(str, input()))", "list", "map(str, input())", "map", "str", "input()", "input", "sc = list(map(str, input()))", "sc", "list(map(str, input()))", "list", "map(str, input())", "map", "str", "input()", "input", "turn = 0", "turn", "0", "while True:\n s = \"\"\n if turn == 0:\n if len(sa) != 0:\n s = sa.pop(0)\n else:\n print(\"A\")\n exit()\n elif turn == 1:\n if len(sb) != 0:\n s = sb.pop(0)\n else:\n print(\"B\")\n exit()\n else:\n if len(sc) != 0:\n s = sc.pop(0)\n else:\n print(\"C\")\n exit()\n\n if s == \"a\":\n turn = 0\n elif s == \"b\":\n turn = 1\n else:\n turn = 2", "True", "s = \"\"", "s", "\"\"", "if turn == 0:\n if len(sa) != 0:\n s = sa.pop(0)\n else:\n print(\"A\")\n exit()\n elif turn == 1:\n if len(sb) != 0:\n s = sb.pop(0)\n else:\n print(\"B\")\n exit()\n else:\n if len(sc) != 0:\n s = sc.pop(0)\n else:\n print(\"C\")\n exit()\n\n ", "turn == 0", "turn", "0", "if len(sa) != 0:\n s = sa.pop(0)\n else:\n print(\"A\")\n exit()\n ", "len(sa) != 0", "len(sa)", "len", "sa", "0", "s = sa.pop(0)", "s", "sa.pop(0)", "sa.pop", "sa", "pop", "0", "print(\"A\")", "print", "\"A\"", "exit()", "exit", "elif turn == 1:\n if len(sb) != 0:\n s = sb.pop(0)\n else:\n print(\"B\")\n exit()\n ", "turn == 1", "turn", "1", "if len(sb) != 0:\n s = sb.pop(0)\n else:\n print(\"B\")\n exit()\n ", "len(sb) != 0", "len(sb)", "len", "sb", "0", "s = sb.pop(0)", "s", "sb.pop(0)", "sb.pop", "sb", "pop", "0", "print(\"B\")", "print", "\"B\"", "exit()", "exit", "if len(sc) != 0:\n s = sc.pop(0)\n else:\n print(\"C\")\n exit()\n\n ", "len(sc) != 0", "len(sc)", "len", "sc", "0", "s = sc.pop(0)", "s", "sc.pop(0)", "sc.pop", "sc", "pop", "0", "print(\"C\")", "print", "\"C\"", "exit()", "exit", "if s == \"a\":\n turn = 0\n elif s == \"b\":\n turn = 1\n else:\n turn = 2", "s == \"a\"", "s", "\"a\"", "turn = 0", "turn", "0", "elif s == \"b\":\n turn = 1\n ", "s == \"b\"", "s", "\"b\"", "turn = 1", "turn", "1", "turn = 2", "turn", "2", "s = sc.pop(0)", "sc.pop(0)", "s", "sa = list(map(str, input()))", "list(map(str, input()))", "sa", "s = \"\"", "\"\"", "s", "sc = list(map(str, input()))", "list(map(str, input()))", "sc", "turn = 1", "1", "turn", "sb = list(map(str, input()))", "list(map(str, input()))", "sb", "turn = 0", "0", "turn", "turn = 2", "2", "turn", "turn = 0", "0", "turn", "s = sa.pop(0)", "sa.pop(0)", "s", "s = sb.pop(0)", "sb.pop(0)", "s" ]
sa = list(map(str, input())) sb = list(map(str, input())) sc = list(map(str, input())) turn = 0 while True: s = "" if turn == 0: if len(sa) != 0: s = sa.pop(0) else: print("A") exit() elif turn == 1: if len(sb) != 0: s = sb.pop(0) else: print("B") exit() else: if len(sc) != 0: s = sc.pop(0) else: print("C") exit() if s == "a": turn = 0 elif s == "b": turn = 1 else: turn = 2
[ 7, 41, 28, 13, 4, 13, 17, 4, 4, 13, 0, 13, 13, 13, 13, 0, 13, 21, 22, 17, 13, 22, 17, 13, 22, 17, 13, 0, 13, 17, 0, 13, 17, 42, 2, 4, 13, 18, 13, 13, 17, 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, 21, 13, 10, 18, 13, 10, 13, 13, 10, 13, 13, 10, 17, 13, 10, 13, 13, 10, 17, 13 ]
[ [ 4, 3 ], [ 86, 11 ], [ 86, 13 ], [ 86, 14 ], [ 71, 16 ], [ 83, 28 ], [ 89, 31 ], [ 49, 37 ], [ 72, 38 ], [ 84, 39 ], [ 81, 39 ], [ 74, 42 ], [ 49, 44 ], [ 72, 45 ], [ 84, 46 ], [ 81, 46 ], [ 52, 49 ], [ 72, 50 ], [ 84, 51 ], [ 81, 51 ], [ 49, 53 ], [ 72, 54 ], [ 84, 55 ], [ 81, 55 ], [ 80, 59 ], [ 75, 60 ], [ 90, 60 ], [ 81, 65 ], [ 84, 65 ], [ 86, 69 ], [ 71, 72 ], [ 74, 75 ], [ 86, 78 ], [ 75, 80 ], [ 90, 80 ], [ 80, 81 ], [ 83, 84 ], [ 86, 87 ], [ 89, 90 ] ]
[ "A, B, C =[input() for _ in range(3)]\nT = {\"a\":A, \"b\":B, \"c\":C}\nplayer = \"a\"\ncard = \"a\"\nwhile len(T[player])>0:\n card = T[player][0]\n T[player] = T[player][1:]\n player = card\nelse:\n print(player.upper())", "input() for _ in range(3)", "for _ in range(3)", "_", "range(3)", "range", "3", "for _ in range(3)", "input()", "input", "A, B, C =[input() for _ in range(3)]", "A", "[input() for _ in range(3)]", "B", "C", "T = {\"a\":A, \"b\":B, \"c\":C}", "T", "{\"a\":A, \"b\":B, \"c\":C}", "\"a\"", "\"a\"", "A", "\"b\"", "\"b\"", "B", "\"c\"", "\"c\"", "C", "player = \"a\"", "player", "\"a\"", "card = \"a\"", "card", "\"a\"", "while len(T[player])>0:\n card = T[player][0]\n T[player] = T[player][1:]\n player = card\nelse:\n print(player.upper())", "len(T[player])>0", "len(T[player])", "len", "T[player]", "T", "player", "0", "card = T[player][0]", "card", "T[player][0]", "[player]", "T", "player", "0", "T[player] = T[player][1:]", "T[player]", "T", "player", "T[player][1:]", "[player]", "T", "player", "1:", "1", "player = card", "player", "card", "print(player.upper())", "print", "player.upper()", "player.upper", "player", "upper", "A, B, C =[input() for _ in range(3)]", "[input() for _ in range(3)]", "A", "T = {\"a\":A, \"b\":B, \"c\":C}", "{\"a\":A, \"b\":B, \"c\":C}", "T", "card = T[player][0]", "T[player][0]", "card", "C =[input() for _ in range(3)]", "[input() for _ in range(3)]", "C", "player = card", "card", "player", "player = \"a\"", "\"a\"", "player", "B, C =[input() for _ in range(3)]", "[input() for _ in range(3)]", "B", "card = \"a\"", "\"a\"", "card" ]
A, B, C =[input() for _ in range(3)] T = {"a":A, "b":B, "c":C} player = "a" card = "a" while len(T[player])>0: card = T[player][0] T[player] = T[player][1:] player = card else: print(player.upper())