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, 0, 13, 4, 13, 4, 13, 0, 13, 4, 13, 4, 13, 0, 13, 17, 0, 13, 17, 28, 13, 4, 13, 17, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 0, 13, 17, 3, 0, 13, 4, 18, 13, 13, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 0, 13, 17, 3, 0, 13, 4, 18, 13, 13, 14, 2, 4, 13, 13, 17, 0, 13, 17, 3, 0, 13, 4, 18, 13, 13, 4, 13, 13, 10, 4, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13 ]
[ [ 118, 3 ], [ 97, 9 ], [ 91, 15 ], [ 94, 21 ], [ 121, 24 ], [ 28, 27 ], [ 122, 33 ], [ 107, 33 ], [ 110, 33 ], [ 104, 33 ], [ 119, 39 ], [ 115, 42 ], [ 103, 46 ], [ 119, 49 ], [ 122, 53 ], [ 107, 53 ], [ 110, 53 ], [ 104, 53 ], [ 98, 59 ], [ 100, 62 ], [ 109, 66 ], [ 98, 69 ], [ 92, 75 ], [ 112, 78 ], [ 106, 82 ], [ 92, 85 ], [ 113, 89 ], [ 101, 89 ], [ 116, 89 ], [ 95, 89 ], [ 91, 92 ], [ 94, 95 ], [ 97, 98 ], [ 100, 101 ], [ 103, 104 ], [ 106, 107 ], [ 109, 110 ], [ 112, 113 ], [ 115, 116 ], [ 118, 119 ], [ 121, 122 ] ]
[ "from collections import deque\nSA=deque(input())\nSB=deque(input())\nSC=deque(input())\n\nans=\"\"\nturn=\"a\"\nfor i in range(500):\n if turn==\"a\":\n if len(SA)<1:\n ans=\"A\"\n break\n else:\n turn=SA.popleft()\n elif turn==\"b\":\n if len(SB)<1:\n ans=\"B\"\n break\n else:\n turn=SB.popleft()\n else:\n if len(SC)<1:\n ans=\"C\"\n break\n else:\n turn=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", "ans=\"\"", "ans", "\"\"", "turn=\"a\"", "turn", "\"a\"", "for i in range(500):\n if turn==\"a\":\n if len(SA)<1:\n ans=\"A\"\n break\n else:\n turn=SA.popleft()\n elif turn==\"b\":\n if len(SB)<1:\n ans=\"B\"\n break\n else:\n turn=SB.popleft()\n else:\n if len(SC)<1:\n ans=\"C\"\n break\n else:\n turn=SC.popleft()\n ", "i", "range(500)", "range", "500", "if turn==\"a\":\n if len(SA)<1:\n ans=\"A\"\n break\n else:\n turn=SA.popleft()\n elif turn==\"b\":\n if len(SB)<1:\n ans=\"B\"\n break\n else:\n turn=SB.popleft()\n else:\n if len(SC)<1:\n ans=\"C\"\n break\n else:\n turn=SC.popleft()\n ", "turn==\"a\"", "turn", "\"a\"", "if len(SA)<1:\n ans=\"A\"\n break\n else:\n turn=SA.popleft()\n ", "len(SA)<1", "len(SA)", "len", "SA", "1", "ans=\"A\"", "ans", "\"A\"", "break", "turn=SA.popleft()", "turn", "SA.popleft()", "SA.popleft", "SA", "popleft", "elif turn==\"b\":\n if len(SB)<1:\n ans=\"B\"\n break\n else:\n turn=SB.popleft()\n ", "turn==\"b\"", "turn", "\"b\"", "if len(SB)<1:\n ans=\"B\"\n break\n else:\n turn=SB.popleft()\n ", "len(SB)<1", "len(SB)", "len", "SB", "1", "ans=\"B\"", "ans", "\"B\"", "break", "turn=SB.popleft()", "turn", "SB.popleft()", "SB.popleft", "SB", "popleft", "if len(SC)<1:\n ans=\"C\"\n break\n else:\n turn=SC.popleft()\n ", "len(SC)<1", "len(SC)", "len", "SC", "1", "ans=\"C\"", "ans", "\"C\"", "break", "turn=SC.popleft()", "turn", "SC.popleft()", "SC.popleft", "SC", "popleft", "print(ans)", "print", "ans", "SC=deque(input())", "deque(input())", "SC", "ans=\"\"", "\"\"", "ans", "SB=deque(input())", "deque(input())", "SB", "ans=\"B\"", "\"B\"", "ans", "turn=SA.popleft()", "SA.popleft()", "turn", "turn=SC.popleft()", "SC.popleft()", "turn", "turn=SB.popleft()", "SB.popleft()", "turn", "ans=\"C\"", "\"C\"", "ans", "ans=\"A\"", "\"A\"", "ans", "SA=deque(input())", "deque(input())", "SA", "turn=\"a\"", "\"a\"", "turn" ]
from collections import deque SA=deque(input()) SB=deque(input()) SC=deque(input()) ans="" turn="a" for i in range(500): if turn=="a": if len(SA)<1: ans="A" break else: turn=SA.popleft() elif turn=="b": if len(SB)<1: ans="B" break else: turn=SB.popleft() else: if len(SC)<1: ans="C" break else: turn=SC.popleft() print(ans)
[ 7, 0, 13, 39, 28, 13, 4, 13, 17, 0, 13, 4, 13, 4, 18, 13, 13, 13, 0, 13, 17, 42, 17, 14, 2, 4, 13, 18, 13, 13, 17, 4, 13, 4, 13, 2, 17, 13, 3, 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, 18, 13, 10, 17, 13, 10, 4, 13, 10, 39, 13 ]
[ [ 76, 2 ], [ 6, 5 ], [ 73, 10 ], [ 77, 15 ], [ 74, 17 ], [ 70, 19 ], [ 47, 27 ], [ 77, 28 ], [ 71, 29 ], [ 65, 29 ], [ 71, 37 ], [ 65, 37 ], [ 67, 40 ], [ 47, 42 ], [ 77, 43 ], [ 71, 44 ], [ 65, 44 ], [ 50, 47 ], [ 77, 48 ], [ 71, 49 ], [ 65, 49 ], [ 47, 51 ], [ 77, 52 ], [ 71, 53 ], [ 65, 53 ], [ 64, 57 ], [ 68, 61 ], [ 64, 65 ], [ 67, 68 ], [ 70, 71 ], [ 73, 74 ], [ 76, 77 ] ]
[ "A = []\nfor i in range(3):\n a = input()\n A.append(a)\nx = 0\nwhile 1:\n if len(A[x]) == 0:\n print(chr(65 + x))\n break\n s = A[x][0]\n A[x] = A[x][1:]\n x = ord(s) - 97", "A = []", "A", "[]", "for i in range(3):\n a = input()\n A.append(a)", "i", "range(3)", "range", "3", "a = input()", "a", "input()", "input", "A.append(a)", "A.append", "A", "append", "a", "x = 0", "x", "0", "while 1:\n if len(A[x]) == 0:\n print(chr(65 + x))\n break\n s = A[x][0]\n A[x] = A[x][1:]\n x = ord(s) - 97", "1", "if len(A[x]) == 0:\n print(chr(65 + x))\n break\n ", "len(A[x]) == 0", "len(A[x])", "len", "A[x]", "A", "x", "0", "print(chr(65 + x))", "print", "chr(65 + x)", "chr", "65 + x", "65", "x", "break", "s = A[x][0]", "s", "A[x][0]", "[x]", "A", "x", "0", "A[x] = A[x][1:]", "A[x]", "A", "x", "A[x][1:]", "[x]", "A", "x", "1:", "1", "x = ord(s) - 97", "x", "ord(s) - 97", "ord(s)", "ord", "s", "97", "x = ord(s) - 97", "ord(s) - 97", "x", "s = A[x][0]", "A[x][0]", "s", "x = 0", "0", "x", "a = input()", "input()", "a", "A = []", "[]", "A" ]
A = [] for i in range(3): a = input() A.append(a) x = 0 while 1: if len(A[x]) == 0: print(chr(65 + x)) break s = A[x][0] A[x] = A[x][1:] x = ord(s) - 97
[ 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, 2, 13, 17, 40, 4, 13, 13, 13, 0, 13, 18, 13, 2, 13, 17, 0, 13, 17, 14, 2, 2, 13, 17, 40, 4, 13, 13, 13, 0, 13, 18, 13, 2, 13, 17, 0, 13, 17, 14, 2, 2, 13, 17, 40, 4, 13, 13, 13, 0, 13, 18, 13, 2, 13, 17, 0, 13, 17, 14, 2, 2, 13, 17, 2, 4, 13, 13, 13, 0, 13, 17, 0, 13, 17, 14, 2, 2, 13, 17, 2, 4, 13, 13, 13, 0, 13, 17, 0, 13, 17, 14, 2, 2, 13, 17, 2, 4, 13, 13, 13, 0, 13, 17, 0, 13, 17, 14, 2, 13, 17, 4, 13, 17, 14, 2, 13, 17, 4, 13, 17, 14, 2, 13, 17, 4, 13, 17, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 18, 13, 10, 17, 13, 10, 4, 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, 18, 13, 10, 4, 13, 10, 18, 13 ]
[ [ 186, 2 ], [ 183, 8 ], [ 222, 14 ], [ 168, 20 ], [ 189, 23 ], [ 216, 26 ], [ 171, 29 ], [ 207, 32 ], [ 169, 36 ], [ 205, 36 ], [ 202, 36 ], [ 193, 36 ], [ 190, 41 ], [ 175, 41 ], [ 196, 41 ], [ 211, 41 ], [ 178, 41 ], [ 226, 41 ], [ 220, 41 ], [ 187, 46 ], [ 217, 47 ], [ 199, 47 ], [ 219, 49 ], [ 187, 51 ], [ 217, 53 ], [ 199, 53 ], [ 198, 56 ], [ 190, 61 ], [ 175, 61 ], [ 196, 61 ], [ 211, 61 ], [ 178, 61 ], [ 226, 61 ], [ 220, 61 ], [ 184, 66 ], [ 172, 67 ], [ 181, 67 ], [ 225, 69 ], [ 184, 71 ], [ 172, 73 ], [ 181, 73 ], [ 180, 76 ], [ 190, 81 ], [ 175, 81 ], [ 196, 81 ], [ 211, 81 ], [ 178, 81 ], [ 226, 81 ], [ 220, 81 ], [ 223, 86 ], [ 208, 87 ], [ 214, 87 ], [ 177, 89 ], [ 223, 91 ], [ 208, 93 ], [ 214, 93 ], [ 213, 96 ], [ 190, 101 ], [ 175, 101 ], [ 196, 101 ], [ 211, 101 ], [ 178, 101 ], [ 226, 101 ], [ 220, 101 ], [ 187, 106 ], [ 217, 107 ], [ 199, 107 ], [ 210, 109 ], [ 192, 112 ], [ 190, 117 ], [ 175, 117 ], [ 196, 117 ], [ 211, 117 ], [ 178, 117 ], [ 226, 117 ], [ 220, 117 ], [ 184, 122 ], [ 172, 123 ], [ 181, 123 ], [ 195, 125 ], [ 201, 128 ], [ 190, 133 ], [ 175, 133 ], [ 196, 133 ], [ 211, 133 ], [ 178, 133 ], [ 226, 133 ], [ 220, 133 ], [ 223, 138 ], [ 208, 139 ], [ 214, 139 ], [ 174, 141 ], [ 204, 144 ], [ 175, 148 ], [ 196, 148 ], [ 211, 148 ], [ 178, 148 ], [ 226, 148 ], [ 220, 148 ], [ 190, 148 ], [ 175, 155 ], [ 196, 155 ], [ 211, 155 ], [ 178, 155 ], [ 226, 155 ], [ 220, 155 ], [ 190, 155 ], [ 175, 162 ], [ 196, 162 ], [ 211, 162 ], [ 178, 162 ], [ 226, 162 ], [ 220, 162 ], [ 190, 162 ], [ 168, 169 ], [ 171, 172 ], [ 174, 175 ], [ 177, 178 ], [ 180, 181 ], [ 183, 184 ], [ 186, 187 ], [ 189, 190 ], [ 192, 193 ], [ 195, 196 ], [ 198, 199 ], [ 201, 202 ], [ 204, 205 ], [ 207, 208 ], [ 210, 211 ], [ 213, 214 ], [ 216, 217 ], [ 219, 220 ], [ 222, 223 ], [ 225, 226 ] ]
[ "SA = list(input())\nSB = list(input())\nSC = list(input())\nj = 0\nturn = 'a'\na = 1\nb = 1\nc = 1\n\n\nwhile j == 0:\n if(turn == 'a' and len(SA) >= a):\n turn = SA[a-1]\n a += 1\n elif(turn == 'b' and len(SB) >= b):\n turn = SB[b-1]\n b += 1\n elif(turn == 'c' and len(SC) >= c):\n turn = SC[c-1]\n c += 1\n elif(turn == 'a' and len(SA) < a):\n turn = 'a'\n j = 1\n elif(turn == 'b' and len(SB) < b):\n turn = 'b'\n j = 1\n elif(turn == 'c' and len(SC) < c):\n turn = 'c'\n j = 1\n \nif(turn == 'a'):\n print('A')\nelif(turn == 'b'):\n print('B')\nelif(turn == 'c'):\n print('C')", "SA = list(input())", "SA", "list(input())", "list", "input()", "input", "SB = list(input())", "SB", "list(input())", "list", "input()", "input", "SC = list(input())", "SC", "list(input())", "list", "input()", "input", "j = 0", "j", "0", "turn = 'a'", "turn", "'a'", "a = 1", "a", "1", "b = 1", "b", "1", "c = 1", "c", "1", "while j == 0:\n if(turn == 'a' and len(SA) >= a):\n turn = SA[a-1]\n a += 1\n elif(turn == 'b' and len(SB) >= b):\n turn = SB[b-1]\n b += 1\n elif(turn == 'c' and len(SC) >= c):\n turn = SC[c-1]\n c += 1\n elif(turn == 'a' and len(SA) < a):\n turn = 'a'\n j = 1\n elif(turn == 'b' and len(SB) < b):\n turn = 'b'\n j = 1\n elif(turn == 'c' and len(SC) < c):\n turn = 'c'\n j = 1\n ", "j == 0", "j", "0", "if(turn == 'a' and len(SA) >= a):\n turn = SA[a-1]\n a += 1\n elif(turn == 'b' and len(SB) >= b):\n turn = SB[b-1]\n b += 1\n elif(turn == 'c' and len(SC) >= c):\n turn = SC[c-1]\n c += 1\n elif(turn == 'a' and len(SA) < a):\n turn = 'a'\n j = 1\n elif(turn == 'b' and len(SB) < b):\n turn = 'b'\n j = 1\n elif(turn == 'c' and len(SC) < c):\n turn = 'c'\n j = 1\n ", "turn == 'a' and len(SA) >= a", "turn == 'a'", "turn", "'a'", "len(SA) >= a", "len(SA)", "len", "SA", "a", "turn = SA[a-1]", "turn", "SA[a-1]", "SA", "a-1", "a", "1", "a += 1", "a", "1", "elif(turn == 'b' and len(SB) >= b):\n turn = SB[b-1]\n b += 1\n ", "turn == 'b' and len(SB) >= b", "turn == 'b'", "turn", "'b'", "len(SB) >= b", "len(SB)", "len", "SB", "b", "turn = SB[b-1]", "turn", "SB[b-1]", "SB", "b-1", "b", "1", "b += 1", "b", "1", "elif(turn == 'c' and len(SC) >= c):\n turn = SC[c-1]\n c += 1\n ", "turn == 'c' and len(SC) >= c", "turn == 'c'", "turn", "'c'", "len(SC) >= c", "len(SC)", "len", "SC", "c", "turn = SC[c-1]", "turn", "SC[c-1]", "SC", "c-1", "c", "1", "c += 1", "c", "1", "elif(turn == 'a' and len(SA) < a):\n turn = 'a'\n j = 1\n ", "turn == 'a' and len(SA) < a", "turn == 'a'", "turn", "'a'", "len(SA) < a", "len(SA)", "len", "SA", "a", "turn = 'a'", "turn", "'a'", "j = 1", "j", "1", "elif(turn == 'b' and len(SB) < b):\n turn = 'b'\n j = 1\n ", "turn == 'b' and len(SB) < b", "turn == 'b'", "turn", "'b'", "len(SB) < b", "len(SB)", "len", "SB", "b", "turn = 'b'", "turn", "'b'", "j = 1", "j", "1", "elif(turn == 'c' and len(SC) < c):\n turn = 'c'\n j = 1\n ", "turn == 'c' and len(SC) < c", "turn == 'c'", "turn", "'c'", "len(SC) < c", "len(SC)", "len", "SC", "c", "turn = 'c'", "turn", "'c'", "j = 1", "j", "1", "if(turn == 'a'):\n print('A')\nelif(turn == 'b'):\n print('B')\nelif(turn == 'c'):\n print('C')", "turn == 'a'", "turn", "'a'", "print('A')", "print", "'A'", "elif(turn == 'b'):\n print('B')", "turn == 'b'", "turn", "'b'", "print('B')", "print", "'B'", "elif(turn == 'c'):\n print('C')", "turn == 'c'", "turn", "'c'", "print('C')", "print", "'C'", "j = 0", "0", "j", "b = 1", "1", "b", "turn = 'c'", "'c'", "turn", "turn = SC[c-1]", "SC[c-1]", "turn", "b += 1", "1", "b", "SB = list(input())", "list(input())", "SB", "SA = list(input())", "list(input())", "SA", "turn = 'a'", "'a'", "turn", "j = 1", "1", "j", "turn = 'b'", "'b'", "turn", "a += 1", "1", "a", "j = 1", "1", "j", "j = 1", "1", "j", "c = 1", "1", "c", "turn = 'a'", "'a'", "turn", "c += 1", "1", "c", "a = 1", "1", "a", "turn = SA[a-1]", "SA[a-1]", "turn", "SC = list(input())", "list(input())", "SC", "turn = SB[b-1]", "SB[b-1]", "turn" ]
SA = list(input()) SB = list(input()) SC = list(input()) j = 0 turn = 'a' a = 1 b = 1 c = 1 while j == 0: if(turn == 'a' and len(SA) >= a): turn = SA[a-1] a += 1 elif(turn == 'b' and len(SB) >= b): turn = SB[b-1] b += 1 elif(turn == 'c' and len(SC) >= c): turn = SC[c-1] c += 1 elif(turn == 'a' and len(SA) < a): turn = 'a' j = 1 elif(turn == 'b' and len(SB) < b): turn = 'b' j = 1 elif(turn == 'c' and len(SC) < c): turn = 'c' j = 1 if(turn == 'a'): print('A') elif(turn == 'b'): print('B') elif(turn == 'c'): print('C')
[ 7, 15, 13, 15, 13, 15, 13, 15, 13, 15, 13, 15, 4, 18, 13, 13, 2, 17, 17, 0, 13, 2, 17, 17, 0, 13, 2, 2, 17, 17, 17, 0, 13, 18, 18, 18, 13, 13, 13, 13, 0, 13, 18, 18, 18, 13, 13, 13, 13, 0, 13, 18, 18, 18, 13, 13, 13, 13, 0, 13, 2, 39, 17, 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, 2, 4, 13, 18, 18, 13, 13, 17, 4, 13, 17, 0, 18, 13, 13, 18, 18, 13, 13, 39, 17, 0, 13, 13, 4, 13, 4, 13, 2, 4, 13, 17, 13, 3, 10, 18, 13, 10, 18, 13, 10, 2, 13, 10, 17, 13, 10, 2, 13, 10, 18, 13, 10, 2, 13, 10, 2, 13, 10, 13, 13 ]
[ [ 150, 20 ], [ 153, 25 ], [ 132, 32 ], [ 135, 41 ], [ 147, 50 ], [ 138, 59 ], [ 68, 65 ], [ 139, 66 ], [ 74, 71 ], [ 139, 72 ], [ 80, 77 ], [ 139, 78 ], [ 141, 83 ], [ 109, 91 ], [ 139, 92 ], [ 142, 93 ], [ 157, 93 ], [ 144, 96 ], [ 109, 101 ], [ 139, 102 ], [ 142, 103 ], [ 157, 103 ], [ 112, 109 ], [ 139, 110 ], [ 142, 111 ], [ 157, 111 ], [ 109, 113 ], [ 139, 114 ], [ 142, 115 ], [ 157, 115 ], [ 156, 119 ], [ 145, 120 ], [ 142, 129 ], [ 157, 129 ], [ 132, 133 ], [ 135, 136 ], [ 138, 139 ], [ 141, 142 ], [ 144, 145 ], [ 147, 148 ], [ 150, 151 ], [ 153, 154 ], [ 145, 156 ], [ 156, 157 ] ]
[ "import sys\nimport itertools\n# import numpy as np\nimport time\nimport math\nimport heapq\nfrom collections import defaultdict\nsys.setrecursionlimit(10 ** 7)\n \nINF = 10 ** 18\nMOD = 10 ** 9 + 7\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\n# map(int, input().split())\n\nS = [0] * 3\nS[0] = input()\nS[1] = input()\nS[2] = input()\n\ncur = 0\nwhile True:\n if len(S[cur]) > 0:\n nx = ord(S[cur][0]) - ord('a')\n S[cur] = S[cur][1:]\n cur = nx\n else:\n print(chr(ord('A') + cur))\n break\n", "import sys", "sys", "import itertools", "itertools", "import time", "time", "import math", "math", "import heapq", "heapq", "from collections import defaultdict", "sys.setrecursionlimit(10 ** 7)", "sys.setrecursionlimit", "sys", "setrecursionlimit", "10 ** 7", "10", "7", "INF = 10 ** 18", "INF", "10 ** 18", "10", "18", "MOD = 10 ** 9 + 7", "MOD", "10 ** 9 + 7", "10 ** 9", "10", "9", "7", "read = sys.stdin.buffer.read", "read", "sys.stdin.buffer.read", "sys.stdin.buffer", "sys.stdin", "sys", "stdin", "buffer", "read", "readline = sys.stdin.buffer.readline", "readline", "sys.stdin.buffer.readline", "sys.stdin.buffer", "sys.stdin", "sys", "stdin", "buffer", "readline", "readlines = sys.stdin.buffer.readlines", "readlines", "sys.stdin.buffer.readlines", "sys.stdin.buffer", "sys.stdin", "sys", "stdin", "buffer", "readlines", "S = [0] * 3", "S", "[0] * 3", "[0]", "0", "3", "S[0] = input()", "S[0]", "S", "0", "input()", "input", "S[1] = input()", "S[1]", "S", "1", "input()", "input", "S[2] = input()", "S[2]", "S", "2", "input()", "input", "cur = 0", "cur", "0", "while True:\n if len(S[cur]) > 0:\n nx = ord(S[cur][0]) - ord('a')\n S[cur] = S[cur][1:]\n cur = nx\n else:\n print(chr(ord('A') + cur))\n break", "True", "if len(S[cur]) > 0:\n nx = ord(S[cur][0]) - ord('a')\n S[cur] = S[cur][1:]\n cur = nx\n else:\n print(chr(ord('A') + cur))\n break", "len(S[cur]) > 0", "len(S[cur])", "len", "S[cur]", "S", "cur", "0", "nx = ord(S[cur][0]) - ord('a')", "nx", "ord(S[cur][0]) - ord('a')", "ord(S[cur][0])", "ord", "S[cur][0]", "[cur]", "S", "cur", "0", "ord('a')", "ord", "'a'", "S[cur] = S[cur][1:]", "S[cur]", "S", "cur", "S[cur][1:]", "[cur]", "S", "cur", "1:", "1", "cur = nx", "cur", "nx", "print(chr(ord('A') + cur))", "print", "chr(ord('A') + cur)", "chr", "ord('A') + cur", "ord('A')", "ord", "'A'", "cur", "break", "read = sys.stdin.buffer.read", "sys.stdin.buffer.read", "read", "readline = sys.stdin.buffer.readline", "sys.stdin.buffer.readline", "readline", "S = [0] * 3", "[0] * 3", "S", "cur = 0", "0", "cur", "nx = ord(S[cur][0]) - ord('a')", "ord(S[cur][0]) - ord('a')", "nx", "readlines = sys.stdin.buffer.readlines", "sys.stdin.buffer.readlines", "readlines", "INF = 10 ** 18", "10 ** 18", "INF", "MOD = 10 ** 9 + 7", "10 ** 9 + 7", "MOD", "cur = nx", "nx", "cur" ]
import sys import itertools # import numpy as np import time import math import heapq from collections import defaultdict sys.setrecursionlimit(10 ** 7) INF = 10 ** 18 MOD = 10 ** 9 + 7 read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines # map(int, input().split()) S = [0] * 3 S[0] = input() S[1] = input() S[2] = input() cur = 0 while True: if len(S[cur]) > 0: nx = ord(S[cur][0]) - ord('a') S[cur] = S[cur][1:] cur = nx else: print(chr(ord('A') + cur)) break
[ 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, 39, 17, 17, 17, 0, 13, 17, 42, 17, 14, 2, 4, 13, 18, 13, 13, 17, 4, 13, 4, 18, 18, 13, 13, 13, 4, 13, 0, 13, 4, 18, 13, 13, 4, 18, 18, 13, 13, 13, 17, 10, 4, 13, 10, 4, 13, 10, 39, 13, 10, 4, 13, 10, 17, 13, 10, 39, 13, 10, 4, 13 ]
[ [ 68, 2 ], [ 77, 8 ], [ 71, 14 ], [ 74, 20 ], [ 83, 26 ], [ 80, 32 ], [ 75, 41 ], [ 81, 42 ], [ 87, 42 ], [ 84, 49 ], [ 81, 50 ], [ 87, 50 ], [ 86, 55 ], [ 84, 58 ], [ 75, 63 ], [ 81, 64 ], [ 87, 64 ], [ 68, 69 ], [ 71, 72 ], [ 74, 75 ], [ 77, 78 ], [ 80, 81 ], [ 83, 84 ], [ 86, 87 ] ]
[ "a=list(input())\nb=list(input())\nc=list(input())\nabc=[a,b,c]\nname=['a','b','c']\nnow=0\nwhile True:\n\tif len(abc[now])==0:\n\t\tprint(name[now].upper())\n\t\texit()\n\tnow=name.index(abc[now].pop(0))\n", "a=list(input())", "a", "list(input())", "list", "input()", "input", "b=list(input())", "b", "list(input())", "list", "input()", "input", "c=list(input())", "c", "list(input())", "list", "input()", "input", "abc=[a,b,c]", "abc", "[a,b,c]", "a", "b", "c", "name=['a','b','c']", "name", "['a','b','c']", "'a'", "'b'", "'c'", "now=0", "now", "0", "while True:\n\tif len(abc[now])==0:\n\t\tprint(name[now].upper())\n\t\texit()\n\tnow=name.index(abc[now].pop(0))", "True", "if len(abc[now])==0:\n\t\tprint(name[now].upper())\n\t\texit()\n\t", "len(abc[now])==0", "len(abc[now])", "len", "abc[now]", "abc", "now", "0", "print(name[now].upper())", "print", "name[now].upper()", "[now].upper", "[now]", "name", "now", "upper", "exit()", "exit", "now=name.index(abc[now].pop(0))", "now", "name.index(abc[now].pop(0))", "name.index", "name", "index", "abc[now].pop(0)", "[now].pop", "[now]", "abc", "now", "pop", "0", "a=list(input())", "list(input())", "a", "c=list(input())", "list(input())", "c", "abc=[a,b,c]", "[a,b,c]", "abc", "b=list(input())", "list(input())", "b", "now=0", "0", "now", "name=['a','b','c']", "['a','b','c']", "name", "now=name.index(abc[now].pop(0))", "name.index(abc[now].pop(0))", "now" ]
a=list(input()) b=list(input()) c=list(input()) abc=[a,b,c] name=['a','b','c'] now=0 while True: if len(abc[now])==0: print(name[now].upper()) exit() now=name.index(abc[now].pop(0))
[ 7, 0, 13, 4, 13, 4, 13, 0, 13, 4, 13, 4, 13, 0, 13, 4, 13, 4, 13, 0, 13, 13, 0, 13, 17, 42, 40, 13, 39, 0, 13, 18, 13, 17, 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, 4, 13, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 4, 13, 10, 13, 13, 10, 17, 13, 10, 13, 13, 10, 13, 13, 10, 4, 13, 10, 17, 13, 10, 18, 13, 10, 13, 13 ]
[ [ 75, 2 ], [ 78, 8 ], [ 93, 14 ], [ 102, 20 ], [ 76, 21 ], [ 96, 23 ], [ 103, 27 ], [ 88, 27 ], [ 91, 27 ], [ 82, 27 ], [ 99, 30 ], [ 103, 32 ], [ 88, 32 ], [ 91, 32 ], [ 82, 32 ], [ 103, 36 ], [ 88, 36 ], [ 91, 36 ], [ 82, 36 ], [ 100, 41 ], [ 81, 44 ], [ 76, 45 ], [ 72, 47 ], [ 100, 51 ], [ 90, 54 ], [ 79, 55 ], [ 69, 57 ], [ 87, 60 ], [ 94, 61 ], [ 84, 63 ], [ 85, 67 ], [ 70, 67 ], [ 73, 67 ], [ 97, 67 ], [ 69, 70 ], [ 72, 73 ], [ 75, 76 ], [ 78, 79 ], [ 76, 81 ], [ 81, 82 ], [ 84, 85 ], [ 94, 87 ], [ 87, 88 ], [ 79, 90 ], [ 90, 91 ], [ 93, 94 ], [ 96, 97 ], [ 99, 100 ], [ 76, 102 ], [ 102, 103 ] ]
[ "Sa = list(input())\nSb = list(input())\nSc = list(input())\nturn = Sa\nans =\"A\"\nwhile turn != []:\n card =turn[0]\n turn.pop(0)\n if card ==\"a\":\n turn =Sa\n ans =\"A\"\n elif card ==\"b\":\n turn =Sb\n ans =\"B\"\n else:\n turn =Sc\n ans =\"C\"\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", "turn = Sa", "turn", "Sa", "ans =\"A\"", "ans", "\"A\"", "while turn != []:\n card =turn[0]\n turn.pop(0)\n if card ==\"a\":\n turn =Sa\n ans =\"A\"\n elif card ==\"b\":\n turn =Sb\n ans =\"B\"\n else:\n turn =Sc\n ans =\"C\"", "turn != []", "turn", "[]", "card =turn[0]", "card", "turn[0]", "turn", "0", "turn.pop(0)", "turn.pop", "turn", "pop", "0", "if card ==\"a\":\n turn =Sa\n ans =\"A\"\n elif card ==\"b\":\n turn =Sb\n ans =\"B\"\n else:\n turn =Sc\n ans =\"C\"", "card ==\"a\"", "card", "\"a\"", "turn =Sa", "turn", "Sa", "ans =\"A\"", "ans", "\"A\"", "elif card ==\"b\":\n turn =Sb\n ans =\"B\"\n ", "card ==\"b\"", "card", "\"b\"", "turn =Sb", "turn", "Sb", "ans =\"B\"", "ans", "\"B\"", "turn =Sc", "turn", "Sc", "ans =\"C\"", "ans", "\"C\"", "print(ans)", "print", "ans", "ans =\"B\"", "\"B\"", "ans", "ans =\"A\"", "\"A\"", "ans", "Sa = list(input())", "list(input())", "Sa", "Sb = list(input())", "list(input())", "Sb", "turn =Sa", "Sa", "turn", "ans =\"C\"", "\"C\"", "ans", "turn =Sc", "Sc", "turn", "turn =Sb", "Sb", "turn", "Sc = list(input())", "list(input())", "Sc", "ans =\"A\"", "\"A\"", "ans", "card =turn[0]", "turn[0]", "card", "turn = Sa", "Sa", "turn" ]
Sa = list(input()) Sb = list(input()) Sc = list(input()) turn = Sa ans ="A" while turn != []: card =turn[0] turn.pop(0) if card =="a": turn =Sa ans ="A" elif card =="b": turn =Sb ans ="B" else: turn =Sc ans ="C" print(ans)
[ 7, 0, 13, 18, 4, 13, 4, 13, 39, 17, 0, 13, 18, 4, 13, 4, 13, 39, 17, 0, 13, 18, 4, 13, 4, 13, 39, 17, 0, 13, 4, 18, 13, 13, 42, 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, 18, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 18, 13, 10, 18, 13, 10, 4, 13 ]
[ [ 106, 2 ], [ 103, 11 ], [ 91, 20 ], [ 94, 29 ], [ 107, 32 ], [ 95, 38 ], [ 98, 38 ], [ 110, 38 ], [ 101, 38 ], [ 107, 42 ], [ 100, 49 ], [ 107, 52 ], [ 95, 56 ], [ 98, 56 ], [ 110, 56 ], [ 101, 56 ], [ 104, 60 ], [ 109, 67 ], [ 104, 70 ], [ 95, 74 ], [ 98, 74 ], [ 110, 74 ], [ 101, 74 ], [ 92, 78 ], [ 97, 85 ], [ 92, 88 ], [ 91, 92 ], [ 94, 95 ], [ 97, 98 ], [ 100, 101 ], [ 103, 104 ], [ 106, 107 ], [ 109, 110 ] ]
[ "Sa = list(input())[::-1]\nSb = list(input())[::-1]\nSc = list(input())[::-1]\n\nnext_turn = Sa.pop()\n\n\nwhile True:\n if next_turn == \"a\":\n if not Sa:\n print(\"A\")\n quit()\n next_turn = Sa.pop()\n elif next_turn == \"b\":\n if not Sb:\n print(\"B\")\n quit()\n next_turn = Sb.pop()\n elif next_turn == \"c\":\n if not Sc:\n print(\"C\")\n quit()\n next_turn = Sc.pop()", "Sa = list(input())[::-1]", "Sa", "list(input())[::-1]", "(input())", "list", "input()", "input", "::-1", "-1", "Sb = list(input())[::-1]", "Sb", "list(input())[::-1]", "(input())", "list", "input()", "input", "::-1", "-1", "Sc = list(input())[::-1]", "Sc", "list(input())[::-1]", "(input())", "list", "input()", "input", "::-1", "-1", "next_turn = Sa.pop()", "next_turn", "Sa.pop()", "Sa.pop", "Sa", "pop", "while True:\n if next_turn == \"a\":\n if not Sa:\n print(\"A\")\n quit()\n next_turn = Sa.pop()\n elif next_turn == \"b\":\n if not Sb:\n print(\"B\")\n quit()\n next_turn = Sb.pop()\n elif next_turn == \"c\":\n if not Sc:\n print(\"C\")\n quit()\n next_turn = Sc.pop()", "True", "if next_turn == \"a\":\n if not Sa:\n print(\"A\")\n quit()\n next_turn = Sa.pop()\n elif next_turn == \"b\":\n if not Sb:\n print(\"B\")\n quit()\n next_turn = Sb.pop()\n elif next_turn == \"c\":\n if not Sc:\n print(\"C\")\n quit()\n next_turn = Sc.pop()", "next_turn == \"a\"", "next_turn", "\"a\"", "if not Sa:\n print(\"A\")\n quit()\n ", "not Sa", "Sa", "print(\"A\")", "print", "\"A\"", "quit()", "quit", "next_turn = Sa.pop()", "next_turn", "Sa.pop()", "Sa.pop", "Sa", "pop", "elif next_turn == \"b\":\n if not Sb:\n print(\"B\")\n quit()\n next_turn = Sb.pop()\n ", "next_turn == \"b\"", "next_turn", "\"b\"", "if not Sb:\n print(\"B\")\n quit()\n ", "not Sb", "Sb", "print(\"B\")", "print", "\"B\"", "quit()", "quit", "next_turn = Sb.pop()", "next_turn", "Sb.pop()", "Sb.pop", "Sb", "pop", "elif next_turn == \"c\":\n if not Sc:\n print(\"C\")\n quit()\n next_turn = Sc.pop()", "next_turn == \"c\"", "next_turn", "\"c\"", "if not Sc:\n print(\"C\")\n quit()\n ", "not Sc", "Sc", "print(\"C\")", "print", "\"C\"", "quit()", "quit", "next_turn = Sc.pop()", "next_turn", "Sc.pop()", "Sc.pop", "Sc", "pop", "Sc = list(input())[::-1]", "list(input())[::-1]", "Sc", "next_turn = Sa.pop()", "Sa.pop()", "next_turn", "next_turn = Sc.pop()", "Sc.pop()", "next_turn", "next_turn = Sa.pop()", "Sa.pop()", "next_turn", "Sb = list(input())[::-1]", "list(input())[::-1]", "Sb", "Sa = list(input())[::-1]", "list(input())[::-1]", "Sa", "next_turn = Sb.pop()", "Sb.pop()", "next_turn" ]
Sa = list(input())[::-1] Sb = list(input())[::-1] Sc = list(input())[::-1] next_turn = Sa.pop() while True: if next_turn == "a": if not Sa: print("A") quit() next_turn = Sa.pop() elif next_turn == "b": if not Sb: print("B") quit() next_turn = Sb.pop() elif next_turn == "c": if not Sc: print("C") quit() next_turn = Sc.pop()
[ 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, 0, 13, 17, 3, 0, 13, 4, 18, 13, 13, 14, 2, 13, 17, 0, 13, 17, 14, 2, 13, 17, 0, 13, 17, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 0, 13, 17, 3, 0, 13, 4, 18, 13, 13, 14, 2, 13, 17, 0, 13, 17, 14, 2, 13, 17, 0, 13, 17, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 0, 13, 17, 3, 0, 13, 4, 18, 13, 13, 14, 2, 13, 17, 0, 13, 17, 14, 2, 13, 17, 0, 13, 17, 4, 13, 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, 4, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13 ]
[ [ 155, 3 ], [ 131, 9 ], [ 149, 15 ], [ 134, 21 ], [ 135, 27 ], [ 177, 27 ], [ 165, 27 ], [ 171, 27 ], [ 147, 27 ], [ 141, 27 ], [ 159, 27 ], [ 156, 33 ], [ 152, 36 ], [ 167, 40 ], [ 156, 43 ], [ 168, 47 ], [ 162, 47 ], [ 174, 47 ], [ 158, 50 ], [ 168, 54 ], [ 162, 54 ], [ 174, 54 ], [ 140, 57 ], [ 141, 61 ], [ 159, 61 ], [ 135, 61 ], [ 177, 61 ], [ 165, 61 ], [ 171, 61 ], [ 147, 61 ], [ 132, 67 ], [ 143, 70 ], [ 173, 74 ], [ 132, 77 ], [ 174, 81 ], [ 168, 81 ], [ 162, 81 ], [ 146, 84 ], [ 174, 88 ], [ 168, 88 ], [ 162, 88 ], [ 170, 91 ], [ 171, 95 ], [ 147, 95 ], [ 141, 95 ], [ 159, 95 ], [ 135, 95 ], [ 177, 95 ], [ 165, 95 ], [ 150, 101 ], [ 137, 104 ], [ 161, 108 ], [ 150, 111 ], [ 162, 115 ], [ 174, 115 ], [ 168, 115 ], [ 164, 118 ], [ 162, 122 ], [ 174, 122 ], [ 168, 122 ], [ 176, 125 ], [ 138, 129 ], [ 144, 129 ], [ 153, 129 ], [ 131, 132 ], [ 134, 135 ], [ 137, 138 ], [ 140, 141 ], [ 143, 144 ], [ 146, 147 ], [ 149, 150 ], [ 152, 153 ], [ 155, 156 ], [ 158, 159 ], [ 161, 162 ], [ 164, 165 ], [ 167, 168 ], [ 170, 171 ], [ 173, 174 ], [ 176, 177 ] ]
[ "#68 B - 3人でカードゲームイージー\nfrom collections import deque\nSa = deque(input())\nSb = deque(input())\nSc = deque(input())\n\nturn = 0\nwhile True:\n if turn == 0:\n if len(Sa) == 0:\n ans = 'A'\n break\n tgt = Sa.popleft()\n if tgt == 'b':\n turn = 1\n elif tgt == 'c':\n turn = 2\n if turn == 1:\n if len(Sb) == 0:\n ans = 'B'\n break\n tgt = Sb.popleft()\n if tgt == 'a':\n turn = 0\n elif tgt == 'c':\n turn = 2\n if turn == 2:\n if len(Sc) == 0:\n ans = 'C'\n break\n tgt = Sc.popleft()\n if tgt == 'a':\n turn = 0\n elif tgt == 'b':\n turn = 1\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", "turn = 0", "turn", "0", "while True:\n if turn == 0:\n if len(Sa) == 0:\n ans = 'A'\n break\n tgt = Sa.popleft()\n if tgt == 'b':\n turn = 1\n elif tgt == 'c':\n turn = 2\n if turn == 1:\n if len(Sb) == 0:\n ans = 'B'\n break\n tgt = Sb.popleft()\n if tgt == 'a':\n turn = 0\n elif tgt == 'c':\n turn = 2\n if turn == 2:\n if len(Sc) == 0:\n ans = 'C'\n break\n tgt = Sc.popleft()\n if tgt == 'a':\n turn = 0\n elif tgt == 'b':\n turn = 1", "True", "if turn == 0:\n if len(Sa) == 0:\n ans = 'A'\n break\n tgt = Sa.popleft()\n if tgt == 'b':\n turn = 1\n elif tgt == 'c':\n turn = 2\n ", "turn == 0", "turn", "0", "if len(Sa) == 0:\n ans = 'A'\n break\n ", "len(Sa) == 0", "len(Sa)", "len", "Sa", "0", "ans = 'A'", "ans", "'A'", "break", "tgt = Sa.popleft()", "tgt", "Sa.popleft()", "Sa.popleft", "Sa", "popleft", "if tgt == 'b':\n turn = 1\n elif tgt == 'c':\n turn = 2\n ", "tgt == 'b'", "tgt", "'b'", "turn = 1", "turn", "1", "elif tgt == 'c':\n turn = 2\n ", "tgt == 'c'", "tgt", "'c'", "turn = 2", "turn", "2", "if turn == 1:\n if len(Sb) == 0:\n ans = 'B'\n break\n tgt = Sb.popleft()\n if tgt == 'a':\n turn = 0\n elif tgt == 'c':\n turn = 2\n ", "turn == 1", "turn", "1", "if len(Sb) == 0:\n ans = 'B'\n break\n ", "len(Sb) == 0", "len(Sb)", "len", "Sb", "0", "ans = 'B'", "ans", "'B'", "break", "tgt = Sb.popleft()", "tgt", "Sb.popleft()", "Sb.popleft", "Sb", "popleft", "if tgt == 'a':\n turn = 0\n elif tgt == 'c':\n turn = 2\n ", "tgt == 'a'", "tgt", "'a'", "turn = 0", "turn", "0", "elif tgt == 'c':\n turn = 2\n ", "tgt == 'c'", "tgt", "'c'", "turn = 2", "turn", "2", "if turn == 2:\n if len(Sc) == 0:\n ans = 'C'\n break\n tgt = Sc.popleft()\n if tgt == 'a':\n turn = 0\n elif tgt == 'b':\n turn = 1", "turn == 2", "turn", "2", "if len(Sc) == 0:\n ans = 'C'\n break\n ", "len(Sc) == 0", "len(Sc)", "len", "Sc", "0", "ans = 'C'", "ans", "'C'", "break", "tgt = Sc.popleft()", "tgt", "Sc.popleft()", "Sc.popleft", "Sc", "popleft", "if tgt == 'a':\n turn = 0\n elif tgt == 'b':\n turn = 1", "tgt == 'a'", "tgt", "'a'", "turn = 0", "turn", "0", "elif tgt == 'b':\n turn = 1", "tgt == 'b'", "tgt", "'b'", "turn = 1", "turn", "1", "print(ans)", "print", "ans", "Sb = deque(input())", "deque(input())", "Sb", "turn = 0", "0", "turn", "ans = 'C'", "'C'", "ans", "turn = 2", "2", "turn", "ans = 'B'", "'B'", "ans", "turn = 0", "0", "turn", "Sc = deque(input())", "deque(input())", "Sc", "ans = 'A'", "'A'", "ans", "Sa = deque(input())", "deque(input())", "Sa", "turn = 1", "1", "turn", "tgt = Sc.popleft()", "Sc.popleft()", "tgt", "turn = 0", "0", "turn", "tgt = Sa.popleft()", "Sa.popleft()", "tgt", "turn = 2", "2", "turn", "tgt = Sb.popleft()", "Sb.popleft()", "tgt", "turn = 1", "1", "turn" ]
#68 B - 3人でカードゲームイージー from collections import deque Sa = deque(input()) Sb = deque(input()) Sc = deque(input()) turn = 0 while True: if turn == 0: if len(Sa) == 0: ans = 'A' break tgt = Sa.popleft() if tgt == 'b': turn = 1 elif tgt == 'c': turn = 2 if turn == 1: if len(Sb) == 0: ans = 'B' break tgt = Sb.popleft() if tgt == 'a': turn = 0 elif tgt == 'c': turn = 2 if turn == 2: if len(Sc) == 0: ans = 'C' break tgt = Sc.popleft() if tgt == 'a': turn = 0 elif tgt == 'b': turn = 1 print(ans)
[ 7, 12, 13, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 23, 13, 41, 28, 13, 4, 13, 17, 4, 18, 39, 31, 4, 13, 39, 17, 0, 13, 13, 13, 13, 4, 13, 4, 18, 13, 13, 10, 13, 13, 10, 13, 13, 10, 12, 13, 10, 13, 13 ]
[ [ 34, 5 ], [ 34, 15 ], [ 34, 25 ], [ 34, 34 ], [ 38, 37 ], [ 70, 50 ], [ 70, 52 ], [ 70, 53 ], [ 68, 55 ], [ 62, 58 ], [ 70, 62 ], [ 70, 65 ], [ 70, 71 ] ]
[ "def check(n):\n if n=='a':\n if len(a)>0: check(a.pop())\n else: print('A')\n elif n=='b':\n if len(b)>0: check(b.pop())\n else: print('B')\n elif n=='c':\n if len(c)>0: check(c.pop())\n else: print('C')\na,b,c=[[*input()][::-1] for _ in range(3)]\ncheck(a.pop())", "def check(n):\n if n=='a':\n if len(a)>0: check(a.pop())\n else: print('A')\n elif n=='b':\n if len(b)>0: check(b.pop())\n else: print('B')\n elif n=='c':\n if len(c)>0: check(c.pop())\n else: print('C')", "check", "if n=='a':\n if len(a)>0: check(a.pop())\n else: print('A')\n elif n=='b':\n if len(b)>0: check(b.pop())\n else: print('B')\n elif n=='c':\n if len(c)>0: check(c.pop())\n else: print('C')", "n=='a'", "n", "'a'", "if len(a)>0: check(a.pop())\n else: print('A')\n ", "len(a)>0", "len(a)", "len", "a", "0", "elif n=='b':\n if len(b)>0: check(b.pop())\n else: print('B')\n ", "n=='b'", "n", "'b'", "if len(b)>0: check(b.pop())\n else: print('B')\n ", "len(b)>0", "len(b)", "len", "b", "0", "elif n=='c':\n if len(c)>0: check(c.pop())\n else: print('C')", "n=='c'", "n", "'c'", "if len(c)>0: check(c.pop())\n else: print('C')", "len(c)>0", "len(c)", "len", "c", "0", "n", "n", "[*input()][::-1] for _ in range(3)", "for _ in range(3)", "_", "range(3)", "range", "3", "for _ in range(3)", "[*input()][::-1]", "[*input()]", "*input()", "input()", "input", "::-1", "-1", "a,b,c=[[*input()][::-1] for _ in range(3)]", "a", "[[*input()][::-1] for _ in range(3)]", "b", "c", "check(a.pop())", "check", "a.pop()", "a.pop", "a", "pop", "a,b,c=[[*input()][::-1] for _ in range(3)]", "[[*input()][::-1] for _ in range(3)]", "a", "b,c=[[*input()][::-1] for _ in range(3)]", "[[*input()][::-1] for _ in range(3)]", "b", "def check(n):\n if n=='a':\n if len(a)>0: check(a.pop())\n else: print('A')\n elif n=='b':\n if len(b)>0: check(b.pop())\n else: print('B')\n elif n=='c':\n if len(c)>0: check(c.pop())\n else: print('C')", "def check(n):\n if n=='a':\n if len(a)>0: check(a.pop())\n else: print('A')\n elif n=='b':\n if len(b)>0: check(b.pop())\n else: print('B')\n elif n=='c':\n if len(c)>0: check(c.pop())\n else: print('C')", "check", "c=[[*input()][::-1] for _ in range(3)]", "[[*input()][::-1] for _ in range(3)]", "c" ]
def check(n): if n=='a': if len(a)>0: check(a.pop()) else: print('A') elif n=='b': if len(b)>0: check(b.pop()) else: print('B') elif n=='c': if len(c)>0: check(c.pop()) else: print('C') a,b,c=[[*input()][::-1] for _ in range(3)] check(a.pop())
[ 7, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 4, 13, 15, 0, 13, 4, 13, 4, 13, 13, 0, 13, 4, 13, 4, 13, 13, 0, 13, 4, 13, 4, 13, 13, 0, 13, 4, 18, 13, 13, 42, 17, 14, 2, 13, 17, 14, 13, 0, 13, 4, 18, 13, 13, 3, 14, 2, 13, 17, 14, 13, 0, 13, 4, 18, 13, 13, 3, 14, 2, 13, 17, 14, 13, 0, 13, 4, 18, 13, 13, 3, 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, 10, 4, 13, 10, 4, 13, 10, 4, 13 ]
[ [ 113, 2 ], [ 98, 6 ], [ 101, 10 ], [ 89, 15 ], [ 114, 20 ], [ 104, 22 ], [ 99, 27 ], [ 95, 29 ], [ 102, 34 ], [ 92, 36 ], [ 90, 39 ], [ 93, 45 ], [ 111, 45 ], [ 108, 45 ], [ 117, 45 ], [ 116, 50 ], [ 90, 53 ], [ 93, 58 ], [ 111, 58 ], [ 108, 58 ], [ 117, 58 ], [ 107, 63 ], [ 105, 66 ], [ 93, 71 ], [ 111, 71 ], [ 108, 71 ], [ 117, 71 ], [ 110, 76 ], [ 96, 79 ], [ 111, 86 ], [ 108, 86 ], [ 117, 86 ], [ 93, 86 ], [ 89, 90 ], [ 92, 93 ], [ 95, 96 ], [ 98, 99 ], [ 101, 102 ], [ 104, 105 ], [ 107, 108 ], [ 110, 111 ], [ 113, 114 ], [ 116, 117 ] ]
[ "a=input()\nb=input()\nc=input()\nfrom collections import deque\nda=deque(list(a))\ndb=deque(list(b))\ndc=deque(list(c))\nnow=da.popleft()\nwhile (1):\n if now==\"a\":\n if da:\n now=da.popleft()\n else:\n break\n elif now==\"b\":\n if db:\n now=db.popleft()\n else:\n break\n elif now==\"c\":\n if dc:\n now=dc.popleft()\n else:\n break\nprint(now.upper())", "a=input()", "a", "input()", "input", "b=input()", "b", "input()", "input", "c=input()", "c", "input()", "input", "from collections import deque", "da=deque(list(a))", "da", "deque(list(a))", "deque", "list(a)", "list", "a", "db=deque(list(b))", "db", "deque(list(b))", "deque", "list(b)", "list", "b", "dc=deque(list(c))", "dc", "deque(list(c))", "deque", "list(c)", "list", "c", "now=da.popleft()", "now", "da.popleft()", "da.popleft", "da", "popleft", "while (1):\n if now==\"a\":\n if da:\n now=da.popleft()\n else:\n break\n elif now==\"b\":\n if db:\n now=db.popleft()\n else:\n break\n elif now==\"c\":\n if dc:\n now=dc.popleft()\n else:\n break", "1", "if now==\"a\":\n if da:\n now=da.popleft()\n else:\n break\n elif now==\"b\":\n if db:\n now=db.popleft()\n else:\n break\n elif now==\"c\":\n if dc:\n now=dc.popleft()\n else:\n break", "now==\"a\"", "now", "\"a\"", "if da:\n now=da.popleft()\n else:\n break\n ", "da", "now=da.popleft()", "now", "da.popleft()", "da.popleft", "da", "popleft", "break", "elif now==\"b\":\n if db:\n now=db.popleft()\n else:\n break\n ", "now==\"b\"", "now", "\"b\"", "if db:\n now=db.popleft()\n else:\n break\n ", "db", "now=db.popleft()", "now", "db.popleft()", "db.popleft", "db", "popleft", "break", "elif now==\"c\":\n if dc:\n now=dc.popleft()\n else:\n break", "now==\"c\"", "now", "\"c\"", "if dc:\n now=dc.popleft()\n else:\n break", "dc", "now=dc.popleft()", "now", "dc.popleft()", "dc.popleft", "dc", "popleft", "break", "print(now.upper())", "print", "now.upper()", "now.upper", "now", "upper", "da=deque(list(a))", "deque(list(a))", "da", "now=da.popleft()", "da.popleft()", "now", "dc=deque(list(c))", "deque(list(c))", "dc", "b=input()", "input()", "b", "c=input()", "input()", "c", "db=deque(list(b))", "deque(list(b))", "db", "now=db.popleft()", "db.popleft()", "now", "now=dc.popleft()", "dc.popleft()", "now", "a=input()", "input()", "a", "now=da.popleft()", "da.popleft()", "now" ]
a=input() b=input() c=input() from collections import deque da=deque(list(a)) db=deque(list(b)) dc=deque(list(c)) now=da.popleft() while (1): if now=="a": if da: now=da.popleft() else: break elif now=="b": if db: now=db.popleft() else: break elif now=="c": if dc: now=dc.popleft() else: break print(now.upper())
[ 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, 42, 17, 14, 2, 13, 17, 14, 2, 13, 4, 13, 13, 4, 13, 17, 4, 13, 0, 13, 18, 13, 13, 0, 13, 17, 14, 2, 13, 17, 14, 2, 13, 4, 13, 13, 4, 13, 17, 4, 13, 0, 13, 18, 13, 13, 0, 13, 17, 14, 2, 13, 4, 13, 13, 4, 13, 17, 4, 13, 0, 13, 18, 13, 13, 0, 13, 17, 10, 4, 13, 10, 18, 13, 10, 4, 13, 10, 17, 13, 10, 18, 13, 10, 18, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13 ]
[ [ 93, 2 ], [ 99, 6 ], [ 129, 10 ], [ 114, 14 ], [ 123, 17 ], [ 120, 20 ], [ 117, 23 ], [ 118, 29 ], [ 106, 29 ], [ 109, 29 ], [ 97, 29 ], [ 115, 33 ], [ 127, 33 ], [ 94, 36 ], [ 96, 43 ], [ 94, 45 ], [ 115, 46 ], [ 127, 46 ], [ 126, 48 ], [ 118, 52 ], [ 106, 52 ], [ 109, 52 ], [ 97, 52 ], [ 124, 56 ], [ 112, 56 ], [ 100, 59 ], [ 108, 66 ], [ 100, 68 ], [ 124, 69 ], [ 112, 69 ], [ 111, 71 ], [ 121, 75 ], [ 103, 75 ], [ 130, 78 ], [ 105, 85 ], [ 130, 87 ], [ 121, 88 ], [ 103, 88 ], [ 102, 90 ], [ 93, 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 ] ]
[ "a = input()\nb = input()\nc = input()\na_cnt = 0\nb_cnt = 0\nc_cnt = 0\nnext_player = \"a\"\nwhile True:\n if next_player == \"a\":\n if a_cnt == len(a):\n print(\"A\")\n exit()\n next_player = a[a_cnt]\n a_cnt += 1\n elif next_player == \"b\":\n if b_cnt == len(b):\n print(\"B\")\n exit()\n next_player = b[b_cnt]\n b_cnt += 1\n else:\n if c_cnt == len(c):\n print(\"C\")\n exit()\n next_player = c[c_cnt]\n c_cnt += 1", "a = input()", "a", "input()", "input", "b = input()", "b", "input()", "input", "c = input()", "c", "input()", "input", "a_cnt = 0", "a_cnt", "0", "b_cnt = 0", "b_cnt", "0", "c_cnt = 0", "c_cnt", "0", "next_player = \"a\"", "next_player", "\"a\"", "while True:\n if next_player == \"a\":\n if a_cnt == len(a):\n print(\"A\")\n exit()\n next_player = a[a_cnt]\n a_cnt += 1\n elif next_player == \"b\":\n if b_cnt == len(b):\n print(\"B\")\n exit()\n next_player = b[b_cnt]\n b_cnt += 1\n else:\n if c_cnt == len(c):\n print(\"C\")\n exit()\n next_player = c[c_cnt]\n c_cnt += 1", "True", "if next_player == \"a\":\n if a_cnt == len(a):\n print(\"A\")\n exit()\n next_player = a[a_cnt]\n a_cnt += 1\n elif next_player == \"b\":\n if b_cnt == len(b):\n print(\"B\")\n exit()\n next_player = b[b_cnt]\n b_cnt += 1\n else:\n if c_cnt == len(c):\n print(\"C\")\n exit()\n next_player = c[c_cnt]\n c_cnt += 1", "next_player == \"a\"", "next_player", "\"a\"", "if a_cnt == len(a):\n print(\"A\")\n exit()\n ", "a_cnt == len(a)", "a_cnt", "len(a)", "len", "a", "print(\"A\")", "print", "\"A\"", "exit()", "exit", "next_player = a[a_cnt]", "next_player", "a[a_cnt]", "a", "a_cnt", "a_cnt += 1", "a_cnt", "1", "elif next_player == \"b\":\n if b_cnt == len(b):\n print(\"B\")\n exit()\n next_player = b[b_cnt]\n b_cnt += 1\n ", "next_player == \"b\"", "next_player", "\"b\"", "if b_cnt == len(b):\n print(\"B\")\n exit()\n ", "b_cnt == len(b)", "b_cnt", "len(b)", "len", "b", "print(\"B\")", "print", "\"B\"", "exit()", "exit", "next_player = b[b_cnt]", "next_player", "b[b_cnt]", "b", "b_cnt", "b_cnt += 1", "b_cnt", "1", "if c_cnt == len(c):\n print(\"C\")\n exit()\n ", "c_cnt == len(c)", "c_cnt", "len(c)", "len", "c", "print(\"C\")", "print", "\"C\"", "exit()", "exit", "next_player = c[c_cnt]", "next_player", "c[c_cnt]", "c", "c_cnt", "c_cnt += 1", "c_cnt", "1", "a = input()", "input()", "a", "next_player = a[a_cnt]", "a[a_cnt]", "next_player", "b = input()", "input()", "b", "c_cnt += 1", "1", "c_cnt", "next_player = c[c_cnt]", "c[c_cnt]", "next_player", "next_player = b[b_cnt]", "b[b_cnt]", "next_player", "b_cnt += 1", "1", "b_cnt", "a_cnt = 0", "0", "a_cnt", "next_player = \"a\"", "\"a\"", "next_player", "c_cnt = 0", "0", "c_cnt", "b_cnt = 0", "0", "b_cnt", "a_cnt += 1", "1", "a_cnt", "c = input()", "input()", "c" ]
a = input() b = input() c = input() a_cnt = 0 b_cnt = 0 c_cnt = 0 next_player = "a" while True: if next_player == "a": if a_cnt == len(a): print("A") exit() next_player = a[a_cnt] a_cnt += 1 elif next_player == "b": if b_cnt == len(b): print("B") exit() next_player = b[b_cnt] b_cnt += 1 else: if c_cnt == len(c): print("C") exit() next_player = c[c_cnt] c_cnt += 1
[ 7, 0, 13, 4, 13, 4, 13, 0, 13, 4, 13, 4, 13, 0, 13, 4, 13, 4, 13, 0, 13, 18, 13, 17, 4, 18, 13, 13, 13, 28, 13, 4, 13, 17, 14, 2, 13, 17, 38, 5, 4, 13, 17, 3, 0, 13, 18, 13, 17, 4, 18, 13, 13, 18, 13, 17, 14, 2, 13, 17, 38, 5, 4, 13, 17, 3, 0, 13, 18, 13, 17, 4, 18, 13, 13, 18, 13, 17, 38, 5, 4, 13, 17, 3, 0, 13, 18, 13, 17, 4, 18, 13, 13, 18, 13, 17, 10, 18, 13, 10, 4, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 4, 13, 10, 4, 13 ]
[ [ 112, 2 ], [ 100, 8 ], [ 115, 14 ], [ 106, 20 ], [ 113, 22 ], [ 113, 26 ], [ 107, 28 ], [ 31, 30 ], [ 107, 36 ], [ 110, 36 ], [ 98, 36 ], [ 104, 36 ], [ 103, 45 ], [ 113, 47 ], [ 113, 51 ], [ 113, 54 ], [ 107, 58 ], [ 110, 58 ], [ 98, 58 ], [ 104, 58 ], [ 97, 67 ], [ 101, 69 ], [ 101, 73 ], [ 101, 76 ], [ 109, 85 ], [ 116, 87 ], [ 116, 91 ], [ 116, 94 ], [ 97, 98 ], [ 100, 101 ], [ 103, 104 ], [ 106, 107 ], [ 109, 110 ], [ 112, 113 ], [ 115, 116 ] ]
[ "SA = list(input())\nSB = list(input())\nSC = list(input())\n\ntmp = SA[0]\nSA.remove(tmp)\nfor i in range(1000):\n if tmp == 'a':\n try:\n tmp = SA[0]\n SA.remove(SA[0])\n except:\n print('A')\n break\n elif tmp == 'b':\n try:\n tmp = SB[0]\n SB.remove(SB[0])\n except:\n print('B')\n break\n else:\n try:\n tmp = SC[0]\n SC.remove(SC[0])\n except:\n print('C')\n break", "SA = list(input())", "SA", "list(input())", "list", "input()", "input", "SB = list(input())", "SB", "list(input())", "list", "input()", "input", "SC = list(input())", "SC", "list(input())", "list", "input()", "input", "tmp = SA[0]", "tmp", "SA[0]", "SA", "0", "SA.remove(tmp)", "SA.remove", "SA", "remove", "tmp", "for i in range(1000):\n if tmp == 'a':\n try:\n tmp = SA[0]\n SA.remove(SA[0])\n except:\n print('A')\n break\n elif tmp == 'b':\n try:\n tmp = SB[0]\n SB.remove(SB[0])\n except:\n print('B')\n break\n else:\n try:\n tmp = SC[0]\n SC.remove(SC[0])\n except:\n print('C')\n break", "i", "range(1000)", "range", "1000", "if tmp == 'a':\n try:\n tmp = SA[0]\n SA.remove(SA[0])\n except:\n print('A')\n break\n elif tmp == 'b':\n try:\n tmp = SB[0]\n SB.remove(SB[0])\n except:\n print('B')\n break\n else:\n try:\n tmp = SC[0]\n SC.remove(SC[0])\n except:\n print('C')\n break", "tmp == 'a'", "tmp", "'a'", "try:\n tmp = SA[0]\n SA.remove(SA[0])\n except:\n print('A')\n break\n ", "except:\n print('A')\n break\n ", "print('A')", "print", "'A'", "break", "tmp = SA[0]", "tmp", "SA[0]", "SA", "0", "SA.remove(SA[0])", "SA.remove", "SA", "remove", "SA[0]", "SA", "0", "elif tmp == 'b':\n try:\n tmp = SB[0]\n SB.remove(SB[0])\n except:\n print('B')\n break\n ", "tmp == 'b'", "tmp", "'b'", "try:\n tmp = SB[0]\n SB.remove(SB[0])\n except:\n print('B')\n break\n ", "except:\n print('B')\n break\n ", "print('B')", "print", "'B'", "break", "tmp = SB[0]", "tmp", "SB[0]", "SB", "0", "SB.remove(SB[0])", "SB.remove", "SB", "remove", "SB[0]", "SB", "0", "try:\n tmp = SC[0]\n SC.remove(SC[0])\n except:\n print('C')\n break", "except:\n print('C')\n break", "print('C')", "print", "'C'", "break", "tmp = SC[0]", "tmp", "SC[0]", "SC", "0", "SC.remove(SC[0])", "SC.remove", "SC", "remove", "SC[0]", "SC", "0", "tmp = SB[0]", "SB[0]", "tmp", "SB = list(input())", "list(input())", "SB", "tmp = SA[0]", "SA[0]", "tmp", "tmp = SA[0]", "SA[0]", "tmp", "tmp = SC[0]", "SC[0]", "tmp", "SA = list(input())", "list(input())", "SA", "SC = list(input())", "list(input())", "SC" ]
SA = list(input()) SB = list(input()) SC = list(input()) tmp = SA[0] SA.remove(tmp) for i in range(1000): if tmp == 'a': try: tmp = SA[0] SA.remove(SA[0]) except: print('A') break elif tmp == 'b': try: tmp = SB[0] SB.remove(SB[0]) except: print('B') break else: try: tmp = SC[0] SC.remove(SC[0]) except: print('C') break
[ 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, 42, 17, 14, 2, 13, 17, 14, 2, 13, 4, 13, 13, 4, 13, 17, 3, 0, 13, 18, 13, 13, 0, 13, 17, 14, 2, 13, 17, 14, 2, 13, 4, 13, 13, 4, 13, 17, 3, 0, 13, 18, 13, 13, 0, 13, 17, 14, 2, 13, 17, 14, 2, 13, 4, 13, 13, 4, 13, 17, 3, 0, 13, 18, 13, 13, 0, 13, 17, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 18, 13, 10, 4, 13, 10, 18, 13, 10, 4, 13, 10, 17, 13, 10, 18, 13, 10, 17, 13 ]
[ [ 121, 2 ], [ 115, 6 ], [ 109, 10 ], [ 103, 14 ], [ 100, 17 ], [ 124, 20 ], [ 106, 23 ], [ 107, 29 ], [ 113, 29 ], [ 128, 29 ], [ 119, 29 ], [ 104, 33 ], [ 95, 33 ], [ 122, 36 ], [ 118, 42 ], [ 122, 44 ], [ 104, 45 ], [ 95, 45 ], [ 94, 47 ], [ 107, 51 ], [ 113, 51 ], [ 128, 51 ], [ 119, 51 ], [ 101, 55 ], [ 131, 55 ], [ 116, 58 ], [ 127, 64 ], [ 116, 66 ], [ 101, 67 ], [ 131, 67 ], [ 130, 69 ], [ 107, 73 ], [ 113, 73 ], [ 128, 73 ], [ 119, 73 ], [ 125, 77 ], [ 98, 77 ], [ 110, 80 ], [ 112, 86 ], [ 110, 88 ], [ 125, 89 ], [ 98, 89 ], [ 97, 91 ], [ 94, 95 ], [ 97, 98 ], [ 100, 101 ], [ 103, 104 ], [ 106, 107 ], [ 109, 110 ], [ 112, 113 ], [ 115, 116 ], [ 118, 119 ], [ 121, 122 ], [ 124, 125 ], [ 127, 128 ], [ 130, 131 ] ]
[ "a=input()\nb=input()\nc=input()\ni=0\nj=0\nk=0\nt='a'\nwhile 1:\n if t=='a':\n if i==len(a):\n print('A')\n break\n t=a[i]\n i+=1\n elif t=='b':\n if j==len(b):\n print('B')\n break\n t=b[j]\n j+=1\n elif t=='c':\n if k==len(c):\n print('C')\n break\n t=c[k]\n k+=1", "a=input()", "a", "input()", "input", "b=input()", "b", "input()", "input", "c=input()", "c", "input()", "input", "i=0", "i", "0", "j=0", "j", "0", "k=0", "k", "0", "t='a'", "t", "'a'", "while 1:\n if t=='a':\n if i==len(a):\n print('A')\n break\n t=a[i]\n i+=1\n elif t=='b':\n if j==len(b):\n print('B')\n break\n t=b[j]\n j+=1\n elif t=='c':\n if k==len(c):\n print('C')\n break\n t=c[k]\n k+=1", "1", "if t=='a':\n if i==len(a):\n print('A')\n break\n t=a[i]\n i+=1\n elif t=='b':\n if j==len(b):\n print('B')\n break\n t=b[j]\n j+=1\n elif t=='c':\n if k==len(c):\n print('C')\n break\n t=c[k]\n k+=1", "t=='a'", "t", "'a'", "if i==len(a):\n print('A')\n break\n ", "i==len(a)", "i", "len(a)", "len", "a", "print('A')", "print", "'A'", "break", "t=a[i]", "t", "a[i]", "a", "i", "i+=1", "i", "1", "elif t=='b':\n if j==len(b):\n print('B')\n break\n t=b[j]\n j+=1\n ", "t=='b'", "t", "'b'", "if j==len(b):\n print('B')\n break\n ", "j==len(b)", "j", "len(b)", "len", "b", "print('B')", "print", "'B'", "break", "t=b[j]", "t", "b[j]", "b", "j", "j+=1", "j", "1", "elif t=='c':\n if k==len(c):\n print('C')\n break\n t=c[k]\n k+=1", "t=='c'", "t", "'c'", "if k==len(c):\n print('C')\n break\n ", "k==len(c)", "k", "len(c)", "len", "c", "print('C')", "print", "'C'", "break", "t=c[k]", "t", "c[k]", "c", "k", "k+=1", "k", "1", "i+=1", "1", "i", "k+=1", "1", "k", "j=0", "0", "j", "i=0", "0", "i", "t='a'", "'a'", "t", "c=input()", "input()", "c", "t=c[k]", "c[k]", "t", "b=input()", "input()", "b", "t=a[i]", "a[i]", "t", "a=input()", "input()", "a", "k=0", "0", "k", "t=b[j]", "b[j]", "t", "j+=1", "1", "j" ]
a=input() b=input() c=input() i=0 j=0 k=0 t='a' while 1: if t=='a': if i==len(a): print('A') break t=a[i] i+=1 elif t=='b': if j==len(b): print('B') break t=b[j] j+=1 elif t=='c': if k==len(c): print('C') break t=c[k] k+=1
[ 7, 15, 13, 15, 12, 13, 12, 13, 0, 13, 4, 13, 4, 13, 0, 13, 4, 13, 4, 13, 0, 13, 4, 13, 4, 13, 0, 13, 21, 22, 17, 13, 22, 17, 13, 22, 17, 13, 0, 13, 17, 42, 18, 13, 13, 0, 13, 4, 18, 18, 13, 13, 13, 4, 13, 4, 18, 13, 13, 13, 14, 2, 13, 17, 4, 13, 10, 12, 13, 10, 12, 13 ]
[ [ 10, 9 ], [ 68, 13 ], [ 16, 15 ], [ 68, 19 ], [ 22, 21 ], [ 68, 25 ], [ 28, 27 ], [ 40, 39 ], [ 27, 43 ], [ 39, 44 ], [ 46, 44 ], [ 47, 46 ], [ 27, 50 ], [ 39, 51 ], [ 46, 51 ], [ 46, 59 ], [ 39, 59 ], [ 71, 65 ] ]
[ "import sys\nfrom collections import deque\ndef input(): return sys.stdin.readline().strip()\n\ndef main():\n a = deque(input())\n b = deque(input())\n c = deque(input())\n d = {'a': a, 'b': b, 'c': c}\n turn = 'a'\n while d[turn]:\n turn = d[turn].popleft()\n print(str.upper(turn))\n\n\n\nif __name__ == \"__main__\":\n main()", "import sys", "sys", "from collections import deque", "def input(): return sys.stdin.readline().strip()", "input", "def main():\n a = deque(input())\n b = deque(input())\n c = deque(input())\n d = {'a': a, 'b': b, 'c': c}\n turn = 'a'\n while d[turn]:\n turn = d[turn].popleft()\n print(str.upper(turn))", "main", "a = deque(input())", "a", "deque(input())", "deque", "input()", "input", "b = deque(input())", "b", "deque(input())", "deque", "input()", "input", "c = deque(input())", "c", "deque(input())", "deque", "input()", "input", "d = {'a': a, 'b': b, 'c': c}", "d", "{'a': a, 'b': b, 'c': c}", "'a'", "'a'", "a", "'b'", "'b'", "b", "'c'", "'c'", "c", "turn = 'a'", "turn", "'a'", "while d[turn]:\n turn = d[turn].popleft()\n ", "d[turn]", "d", "turn", "turn = d[turn].popleft()", "turn", "d[turn].popleft()", "[turn].popleft", "[turn]", "d", "turn", "popleft", "print(str.upper(turn))", "print", "str.upper(turn)", "str.upper", "str", "upper", "turn", "if __name__ == \"__main__\":\n main()", "__name__ == \"__main__\"", "__name__", "\"__main__\"", "main()", "main", "def input(): return sys.stdin.readline().strip()", "def input(): return sys.stdin.readline().strip()", "input", "def main():\n a = deque(input())\n b = deque(input())\n c = deque(input())\n d = {'a': a, 'b': b, 'c': c}\n turn = 'a'\n while d[turn]:\n turn = d[turn].popleft()\n print(str.upper(turn))", "def main():\n a = deque(input())\n b = deque(input())\n c = deque(input())\n d = {'a': a, 'b': b, 'c': c}\n turn = 'a'\n while d[turn]:\n turn = d[turn].popleft()\n print(str.upper(turn))", "main" ]
import sys from collections import deque def input(): return sys.stdin.readline().strip() def main(): a = deque(input()) b = deque(input()) c = deque(input()) d = {'a': a, 'b': b, 'c': c} turn = 'a' while d[turn]: turn = d[turn].popleft() print(str.upper(turn)) if __name__ == "__main__": main()
[ 7, 6, 13, 12, 13, 0, 18, 13, 13, 13, 0, 18, 13, 13, 13, 23, 13, 23, 13, 23, 13, 12, 13, 14, 2, 4, 13, 18, 13, 13, 17, 29, 18, 13, 13, 0, 13, 4, 18, 18, 13, 13, 13, 17, 14, 2, 13, 17, 29, 4, 13, 13, 14, 2, 13, 17, 29, 4, 13, 13, 14, 2, 13, 17, 29, 4, 13, 13, 23, 13, 0, 13, 4, 13, 17, 4, 13, 4, 13, 0, 13, 4, 13, 17, 4, 13, 4, 13, 0, 13, 4, 13, 17, 4, 13, 4, 13, 4, 13, 4, 13, 13, 10, 12, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 6, 13 ]
[ [ 9, 6 ], [ 16, 7 ], [ 18, 8 ], [ 18, 9 ], [ 14, 11 ], [ 16, 12 ], [ 20, 13 ], [ 20, 14 ], [ 16, 16 ], [ 18, 18 ], [ 20, 20 ], [ 69, 28 ], [ 69, 33 ], [ 37, 36 ], [ 69, 40 ], [ 36, 46 ], [ 36, 54 ], [ 36, 62 ], [ 69, 69 ], [ 106, 71 ], [ 109, 80 ], [ 112, 89 ], [ 104, 100 ], [ 107, 101 ], [ 106, 107 ], [ 109, 110 ], [ 112, 113 ] ]
[ "class Player:\n def __init__(self,name,hands):\n self.name=name\n self.hands=hands\n\ndef discard(player):\n if len(player.hands)==0:\n return player.name\n tmp=player.hands.pop(0)\n if tmp==\"a\":\n return discard(A)\n if tmp==\"b\":\n return discard(B)\n if tmp==\"c\":\n return discard(C)\n\n\nA=Player(\"A\",list(input()))\nB=Player(\"B\",list(input()))\nC=Player(\"C\",list(input()))\nprint(discard(A))", "class Player:\n def __init__(self,name,hands):\n self.name=name\n self.hands=hands", "Player", "def __init__(self,name,hands):\n self.name=name\n self.hands=hands", "__init__", "self.name=name", "self.name", "self", "name", "name", "self.hands=hands", "self.hands", "self", "hands", "hands", "self", "self", "name", "name", "hands", "hands", "def discard(player):\n if len(player.hands)==0:\n return player.name\n tmp=player.hands.pop(0)\n if tmp==\"a\":\n return discard(A)\n if tmp==\"b\":\n return discard(B)\n if tmp==\"c\":\n return discard(C)", "discard", "if len(player.hands)==0:\n return player.name\n ", "len(player.hands)==0", "len(player.hands)", "len", "player.hands", "player", "hands", "0", "return player.name", "player.name", "player", "name", "tmp=player.hands.pop(0)", "tmp", "player.hands.pop(0)", "player.hands.pop", "player.hands", "player", "hands", "pop", "0", "if tmp==\"a\":\n return discard(A)\n ", "tmp==\"a\"", "tmp", "\"a\"", "return discard(A)", "discard(A)", "discard", "A", "if tmp==\"b\":\n return discard(B)\n ", "tmp==\"b\"", "tmp", "\"b\"", "return discard(B)", "discard(B)", "discard", "B", "if tmp==\"c\":\n return discard(C)", "tmp==\"c\"", "tmp", "\"c\"", "return discard(C)", "discard(C)", "discard", "C", "player", "player", "A=Player(\"A\",list(input()))", "A", "Player(\"A\",list(input()))", "Player", "\"A\"", "list(input())", "list", "input()", "input", "B=Player(\"B\",list(input()))", "B", "Player(\"B\",list(input()))", "Player", "\"B\"", "list(input())", "list", "input()", "input", "C=Player(\"C\",list(input()))", "C", "Player(\"C\",list(input()))", "Player", "\"C\"", "list(input())", "list", "input()", "input", "print(discard(A))", "print", "discard(A)", "discard", "A", "def discard(player):\n if len(player.hands)==0:\n return player.name\n tmp=player.hands.pop(0)\n if tmp==\"a\":\n return discard(A)\n if tmp==\"b\":\n return discard(B)\n if tmp==\"c\":\n return discard(C)", "def discard(player):\n if len(player.hands)==0:\n return player.name\n tmp=player.hands.pop(0)\n if tmp==\"a\":\n return discard(A)\n if tmp==\"b\":\n return discard(B)\n if tmp==\"c\":\n return discard(C)", "discard", "A=Player(\"A\",list(input()))", "Player(\"A\",list(input()))", "A", "B=Player(\"B\",list(input()))", "Player(\"B\",list(input()))", "B", "C=Player(\"C\",list(input()))", "Player(\"C\",list(input()))", "C", "class Player:\n def __init__(self,name,hands):\n self.name=name\n self.hands=hands", "class Player:\n def __init__(self,name,hands):\n self.name=name\n self.hands=hands", "Player" ]
class Player: def __init__(self,name,hands): self.name=name self.hands=hands def discard(player): if len(player.hands)==0: return player.name tmp=player.hands.pop(0) if tmp=="a": return discard(A) if tmp=="b": return discard(B) if tmp=="c": return discard(C) A=Player("A",list(input())) B=Player("B",list(input())) C=Player("C",list(input())) print(discard(A))
[ 7, 15, 12, 13, 14, 4, 13, 17, 0, 13, 4, 13, 17, 29, 4, 18, 13, 13, 29, 4, 13, 13, 13, 13, 13, 23, 13, 23, 13, 23, 13, 23, 13, 12, 13, 0, 13, 4, 13, 4, 13, 13, 0, 13, 4, 13, 4, 13, 13, 0, 13, 4, 13, 4, 13, 13, 29, 4, 13, 4, 18, 13, 13, 13, 13, 13, 23, 13, 23, 13, 23, 13, 12, 13, 41, 28, 13, 4, 13, 17, 4, 4, 13, 0, 13, 13, 13, 13, 4, 13, 4, 13, 13, 13, 13, 14, 2, 13, 17, 4, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13 ]
[ [ 10, 9 ], [ 26, 16 ], [ 9, 21 ], [ 26, 21 ], [ 28, 22 ], [ 30, 23 ], [ 32, 24 ], [ 26, 26 ], [ 28, 28 ], [ 30, 30 ], [ 32, 32 ], [ 37, 36 ], [ 67, 41 ], [ 44, 43 ], [ 69, 48 ], [ 51, 50 ], [ 71, 55 ], [ 106, 58 ], [ 36, 61 ], [ 36, 63 ], [ 43, 64 ], [ 50, 65 ], [ 67, 67 ], [ 69, 69 ], [ 71, 71 ], [ 77, 76 ], [ 85, 84 ], [ 85, 86 ], [ 85, 87 ], [ 109, 91 ], [ 84, 92 ], [ 86, 93 ], [ 87, 94 ], [ 103, 100 ] ]
[ "from collections import deque\n\n\ndef discard(c: str, da: deque, db: deque, dc: deque) -> str:\n if eval(f'len(d{c})'):\n c = eval(f'd{c}.popleft()')\n else:\n return c.upper()\n\n return discard(c, da, db, dc)\n\n\ndef answer(sa: str, sb: str, sc: str) -> str:\n deque_a = deque(list(sa))\n deque_b = deque(list(sb))\n deque_c = deque(list(sc))\n return discard(deque_a.popleft(), deque_a, deque_b, deque_c)\n\n\ndef main():\n sa, sb, sc = [input() for _ in range(3)]\n print(answer(sa, sb, sc))\n\n\nif __name__ == '__main__':\n main()", "from collections import deque", "def discard(c: str, da: deque, db: deque, dc: deque) -> str:\n if eval(f'len(d{c})'):\n c = eval(f'd{c}.popleft()')\n else:\n return c.upper()\n\n return discard(c, da, db, dc)", "discard", "if eval(f'len(d{c})'):\n c = eval(f'd{c}.popleft()')\n else:\n return c.upper()\n\n ", "eval(f'len(d{c})')", "eval", "f'len(d{c})'", "c = eval(f'd{c}.popleft()')", "c", "eval(f'd{c}.popleft()')", "eval", "f'd{c}.popleft()'", "return c.upper()", "c.upper()", "c.upper", "c", "upper", "return discard(c, da, db, dc)", "discard(c, da, db, dc)", "discard", "c", "da", "db", "dc", "c: str", "c", "da: deque", "da", "db: deque", "db", "dc: deque", "dc", "def answer(sa: str, sb: str, sc: str) -> str:\n deque_a = deque(list(sa))\n deque_b = deque(list(sb))\n deque_c = deque(list(sc))\n return discard(deque_a.popleft(), deque_a, deque_b, deque_c)", "answer", "deque_a = deque(list(sa))", "deque_a", "deque(list(sa))", "deque", "list(sa)", "list", "sa", "deque_b = deque(list(sb))", "deque_b", "deque(list(sb))", "deque", "list(sb)", "list", "sb", "deque_c = deque(list(sc))", "deque_c", "deque(list(sc))", "deque", "list(sc)", "list", "sc", "return discard(deque_a.popleft(), deque_a, deque_b, deque_c)", "discard(deque_a.popleft(), deque_a, deque_b, deque_c)", "discard", "deque_a.popleft()", "deque_a.popleft", "deque_a", "popleft", "deque_a", "deque_b", "deque_c", "sa: str", "sa", "sb: str", "sb", "sc: str", "sc", "def main():\n sa, sb, sc = [input() for _ in range(3)]\n print(answer(sa, sb, sc))", "main", "input() for _ in range(3)", "for _ in range(3)", "_", "range(3)", "range", "3", "for _ in range(3)", "input()", "input", "sa, sb, sc = [input() for _ in range(3)]", "sa", "[input() for _ in range(3)]", "sb", "sc", "print(answer(sa, sb, sc))", "print", "answer(sa, sb, sc)", "answer", "sa", "sb", "sc", "if __name__ == '__main__':\n main()", "__name__ == '__main__'", "__name__", "'__main__'", "main()", "main", "def main():\n sa, sb, sc = [input() for _ in range(3)]\n print(answer(sa, sb, sc))", "def main():\n sa, sb, sc = [input() for _ in range(3)]\n print(answer(sa, sb, sc))", "main", "def discard(c: str, da: deque, db: deque, dc: deque) -> str:\n if eval(f'len(d{c})'):\n c = eval(f'd{c}.popleft()')\n else:\n return c.upper()\n\n return discard(c, da, db, dc)", "def discard(c: str, da: deque, db: deque, dc: deque) -> str:\n if eval(f'len(d{c})'):\n c = eval(f'd{c}.popleft()')\n else:\n return c.upper()\n\n return discard(c, da, db, dc)", "discard", "def answer(sa: str, sb: str, sc: str) -> str:\n deque_a = deque(list(sa))\n deque_b = deque(list(sb))\n deque_c = deque(list(sc))\n return discard(deque_a.popleft(), deque_a, deque_b, deque_c)", "def answer(sa: str, sb: str, sc: str) -> str:\n deque_a = deque(list(sa))\n deque_b = deque(list(sb))\n deque_c = deque(list(sc))\n return discard(deque_a.popleft(), deque_a, deque_b, deque_c)", "answer" ]
from collections import deque def discard(c: str, da: deque, db: deque, dc: deque) -> str: if eval(f'len(d{c})'): c = eval(f'd{c}.popleft()') else: return c.upper() return discard(c, da, db, dc) def answer(sa: str, sb: str, sc: str) -> str: deque_a = deque(list(sa)) deque_b = deque(list(sb)) deque_c = deque(list(sc)) return discard(deque_a.popleft(), deque_a, deque_b, deque_c) def main(): sa, sb, sc = [input() for _ in range(3)] print(answer(sa, sb, sc)) if __name__ == '__main__': main()
[ 7, 41, 28, 13, 4, 13, 17, 4, 4, 13, 0, 13, 13, 0, 13, 17, 0, 13, 17, 42, 17, 14, 2, 13, 17, 14, 2, 13, 17, 14, 2, 18, 13, 13, 17, 4, 13, 4, 13, 2, 4, 13, 13, 2, 4, 13, 17, 4, 13, 17, 4, 13, 0, 13, 18, 18, 13, 13, 17, 0, 18, 13, 13, 18, 18, 13, 13, 39, 17, 10, 18, 13, 10, 13, 13, 10, 17, 13, 10, 17, 13 ]
[ [ 4, 3 ], [ 73, 11 ], [ 76, 14 ], [ 79, 17 ], [ 80, 23 ], [ 71, 23 ], [ 80, 27 ], [ 71, 27 ], [ 60, 31 ], [ 74, 32 ], [ 77, 33 ], [ 80, 42 ], [ 71, 42 ], [ 70, 53 ], [ 60, 55 ], [ 74, 56 ], [ 77, 57 ], [ 63, 60 ], [ 74, 61 ], [ 77, 62 ], [ 60, 64 ], [ 74, 65 ], [ 77, 66 ], [ 70, 71 ], [ 73, 74 ], [ 76, 77 ], [ 79, 80 ] ]
[ "s = [input() for i in range(3)]\ndex = 0\nnext = 'a'\nwhile True:\n if next == 'a': dex = 0\n elif next == 'b': dex = 1\n else: dex = 2\n if s[dex] == \"\":\n print(chr(ord(next) - (ord('a')-ord('A'))))\n exit()\n next = s[dex][0]\n s[dex] = s[dex][1:]", "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)]", "dex = 0", "dex", "0", "next = 'a'", "next", "'a'", "while True:\n if next == 'a': dex = 0\n elif next == 'b': dex = 1\n else: dex = 2\n if s[dex] == \"\":\n print(chr(ord(next) - (ord('a')-ord('A'))))\n exit()\n next = s[dex][0]\n s[dex] = s[dex][1:]", "True", "if next == 'a': dex = 0\n elif next == 'b': dex = 1\n else: dex = 2\n ", "next == 'a'", "next", "'a'", "elif next == 'b': dex = 1\n ", "next == 'b'", "next", "'b'", "if s[dex] == \"\":\n print(chr(ord(next) - (ord('a')-ord('A'))))\n exit()\n ", "s[dex] == \"\"", "s[dex]", "s", "dex", "\"\"", "print(chr(ord(next) - (ord('a')-ord('A'))))", "print", "chr(ord(next) - (ord('a')-ord('A')))", "chr", "ord(next) - (ord('a')-ord('A'))", "ord(next)", "ord", "next", "ord('a')-ord('A')", "ord('a')", "ord", "'a'", "ord('A')", "ord", "'A'", "exit()", "exit", "next = s[dex][0]", "next", "s[dex][0]", "[dex]", "s", "dex", "0", "s[dex] = s[dex][1:]", "s[dex]", "s", "dex", "s[dex][1:]", "[dex]", "s", "dex", "1:", "1", "next = s[dex][0]", "s[dex][0]", "next", "s = [input() for i in range(3)]", "[input() for i in range(3)]", "s", "dex = 0", "0", "dex", "next = 'a'", "'a'", "next" ]
s = [input() for i in range(3)] dex = 0 next = 'a' while True: if next == 'a': dex = 0 elif next == 'b': dex = 1 else: dex = 2 if s[dex] == "": print(chr(ord(next) - (ord('a')-ord('A')))) exit() next = s[dex][0] s[dex] = s[dex][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, 40, 2, 13, 17, 14, 2, 13, 17, 0, 13, 18, 13, 39, 17, 0, 13, 18, 13, 39, 17, 0, 13, 17, 14, 2, 13, 17, 0, 13, 18, 13, 39, 17, 0, 13, 18, 13, 39, 17, 0, 13, 17, 0, 13, 18, 13, 39, 17, 0, 13, 18, 13, 39, 17, 0, 13, 17, 4, 13, 13, 10, 17, 13, 10, 18, 13, 10, 17, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 17, 13, 10, 4, 13, 10, 18, 13, 10, 4, 13, 10, 18, 13, 10, 4, 13, 10, 18, 13 ]
[ [ 116, 2 ], [ 122, 6 ], [ 110, 10 ], [ 89, 14 ], [ 117, 16 ], [ 95, 19 ], [ 117, 21 ], [ 90, 27 ], [ 114, 27 ], [ 102, 27 ], [ 99, 27 ], [ 90, 31 ], [ 114, 31 ], [ 102, 31 ], [ 99, 31 ], [ 98, 34 ], [ 96, 36 ], [ 117, 36 ], [ 105, 36 ], [ 104, 40 ], [ 96, 42 ], [ 117, 42 ], [ 105, 42 ], [ 92, 46 ], [ 90, 50 ], [ 114, 50 ], [ 102, 50 ], [ 99, 50 ], [ 101, 53 ], [ 123, 55 ], [ 120, 55 ], [ 119, 59 ], [ 123, 61 ], [ 120, 61 ], [ 86, 65 ], [ 113, 68 ], [ 111, 70 ], [ 126, 70 ], [ 125, 74 ], [ 111, 76 ], [ 126, 76 ], [ 107, 80 ], [ 108, 84 ], [ 87, 84 ], [ 93, 84 ], [ 86, 87 ], [ 89, 90 ], [ 92, 93 ], [ 95, 96 ], [ 98, 99 ], [ 101, 102 ], [ 104, 105 ], [ 107, 108 ], [ 110, 111 ], [ 113, 114 ], [ 116, 117 ], [ 119, 120 ], [ 122, 123 ], [ 125, 126 ] ]
[ "SA = input()\nSB = input()\nSC = input()\nR = SA[0]\nSA = SA[1:]\nwhile not R == \"\":\n if R == \"a\":\n R = SA[:1]\n SA = SA[1:]\n E = \"A\"\n elif R == \"b\":\n R = SB[:1]\n SB = SB[1:]\n E = \"B\"\n else:\n R = SC[:1]\n SC = SC[1:]\n E = \"C\"\nprint(E)", "SA = input()", "SA", "input()", "input", "SB = input()", "SB", "input()", "input", "SC = input()", "SC", "input()", "input", "R = SA[0]", "R", "SA[0]", "SA", "0", "SA = SA[1:]", "SA", "SA[1:]", "SA", "1:", "1", "while not R == \"\":\n if R == \"a\":\n R = SA[:1]\n SA = SA[1:]\n E = \"A\"\n elif R == \"b\":\n R = SB[:1]\n SB = SB[1:]\n E = \"B\"\n else:\n R = SC[:1]\n SC = SC[1:]\n E = \"C\"", "not R == \"\"", "R == \"\"", "R", "\"\"", "if R == \"a\":\n R = SA[:1]\n SA = SA[1:]\n E = \"A\"\n elif R == \"b\":\n R = SB[:1]\n SB = SB[1:]\n E = \"B\"\n else:\n R = SC[:1]\n SC = SC[1:]\n E = \"C\"", "R == \"a\"", "R", "\"a\"", "R = SA[:1]", "R", "SA[:1]", "SA", ":1", "1", "SA = SA[1:]", "SA", "SA[1:]", "SA", "1:", "1", "E = \"A\"", "E", "\"A\"", "elif R == \"b\":\n R = SB[:1]\n SB = SB[1:]\n E = \"B\"\n ", "R == \"b\"", "R", "\"b\"", "R = SB[:1]", "R", "SB[:1]", "SB", ":1", "1", "SB = SB[1:]", "SB", "SB[1:]", "SB", "1:", "1", "E = \"B\"", "E", "\"B\"", "R = SC[:1]", "R", "SC[:1]", "SC", ":1", "1", "SC = SC[1:]", "SC", "SC[1:]", "SC", "1:", "1", "E = \"C\"", "E", "\"C\"", "print(E)", "print", "E", "E = \"B\"", "\"B\"", "E", "R = SA[0]", "SA[0]", "R", "E = \"A\"", "\"A\"", "E", "SA = SA[1:]", "SA[1:]", "SA", "R = SA[:1]", "SA[:1]", "R", "R = SB[:1]", "SB[:1]", "R", "SA = SA[1:]", "SA[1:]", "SA", "E = \"C\"", "\"C\"", "E", "SC = input()", "input()", "SC", "R = SC[:1]", "SC[:1]", "R", "SA = input()", "input()", "SA", "SB = SB[1:]", "SB[1:]", "SB", "SB = input()", "input()", "SB", "SC = SC[1:]", "SC[1:]", "SC" ]
SA = input() SB = input() SC = input() R = SA[0] SA = SA[1:] while not R == "": if R == "a": R = SA[:1] SA = SA[1:] E = "A" elif R == "b": R = SB[:1] SB = SB[1:] E = "B" else: R = SC[:1] SC = SC[1:] E = "C" print(E)
[ 7, 41, 28, 13, 4, 13, 17, 4, 4, 13, 4, 13, 0, 13, 13, 0, 13, 17, 42, 17, 14, 2, 13, 17, 14, 2, 4, 13, 18, 13, 17, 17, 3, 14, 2, 13, 17, 14, 2, 4, 13, 18, 13, 17, 17, 3, 14, 2, 4, 13, 18, 13, 17, 17, 3, 0, 13, 2, 4, 13, 4, 18, 18, 13, 13, 13, 17, 4, 13, 17, 14, 2, 13, 17, 4, 13, 17, 14, 2, 13, 17, 4, 13, 17, 4, 13, 17, 10, 13, 13, 10, 17, 13, 10, 2, 13 ]
[ [ 4, 3 ], [ 88, 13 ], [ 91, 16 ], [ 92, 22 ], [ 95, 22 ], [ 89, 29 ], [ 92, 35 ], [ 95, 35 ], [ 89, 42 ], [ 89, 51 ], [ 94, 56 ], [ 89, 63 ], [ 92, 64 ], [ 95, 64 ], [ 95, 72 ], [ 92, 72 ], [ 95, 79 ], [ 92, 79 ], [ 88, 89 ], [ 91, 92 ], [ 94, 95 ] ]
[ "check=[list(input()) for i in range(3)]\ncur=0\nwhile True:\n if cur==0:\n if len(check[0])==0:\n break\n elif cur==1:\n if len(check[1])==0:\n break\n else:\n if len(check[2])==0:\n break\n cur=ord(check[cur].pop(0))-ord(\"a\")\nif cur==0:\n print(\"A\")\nelif cur==1:\n print(\"B\")\nelse:\n print(\"C\")", "list(input()) for i in range(3)", "for i in range(3)", "i", "range(3)", "range", "3", "for i in range(3)", "list(input())", "list", "input()", "input", "check=[list(input()) for i in range(3)]", "check", "[list(input()) for i in range(3)]", "cur=0", "cur", "0", "while True:\n if cur==0:\n if len(check[0])==0:\n break\n elif cur==1:\n if len(check[1])==0:\n break\n else:\n if len(check[2])==0:\n break\n cur=ord(check[cur].pop(0))-ord(\"a\")", "True", "if cur==0:\n if len(check[0])==0:\n break\n elif cur==1:\n if len(check[1])==0:\n break\n else:\n if len(check[2])==0:\n break\n ", "cur==0", "cur", "0", "if len(check[0])==0:\n break\n ", "len(check[0])==0", "len(check[0])", "len", "check[0]", "check", "0", "0", "break", "elif cur==1:\n if len(check[1])==0:\n break\n ", "cur==1", "cur", "1", "if len(check[1])==0:\n break\n ", "len(check[1])==0", "len(check[1])", "len", "check[1]", "check", "1", "0", "break", "if len(check[2])==0:\n break\n ", "len(check[2])==0", "len(check[2])", "len", "check[2]", "check", "2", "0", "break", "cur=ord(check[cur].pop(0))-ord(\"a\")", "cur", "ord(check[cur].pop(0))-ord(\"a\")", "ord(check[cur].pop(0))", "ord", "check[cur].pop(0)", "[cur].pop", "[cur]", "check", "cur", "pop", "0", "ord(\"a\")", "ord", "\"a\"", "if cur==0:\n print(\"A\")\nelif cur==1:\n print(\"B\")\nelse:\n print(\"C\")", "cur==0", "cur", "0", "print(\"A\")", "print", "\"A\"", "elif cur==1:\n print(\"B\")", "cur==1", "cur", "1", "print(\"B\")", "print", "\"B\"", "print(\"C\")", "print", "\"C\"", "check=[list(input()) for i in range(3)]", "[list(input()) for i in range(3)]", "check", "cur=0", "0", "cur", "cur=ord(check[cur].pop(0))-ord(\"a\")", "ord(check[cur].pop(0))-ord(\"a\")", "cur" ]
check=[list(input()) for i in range(3)] cur=0 while True: if cur==0: if len(check[0])==0: break elif cur==1: if len(check[1])==0: break else: if len(check[2])==0: break cur=ord(check[cur].pop(0))-ord("a") if cur==0: print("A") elif cur==1: print("B") else: print("C")
[ 7, 15, 0, 13, 17, 0, 13, 21, 22, 17, 4, 13, 4, 13, 4, 13, 22, 17, 4, 13, 4, 13, 4, 13, 22, 17, 4, 13, 4, 13, 4, 13, 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, 21, 13, 10, 17, 13 ]
[ [ 63, 3 ], [ 60, 6 ], [ 54, 33 ], [ 61, 37 ], [ 64, 37 ], [ 55, 38 ], [ 58, 38 ], [ 57, 40 ], [ 61, 44 ], [ 64, 44 ], [ 55, 45 ], [ 58, 45 ], [ 58, 51 ], [ 55, 51 ], [ 54, 55 ], [ 57, 58 ], [ 60, 61 ], [ 63, 64 ] ]
[ "from collections import deque\n\ns = {}\n\ns = {\n \"a\": deque(list(input())),\n \"b\": deque(list(input())),\n \"c\": deque(list(input())),\n}\n\nt = \"a\"\n\nwhile s[t]:\n t = s[t].popleft()\n\nprint(t.upper())", "from collections import deque", "s = {}", "s", "{}", "s = {\n \"a\": deque(list(input())),\n \"b\": deque(list(input())),\n \"c\": deque(list(input())),\n}", "s", "{\n \"a\": deque(list(input())),\n \"b\": deque(list(input())),\n \"c\": deque(list(input())),\n}", "\"a\"", "\"a\"", "deque(list(input()))", "deque", "list(input())", "list", "input()", "input", "\"b\"", "\"b\"", "deque(list(input()))", "deque", "list(input())", "list", "input()", "input", "\"c\"", "\"c\"", "deque(list(input()))", "deque", "list(input())", "list", "input()", "input", "t = \"a\"", "t", "\"a\"", "while s[t]:\n t = s[t].popleft()", "s[t]", "s", "t", "t = s[t].popleft()", "t", "s[t].popleft()", "[t].popleft", "[t]", "s", "t", "popleft", "print(t.upper())", "print", "t.upper()", "t.upper", "t", "upper", "t = \"a\"", "\"a\"", "t", "t = s[t].popleft()", "s[t].popleft()", "t", "s = {\n \"a\": deque(list(input())),\n \"b\": deque(list(input())),\n \"c\": deque(list(input())),\n}", "{\n \"a\": deque(list(input())),\n \"b\": deque(list(input())),\n \"c\": deque(list(input())),\n}", "s", "s = {}", "{}", "s" ]
from collections import deque s = {} s = { "a": deque(list(input())), "b": deque(list(input())), "c": deque(list(input())), } t = "a" while s[t]: t = s[t].popleft() print(t.upper())
[ 7, 0, 13, 21, 22, 17, 4, 13, 4, 13, 22, 17, 4, 13, 4, 13, 22, 17, 4, 13, 4, 13, 12, 13, 41, 14, 2, 4, 13, 18, 13, 13, 17, 29, 4, 18, 13, 13, 0, 13, 4, 18, 18, 13, 13, 13, 17, 29, 4, 13, 13, 23, 13, 4, 13, 4, 13, 17, 10, 21, 13, 10, 12, 13 ]
[ [ 59, 2 ], [ 52, 31 ], [ 52, 36 ], [ 40, 39 ], [ 52, 44 ], [ 39, 50 ], [ 52, 52 ], [ 63, 56 ], [ 59, 60 ] ]
[ "Cards = {'a':list(input()),'b':list(input()),'c':list(input())}\n\ndef solve(p):\n global Cards\n if len(Cards[p]) == 0:\n return p.capitalize()\n np = Cards[p].pop(0)\n return solve(np)\n\nprint(solve('a'))", "Cards = {'a':list(input()),'b':list(input()),'c':list(input())}", "Cards", "{'a':list(input()),'b':list(input()),'c':list(input())}", "'a'", "'a'", "list(input())", "list", "input()", "input", "'b'", "'b'", "list(input())", "list", "input()", "input", "'c'", "'c'", "list(input())", "list", "input()", "input", "def solve(p):\n global Cards\n if len(Cards[p]) == 0:\n return p.capitalize()\n np = Cards[p].pop(0)\n return solve(np)", "solve", "global Cards", "if len(Cards[p]) == 0:\n return p.capitalize()\n ", "len(Cards[p]) == 0", "len(Cards[p])", "len", "Cards[p]", "Cards", "p", "0", "return p.capitalize()", "p.capitalize()", "p.capitalize", "p", "capitalize", "np = Cards[p].pop(0)", "np", "Cards[p].pop(0)", "[p].pop", "[p]", "Cards", "p", "pop", "0", "return solve(np)", "solve(np)", "solve", "np", "p", "p", "print(solve('a'))", "print", "solve('a')", "solve", "'a'", "Cards = {'a':list(input()),'b':list(input()),'c':list(input())}", "{'a':list(input()),'b':list(input()),'c':list(input())}", "Cards", "def solve(p):\n global Cards\n if len(Cards[p]) == 0:\n return p.capitalize()\n np = Cards[p].pop(0)\n return solve(np)", "def solve(p):\n global Cards\n if len(Cards[p]) == 0:\n return p.capitalize()\n np = Cards[p].pop(0)\n return solve(np)", "solve" ]
Cards = {'a':list(input()),'b':list(input()),'c':list(input())} def solve(p): global Cards if len(Cards[p]) == 0: return p.capitalize() np = Cards[p].pop(0) return solve(np) print(solve('a'))
[ 7, 15, 12, 13, 0, 13, 21, 22, 17, 17, 22, 17, 17, 22, 17, 17, 28, 13, 13, 0, 18, 13, 13, 4, 13, 4, 13, 4, 13, 0, 13, 17, 42, 18, 13, 13, 0, 13, 4, 18, 18, 13, 13, 13, 4, 13, 4, 18, 13, 13, 14, 2, 13, 17, 4, 13, 10, 12, 13 ]
[ [ 6, 5 ], [ 18, 17 ], [ 5, 17 ], [ 23, 20 ], [ 5, 21 ], [ 17, 22 ], [ 31, 30 ], [ 5, 34 ], [ 30, 35 ], [ 37, 35 ], [ 38, 37 ], [ 5, 41 ], [ 30, 42 ], [ 37, 42 ], [ 37, 48 ], [ 30, 48 ], [ 58, 55 ] ]
[ "from collections import deque\n\ndef main():\n\n players = {\n 'a': None,\n 'b': None,\n 'c': None\n }\n\n for i in players:\n players[i] = deque(tuple(input()))\n\n card = 'a'\n while players[card]:\n card = players[card].popleft()\n\n print(card.upper())\n\n\nif __name__ == '__main__':\n main()", "from collections import deque", "def main():\n\n players = {\n 'a': None,\n 'b': None,\n 'c': None\n }\n\n for i in players:\n players[i] = deque(tuple(input()))\n\n card = 'a'\n while players[card]:\n card = players[card].popleft()\n\n print(card.upper())", "main", "players = {\n 'a': None,\n 'b': None,\n 'c': None\n }", "players", "{\n 'a': None,\n 'b': None,\n 'c': None\n }", "'a'", "'a'", "None", "'b'", "'b'", "None", "'c'", "'c'", "None", "for i in players:\n players[i] = deque(tuple(input()))\n\n ", "i", "players", "players[i] = deque(tuple(input()))", "players[i]", "players", "i", "deque(tuple(input()))", "deque", "tuple(input())", "tuple", "input()", "input", "card = 'a'", "card", "'a'", "while players[card]:\n card = players[card].popleft()\n\n ", "players[card]", "players", "card", "card = players[card].popleft()", "card", "players[card].popleft()", "[card].popleft", "[card]", "players", "card", "popleft", "print(card.upper())", "print", "card.upper()", "card.upper", "card", "upper", "if __name__ == '__main__':\n main()", "__name__ == '__main__'", "__name__", "'__main__'", "main()", "main", "def main():\n\n players = {\n 'a': None,\n 'b': None,\n 'c': None\n }\n\n for i in players:\n players[i] = deque(tuple(input()))\n\n card = 'a'\n while players[card]:\n card = players[card].popleft()\n\n print(card.upper())", "def main():\n\n players = {\n 'a': None,\n 'b': None,\n 'c': None\n }\n\n for i in players:\n players[i] = deque(tuple(input()))\n\n card = 'a'\n while players[card]:\n card = players[card].popleft()\n\n print(card.upper())", "main" ]
from collections import deque def main(): players = { 'a': None, 'b': None, 'c': None } for i in players: players[i] = deque(tuple(input())) card = 'a' while players[card]: card = players[card].popleft() print(card.upper()) if __name__ == '__main__': main()
[ 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, 17, 0, 13, 17, 42, 17, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 0, 13, 17, 3, 0, 13, 4, 18, 13, 13, 17, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 0, 13, 17, 3, 0, 13, 4, 18, 13, 13, 17, 14, 2, 4, 13, 13, 17, 0, 13, 17, 3, 0, 13, 4, 18, 13, 13, 17, 4, 13, 13, 10, 4, 13, 10, 17, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13 ]
[ [ 126, 2 ], [ 105, 10 ], [ 96, 18 ], [ 111, 26 ], [ 120, 29 ], [ 112, 35 ], [ 115, 35 ], [ 103, 35 ], [ 109, 35 ], [ 127, 41 ], [ 123, 44 ], [ 108, 48 ], [ 127, 51 ], [ 112, 56 ], [ 115, 56 ], [ 103, 56 ], [ 109, 56 ], [ 106, 62 ], [ 99, 65 ], [ 102, 69 ], [ 106, 72 ], [ 97, 79 ], [ 117, 82 ], [ 114, 86 ], [ 97, 89 ], [ 118, 94 ], [ 100, 94 ], [ 124, 94 ], [ 121, 94 ], [ 96, 97 ], [ 99, 100 ], [ 102, 103 ], [ 105, 106 ], [ 108, 109 ], [ 111, 112 ], [ 114, 115 ], [ 117, 118 ], [ 120, 121 ], [ 123, 124 ], [ 126, 127 ] ]
[ "# -*- coding: utf-8 -*-\n\nsa = list(str(input()))\nsb = list(str(input()))\nsc = list(str(input()))\n\nt = 'a'\nwinner = ''\n\nwhile True:\n if t == 'a':\n if len(sa) == 0:\n winner = 'A'\n break \n t = sa.pop(0)\n elif t == 'b':\n if len(sb) == 0:\n winner = 'B'\n break \n t = sb.pop(0)\n else:\n if len(sc) == 0:\n winner = 'C'\n break \n t = sc.pop(0)\n\nprint(winner)", "sa = list(str(input()))", "sa", "list(str(input()))", "list", "str(input())", "str", "input()", "input", "sb = list(str(input()))", "sb", "list(str(input()))", "list", "str(input())", "str", "input()", "input", "sc = list(str(input()))", "sc", "list(str(input()))", "list", "str(input())", "str", "input()", "input", "t = 'a'", "t", "'a'", "winner = ''", "winner", "''", "while True:\n if t == 'a':\n if len(sa) == 0:\n winner = 'A'\n break \n t = sa.pop(0)\n elif t == 'b':\n if len(sb) == 0:\n winner = 'B'\n break \n t = sb.pop(0)\n else:\n if len(sc) == 0:\n winner = 'C'\n break \n t = sc.pop(0)", "True", "if t == 'a':\n if len(sa) == 0:\n winner = 'A'\n break \n t = sa.pop(0)\n elif t == 'b':\n if len(sb) == 0:\n winner = 'B'\n break \n t = sb.pop(0)\n else:\n if len(sc) == 0:\n winner = 'C'\n break \n t = sc.pop(0)", "t == 'a'", "t", "'a'", "if len(sa) == 0:\n winner = 'A'\n break \n ", "len(sa) == 0", "len(sa)", "len", "sa", "0", "winner = 'A'", "winner", "'A'", "break", "t = sa.pop(0)", "t", "sa.pop(0)", "sa.pop", "sa", "pop", "0", "elif t == 'b':\n if len(sb) == 0:\n winner = 'B'\n break \n t = sb.pop(0)\n ", "t == 'b'", "t", "'b'", "if len(sb) == 0:\n winner = 'B'\n break \n ", "len(sb) == 0", "len(sb)", "len", "sb", "0", "winner = 'B'", "winner", "'B'", "break", "t = sb.pop(0)", "t", "sb.pop(0)", "sb.pop", "sb", "pop", "0", "if len(sc) == 0:\n winner = 'C'\n break \n ", "len(sc) == 0", "len(sc)", "len", "sc", "0", "winner = 'C'", "winner", "'C'", "break", "t = sc.pop(0)", "t", "sc.pop(0)", "sc.pop", "sc", "pop", "0", "print(winner)", "print", "winner", "sc = list(str(input()))", "list(str(input()))", "sc", "winner = 'B'", "'B'", "winner", "t = sb.pop(0)", "sb.pop(0)", "t", "sb = list(str(input()))", "list(str(input()))", "sb", "t = sa.pop(0)", "sa.pop(0)", "t", "t = 'a'", "'a'", "t", "t = sc.pop(0)", "sc.pop(0)", "t", "winner = 'C'", "'C'", "winner", "winner = ''", "''", "winner", "winner = 'A'", "'A'", "winner", "sa = list(str(input()))", "list(str(input()))", "sa" ]
# -*- coding: utf-8 -*- sa = list(str(input())) sb = list(str(input())) sc = list(str(input())) t = 'a' winner = '' while True: if t == 'a': if len(sa) == 0: winner = 'A' break t = sa.pop(0) elif t == 'b': if len(sb) == 0: winner = 'B' break t = sb.pop(0) else: if len(sc) == 0: winner = 'C' break t = sc.pop(0) print(winner)
[ 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, 28, 13, 4, 13, 17, 14, 2, 13, 17, 14, 2, 13, 4, 13, 13, 4, 13, 17, 4, 13, 0, 13, 18, 13, 13, 0, 13, 17, 14, 2, 13, 17, 14, 2, 13, 4, 13, 13, 4, 13, 17, 4, 13, 0, 13, 18, 13, 13, 0, 13, 17, 14, 2, 13, 17, 14, 2, 13, 4, 13, 13, 4, 13, 17, 4, 13, 0, 13, 18, 13, 13, 0, 13, 17, 10, 17, 13, 10, 4, 13, 10, 4, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13 ]
[ [ 106, 2 ], [ 133, 6 ], [ 103, 10 ], [ 136, 14 ], [ 118, 17 ], [ 121, 20 ], [ 130, 23 ], [ 27, 26 ], [ 131, 32 ], [ 113, 32 ], [ 116, 32 ], [ 110, 32 ], [ 137, 36 ], [ 125, 36 ], [ 107, 39 ], [ 109, 46 ], [ 107, 48 ], [ 137, 49 ], [ 125, 49 ], [ 124, 51 ], [ 110, 55 ], [ 131, 55 ], [ 113, 55 ], [ 116, 55 ], [ 119, 59 ], [ 101, 59 ], [ 134, 62 ], [ 115, 69 ], [ 134, 71 ], [ 119, 72 ], [ 101, 72 ], [ 100, 74 ], [ 116, 78 ], [ 110, 78 ], [ 131, 78 ], [ 113, 78 ], [ 122, 82 ], [ 128, 82 ], [ 104, 85 ], [ 112, 92 ], [ 104, 94 ], [ 122, 95 ], [ 128, 95 ], [ 127, 97 ], [ 100, 101 ], [ 103, 104 ], [ 106, 107 ], [ 109, 110 ], [ 112, 113 ], [ 115, 116 ], [ 118, 119 ], [ 121, 122 ], [ 124, 125 ], [ 127, 128 ], [ 130, 131 ], [ 133, 134 ], [ 136, 137 ] ]
[ "sa = input()\nsb = input()\nsc = input()\n\ntmp_a = 0\ntmp_b = 0\ntmp_c = 0\n\nturn = 'a'\n\nfor _ in range(300):\n if turn == 'a':\n if tmp_a == len(sa):\n print('A')\n exit()\n turn = sa[tmp_a]\n tmp_a += 1\n if turn == 'b':\n if tmp_b == len(sb):\n print('B')\n exit()\n turn = sb[tmp_b]\n tmp_b += 1\n if turn == 'c':\n if tmp_c == len(sc):\n print('C')\n exit()\n turn = sc[tmp_c]\n tmp_c += 1", "sa = input()", "sa", "input()", "input", "sb = input()", "sb", "input()", "input", "sc = input()", "sc", "input()", "input", "tmp_a = 0", "tmp_a", "0", "tmp_b = 0", "tmp_b", "0", "tmp_c = 0", "tmp_c", "0", "turn = 'a'", "turn", "'a'", "for _ in range(300):\n if turn == 'a':\n if tmp_a == len(sa):\n print('A')\n exit()\n turn = sa[tmp_a]\n tmp_a += 1\n if turn == 'b':\n if tmp_b == len(sb):\n print('B')\n exit()\n turn = sb[tmp_b]\n tmp_b += 1\n if turn == 'c':\n if tmp_c == len(sc):\n print('C')\n exit()\n turn = sc[tmp_c]\n tmp_c += 1", "_", "range(300)", "range", "300", "if turn == 'a':\n if tmp_a == len(sa):\n print('A')\n exit()\n turn = sa[tmp_a]\n tmp_a += 1\n ", "turn == 'a'", "turn", "'a'", "if tmp_a == len(sa):\n print('A')\n exit()\n ", "tmp_a == len(sa)", "tmp_a", "len(sa)", "len", "sa", "print('A')", "print", "'A'", "exit()", "exit", "turn = sa[tmp_a]", "turn", "sa[tmp_a]", "sa", "tmp_a", "tmp_a += 1", "tmp_a", "1", "if turn == 'b':\n if tmp_b == len(sb):\n print('B')\n exit()\n turn = sb[tmp_b]\n tmp_b += 1\n ", "turn == 'b'", "turn", "'b'", "if tmp_b == len(sb):\n print('B')\n exit()\n ", "tmp_b == len(sb)", "tmp_b", "len(sb)", "len", "sb", "print('B')", "print", "'B'", "exit()", "exit", "turn = sb[tmp_b]", "turn", "sb[tmp_b]", "sb", "tmp_b", "tmp_b += 1", "tmp_b", "1", "if turn == 'c':\n if tmp_c == len(sc):\n print('C')\n exit()\n turn = sc[tmp_c]\n tmp_c += 1", "turn == 'c'", "turn", "'c'", "if tmp_c == len(sc):\n print('C')\n exit()\n ", "tmp_c == len(sc)", "tmp_c", "len(sc)", "len", "sc", "print('C')", "print", "'C'", "exit()", "exit", "turn = sc[tmp_c]", "turn", "sc[tmp_c]", "sc", "tmp_c", "tmp_c += 1", "tmp_c", "1", "tmp_b += 1", "1", "tmp_b", "sc = input()", "input()", "sc", "sa = input()", "input()", "sa", "turn = sa[tmp_a]", "sa[tmp_a]", "turn", "turn = sc[tmp_c]", "sc[tmp_c]", "turn", "turn = sb[tmp_b]", "sb[tmp_b]", "turn", "tmp_b = 0", "0", "tmp_b", "tmp_c = 0", "0", "tmp_c", "tmp_a += 1", "1", "tmp_a", "tmp_c += 1", "1", "tmp_c", "turn = 'a'", "'a'", "turn", "sb = input()", "input()", "sb", "tmp_a = 0", "0", "tmp_a" ]
sa = input() sb = input() sc = input() tmp_a = 0 tmp_b = 0 tmp_c = 0 turn = 'a' for _ in range(300): if turn == 'a': if tmp_a == len(sa): print('A') exit() turn = sa[tmp_a] tmp_a += 1 if turn == 'b': if tmp_b == len(sb): print('B') exit() turn = sb[tmp_b] tmp_b += 1 if turn == 'c': if tmp_c == len(sc): print('C') exit() turn = sc[tmp_c] tmp_c += 1
[ 7, 41, 28, 13, 4, 13, 17, 17, 4, 4, 13, 4, 13, 0, 13, 13, 13, 13, 0, 13, 4, 18, 13, 13, 17, 42, 17, 14, 2, 13, 17, 14, 40, 4, 13, 13, 4, 13, 17, 3, 0, 13, 4, 18, 13, 13, 17, 14, 2, 13, 17, 14, 40, 4, 13, 13, 4, 13, 17, 3, 0, 13, 4, 18, 13, 13, 17, 14, 40, 4, 13, 13, 4, 13, 17, 3, 0, 13, 4, 18, 13, 13, 17, 10, 13, 13, 10, 13, 13, 10, 4, 13, 10, 13, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13 ]
[ [ 4, 3 ], [ 93, 14 ], [ 93, 16 ], [ 93, 17 ], [ 96, 19 ], [ 94, 22 ], [ 97, 29 ], [ 103, 29 ], [ 100, 29 ], [ 91, 29 ], [ 94, 35 ], [ 90, 41 ], [ 94, 44 ], [ 97, 49 ], [ 103, 49 ], [ 100, 49 ], [ 91, 49 ], [ 88, 55 ], [ 99, 61 ], [ 88, 64 ], [ 85, 71 ], [ 102, 77 ], [ 85, 80 ], [ 93, 85 ], [ 93, 88 ], [ 90, 91 ], [ 93, 94 ], [ 96, 97 ], [ 99, 100 ], [ 102, 103 ] ]
[ "A,B,C = (list(input()) for T in range(0,3))\nNext = A.pop(0)\nwhile True:\n if Next=='a':\n if not len(A):\n print('A')\n break\n Next = A.pop(0)\n elif Next=='b':\n if not len(B):\n print('B')\n break\n Next = B.pop(0)\n else:\n if not len(C):\n print('C')\n break\n Next = C.pop(0)", "list(input()) for T in range(0,3)", "for T in range(0,3)", "T", "range(0,3)", "range", "0", "3", "for T in range(0,3)", "list(input())", "list", "input()", "input", "A,B,C = (list(input()) for T in range(0,3))", "A", "(list(input()) for T in range(0,3))", "B", "C", "Next = A.pop(0)", "Next", "A.pop(0)", "A.pop", "A", "pop", "0", "while True:\n if Next=='a':\n if not len(A):\n print('A')\n break\n Next = A.pop(0)\n elif Next=='b':\n if not len(B):\n print('B')\n break\n Next = B.pop(0)\n else:\n if not len(C):\n print('C')\n break\n Next = C.pop(0)", "True", "if Next=='a':\n if not len(A):\n print('A')\n break\n Next = A.pop(0)\n elif Next=='b':\n if not len(B):\n print('B')\n break\n Next = B.pop(0)\n else:\n if not len(C):\n print('C')\n break\n Next = C.pop(0)", "Next=='a'", "Next", "'a'", "if not len(A):\n print('A')\n break\n ", "not len(A)", "len(A)", "len", "A", "print('A')", "print", "'A'", "break", "Next = A.pop(0)", "Next", "A.pop(0)", "A.pop", "A", "pop", "0", "elif Next=='b':\n if not len(B):\n print('B')\n break\n Next = B.pop(0)\n ", "Next=='b'", "Next", "'b'", "if not len(B):\n print('B')\n break\n ", "not len(B)", "len(B)", "len", "B", "print('B')", "print", "'B'", "break", "Next = B.pop(0)", "Next", "B.pop(0)", "B.pop", "B", "pop", "0", "if not len(C):\n print('C')\n break\n ", "not len(C)", "len(C)", "len", "C", "print('C')", "print", "'C'", "break", "Next = C.pop(0)", "Next", "C.pop(0)", "C.pop", "C", "pop", "0", "C = (list(input()) for T in range(0,3))", "(list(input()) for T in range(0,3))", "C", "B,C = (list(input()) for T in range(0,3))", "(list(input()) for T in range(0,3))", "B", "Next = A.pop(0)", "A.pop(0)", "Next", "A,B,C = (list(input()) for T in range(0,3))", "(list(input()) for T in range(0,3))", "A", "Next = A.pop(0)", "A.pop(0)", "Next", "Next = B.pop(0)", "B.pop(0)", "Next", "Next = C.pop(0)", "C.pop(0)", "Next" ]
A,B,C = (list(input()) for T in range(0,3)) Next = A.pop(0) while True: if Next=='a': if not len(A): print('A') break Next = A.pop(0) elif Next=='b': if not len(B): print('B') break Next = B.pop(0) else: if not len(C): print('C') break Next = C.pop(0)
[ 7, 15, 0, 13, 4, 13, 4, 13, 0, 13, 4, 13, 4, 13, 0, 13, 4, 13, 4, 13, 0, 13, 21, 22, 17, 13, 22, 17, 13, 22, 17, 13, 0, 13, 4, 18, 4, 18, 18, 13, 17, 13, 13, 42, 18, 13, 13, 0, 13, 4, 18, 4, 18, 18, 13, 13, 13, 13, 4, 13, 13, 10, 4, 13, 10, 21, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13 ]
[ [ 71, 3 ], [ 74, 9 ], [ 62, 15 ], [ 65, 21 ], [ 68, 33 ], [ 66, 39 ], [ 66, 45 ], [ 69, 46 ], [ 78, 46 ], [ 77, 48 ], [ 66, 54 ], [ 69, 55 ], [ 78, 55 ], [ 78, 60 ], [ 69, 60 ], [ 62, 63 ], [ 65, 66 ], [ 68, 69 ], [ 71, 72 ], [ 74, 75 ], [ 77, 78 ] ]
[ "from collections import deque\n\na = deque(input())\nb = deque(input())\nc = deque(input())\ndic = {'A':a, 'B':b, 'C':c}\npop = dic['A'].popleft().upper()\n\n\nwhile dic[pop]:\n pop = dic[pop].popleft().upper()\n\nprint(pop)", "from collections import deque", "a = deque(input())", "a", "deque(input())", "deque", "input()", "input", "b = deque(input())", "b", "deque(input())", "deque", "input()", "input", "c = deque(input())", "c", "deque(input())", "deque", "input()", "input", "dic = {'A':a, 'B':b, 'C':c}", "dic", "{'A':a, 'B':b, 'C':c}", "'A'", "'A'", "a", "'B'", "'B'", "b", "'C'", "'C'", "c", "pop = dic['A'].popleft().upper()", "pop", "dic['A'].popleft().upper()", "['A'].popleft().upper", "['A'].popleft()", "['A'].popleft", "['A']", "dic", "'A'", "popleft", "upper", "while dic[pop]:\n pop = dic[pop].popleft().upper()", "dic[pop]", "dic", "pop", "pop = dic[pop].popleft().upper()", "pop", "dic[pop].popleft().upper()", "[pop].popleft().upper", "[pop].popleft()", "[pop].popleft", "[pop]", "dic", "pop", "popleft", "upper", "print(pop)", "print", "pop", "c = deque(input())", "deque(input())", "c", "dic = {'A':a, 'B':b, 'C':c}", "{'A':a, 'B':b, 'C':c}", "dic", "pop = dic['A'].popleft().upper()", "dic['A'].popleft().upper()", "pop", "a = deque(input())", "deque(input())", "a", "b = deque(input())", "deque(input())", "b", "pop = dic[pop].popleft().upper()", "dic[pop].popleft().upper()", "pop" ]
from collections import deque a = deque(input()) b = deque(input()) c = deque(input()) dic = {'A':a, 'B':b, 'C':c} pop = dic['A'].popleft().upper() while dic[pop]: pop = dic[pop].popleft().upper() print(pop)
[ 7, 15, 41, 28, 13, 4, 13, 17, 4, 4, 13, 4, 13, 4, 13, 0, 13, 13, 0, 13, 17, 42, 17, 14, 2, 4, 13, 18, 13, 13, 17, 14, 2, 13, 17, 14, 2, 13, 17, 4, 13, 0, 13, 4, 18, 18, 13, 13, 13, 14, 2, 13, 17, 14, 2, 13, 17, 10, 4, 13, 10, 13, 13, 10, 17, 13 ]
[ [ 5, 4 ], [ 61, 16 ], [ 64, 19 ], [ 62, 28 ], [ 65, 29 ], [ 65, 33 ], [ 65, 37 ], [ 58, 42 ], [ 62, 46 ], [ 65, 47 ], [ 59, 51 ], [ 59, 55 ], [ 58, 59 ], [ 61, 62 ], [ 64, 65 ] ]
[ "from collections import deque\nA=[deque(list(input())) for _ in range(3)]\n\nnum=0\nwhile 1:\n if len(A[num])==0:\n if num==0:print(\"A\")\n elif num==1:print(\"B\")\n else:print(\"C\")\n exit()\n else:\n word=A[num].popleft()\n if word==\"a\":num=0\n elif word==\"b\":num=1\n else:num=2", "from collections import deque", "deque(list(input())) for _ in range(3)", "for _ in range(3)", "_", "range(3)", "range", "3", "for _ in range(3)", "deque(list(input()))", "deque", "list(input())", "list", "input()", "input", "A=[deque(list(input())) for _ in range(3)]", "A", "[deque(list(input())) for _ in range(3)]", "num=0", "num", "0", "while 1:\n if len(A[num])==0:\n if num==0:print(\"A\")\n elif num==1:print(\"B\")\n else:print(\"C\")\n exit()\n else:\n word=A[num].popleft()\n if word==\"a\":num=0\n elif word==\"b\":num=1\n else:num=2", "1", "if len(A[num])==0:\n if num==0:print(\"A\")\n elif num==1:print(\"B\")\n else:print(\"C\")\n exit()\n else:\n word=A[num].popleft()\n if word==\"a\":num=0\n elif word==\"b\":num=1\n else:num=2", "len(A[num])==0", "len(A[num])", "len", "A[num]", "A", "num", "0", "if num==0:print(\"A\")\n elif num==1:print(\"B\")\n else:print(\"C\")\n ", "num==0", "num", "0", "elif num==1:print(\"B\")\n ", "num==1", "num", "1", "exit()", "exit", "word=A[num].popleft()", "word", "A[num].popleft()", "[num].popleft", "[num]", "A", "num", "popleft", "if word==\"a\":num=0\n elif word==\"b\":num=1\n else:num=2", "word==\"a\"", "word", "\"a\"", "elif word==\"b\":num=1\n ", "word==\"b\"", "word", "\"b\"", "word=A[num].popleft()", "A[num].popleft()", "word", "A=[deque(list(input())) for _ in range(3)]", "[deque(list(input())) for _ in range(3)]", "A", "num=0", "0", "num" ]
from collections import deque A=[deque(list(input())) for _ in range(3)] num=0 while 1: if len(A[num])==0: if num==0:print("A") elif num==1:print("B") else:print("C") exit() else: word=A[num].popleft() if word=="a":num=0 elif word=="b":num=1 else:num=2
[ 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, 13, 0, 13, 4, 18, 13, 13, 17, 0, 13, 17, 3, 14, 2, 13, 17, 14, 13, 0, 13, 4, 18, 13, 13, 17, 0, 13, 17, 3, 14, 13, 0, 13, 4, 18, 13, 13, 17, 0, 13, 17, 3, 4, 13, 13, 10, 17, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 4, 13 ]
[ [ 82, 2 ], [ 106, 8 ], [ 94, 14 ], [ 91, 20 ], [ 83, 23 ], [ 92, 30 ], [ 89, 30 ], [ 101, 30 ], [ 86, 30 ], [ 85, 35 ], [ 83, 38 ], [ 97, 42 ], [ 92, 47 ], [ 89, 47 ], [ 101, 47 ], [ 86, 47 ], [ 100, 52 ], [ 107, 55 ], [ 103, 59 ], [ 88, 65 ], [ 95, 68 ], [ 79, 72 ], [ 80, 77 ], [ 104, 77 ], [ 98, 77 ], [ 79, 80 ], [ 82, 83 ], [ 85, 86 ], [ 88, 89 ], [ 91, 92 ], [ 94, 95 ], [ 97, 98 ], [ 100, 101 ], [ 103, 104 ], [ 106, 107 ] ]
[ "a = list(input())\nb = list(input())\nc = list(input())\n\ntgt = a.pop(0)\n\nwhile True:\n if tgt == 'a':\n if a:\n tgt = a.pop(0)\n else:\n ans = 'A'\n break\n elif tgt == 'b':\n if b:\n tgt = b.pop(0)\n else:\n ans = 'B'\n break\n else:\n if c:\n tgt = c.pop(0)\n else:\n ans = 'C'\n break\nprint(ans)", "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", "tgt = a.pop(0)", "tgt", "a.pop(0)", "a.pop", "a", "pop", "0", "while True:\n if tgt == 'a':\n if a:\n tgt = a.pop(0)\n else:\n ans = 'A'\n break\n elif tgt == 'b':\n if b:\n tgt = b.pop(0)\n else:\n ans = 'B'\n break\n else:\n if c:\n tgt = c.pop(0)\n else:\n ans = 'C'\n break", "True", "if tgt == 'a':\n if a:\n tgt = a.pop(0)\n else:\n ans = 'A'\n break\n elif tgt == 'b':\n if b:\n tgt = b.pop(0)\n else:\n ans = 'B'\n break\n else:\n if c:\n tgt = c.pop(0)\n else:\n ans = 'C'\n break", "tgt == 'a'", "tgt", "'a'", "if a:\n tgt = a.pop(0)\n else:\n ans = 'A'\n break\n ", "a", "tgt = a.pop(0)", "tgt", "a.pop(0)", "a.pop", "a", "pop", "0", "ans = 'A'", "ans", "'A'", "break", "elif tgt == 'b':\n if b:\n tgt = b.pop(0)\n else:\n ans = 'B'\n break\n ", "tgt == 'b'", "tgt", "'b'", "if b:\n tgt = b.pop(0)\n else:\n ans = 'B'\n break\n ", "b", "tgt = b.pop(0)", "tgt", "b.pop(0)", "b.pop", "b", "pop", "0", "ans = 'B'", "ans", "'B'", "break", "if c:\n tgt = c.pop(0)\n else:\n ans = 'C'\n break", "c", "tgt = c.pop(0)", "tgt", "c.pop(0)", "c.pop", "c", "pop", "0", "ans = 'C'", "ans", "'C'", "break", "print(ans)", "print", "ans", "ans = 'C'", "'C'", "ans", "a = list(input())", "list(input())", "a", "tgt = a.pop(0)", "a.pop(0)", "tgt", "tgt = c.pop(0)", "c.pop(0)", "tgt", "tgt = a.pop(0)", "a.pop(0)", "tgt", "c = list(input())", "list(input())", "c", "ans = 'A'", "'A'", "ans", "tgt = b.pop(0)", "b.pop(0)", "tgt", "ans = 'B'", "'B'", "ans", "b = list(input())", "list(input())", "b" ]
a = list(input()) b = list(input()) c = list(input()) tgt = a.pop(0) while True: if tgt == 'a': if a: tgt = a.pop(0) else: ans = 'A' break elif tgt == 'b': if b: tgt = b.pop(0) else: ans = 'B' break else: if c: tgt = c.pop(0) else: ans = 'C' break print(ans)
[ 7, 6, 13, 12, 13, 0, 18, 13, 13, 13, 0, 18, 13, 13, 13, 41, 28, 13, 4, 13, 2, 18, 13, 13, 17, 4, 17, 0, 18, 13, 13, 13, 41, 28, 13, 4, 13, 2, 18, 13, 13, 17, 4, 17, 0, 18, 13, 13, 13, 28, 13, 4, 13, 17, 2, 18, 13, 13, 17, 0, 18, 18, 13, 13, 13, 2, 2, 18, 18, 13, 13, 2, 13, 17, 13, 18, 13, 13, 0, 18, 18, 13, 13, 13, 2, 2, 18, 18, 13, 13, 2, 13, 17, 4, 13, 13, 17, 18, 13, 13, 18, 13, 13, 23, 13, 23, 13, 23, 13, 12, 13, 29, 2, 2, 18, 18, 13, 13, 13, 2, 2, 18, 18, 13, 13, 2, 13, 13, 18, 18, 13, 13, 13, 18, 13, 13, 18, 13, 13, 23, 13, 23, 13, 23, 13, 12, 13, 29, 4, 13, 4, 13, 13, 4, 18, 4, 13, 13, 14, 2, 13, 17, 41, 28, 13, 4, 13, 17, 4, 4, 13, 4, 13, 0, 13, 13, 28, 13, 13, 4, 18, 13, 13, 0, 13, 17, 42, 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, 14, 2, 13, 17, 0, 13, 17, 0, 13, 17, 14, 2, 13, 17, 4, 13, 17, 14, 2, 13, 17, 4, 13, 17, 4, 13, 17, 10, 6, 13, 10, 17, 13, 10, 17, 13, 10, 12, 13, 10, 13, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13 ]
[ [ 9, 6 ], [ 104, 7 ], [ 106, 8 ], [ 106, 9 ], [ 14, 11 ], [ 104, 12 ], [ 108, 13 ], [ 108, 14 ], [ 18, 17 ], [ 6, 21 ], [ 104, 22 ], [ 106, 23 ], [ 31, 28 ], [ 104, 29 ], [ 35, 34 ], [ 6, 38 ], [ 104, 39 ], [ 106, 40 ], [ 48, 45 ], [ 104, 46 ], [ 51, 50 ], [ 6, 55 ], [ 104, 56 ], [ 106, 57 ], [ 65, 60 ], [ 28, 61 ], [ 104, 62 ], [ 50, 64 ], [ 28, 68 ], [ 104, 69 ], [ 50, 72 ], [ 50, 74 ], [ 11, 75 ], [ 104, 76 ], [ 108, 77 ], [ 84, 79 ], [ 45, 80 ], [ 104, 81 ], [ 50, 83 ], [ 45, 87 ], [ 104, 88 ], [ 50, 91 ], [ 50, 95 ], [ 11, 97 ], [ 104, 98 ], [ 108, 99 ], [ 11, 100 ], [ 104, 101 ], [ 108, 102 ], [ 104, 104 ], [ 106, 106 ], [ 108, 108 ], [ 140, 116 ], [ 142, 118 ], [ 140, 123 ], [ 142, 126 ], [ 144, 127 ], [ 140, 130 ], [ 144, 132 ], [ 140, 134 ], [ 140, 137 ], [ 140, 140 ], [ 142, 142 ], [ 144, 144 ], [ 165, 164 ], [ 252, 174 ], [ 178, 177 ], [ 253, 177 ], [ 177, 181 ], [ 246, 184 ], [ 253, 193 ], [ 247, 194 ], [ 244, 194 ], [ 262, 194 ], [ 259, 194 ], [ 255, 198 ], [ 253, 202 ], [ 247, 203 ], [ 244, 203 ], [ 262, 203 ], [ 259, 203 ], [ 256, 207 ], [ 258, 210 ], [ 256, 214 ], [ 261, 217 ], [ 243, 220 ], [ 244, 224 ], [ 262, 224 ], [ 259, 224 ], [ 247, 224 ], [ 244, 231 ], [ 262, 231 ], [ 259, 231 ], [ 247, 231 ], [ 243, 244 ], [ 246, 247 ], [ 252, 253 ], [ 255, 256 ], [ 258, 259 ], [ 261, 262 ] ]
[ "class Combination:\n def __init__(self, n, mod):\n self.n = n\n self.mod = mod\n self.fac = [1 for i in range(self.n + 1)]\n self.finv = [1 for i in range(self.n + 1)]\n for i in range(2, self.n+1):\n self.fac[i] = (self.fac[i - 1] * i) % self.mod\n self.finv[i] = (self.finv[i-1] * pow(i, -1, self.mod)) % self.mod\n\n def comb(self, n, m):\n return self.fac[n] * (self.finv[n-m] * self.finv[m] % self.mod) % self.mod\ndef iparse():\n return list(map(int, input().split()))\n\nif __name__ == \"__main__\":\n s = [list(input()) for i in range(3)]\n for e in s:\n e.reverse()\n \n turn = 0\n while True:\n if len(s[turn]) == 0:\n break\n tmp = s[turn].pop()\n if tmp == 'a':\n turn = 0\n elif tmp == 'b':\n turn = 1\n else:\n turn = 2\n\n if turn == 0:\n print(\"A\")\n elif turn == 1:\n print(\"B\")\n else:\n print(\"C\")\n \n ", "class Combination:\n def __init__(self, n, mod):\n self.n = n\n self.mod = mod\n self.fac = [1 for i in range(self.n + 1)]\n self.finv = [1 for i in range(self.n + 1)]\n for i in range(2, self.n+1):\n self.fac[i] = (self.fac[i - 1] * i) % self.mod\n self.finv[i] = (self.finv[i-1] * pow(i, -1, self.mod)) % self.mod\n\n def comb(self, n, m):\n return self.fac[n] * (self.finv[n-m] * self.finv[m] % self.mod) % self.mod", "Combination", "def __init__(self, n, mod):\n self.n = n\n self.mod = mod\n self.fac = [1 for i in range(self.n + 1)]\n self.finv = [1 for i in range(self.n + 1)]\n for i in range(2, self.n+1):\n self.fac[i] = (self.fac[i - 1] * i) % self.mod\n self.finv[i] = (self.finv[i-1] * pow(i, -1, self.mod)) % self.mod\n\n ", "__init__", "self.n = n", "self.n", "self", "n", "n", "self.mod = mod", "self.mod", "self", "mod", "mod", "1 for i in range(self.n + 1)", "for i in range(self.n + 1)", "i", "range(self.n + 1)", "range", "self.n + 1", "self.n", "self", "n", "1", "for i in range(self.n + 1)", "1", "self.fac = [1 for i in range(self.n + 1)]", "self.fac", "self", "fac", "[1 for i in range(self.n + 1)]", "1 for i in range(self.n + 1)", "for i in range(self.n + 1)", "i", "range(self.n + 1)", "range", "self.n + 1", "self.n", "self", "n", "1", "for i in range(self.n + 1)", "1", "self.finv = [1 for i in range(self.n + 1)]", "self.finv", "self", "finv", "[1 for i in range(self.n + 1)]", "for i in range(2, self.n+1):\n self.fac[i] = (self.fac[i - 1] * i) % self.mod\n self.finv[i] = (self.finv[i-1] * pow(i, -1, self.mod)) % self.mod\n\n ", "i", "range(2, self.n+1)", "range", "2", "self.n+1", "self.n", "self", "n", "1", "self.fac[i] = (self.fac[i - 1] * i) % self.mod", "self.fac[i]", "self.fac", "self", "fac", "i", "(self.fac[i - 1] * i) % self.mod", "self.fac[i - 1] * i", "self.fac[i - 1]", "self.fac", "self", "fac", "i - 1", "i", "1", "i", "self.mod", "self", "mod", "self.finv[i] = (self.finv[i-1] * pow(i, -1, self.mod)) % self.mod", "self.finv[i]", "self.finv", "self", "finv", "i", "(self.finv[i-1] * pow(i, -1, self.mod)) % self.mod", "self.finv[i-1] * pow(i, -1, self.mod)", "self.finv[i-1]", "self.finv", "self", "finv", "i-1", "i", "1", "pow(i, -1, self.mod)", "pow", "i", "-1", "self.mod", "self", "mod", "self.mod", "self", "mod", "self", "self", "n", "n", "mod", "mod", "def comb(self, n, m):\n return self.fac[n] * (self.finv[n-m] * self.finv[m] % self.mod) % self.mod", "comb", "return self.fac[n] * (self.finv[n-m] * self.finv[m] % self.mod) % self.mod", "self.fac[n] * (self.finv[n-m] * self.finv[m] % self.mod) % self.mod", "self.fac[n] * (self.finv[n-m] * self.finv[m] % self.mod)", "self.fac[n]", "self.fac", "self", "fac", "n", "self.finv[n-m] * self.finv[m] % self.mod", "self.finv[n-m] * self.finv[m]", "self.finv[n-m]", "self.finv", "self", "finv", "n-m", "n", "m", "self.finv[m]", "self.finv", "self", "finv", "m", "self.mod", "self", "mod", "self.mod", "self", "mod", "self", "self", "n", "n", "m", "m", "def iparse():\n return list(map(int, input().split()))", "iparse", "return list(map(int, input().split()))", "list(map(int, input().split()))", "list", "map(int, input().split())", "map", "int", "input().split()", "().split", "()", "input", "split", "if __name__ == \"__main__\":\n s = [list(input()) for i in range(3)]\n for e in s:\n e.reverse()\n \n turn = 0\n while True:\n if len(s[turn]) == 0:\n break\n tmp = s[turn].pop()\n if tmp == 'a':\n turn = 0\n elif tmp == 'b':\n turn = 1\n else:\n turn = 2\n\n if turn == 0:\n print(\"A\")\n elif turn == 1:\n print(\"B\")\n else:\n print(\"C\")\n \n ", "__name__ == \"__main__\"", "__name__", "\"__main__\"", "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)]", "for e in s:\n e.reverse()\n \n ", "e", "s", "e.reverse()", "e.reverse", "e", "reverse", "turn = 0", "turn", "0", "while True:\n if len(s[turn]) == 0:\n break\n tmp = s[turn].pop()\n if tmp == 'a':\n turn = 0\n elif tmp == 'b':\n turn = 1\n else:\n turn = 2\n\n ", "True", "if len(s[turn]) == 0:\n break\n ", "len(s[turn]) == 0", "len(s[turn])", "len", "s[turn]", "s", "turn", "0", "break", "tmp = s[turn].pop()", "tmp", "s[turn].pop()", "[turn].pop", "[turn]", "s", "turn", "pop", "if tmp == 'a':\n turn = 0\n elif tmp == 'b':\n turn = 1\n else:\n turn = 2\n\n ", "tmp == 'a'", "tmp", "'a'", "turn = 0", "turn", "0", "elif tmp == 'b':\n turn = 1\n ", "tmp == 'b'", "tmp", "'b'", "turn = 1", "turn", "1", "turn = 2", "turn", "2", "if turn == 0:\n print(\"A\")\n elif turn == 1:\n print(\"B\")\n else:\n print(\"C\")\n \n ", "turn == 0", "turn", "0", "print(\"A\")", "print", "\"A\"", "elif turn == 1:\n print(\"B\")\n ", "turn == 1", "turn", "1", "print(\"B\")", "print", "\"B\"", "print(\"C\")", "print", "\"C\"", "class Combination:\n def __init__(self, n, mod):\n self.n = n\n self.mod = mod\n self.fac = [1 for i in range(self.n + 1)]\n self.finv = [1 for i in range(self.n + 1)]\n for i in range(2, self.n+1):\n self.fac[i] = (self.fac[i - 1] * i) % self.mod\n self.finv[i] = (self.finv[i-1] * pow(i, -1, self.mod)) % self.mod\n\n def comb(self, n, m):\n return self.fac[n] * (self.finv[n-m] * self.finv[m] % self.mod) % self.mod", "class Combination:\n def __init__(self, n, mod):\n self.n = n\n self.mod = mod\n self.fac = [1 for i in range(self.n + 1)]\n self.finv = [1 for i in range(self.n + 1)]\n for i in range(2, self.n+1):\n self.fac[i] = (self.fac[i - 1] * i) % self.mod\n self.finv[i] = (self.finv[i-1] * pow(i, -1, self.mod)) % self.mod\n\n def comb(self, n, m):\n return self.fac[n] * (self.finv[n-m] * self.finv[m] % self.mod) % self.mod", "Combination", "turn = 2", "2", "turn", "turn = 0", "0", "turn", "def iparse():\n return list(map(int, input().split()))", "def iparse():\n return list(map(int, input().split()))", "iparse", "s = [list(input()) for i in range(3)]", "[list(input()) for i in range(3)]", "s", "tmp = s[turn].pop()", "s[turn].pop()", "tmp", "turn = 0", "0", "turn", "turn = 1", "1", "turn" ]
class Combination: def __init__(self, n, mod): self.n = n self.mod = mod self.fac = [1 for i in range(self.n + 1)] self.finv = [1 for i in range(self.n + 1)] for i in range(2, self.n+1): self.fac[i] = (self.fac[i - 1] * i) % self.mod self.finv[i] = (self.finv[i-1] * pow(i, -1, self.mod)) % self.mod def comb(self, n, m): return self.fac[n] * (self.finv[n-m] * self.finv[m] % self.mod) % self.mod def iparse(): return list(map(int, input().split())) if __name__ == "__main__": s = [list(input()) for i in range(3)] for e in s: e.reverse() turn = 0 while True: if len(s[turn]) == 0: break tmp = s[turn].pop() if tmp == 'a': turn = 0 elif tmp == 'b': turn = 1 else: turn = 2 if turn == 0: print("A") elif turn == 1: print("B") else: print("C")
[ 7, 0, 13, 4, 13, 2, 4, 13, 17, 0, 13, 4, 13, 2, 4, 13, 17, 0, 13, 4, 13, 2, 4, 13, 17, 0, 13, 4, 18, 13, 13, 17, 0, 13, 17, 42, 40, 13, 17, 14, 2, 13, 17, 0, 13, 4, 18, 13, 13, 17, 0, 13, 17, 14, 2, 13, 17, 0, 13, 4, 18, 13, 13, 17, 0, 13, 17, 0, 13, 4, 18, 13, 13, 17, 0, 13, 17, 4, 13, 13, 10, 17, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 4, 13, 10, 4, 13, 10, 17, 13 ]
[ [ 105, 2 ], [ 90, 10 ], [ 99, 18 ], [ 87, 26 ], [ 106, 29 ], [ 102, 33 ], [ 88, 37 ], [ 109, 37 ], [ 85, 37 ], [ 94, 37 ], [ 88, 41 ], [ 109, 41 ], [ 85, 41 ], [ 94, 41 ], [ 93, 44 ], [ 106, 47 ], [ 96, 51 ], [ 88, 55 ], [ 109, 55 ], [ 85, 55 ], [ 94, 55 ], [ 84, 58 ], [ 91, 61 ], [ 111, 65 ], [ 108, 68 ], [ 100, 71 ], [ 81, 75 ], [ 82, 79 ], [ 112, 79 ], [ 97, 79 ], [ 103, 79 ], [ 81, 82 ], [ 84, 85 ], [ 87, 88 ], [ 90, 91 ], [ 93, 94 ], [ 96, 97 ], [ 99, 100 ], [ 102, 103 ], [ 105, 106 ], [ 108, 109 ], [ 111, 112 ] ]
[ "sa = list(input()+'x')\nsb = list(input()+'x')\nsc = list(input()+'x')\n\ncard = sa.pop(0)\nturn = 'A'\nwhile card != 'x':\n if card == 'a':\n card = sa.pop(0)\n turn = 'A'\n elif card == 'b':\n card = sb.pop(0)\n turn = 'B'\n else:\n card = sc.pop(0)\n turn = 'C'\nprint(turn)", "sa = list(input()+'x')", "sa", "list(input()+'x')", "list", "input()+'x'", "input()", "input", "'x'", "sb = list(input()+'x')", "sb", "list(input()+'x')", "list", "input()+'x'", "input()", "input", "'x'", "sc = list(input()+'x')", "sc", "list(input()+'x')", "list", "input()+'x'", "input()", "input", "'x'", "card = sa.pop(0)", "card", "sa.pop(0)", "sa.pop", "sa", "pop", "0", "turn = 'A'", "turn", "'A'", "while card != 'x':\n if card == 'a':\n card = sa.pop(0)\n turn = 'A'\n elif card == 'b':\n card = sb.pop(0)\n turn = 'B'\n else:\n card = sc.pop(0)\n turn = 'C'", "card != 'x'", "card", "'x'", "if card == 'a':\n card = sa.pop(0)\n turn = 'A'\n elif card == 'b':\n card = sb.pop(0)\n turn = 'B'\n else:\n card = sc.pop(0)\n turn = 'C'", "card == 'a'", "card", "'a'", "card = sa.pop(0)", "card", "sa.pop(0)", "sa.pop", "sa", "pop", "0", "turn = 'A'", "turn", "'A'", "elif card == 'b':\n card = sb.pop(0)\n turn = 'B'\n ", "card == 'b'", "card", "'b'", "card = sb.pop(0)", "card", "sb.pop(0)", "sb.pop", "sb", "pop", "0", "turn = 'B'", "turn", "'B'", "card = sc.pop(0)", "card", "sc.pop(0)", "sc.pop", "sc", "pop", "0", "turn = 'C'", "turn", "'C'", "print(turn)", "print", "turn", "turn = 'C'", "'C'", "turn", "card = sb.pop(0)", "sb.pop(0)", "card", "card = sa.pop(0)", "sa.pop(0)", "card", "sb = list(input()+'x')", "list(input()+'x')", "sb", "card = sa.pop(0)", "sa.pop(0)", "card", "turn = 'A'", "'A'", "turn", "sc = list(input()+'x')", "list(input()+'x')", "sc", "turn = 'A'", "'A'", "turn", "sa = list(input()+'x')", "list(input()+'x')", "sa", "card = sc.pop(0)", "sc.pop(0)", "card", "turn = 'B'", "'B'", "turn" ]
sa = list(input()+'x') sb = list(input()+'x') sc = list(input()+'x') card = sa.pop(0) turn = 'A' while card != 'x': if card == 'a': card = sa.pop(0) turn = 'A' elif card == 'b': card = sb.pop(0) turn = 'B' else: card = sc.pop(0) turn = 'C' print(turn)
[ 7, 15, 13, 13, 13, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 13, 12, 4, 18, 4, 18, 18, 13, 13, 13, 13, 0, 13, 12, 4, 13, 4, 13, 0, 13, 12, 4, 13, 13, 4, 18, 4, 13, 13, 0, 13, 12, 4, 13, 13, 4, 18, 4, 13, 13, 0, 13, 12, 4, 13, 4, 13, 13, 4, 18, 4, 13, 13, 0, 13, 12, 4, 13, 4, 13, 13, 4, 18, 4, 13, 13, 4, 18, 13, 13, 2, 17, 17, 0, 13, 4, 13, 17, 0, 13, 2, 2, 17, 17, 17, 12, 13, 41, 28, 13, 4, 13, 17, 4, 4, 13, 0, 13, 13, 0, 13, 12, 2, 4, 13, 13, 4, 13, 17, 23, 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, 13, 13, 4, 13, 18, 17, 13, 14, 2, 13, 17, 4, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 2, 13, 10, 12, 13, 10, 4, 13, 10, 12, 13 ]
[ [ 170, 15 ], [ 176, 27 ], [ 171, 32 ], [ 179, 34 ], [ 171, 42 ], [ 188, 45 ], [ 171, 53 ], [ 182, 56 ], [ 171, 66 ], [ 173, 69 ], [ 171, 79 ], [ 191, 89 ], [ 185, 94 ], [ 105, 104 ], [ 171, 110 ], [ 113, 112 ], [ 116, 115 ], [ 127, 126 ], [ 144, 132 ], [ 112, 133 ], [ 126, 134 ], [ 154, 134 ], [ 138, 137 ], [ 144, 139 ], [ 112, 140 ], [ 126, 141 ], [ 154, 141 ], [ 147, 144 ], [ 112, 145 ], [ 126, 146 ], [ 154, 146 ], [ 144, 148 ], [ 112, 149 ], [ 126, 150 ], [ 154, 150 ], [ 155, 154 ], [ 115, 156 ], [ 137, 157 ], [ 154, 162 ], [ 126, 162 ], [ 195, 168 ], [ 170, 171 ], [ 173, 174 ], [ 176, 177 ], [ 179, 180 ], [ 182, 183 ], [ 185, 186 ], [ 188, 189 ], [ 191, 192 ] ]
[ "import sys, re, os\nfrom collections import deque, defaultdict, Counter\nfrom math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd\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 functools import reduce\nfrom bisect import bisect_left, insort_left\nfrom heapq import heapify, heappush, heappop\n\nINPUT = lambda: sys.stdin.readline().rstrip()\nINT = lambda: int(INPUT())\nMAP = lambda: map(int, INPUT().split())\nS_MAP = lambda: map(str, INPUT().split())\nLIST = lambda: list(map(int, INPUT().split()))\nS_LIST = lambda: list(map(str, INPUT().split()))\n\nsys.setrecursionlimit(10 ** 9)\nINF = float('inf')\nmod = 10 ** 9 + 7\n\n\ndef main():\n S = [INPUT() for _ in range(3)]\n ctoi = lambda c: ord(c) - ord('a')\n\n num = 0\n while len(S[num]) > 0:\n init = S[num][0]\n S[num] = S[num][1:]\n num = ctoi(init)\n\n print(\"ABC\"[num])\n\n\nif __name__ == '__main__':\n main()", "import sys, re, os", "sys", "re", "os", "from collections import deque, defaultdict, Counter", "from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd", "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 functools import reduce", "from bisect import bisect_left, insort_left", "from heapq import heapify, heappush, heappop", "INPUT = lambda: sys.stdin.readline().rstrip()", "INPUT", "lambda: sys.stdin.readline().rstrip()", "sys.stdin.readline().rstrip()", "sys.stdin.readline().rstrip", "sys.stdin.readline()", "sys.stdin.readline", "sys.stdin", "sys", "stdin", "readline", "rstrip", "INT = lambda: int(INPUT())", "INT", "lambda: int(INPUT())", "int(INPUT())", "int", "INPUT()", "INPUT", "MAP = lambda: map(int, INPUT().split())", "MAP", "lambda: map(int, INPUT().split())", "map(int, INPUT().split())", "map", "int", "INPUT().split()", "().split", "()", "INPUT", "split", "S_MAP = lambda: map(str, INPUT().split())", "S_MAP", "lambda: map(str, INPUT().split())", "map(str, INPUT().split())", "map", "str", "INPUT().split()", "().split", "()", "INPUT", "split", "LIST = lambda: list(map(int, INPUT().split()))", "LIST", "lambda: list(map(int, INPUT().split()))", "list(map(int, INPUT().split()))", "list", "map(int, INPUT().split())", "map", "int", "INPUT().split()", "().split", "()", "INPUT", "split", "S_LIST = lambda: list(map(str, INPUT().split()))", "S_LIST", "lambda: list(map(str, INPUT().split()))", "list(map(str, INPUT().split()))", "list", "map(str, INPUT().split())", "map", "str", "INPUT().split()", "().split", "()", "INPUT", "split", "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", "def main():\n S = [INPUT() for _ in range(3)]\n ctoi = lambda c: ord(c) - ord('a')\n\n num = 0\n while len(S[num]) > 0:\n init = S[num][0]\n S[num] = S[num][1:]\n num = ctoi(init)\n\n print(\"ABC\"[num])", "main", "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)]", "ctoi = lambda c: ord(c) - ord('a')", "ctoi", "lambda c: ord(c) - ord('a')", "ord(c) - ord('a')", "ord(c)", "ord", "c", "ord('a')", "ord", "'a'", "c", "num = 0", "num", "0", "while len(S[num]) > 0:\n init = S[num][0]\n S[num] = S[num][1:]\n num = ctoi(init)\n\n ", "len(S[num]) > 0", "len(S[num])", "len", "S[num]", "S", "num", "0", "init = S[num][0]", "init", "S[num][0]", "[num]", "S", "num", "0", "S[num] = S[num][1:]", "S[num]", "S", "num", "S[num][1:]", "[num]", "S", "num", "1:", "1", "num = ctoi(init)", "num", "ctoi(init)", "ctoi", "init", "print(\"ABC\"[num])", "print", "\"ABC\"[num]", "\"ABC\"", "num", "if __name__ == '__main__':\n main()", "__name__ == '__main__'", "__name__", "'__main__'", "main()", "main", "INPUT = lambda: sys.stdin.readline().rstrip()", "lambda: sys.stdin.readline().rstrip()", "INPUT", "S_LIST = lambda: list(map(str, INPUT().split()))", "lambda: list(map(str, INPUT().split()))", "S_LIST", "INT = lambda: int(INPUT())", "lambda: int(INPUT())", "INT", "MAP = lambda: map(int, INPUT().split())", "lambda: map(int, INPUT().split())", "MAP", "LIST = lambda: list(map(int, INPUT().split()))", "lambda: list(map(int, INPUT().split()))", "LIST", "mod = 10 ** 9 + 7", "10 ** 9 + 7", "mod", "S_MAP = lambda: map(str, INPUT().split())", "lambda: map(str, INPUT().split())", "S_MAP", "INF = float('inf')", "float('inf')", "INF", "def main():\n S = [INPUT() for _ in range(3)]\n ctoi = lambda c: ord(c) - ord('a')\n\n num = 0\n while len(S[num]) > 0:\n init = S[num][0]\n S[num] = S[num][1:]\n num = ctoi(init)\n\n print(\"ABC\"[num])", "def main():\n S = [INPUT() for _ in range(3)]\n ctoi = lambda c: ord(c) - ord('a')\n\n num = 0\n while len(S[num]) > 0:\n init = S[num][0]\n S[num] = S[num][1:]\n num = ctoi(init)\n\n print(\"ABC\"[num])", "main" ]
import sys, re, os from collections import deque, defaultdict, Counter from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd 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 functools import reduce from bisect import bisect_left, insort_left from heapq import heapify, heappush, heappop INPUT = lambda: sys.stdin.readline().rstrip() INT = lambda: int(INPUT()) MAP = lambda: map(int, INPUT().split()) S_MAP = lambda: map(str, INPUT().split()) LIST = lambda: list(map(int, INPUT().split())) S_LIST = lambda: list(map(str, INPUT().split())) sys.setrecursionlimit(10 ** 9) INF = float('inf') mod = 10 ** 9 + 7 def main(): S = [INPUT() for _ in range(3)] ctoi = lambda c: ord(c) - ord('a') num = 0 while len(S[num]) > 0: init = S[num][0] S[num] = S[num][1:] num = ctoi(init) print("ABC"[num]) if __name__ == '__main__': main()
[ 7, 12, 13, 14, 2, 13, 17, 14, 40, 13, 4, 13, 17, 4, 13, 4, 13, 13, 13, 13, 4, 18, 13, 13, 17, 14, 2, 13, 17, 14, 40, 13, 4, 13, 17, 4, 13, 4, 13, 13, 13, 13, 4, 18, 13, 13, 17, 14, 2, 13, 17, 14, 40, 13, 4, 13, 17, 4, 13, 4, 13, 13, 13, 13, 4, 18, 13, 13, 17, 23, 13, 23, 13, 23, 13, 23, 13, 0, 13, 4, 13, 4, 13, 13, 4, 13, 4, 13, 13, 4, 13, 4, 13, 4, 13, 13, 13, 13, 4, 18, 13, 13, 17, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 12, 13 ]
[ [ 76, 5 ], [ 70, 9 ], [ 70, 17 ], [ 72, 18 ], [ 74, 19 ], [ 70, 22 ], [ 76, 27 ], [ 72, 31 ], [ 70, 39 ], [ 72, 40 ], [ 74, 41 ], [ 72, 44 ], [ 76, 49 ], [ 74, 53 ], [ 70, 61 ], [ 72, 62 ], [ 74, 63 ], [ 74, 66 ], [ 70, 70 ], [ 72, 72 ], [ 74, 74 ], [ 76, 76 ], [ 110, 78 ], [ 107, 83 ], [ 104, 88 ], [ 114, 94 ], [ 111, 95 ], [ 108, 96 ], [ 105, 97 ], [ 111, 100 ], [ 104, 105 ], [ 107, 108 ], [ 110, 111 ] ]
[ "def check(a, b, c, word):\n if word == 'a':\n if not a:\n print('A')\n exit()\n check(a, b, c, a.pop(0))\n elif word == 'b':\n if not b:\n print('B')\n exit()\n check(a, b, c, b.pop(0))\n elif word == 'c':\n if not c:\n print('C')\n exit()\n check(a, b, c, c.pop(0))\n\na,b,c=list(input()),list(input()),list(input())\ncheck(a, b, c, a.pop(0))", "def check(a, b, c, word):\n if word == 'a':\n if not a:\n print('A')\n exit()\n check(a, b, c, a.pop(0))\n elif word == 'b':\n if not b:\n print('B')\n exit()\n check(a, b, c, b.pop(0))\n elif word == 'c':\n if not c:\n print('C')\n exit()\n check(a, b, c, c.pop(0))", "check", "if word == 'a':\n if not a:\n print('A')\n exit()\n check(a, b, c, a.pop(0))\n elif word == 'b':\n if not b:\n print('B')\n exit()\n check(a, b, c, b.pop(0))\n elif word == 'c':\n if not c:\n print('C')\n exit()\n check(a, b, c, c.pop(0))", "word == 'a'", "word", "'a'", "if not a:\n print('A')\n exit()\n ", "not a", "a", "print('A')", "print", "'A'", "exit()", "exit", "check(a, b, c, a.pop(0))", "check", "a", "b", "c", "a.pop(0)", "a.pop", "a", "pop", "0", "elif word == 'b':\n if not b:\n print('B')\n exit()\n check(a, b, c, b.pop(0))\n ", "word == 'b'", "word", "'b'", "if not b:\n print('B')\n exit()\n ", "not b", "b", "print('B')", "print", "'B'", "exit()", "exit", "check(a, b, c, b.pop(0))", "check", "a", "b", "c", "b.pop(0)", "b.pop", "b", "pop", "0", "elif word == 'c':\n if not c:\n print('C')\n exit()\n check(a, b, c, c.pop(0))", "word == 'c'", "word", "'c'", "if not c:\n print('C')\n exit()\n ", "not c", "c", "print('C')", "print", "'C'", "exit()", "exit", "check(a, b, c, c.pop(0))", "check", "a", "b", "c", "c.pop(0)", "c.pop", "c", "pop", "0", "a", "a", "b", "b", "c", "c", "word", "word", "a,b,c=list(input()),list(input()),list(input())", "a", "list(input())", "list", "input()", "input", "b", "list(input())", "list", "input()", "input", "c", "list(input())", "list", "input()", "input", "check(a, b, c, a.pop(0))", "check", "a", "b", "c", "a.pop(0)", "a.pop", "a", "pop", "0", "c=list(input()),list(input()),list(input())", "list(input())", "c", "b,c=list(input()),list(input()),list(input())", "list(input())", "b", "a,b,c=list(input()),list(input()),list(input())", "list(input())", "a", "def check(a, b, c, word):\n if word == 'a':\n if not a:\n print('A')\n exit()\n check(a, b, c, a.pop(0))\n elif word == 'b':\n if not b:\n print('B')\n exit()\n check(a, b, c, b.pop(0))\n elif word == 'c':\n if not c:\n print('C')\n exit()\n check(a, b, c, c.pop(0))", "def check(a, b, c, word):\n if word == 'a':\n if not a:\n print('A')\n exit()\n check(a, b, c, a.pop(0))\n elif word == 'b':\n if not b:\n print('B')\n exit()\n check(a, b, c, b.pop(0))\n elif word == 'c':\n if not c:\n print('C')\n exit()\n check(a, b, c, c.pop(0))", "check" ]
def check(a, b, c, word): if word == 'a': if not a: print('A') exit() check(a, b, c, a.pop(0)) elif word == 'b': if not b: print('B') exit() check(a, b, c, b.pop(0)) elif word == 'c': if not c: print('C') exit() check(a, b, c, c.pop(0)) a,b,c=list(input()),list(input()),list(input()) check(a, b, c, a.pop(0))
[ 7, 0, 13, 4, 13, 4, 13, 0, 13, 4, 13, 4, 13, 0, 13, 4, 13, 4, 13, 0, 13, 21, 22, 17, 13, 22, 17, 13, 22, 17, 13, 0, 13, 17, 42, 17, 0, 13, 18, 13, 13, 14, 2, 13, 39, 3, 0, 13, 4, 18, 13, 13, 17, 4, 13, 4, 18, 13, 13, 10, 18, 13, 10, 17, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 21, 13, 10, 4, 13 ]
[ [ 78, 2 ], [ 69, 8 ], [ 72, 14 ], [ 75, 20 ], [ 63, 32 ], [ 60, 37 ], [ 76, 39 ], [ 64, 40 ], [ 67, 40 ], [ 61, 43 ], [ 66, 47 ], [ 61, 50 ], [ 67, 57 ], [ 64, 57 ], [ 60, 61 ], [ 63, 64 ], [ 66, 67 ], [ 69, 70 ], [ 72, 73 ], [ 75, 76 ], [ 78, 79 ] ]
[ "a = list(input())\nb = list(input())\nc = list(input())\n\nD = {'a':a, 'b':b, 'c':c}\ncurr = 'a'\nwhile True:\n tmp = D[curr]\n if tmp == []:\n break\n curr = tmp.pop(0)\nprint(curr.upper())\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", "D = {'a':a, 'b':b, 'c':c}", "D", "{'a':a, 'b':b, 'c':c}", "'a'", "'a'", "a", "'b'", "'b'", "b", "'c'", "'c'", "c", "curr = 'a'", "curr", "'a'", "while True:\n tmp = D[curr]\n if tmp == []:\n break\n curr = tmp.pop(0)", "True", "tmp = D[curr]", "tmp", "D[curr]", "D", "curr", "if tmp == []:\n break\n ", "tmp == []", "tmp", "[]", "break", "curr = tmp.pop(0)", "curr", "tmp.pop(0)", "tmp.pop", "tmp", "pop", "0", "print(curr.upper())", "print", "curr.upper()", "curr.upper", "curr", "upper", "tmp = D[curr]", "D[curr]", "tmp", "curr = 'a'", "'a'", "curr", "curr = tmp.pop(0)", "tmp.pop(0)", "curr", "b = list(input())", "list(input())", "b", "c = list(input())", "list(input())", "c", "D = {'a':a, 'b':b, 'c':c}", "{'a':a, 'b':b, 'c':c}", "D", "a = list(input())", "list(input())", "a" ]
a = list(input()) b = list(input()) c = list(input()) D = {'a':a, 'b':b, 'c':c} curr = 'a' while True: tmp = D[curr] if tmp == []: break curr = tmp.pop(0) print(curr.upper())
[ 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, 21, 22, 17, 13, 22, 17, 13, 22, 17, 13, 0, 13, 17, 15, 13, 42, 17, 14, 2, 4, 13, 18, 13, 13, 17, 4, 13, 4, 18, 13, 13, 4, 18, 13, 13, 0, 13, 4, 18, 18, 13, 13, 13, 10, 4, 13, 10, 17, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 21, 13 ]
[ [ 77, 2 ], [ 83, 10 ], [ 71, 18 ], [ 86, 26 ], [ 74, 38 ], [ 87, 49 ], [ 75, 50 ], [ 81, 50 ], [ 75, 56 ], [ 81, 56 ], [ 80, 63 ], [ 87, 67 ], [ 75, 68 ], [ 81, 68 ], [ 71, 72 ], [ 74, 75 ], [ 77, 78 ], [ 80, 81 ], [ 83, 84 ], [ 86, 87 ] ]
[ "A = list(reversed(input()))\nB = list(reversed(input()))\nC = list(reversed(input()))\n\nd = {'a': A, 'b': B, 'c': C}\ncur = 'a'\n\nimport sys\n\nwhile True:\n if len(d[cur]) == 0:\n print(cur.upper())\n sys.exit()\n \n cur = d[cur].pop()", "A = list(reversed(input()))", "A", "list(reversed(input()))", "list", "reversed(input())", "reversed", "input()", "input", "B = list(reversed(input()))", "B", "list(reversed(input()))", "list", "reversed(input())", "reversed", "input()", "input", "C = list(reversed(input()))", "C", "list(reversed(input()))", "list", "reversed(input())", "reversed", "input()", "input", "d = {'a': A, 'b': B, 'c': C}", "d", "{'a': A, 'b': B, 'c': C}", "'a'", "'a'", "A", "'b'", "'b'", "B", "'c'", "'c'", "C", "cur = 'a'", "cur", "'a'", "import sys", "sys", "while True:\n if len(d[cur]) == 0:\n print(cur.upper())\n sys.exit()\n \n cur = d[cur].pop()", "True", "if len(d[cur]) == 0:\n print(cur.upper())\n sys.exit()\n \n ", "len(d[cur]) == 0", "len(d[cur])", "len", "d[cur]", "d", "cur", "0", "print(cur.upper())", "print", "cur.upper()", "cur.upper", "cur", "upper", "sys.exit()", "sys.exit", "sys", "exit", "cur = d[cur].pop()", "cur", "d[cur].pop()", "[cur].pop", "[cur]", "d", "cur", "pop", "C = list(reversed(input()))", "list(reversed(input()))", "C", "cur = 'a'", "'a'", "cur", "A = list(reversed(input()))", "list(reversed(input()))", "A", "cur = d[cur].pop()", "d[cur].pop()", "cur", "B = list(reversed(input()))", "list(reversed(input()))", "B", "d = {'a': A, 'b': B, 'c': C}", "{'a': A, 'b': B, 'c': C}", "d" ]
A = list(reversed(input())) B = list(reversed(input())) C = list(reversed(input())) d = {'a': A, 'b': B, 'c': C} cur = 'a' import sys while True: if len(d[cur]) == 0: print(cur.upper()) sys.exit() cur = d[cur].pop()
[ 7, 0, 13, 4, 13, 13, 0, 13, 4, 13, 13, 0, 13, 4, 13, 13, 12, 13, 38, 5, 4, 13, 17, 0, 13, 4, 18, 13, 13, 17, 14, 2, 13, 17, 4, 13, 14, 2, 13, 17, 4, 13, 14, 2, 13, 17, 4, 13, 29, 12, 13, 38, 5, 4, 13, 17, 0, 13, 4, 18, 13, 13, 17, 14, 2, 13, 17, 4, 13, 14, 2, 13, 17, 4, 13, 14, 2, 13, 17, 4, 13, 29, 12, 13, 38, 5, 4, 13, 17, 0, 13, 4, 18, 13, 13, 17, 14, 2, 13, 17, 4, 13, 14, 2, 13, 17, 4, 13, 14, 2, 13, 17, 4, 13, 29, 4, 13, 10, 12, 13, 10, 4, 13, 10, 12, 13, 10, 12, 13, 10, 4, 13, 10, 4, 13 ]
[ [ 133, 2 ], [ 130, 7 ], [ 121, 12 ], [ 25, 24 ], [ 134, 27 ], [ 24, 32 ], [ 24, 38 ], [ 24, 44 ], [ 58, 57 ], [ 131, 60 ], [ 57, 65 ], [ 125, 68 ], [ 57, 71 ], [ 57, 77 ], [ 91, 90 ], [ 122, 93 ], [ 90, 98 ], [ 125, 101 ], [ 90, 104 ], [ 128, 107 ], [ 90, 110 ], [ 125, 116 ], [ 121, 122 ], [ 130, 131 ], [ 133, 134 ] ]
[ "s_a = list(x for x in input())\ns_b = list(x for x in input())\ns_c = list(x for x in input())\n\ndef turn_a():\n try:\n temp = s_a.pop(0)\n if temp == 'a':\n turn_a()\n elif temp == 'b':\n turn_b()\n elif temp == 'c':\n turn_c()\n except:\n print('A')\n return\n \ndef turn_b():\n try:\n temp = s_b.pop(0)\n if temp == 'a':\n turn_a()\n elif temp == 'b':\n turn_b()\n elif temp == 'c':\n turn_c()\n except:\n print('B')\n return\n\ndef turn_c():\n try:\n temp = s_c.pop(0)\n if temp == 'a':\n turn_a()\n elif temp == 'b':\n turn_b()\n elif temp == 'c':\n turn_c()\n except:\n print('C')\n return\n\nturn_a()\n ", "s_a = list(x for x in input())", "s_a", "list(x for x in input())", "list", "x", "s_b = list(x for x in input())", "s_b", "list(x for x in input())", "list", "x", "s_c = list(x for x in input())", "s_c", "list(x for x in input())", "list", "x", "def turn_a():\n try:\n temp = s_a.pop(0)\n if temp == 'a':\n turn_a()\n elif temp == 'b':\n turn_b()\n elif temp == 'c':\n turn_c()\n except:\n print('A')\n return\n ", "turn_a", "try:\n temp = s_a.pop(0)\n if temp == 'a':\n turn_a()\n elif temp == 'b':\n turn_b()\n elif temp == 'c':\n turn_c()\n except:\n print('A')\n ", "except:\n print('A')\n ", "print('A')", "print", "'A'", "temp = s_a.pop(0)", "temp", "s_a.pop(0)", "s_a.pop", "s_a", "pop", "0", "if temp == 'a':\n turn_a()\n elif temp == 'b':\n turn_b()\n elif temp == 'c':\n turn_c()\n ", "temp == 'a'", "temp", "'a'", "turn_a()", "turn_a", "elif temp == 'b':\n turn_b()\n ", "temp == 'b'", "temp", "'b'", "turn_b()", "turn_b", "elif temp == 'c':\n turn_c()\n ", "temp == 'c'", "temp", "'c'", "turn_c()", "turn_c", "return", "def turn_b():\n try:\n temp = s_b.pop(0)\n if temp == 'a':\n turn_a()\n elif temp == 'b':\n turn_b()\n elif temp == 'c':\n turn_c()\n except:\n print('B')\n return", "turn_b", "try:\n temp = s_b.pop(0)\n if temp == 'a':\n turn_a()\n elif temp == 'b':\n turn_b()\n elif temp == 'c':\n turn_c()\n except:\n print('B')\n ", "except:\n print('B')\n ", "print('B')", "print", "'B'", "temp = s_b.pop(0)", "temp", "s_b.pop(0)", "s_b.pop", "s_b", "pop", "0", "if temp == 'a':\n turn_a()\n elif temp == 'b':\n turn_b()\n elif temp == 'c':\n turn_c()\n ", "temp == 'a'", "temp", "'a'", "turn_a()", "turn_a", "elif temp == 'b':\n turn_b()\n ", "temp == 'b'", "temp", "'b'", "turn_b()", "turn_b", "elif temp == 'c':\n turn_c()\n ", "temp == 'c'", "temp", "'c'", "turn_c()", "turn_c", "return", "def turn_c():\n try:\n temp = s_c.pop(0)\n if temp == 'a':\n turn_a()\n elif temp == 'b':\n turn_b()\n elif temp == 'c':\n turn_c()\n except:\n print('C')\n return", "turn_c", "try:\n temp = s_c.pop(0)\n if temp == 'a':\n turn_a()\n elif temp == 'b':\n turn_b()\n elif temp == 'c':\n turn_c()\n except:\n print('C')\n ", "except:\n print('C')\n ", "print('C')", "print", "'C'", "temp = s_c.pop(0)", "temp", "s_c.pop(0)", "s_c.pop", "s_c", "pop", "0", "if temp == 'a':\n turn_a()\n elif temp == 'b':\n turn_b()\n elif temp == 'c':\n turn_c()\n ", "temp == 'a'", "temp", "'a'", "turn_a()", "turn_a", "elif temp == 'b':\n turn_b()\n ", "temp == 'b'", "temp", "'b'", "turn_b()", "turn_b", "elif temp == 'c':\n turn_c()\n ", "temp == 'c'", "temp", "'c'", "turn_c()", "turn_c", "return", "turn_a()", "turn_a", "def turn_c():\n try:\n temp = s_c.pop(0)\n if temp == 'a':\n turn_a()\n elif temp == 'b':\n turn_b()\n elif temp == 'c':\n turn_c()\n except:\n print('C')\n return", "def turn_c():\n try:\n temp = s_c.pop(0)\n if temp == 'a':\n turn_a()\n elif temp == 'b':\n turn_b()\n elif temp == 'c':\n turn_c()\n except:\n print('C')\n return", "turn_c", "s_c = list(x for x in input())", "list(x for x in input())", "s_c", "def turn_a():\n try:\n temp = s_a.pop(0)\n if temp == 'a':\n turn_a()\n elif temp == 'b':\n turn_b()\n elif temp == 'c':\n turn_c()\n except:\n print('A')\n return\n ", "def turn_a():\n try:\n temp = s_a.pop(0)\n if temp == 'a':\n turn_a()\n elif temp == 'b':\n turn_b()\n elif temp == 'c':\n turn_c()\n except:\n print('A')\n return\n ", "turn_a", "def turn_b():\n try:\n temp = s_b.pop(0)\n if temp == 'a':\n turn_a()\n elif temp == 'b':\n turn_b()\n elif temp == 'c':\n turn_c()\n except:\n print('B')\n return", "def turn_b():\n try:\n temp = s_b.pop(0)\n if temp == 'a':\n turn_a()\n elif temp == 'b':\n turn_b()\n elif temp == 'c':\n turn_c()\n except:\n print('B')\n return", "turn_b", "s_b = list(x for x in input())", "list(x for x in input())", "s_b", "s_a = list(x for x in input())", "list(x for x in input())", "s_a" ]
s_a = list(x for x in input()) s_b = list(x for x in input()) s_c = list(x for x in input()) def turn_a(): try: temp = s_a.pop(0) if temp == 'a': turn_a() elif temp == 'b': turn_b() elif temp == 'c': turn_c() except: print('A') return def turn_b(): try: temp = s_b.pop(0) if temp == 'a': turn_a() elif temp == 'b': turn_b() elif temp == 'c': turn_c() except: print('B') return def turn_c(): try: temp = s_c.pop(0) if temp == 'a': turn_a() elif temp == 'b': turn_b() elif temp == 'c': turn_c() except: print('C') return turn_a()
[ 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 ]
[ [ 97, 2 ], [ 94, 8 ], [ 82, 14 ], [ 85, 20 ], [ 98, 23 ], [ 86, 30 ], [ 89, 30 ], [ 92, 30 ], [ 101, 30 ], [ 98, 34 ], [ 100, 41 ], [ 98, 44 ], [ 86, 49 ], [ 89, 49 ], [ 92, 49 ], [ 101, 49 ], [ 95, 53 ], [ 91, 60 ], [ 95, 63 ], [ 83, 68 ], [ 88, 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())\nst = a.pop(0)\nwhile True:\n if st == 'a':\n if a == []:\n print('A')\n break\n else:\n st = a.pop(0)\n elif st == 'b':\n if b == []:\n print('B')\n break\n else:\n st = b.pop(0)\n else:\n if c == []:\n print('C')\n break\n else:\n st = 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", "st = a.pop(0)", "st", "a.pop(0)", "a.pop", "a", "pop", "0", "while True:\n if st == 'a':\n if a == []:\n print('A')\n break\n else:\n st = a.pop(0)\n elif st == 'b':\n if b == []:\n print('B')\n break\n else:\n st = b.pop(0)\n else:\n if c == []:\n print('C')\n break\n else:\n st = c.pop(0)", "True", "if st == 'a':\n if a == []:\n print('A')\n break\n else:\n st = a.pop(0)\n elif st == 'b':\n if b == []:\n print('B')\n break\n else:\n st = b.pop(0)\n else:\n if c == []:\n print('C')\n break\n else:\n st = c.pop(0)", "st == 'a'", "st", "'a'", "if a == []:\n print('A')\n break\n else:\n st = a.pop(0)\n ", "a == []", "a", "[]", "print('A')", "print", "'A'", "break", "st = a.pop(0)", "st", "a.pop(0)", "a.pop", "a", "pop", "0", "elif st == 'b':\n if b == []:\n print('B')\n break\n else:\n st = b.pop(0)\n ", "st == 'b'", "st", "'b'", "if b == []:\n print('B')\n break\n else:\n st = b.pop(0)\n ", "b == []", "b", "[]", "print('B')", "print", "'B'", "break", "st = b.pop(0)", "st", "b.pop(0)", "b.pop", "b", "pop", "0", "if c == []:\n print('C')\n break\n else:\n st = c.pop(0)", "c == []", "c", "[]", "print('C')", "print", "'C'", "break", "st = c.pop(0)", "st", "c.pop(0)", "c.pop", "c", "pop", "0", "c = list(input())", "list(input())", "c", "st = a.pop(0)", "a.pop(0)", "st", "st = c.pop(0)", "c.pop(0)", "st", "st = b.pop(0)", "b.pop(0)", "st", "b = list(input())", "list(input())", "b", "a = list(input())", "list(input())", "a", "st = a.pop(0)", "a.pop(0)", "st" ]
a = list(input()) b = list(input()) c = list(input()) st = a.pop(0) while True: if st == 'a': if a == []: print('A') break else: st = a.pop(0) elif st == 'b': if b == []: print('B') break else: st = b.pop(0) else: if c == []: print('C') break else: st = c.pop(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, 13, 39, 4, 13, 17, 3, 0, 13, 18, 13, 17, 24, 18, 13, 17, 14, 2, 13, 17, 14, 2, 13, 39, 4, 13, 17, 3, 0, 13, 18, 13, 17, 24, 18, 13, 17, 14, 2, 13, 39, 4, 13, 17, 3, 0, 13, 18, 13, 17, 24, 18, 13, 17, 10, 4, 13, 10, 4, 13, 10, 18, 13, 10, 4, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13 ]
[ [ 99, 2 ], [ 90, 8 ], [ 93, 14 ], [ 96, 20 ], [ 100, 22 ], [ 100, 26 ], [ 97, 32 ], [ 103, 32 ], [ 109, 32 ], [ 106, 32 ], [ 100, 36 ], [ 105, 43 ], [ 100, 45 ], [ 100, 49 ], [ 97, 53 ], [ 103, 53 ], [ 109, 53 ], [ 106, 53 ], [ 91, 57 ], [ 108, 64 ], [ 91, 66 ], [ 91, 70 ], [ 94, 74 ], [ 102, 81 ], [ 94, 83 ], [ 94, 87 ], [ 90, 91 ], [ 93, 94 ], [ 96, 97 ], [ 99, 100 ], [ 102, 103 ], [ 105, 106 ], [ 108, 109 ] ]
[ "A = list(input())\nB = list(input())\nC = list(input())\nn = A[0]\ndel A[0]\nwhile True:\n if n == \"a\":\n if A == []:\n print(\"A\")\n break\n n = A[0]\n del A[0]\n elif n == \"b\":\n if B == []:\n print(\"B\")\n break\n n = B[0]\n del B[0]\n else:\n if C == []:\n print(\"C\")\n break\n n = C[0]\n del C[0]\n ", "A = list(input())", "A", "list(input())", "list", "input()", "input", "B = list(input())", "B", "list(input())", "list", "input()", "input", "C = list(input())", "C", "list(input())", "list", "input()", "input", "n = A[0]", "n", "A[0]", "A", "0", "del A[0]", "A[0]", "A", "0", "while True:\n if n == \"a\":\n if A == []:\n print(\"A\")\n break\n n = A[0]\n del A[0]\n elif n == \"b\":\n if B == []:\n print(\"B\")\n break\n n = B[0]\n del B[0]\n else:\n if C == []:\n print(\"C\")\n break\n n = C[0]\n del C[0]\n ", "True", "if n == \"a\":\n if A == []:\n print(\"A\")\n break\n n = A[0]\n del A[0]\n elif n == \"b\":\n if B == []:\n print(\"B\")\n break\n n = B[0]\n del B[0]\n else:\n if C == []:\n print(\"C\")\n break\n n = C[0]\n del C[0]\n ", "n == \"a\"", "n", "\"a\"", "if A == []:\n print(\"A\")\n break\n ", "A == []", "A", "[]", "print(\"A\")", "print", "\"A\"", "break", "n = A[0]", "n", "A[0]", "A", "0", "del A[0]", "A[0]", "A", "0", "elif n == \"b\":\n if B == []:\n print(\"B\")\n break\n n = B[0]\n del B[0]\n ", "n == \"b\"", "n", "\"b\"", "if B == []:\n print(\"B\")\n break\n ", "B == []", "B", "[]", "print(\"B\")", "print", "\"B\"", "break", "n = B[0]", "n", "B[0]", "B", "0", "del B[0]", "B[0]", "B", "0", "if C == []:\n print(\"C\")\n break\n ", "C == []", "C", "[]", "print(\"C\")", "print", "\"C\"", "break", "n = C[0]", "n", "C[0]", "C", "0", "del C[0]", "C[0]", "C", "0", "B = list(input())", "list(input())", "B", "C = list(input())", "list(input())", "C", "n = A[0]", "A[0]", "n", "A = list(input())", "list(input())", "A", "n = C[0]", "C[0]", "n", "n = A[0]", "A[0]", "n", "n = B[0]", "B[0]", "n" ]
A = list(input()) B = list(input()) C = list(input()) n = A[0] del A[0] while True: if n == "a": if A == []: print("A") break n = A[0] del A[0] elif n == "b": if B == []: print("B") break n = B[0] del B[0] else: if C == []: print("C") break n = C[0] del C[0]
[ 7, 15, 41, 28, 13, 4, 13, 17, 4, 4, 13, 4, 13, 0, 13, 13, 0, 13, 21, 22, 17, 17, 22, 17, 17, 22, 17, 17, 0, 13, 21, 22, 17, 17, 22, 17, 17, 22, 17, 17, 0, 13, 17, 28, 13, 4, 13, 17, 0, 13, 4, 18, 18, 13, 13, 13, 0, 13, 18, 13, 13, 14, 40, 18, 13, 13, 4, 13, 18, 13, 13, 4, 13, 10, 18, 13, 10, 17, 13, 10, 4, 13, 10, 21, 13, 10, 21, 13, 10, 13, 13 ]
[ [ 5, 4 ], [ 89, 14 ], [ 86, 17 ], [ 83, 29 ], [ 77, 41 ], [ 45, 44 ], [ 80, 49 ], [ 90, 53 ], [ 78, 54 ], [ 75, 54 ], [ 74, 57 ], [ 87, 59 ], [ 81, 60 ], [ 90, 64 ], [ 75, 65 ], [ 78, 65 ], [ 84, 69 ], [ 75, 70 ], [ 78, 70 ], [ 74, 75 ], [ 77, 78 ], [ 80, 81 ], [ 83, 84 ], [ 86, 87 ], [ 89, 90 ] ]
[ "from collections import deque\ns = [deque(input()) for _ in range(3)]\nd = {\"a\":0, \"b\":1, \"c\":2}\nD = {0:\"A\", 1:\"B\", 2:\"C\"}\nplayer = 0\nfor _ in range(301):\n x = s[player].popleft()\n player = d[x]\n if not s[player]:\n print(D[player])\n exit()", "from collections import deque", "deque(input()) for _ in range(3)", "for _ in range(3)", "_", "range(3)", "range", "3", "for _ in range(3)", "deque(input())", "deque", "input()", "input", "s = [deque(input()) for _ in range(3)]", "s", "[deque(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", "D = {0:\"A\", 1:\"B\", 2:\"C\"}", "D", "{0:\"A\", 1:\"B\", 2:\"C\"}", "0", "0", "\"A\"", "1", "1", "\"B\"", "2", "2", "\"C\"", "player = 0", "player", "0", "for _ in range(301):\n x = s[player].popleft()\n player = d[x]\n if not s[player]:\n print(D[player])\n exit()", "_", "range(301)", "range", "301", "x = s[player].popleft()", "x", "s[player].popleft()", "[player].popleft", "[player]", "s", "player", "popleft", "player = d[x]", "player", "d[x]", "d", "x", "if not s[player]:\n print(D[player])\n exit()", "not s[player]", "s[player]", "s", "player", "print(D[player])", "print", "D[player]", "D", "player", "exit()", "exit", "player = d[x]", "d[x]", "player", "player = 0", "0", "player", "x = s[player].popleft()", "s[player].popleft()", "x", "D = {0:\"A\", 1:\"B\", 2:\"C\"}", "{0:\"A\", 1:\"B\", 2:\"C\"}", "D", "d = {\"a\":0, \"b\":1, \"c\":2}", "{\"a\":0, \"b\":1, \"c\":2}", "d", "s = [deque(input()) for _ in range(3)]", "[deque(input()) for _ in range(3)]", "s" ]
from collections import deque s = [deque(input()) for _ in range(3)] d = {"a":0, "b":1, "c":2} D = {0:"A", 1:"B", 2:"C"} player = 0 for _ in range(301): x = s[player].popleft() player = d[x] if not s[player]: print(D[player]) exit()
[ 7, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 0, 13, 17, 42, 17, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 0, 13, 17, 3, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 0, 13, 17, 3, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 14, 2, 4, 13, 13, 17, 0, 13, 17, 3, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 4, 13, 13, 10, 18, 13, 10, 18, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 17, 13, 10, 18, 13, 10, 4, 13, 10, 18, 13, 10, 18, 13, 10, 4, 13, 10, 4, 13 ]
[ [ 134, 2 ], [ 146, 6 ], [ 143, 10 ], [ 125, 14 ], [ 135, 16 ], [ 104, 19 ], [ 135, 21 ], [ 116, 25 ], [ 126, 31 ], [ 123, 31 ], [ 132, 31 ], [ 138, 31 ], [ 105, 37 ], [ 135, 37 ], [ 120, 37 ], [ 110, 40 ], [ 137, 44 ], [ 105, 46 ], [ 135, 46 ], [ 120, 46 ], [ 119, 49 ], [ 105, 51 ], [ 135, 51 ], [ 120, 51 ], [ 126, 56 ], [ 123, 56 ], [ 132, 56 ], [ 138, 56 ], [ 147, 62 ], [ 141, 62 ], [ 113, 65 ], [ 131, 69 ], [ 147, 71 ], [ 141, 71 ], [ 140, 74 ], [ 147, 76 ], [ 141, 76 ], [ 144, 83 ], [ 108, 83 ], [ 128, 86 ], [ 122, 90 ], [ 144, 92 ], [ 108, 92 ], [ 107, 95 ], [ 144, 97 ], [ 108, 97 ], [ 129, 102 ], [ 114, 102 ], [ 111, 102 ], [ 117, 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 ] ]
[ "#k = int(input())\n#s = input()\n#a, b = map(int, input().split())\n#s, t = map(str, input().split())\n#l = list(map(int, input().split()))\n#l = [list(map(int,input().split())) for i in range(n)]\n\na = input()\nb = input()\nc = input()\n\ntemp = a[0]\na = a[1:]\n\nans = \"A\"\nwhile True:\n if temp == \"a\":\n if len(a) == 0:\n ans = \"A\"\n break\n else:\n temp = a[0]\n a = a[1:]\n elif temp == \"b\":\n if len(b) == 0:\n ans = \"B\"\n break\n else:\n temp = b[0]\n b = b[1:]\n else:\n if len(c) == 0:\n ans = \"C\"\n break\n else:\n temp = c[0]\n c = c[1:]\n\nprint(ans)\n", "a = input()", "a", "input()", "input", "b = input()", "b", "input()", "input", "c = input()", "c", "input()", "input", "temp = a[0]", "temp", "a[0]", "a", "0", "a = a[1:]", "a", "a[1:]", "a", "1:", "1", "ans = \"A\"", "ans", "\"A\"", "while True:\n if temp == \"a\":\n if len(a) == 0:\n ans = \"A\"\n break\n else:\n temp = a[0]\n a = a[1:]\n elif temp == \"b\":\n if len(b) == 0:\n ans = \"B\"\n break\n else:\n temp = b[0]\n b = b[1:]\n else:\n if len(c) == 0:\n ans = \"C\"\n break\n else:\n temp = c[0]\n c = c[1:]", "True", "if temp == \"a\":\n if len(a) == 0:\n ans = \"A\"\n break\n else:\n temp = a[0]\n a = a[1:]\n elif temp == \"b\":\n if len(b) == 0:\n ans = \"B\"\n break\n else:\n temp = b[0]\n b = b[1:]\n else:\n if len(c) == 0:\n ans = \"C\"\n break\n else:\n temp = c[0]\n c = c[1:]", "temp == \"a\"", "temp", "\"a\"", "if len(a) == 0:\n ans = \"A\"\n break\n else:\n temp = a[0]\n a = a[1:]\n ", "len(a) == 0", "len(a)", "len", "a", "0", "ans = \"A\"", "ans", "\"A\"", "break", "temp = a[0]", "temp", "a[0]", "a", "0", "a = a[1:]", "a", "a[1:]", "a", "1:", "1", "elif temp == \"b\":\n if len(b) == 0:\n ans = \"B\"\n break\n else:\n temp = b[0]\n b = b[1:]\n ", "temp == \"b\"", "temp", "\"b\"", "if len(b) == 0:\n ans = \"B\"\n break\n else:\n temp = b[0]\n b = b[1:]\n ", "len(b) == 0", "len(b)", "len", "b", "0", "ans = \"B\"", "ans", "\"B\"", "break", "temp = b[0]", "temp", "b[0]", "b", "0", "b = b[1:]", "b", "b[1:]", "b", "1:", "1", "if len(c) == 0:\n ans = \"C\"\n break\n else:\n temp = c[0]\n c = c[1:]", "len(c) == 0", "len(c)", "len", "c", "0", "ans = \"C\"", "ans", "\"C\"", "break", "temp = c[0]", "temp", "c[0]", "c", "0", "c = c[1:]", "c", "c[1:]", "c", "1:", "1", "print(ans)", "print", "ans", "a = a[1:]", "a[1:]", "a", "c = c[1:]", "c[1:]", "c", "ans = \"A\"", "\"A\"", "ans", "ans = \"B\"", "\"B\"", "ans", "ans = \"A\"", "\"A\"", "ans", "a = a[1:]", "a[1:]", "a", "temp = c[0]", "c[0]", "temp", "temp = a[0]", "a[0]", "temp", "ans = \"C\"", "\"C\"", "ans", "temp = b[0]", "b[0]", "temp", "a = input()", "input()", "a", "temp = a[0]", "a[0]", "temp", "b = b[1:]", "b[1:]", "b", "c = input()", "input()", "c", "b = input()", "input()", "b" ]
#k = int(input()) #s = input() #a, b = map(int, input().split()) #s, t = map(str, input().split()) #l = list(map(int, input().split())) #l = [list(map(int,input().split())) for i in range(n)] a = input() b = input() c = input() temp = a[0] a = a[1:] ans = "A" while True: if temp == "a": if len(a) == 0: ans = "A" break else: temp = a[0] a = a[1:] elif temp == "b": if len(b) == 0: ans = "B" break else: temp = b[0] b = b[1:] else: if len(c) == 0: ans = "C" break else: temp = c[0] c = c[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, 17, 0, 13, 21, 22, 17, 17, 22, 17, 17, 22, 17, 17, 42, 2, 18, 13, 13, 4, 13, 18, 13, 13, 0, 13, 18, 18, 13, 13, 18, 13, 13, 0, 18, 13, 13, 17, 4, 13, 4, 18, 13, 13, 10, 4, 13, 10, 4, 13, 10, 18, 13, 10, 4, 13, 10, 17, 13, 10, 21, 13, 10, 21, 13 ]
[ [ 74, 2 ], [ 71, 6 ], [ 80, 10 ], [ 86, 14 ], [ 83, 26 ], [ 89, 29 ], [ 60, 42 ], [ 90, 43 ], [ 84, 44 ], [ 78, 44 ], [ 87, 48 ], [ 84, 49 ], [ 78, 49 ], [ 77, 51 ], [ 87, 54 ], [ 84, 55 ], [ 78, 55 ], [ 60, 56 ], [ 90, 57 ], [ 84, 58 ], [ 78, 58 ], [ 63, 60 ], [ 90, 61 ], [ 78, 62 ], [ 84, 62 ], [ 78, 68 ], [ 84, 68 ], [ 71, 72 ], [ 74, 75 ], [ 77, 78 ], [ 80, 81 ], [ 83, 84 ], [ 86, 87 ], [ 89, 90 ] ]
[ "ma=input()\nmb=input()\nmc=input()\nmdic={\"a\":ma,\"b\":mb,\"c\":mc}\nm=\"a\"\nndic={\"a\":0,\"b\":-1,\"c\":-1}\nwhile ndic[m]<len(mdic[m]):\n m=mdic[m][ndic[m]]\n ndic[m]+=1\nprint(m.upper())", "ma=input()", "ma", "input()", "input", "mb=input()", "mb", "input()", "input", "mc=input()", "mc", "input()", "input", "mdic={\"a\":ma,\"b\":mb,\"c\":mc}", "mdic", "{\"a\":ma,\"b\":mb,\"c\":mc}", "\"a\"", "\"a\"", "ma", "\"b\"", "\"b\"", "mb", "\"c\"", "\"c\"", "mc", "m=\"a\"", "m", "\"a\"", "ndic={\"a\":0,\"b\":-1,\"c\":-1}", "ndic", "{\"a\":0,\"b\":-1,\"c\":-1}", "\"a\"", "\"a\"", "0", "\"b\"", "\"b\"", "-1", "\"c\"", "\"c\"", "-1", "while ndic[m]<len(mdic[m]):\n m=mdic[m][ndic[m]]\n ndic[m]+=1", "ndic[m]<len(mdic[m])", "ndic[m]", "ndic", "m", "len(mdic[m])", "len", "mdic[m]", "mdic", "m", "m=mdic[m][ndic[m]]", "m", "mdic[m][ndic[m]]", "[m]", "mdic", "m", "ndic[m]", "ndic", "m", "ndic[m]+=1", "ndic[m]", "ndic", "m", "1", "print(m.upper())", "print", "m.upper()", "m.upper", "m", "upper", "mb=input()", "input()", "mb", "ma=input()", "input()", "ma", "m=mdic[m][ndic[m]]", "mdic[m][ndic[m]]", "m", "mc=input()", "input()", "mc", "m=\"a\"", "\"a\"", "m", "mdic={\"a\":ma,\"b\":mb,\"c\":mc}", "{\"a\":ma,\"b\":mb,\"c\":mc}", "mdic", "ndic={\"a\":0,\"b\":-1,\"c\":-1}", "{\"a\":0,\"b\":-1,\"c\":-1}", "ndic" ]
ma=input() mb=input() mc=input() mdic={"a":ma,"b":mb,"c":mc} m="a" ndic={"a":0,"b":-1,"c":-1} while ndic[m]<len(mdic[m]): m=mdic[m][ndic[m]] ndic[m]+=1 print(m.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, 17, 13, 10, 13, 13, 10, 4, 13 ]
[ [ 4, 3 ], [ 3, 6 ], [ 40, 12 ], [ 37, 15 ], [ 41, 19 ], [ 38, 20 ], [ 44, 20 ], [ 43, 22 ], [ 41, 26 ], [ 38, 27 ], [ 44, 27 ], [ 44, 34 ], [ 38, 34 ], [ 37, 38 ], [ 40, 41 ], [ 43, 44 ] ]
[ "S= {char:list(input()) for char in 'abc'}\nturn = 'a'\nwhile S[turn]:\n turn = S[turn].pop(0)\nprint(turn.upper())", "char:list(input()) for char in 'abc'", "for char in 'abc'", "char", "'abc'", "for char in 'abc'", "char", "list(input())", "list", "input()", "input", "S= {char:list(input()) for char in 'abc'}", "S", "{char:list(input()) for char in 'abc'}", "turn = 'a'", "turn", "'a'", "while S[turn]:\n turn = S[turn].pop(0)", "S[turn]", "S", "turn", "turn = S[turn].pop(0)", "turn", "S[turn].pop(0)", "[turn].pop", "[turn]", "S", "turn", "pop", "0", "print(turn.upper())", "print", "turn.upper()", "turn.upper", "turn", "upper", "turn = 'a'", "'a'", "turn", "S= {char:list(input()) for char in 'abc'}", "{char:list(input()) for char in 'abc'}", "S", "turn = S[turn].pop(0)", "S[turn].pop(0)", "turn" ]
S= {char:list(input()) for char in 'abc'} turn = 'a' while S[turn]: turn = S[turn].pop(0) print(turn.upper())
[ 7, 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, 18, 13, 10, 4, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 4, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 4, 13 ]
[ [ 99, 2 ], [ 126, 6 ], [ 111, 10 ], [ 108, 14 ], [ 100, 16 ], [ 123, 19 ], [ 100, 21 ], [ 109, 28 ], [ 106, 28 ], [ 115, 28 ], [ 118, 28 ], [ 124, 32 ], [ 100, 32 ], [ 97, 32 ], [ 117, 39 ], [ 124, 41 ], [ 100, 41 ], [ 97, 41 ], [ 96, 44 ], [ 124, 46 ], [ 100, 46 ], [ 97, 46 ], [ 109, 51 ], [ 106, 51 ], [ 115, 51 ], [ 118, 51 ], [ 127, 55 ], [ 103, 55 ], [ 114, 62 ], [ 127, 64 ], [ 103, 64 ], [ 102, 67 ], [ 127, 69 ], [ 103, 69 ], [ 109, 74 ], [ 106, 74 ], [ 115, 74 ], [ 118, 74 ], [ 112, 78 ], [ 121, 78 ], [ 105, 85 ], [ 112, 87 ], [ 121, 87 ], [ 120, 90 ], [ 112, 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\ntmp = sa[0]\nsa = sa[1:]\nwhile True:\n if tmp == 'a':\n if sa=='':\n print('A')\n break\n tmp = sa[0]\n sa = sa[1:]\n elif tmp == 'b':\n if sb=='':\n print('B')\n break\n tmp = sb[0]\n sb = sb[1:]\n elif tmp == 'c':\n if sc=='':\n print('C')\n break\n tmp = sc[0]\n sc = sc[1:]", "sa = input()", "sa", "input()", "input", "sb = input()", "sb", "input()", "input", "sc = input()", "sc", "input()", "input", "tmp = sa[0]", "tmp", "sa[0]", "sa", "0", "sa = sa[1:]", "sa", "sa[1:]", "sa", "1:", "1", "while True:\n if tmp == 'a':\n if sa=='':\n print('A')\n break\n tmp = sa[0]\n sa = sa[1:]\n elif tmp == 'b':\n if sb=='':\n print('B')\n break\n tmp = sb[0]\n sb = sb[1:]\n elif tmp == 'c':\n if sc=='':\n print('C')\n break\n tmp = sc[0]\n sc = sc[1:]", "True", "if tmp == 'a':\n if sa=='':\n print('A')\n break\n tmp = sa[0]\n sa = sa[1:]\n elif tmp == 'b':\n if sb=='':\n print('B')\n break\n tmp = sb[0]\n sb = sb[1:]\n elif tmp == 'c':\n if sc=='':\n print('C')\n break\n tmp = sc[0]\n sc = sc[1:]", "tmp == 'a'", "tmp", "'a'", "if sa=='':\n print('A')\n break\n ", "sa==''", "sa", "''", "print('A')", "print", "'A'", "break", "tmp = sa[0]", "tmp", "sa[0]", "sa", "0", "sa = sa[1:]", "sa", "sa[1:]", "sa", "1:", "1", "elif tmp == 'b':\n if sb=='':\n print('B')\n break\n tmp = sb[0]\n sb = sb[1:]\n ", "tmp == 'b'", "tmp", "'b'", "if sb=='':\n print('B')\n break\n ", "sb==''", "sb", "''", "print('B')", "print", "'B'", "break", "tmp = sb[0]", "tmp", "sb[0]", "sb", "0", "sb = sb[1:]", "sb", "sb[1:]", "sb", "1:", "1", "elif tmp == 'c':\n if sc=='':\n print('C')\n break\n tmp = sc[0]\n sc = sc[1:]", "tmp == 'c'", "tmp", "'c'", "if sc=='':\n print('C')\n break\n ", "sc==''", "sc", "''", "print('C')", "print", "'C'", "break", "tmp = sc[0]", "tmp", "sc[0]", "sc", "0", "sc = sc[1:]", "sc", "sc[1:]", "sc", "1:", "1", "sa = sa[1:]", "sa[1:]", "sa", "sa = input()", "input()", "sa", "sb = sb[1:]", "sb[1:]", "sb", "tmp = sc[0]", "sc[0]", "tmp", "tmp = sa[0]", "sa[0]", "tmp", "sc = input()", "input()", "sc", "tmp = sb[0]", "sb[0]", "tmp", "tmp = sa[0]", "sa[0]", "tmp", "sc = sc[1:]", "sc[1:]", "sc", "sa = sa[1:]", "sa[1:]", "sa", "sb = input()", "input()", "sb" ]
sa = input() sb = input() sc = input() tmp = sa[0] sa = sa[1:] while True: if tmp == 'a': if sa=='': print('A') break tmp = sa[0] sa = sa[1:] elif tmp == 'b': if sb=='': print('B') break tmp = sb[0] sb = sb[1:] elif tmp == 'c': if sc=='': print('C') break tmp = sc[0] sc = sc[1:]
[ 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, 17, 0, 13, 17, 0, 13, 17, 0, 13, 18, 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, 4, 13, 10, 4, 13, 10, 17, 13, 10, 18, 13, 10, 17, 13, 10, 18, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 4, 13, 10, 4, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13 ]
[ [ 134, 2 ], [ 128, 6 ], [ 143, 10 ], [ 137, 14 ], [ 135, 17 ], [ 107, 19 ], [ 129, 22 ], [ 110, 24 ], [ 144, 27 ], [ 140, 29 ], [ 131, 32 ], [ 146, 35 ], [ 101, 38 ], [ 135, 40 ], [ 102, 46 ], [ 117, 46 ], [ 123, 46 ], [ 105, 46 ], [ 141, 50 ], [ 114, 50 ], [ 138, 51 ], [ 104, 57 ], [ 135, 59 ], [ 141, 60 ], [ 114, 60 ], [ 113, 62 ], [ 102, 66 ], [ 117, 66 ], [ 123, 66 ], [ 105, 66 ], [ 132, 70 ], [ 126, 70 ], [ 108, 71 ], [ 122, 77 ], [ 129, 79 ], [ 132, 80 ], [ 126, 80 ], [ 125, 82 ], [ 147, 86 ], [ 120, 86 ], [ 111, 87 ], [ 116, 93 ], [ 144, 95 ], [ 147, 96 ], [ 120, 96 ], [ 119, 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 ] ]
[ "a = input()\nb = input()\nc = input()\n\nla = len(a)\nlb = len(b)\nlc = len(c)\n\nna = 1\nnb = 0\nnc = 0\n\nnow = a[0]\n\nwhile True:\n if now == 'a':\n if na == la:\n print('A')\n break\n else:\n now = a[na]\n na += 1\n elif now == 'b':\n if nb == lb:\n print('B')\n break\n else:\n now = b[nb]\n nb += 1\n else:\n if nc == lc:\n print('C')\n break\n else:\n now = c[nc]\n nc += 1", "a = input()", "a", "input()", "input", "b = input()", "b", "input()", "input", "c = input()", "c", "input()", "input", "la = len(a)", "la", "len(a)", "len", "a", "lb = len(b)", "lb", "len(b)", "len", "b", "lc = len(c)", "lc", "len(c)", "len", "c", "na = 1", "na", "1", "nb = 0", "nb", "0", "nc = 0", "nc", "0", "now = a[0]", "now", "a[0]", "a", "0", "while True:\n if now == 'a':\n if na == la:\n print('A')\n break\n else:\n now = a[na]\n na += 1\n elif now == 'b':\n if nb == lb:\n print('B')\n break\n else:\n now = b[nb]\n nb += 1\n else:\n if nc == lc:\n print('C')\n break\n else:\n now = c[nc]\n nc += 1", "True", "if now == 'a':\n if na == la:\n print('A')\n break\n else:\n now = a[na]\n na += 1\n elif now == 'b':\n if nb == lb:\n print('B')\n break\n else:\n now = b[nb]\n nb += 1\n else:\n if nc == lc:\n print('C')\n break\n else:\n now = c[nc]\n nc += 1", "now == 'a'", "now", "'a'", "if na == la:\n print('A')\n break\n else:\n now = a[na]\n na += 1\n ", "na == la", "na", "la", "print('A')", "print", "'A'", "break", "now = a[na]", "now", "a[na]", "a", "na", "na += 1", "na", "1", "elif now == 'b':\n if nb == lb:\n print('B')\n break\n else:\n now = b[nb]\n nb += 1\n ", "now == 'b'", "now", "'b'", "if nb == lb:\n print('B')\n break\n else:\n now = b[nb]\n nb += 1\n ", "nb == lb", "nb", "lb", "print('B')", "print", "'B'", "break", "now = b[nb]", "now", "b[nb]", "b", "nb", "nb += 1", "nb", "1", "if nc == lc:\n print('C')\n break\n else:\n now = c[nc]\n nc += 1", "nc == lc", "nc", "lc", "print('C')", "print", "'C'", "break", "now = c[nc]", "now", "c[nc]", "c", "nc", "nc += 1", "nc", "1", "now = a[0]", "a[0]", "now", "now = a[na]", "a[na]", "now", "lb = len(b)", "len(b)", "lb", "lc = len(c)", "len(c)", "lc", "na += 1", "1", "na", "now = c[nc]", "c[nc]", "now", "nc += 1", "1", "nc", "now = b[nb]", "b[nb]", "now", "nb += 1", "1", "nb", "b = input()", "input()", "b", "nb = 0", "0", "nb", "a = input()", "input()", "a", "la = len(a)", "len(a)", "la", "na = 1", "1", "na", "c = input()", "input()", "c", "nc = 0", "0", "nc" ]
a = input() b = input() c = input() la = len(a) lb = len(b) lc = len(c) na = 1 nb = 0 nc = 0 now = a[0] while True: if now == 'a': if na == la: print('A') break else: now = a[na] na += 1 elif now == 'b': if nb == lb: print('B') break else: now = b[nb] nb += 1 else: if nc == lc: print('C') break else: now = c[nc] nc += 1
[ 7, 15, 13, 13, 13, 13, 15, 15, 15, 15, 13, 12, 13, 12, 13, 12, 13, 12, 13, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 17, 0, 13, 17, 13, 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, 17, 14, 2, 13, 4, 13, 13, 0, 13, 18, 13, 13, 14, 2, 13, 17, 0, 13, 17, 14, 2, 13, 4, 13, 13, 0, 13, 18, 13, 13, 14, 2, 13, 17, 0, 13, 17, 14, 2, 13, 4, 13, 13, 0, 13, 18, 13, 13, 14, 2, 13, 4, 13, 13, 4, 13, 17, 14, 2, 13, 4, 13, 13, 4, 13, 17, 14, 2, 13, 4, 13, 13, 4, 13, 17, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 12, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13, 10, 12, 13, 10, 17, 13, 10, 17, 13, 10, 12, 13, 10, 17, 13, 10, 17, 13, 10, 12, 13, 10, 4, 13, 10, 4, 13 ]
[ [ 189, 20 ], [ 166, 22 ], [ 156, 24 ], [ 166, 26 ], [ 186, 28 ], [ 166, 30 ], [ 171, 32 ], [ 171, 35 ], [ 171, 37 ], [ 177, 39 ], [ 154, 45 ], [ 169, 45 ], [ 190, 48 ], [ 172, 50 ], [ 160, 50 ], [ 157, 53 ], [ 163, 55 ], [ 181, 55 ], [ 187, 58 ], [ 178, 61 ], [ 142, 61 ], [ 145, 61 ], [ 148, 61 ], [ 168, 64 ], [ 169, 68 ], [ 154, 68 ], [ 190, 71 ], [ 147, 73 ], [ 190, 75 ], [ 169, 76 ], [ 154, 76 ], [ 178, 79 ], [ 142, 79 ], [ 145, 79 ], [ 148, 79 ], [ 159, 82 ], [ 160, 86 ], [ 172, 86 ], [ 157, 89 ], [ 144, 91 ], [ 157, 93 ], [ 160, 94 ], [ 172, 94 ], [ 178, 97 ], [ 142, 97 ], [ 145, 97 ], [ 148, 97 ], [ 180, 100 ], [ 181, 104 ], [ 163, 104 ], [ 187, 107 ], [ 141, 109 ], [ 187, 111 ], [ 181, 112 ], [ 163, 112 ], [ 169, 115 ], [ 154, 115 ], [ 190, 118 ], [ 160, 124 ], [ 172, 124 ], [ 157, 127 ], [ 181, 133 ], [ 163, 133 ], [ 187, 136 ], [ 141, 142 ], [ 144, 145 ], [ 147, 148 ], [ 171, 154 ], [ 156, 157 ], [ 159, 160 ], [ 171, 163 ], [ 168, 169 ], [ 171, 172 ], [ 177, 178 ], [ 180, 181 ], [ 186, 187 ], [ 189, 190 ] ]
[ "import bisect,copy,heapq,string\nfrom collections import *\nfrom math import *\nfrom itertools import *\nimport sys\ndef input() : return sys.stdin.readline().strip()\ndef INT() : return int(input())\ndef MAP() : return map(int,input().split())\ndef LIST() : return list(MAP())\n\na = input()\nb = input()\nc = input()\ni = j = k = -1\nsel = 'a'\n\nwhile i<len(a) and j<len(b) and k<len(c):\n if sel == 'a':\n i += 1\n if i < len(a):\n sel = a[i]\n elif sel == 'b':\n j += 1\n if j < len(b):\n sel = b[j]\n elif sel == 'c':\n k += 1\n if k < len(c):\n sel = c[k]\n\nif i == len(a):\n print('A')\nelif j == len(b):\n print('B')\nelif k == len(c):\n print('C')", "import bisect,copy,heapq,string", "bisect", "copy", "heapq", "string", "from collections import *", "from math import *", "from itertools import *", "import sys", "sys", "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())", "LIST", "a = input()", "a", "input()", "input", "b = input()", "b", "input()", "input", "c = input()", "c", "input()", "input", "i = j = k = -1", "i", "-1", "= j = k = -1", "j", "-1", "k", "sel = 'a'", "sel", "'a'", "while i<len(a) and j<len(b) and k<len(c):\n if sel == 'a':\n i += 1\n if i < len(a):\n sel = a[i]\n elif sel == 'b':\n j += 1\n if j < len(b):\n sel = b[j]\n elif sel == 'c':\n k += 1\n if k < len(c):\n sel = c[k]", "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 sel == 'a':\n i += 1\n if i < len(a):\n sel = a[i]\n elif sel == 'b':\n j += 1\n if j < len(b):\n sel = b[j]\n elif sel == 'c':\n k += 1\n if k < len(c):\n sel = c[k]", "sel == 'a'", "sel", "'a'", "i += 1", "i", "1", "if i < len(a):\n sel = a[i]\n ", "i < len(a)", "i", "len(a)", "len", "a", "sel = a[i]", "sel", "a[i]", "a", "i", "elif sel == 'b':\n j += 1\n if j < len(b):\n sel = b[j]\n ", "sel == 'b'", "sel", "'b'", "j += 1", "j", "1", "if j < len(b):\n sel = b[j]\n ", "j < len(b)", "j", "len(b)", "len", "b", "sel = b[j]", "sel", "b[j]", "b", "j", "elif sel == 'c':\n k += 1\n if k < len(c):\n sel = c[k]", "sel == 'c'", "sel", "'c'", "k += 1", "k", "1", "if k < len(c):\n sel = c[k]", "k < len(c)", "k", "len(c)", "len", "c", "sel = c[k]", "sel", "c[k]", "c", "k", "if i == len(a):\n print('A')\nelif j == len(b):\n print('B')\nelif k == len(c):\n print('C')", "i == len(a)", "i", "len(a)", "len", "a", "print('A')", "print", "'A'", "elif j == len(b):\n print('B')", "j == len(b)", "j", "len(b)", "len", "b", "print('B')", "print", "'B'", "elif k == len(c):\n print('C')", "k == len(c)", "k", "len(c)", "len", "c", "print('C')", "print", "'C'", "sel = c[k]", "c[k]", "sel", "sel = b[j]", "b[j]", "sel", "sel = a[i]", "a[i]", "sel", "def INT() : return int(input())", "def INT() : return int(input())", "INT", "i = j = k = -1", "-1", "i", "b = input()", "input()", "b", "j += 1", "1", "j", "k = -1", "-1", "k", "def input() : return sys.stdin.readline().strip()", "def input() : return sys.stdin.readline().strip()", "input", "i += 1", "1", "i", "j = k = -1", "-1", "j", "def MAP() : return map(int,input().split())", "def MAP() : return map(int,input().split())", "MAP", "sel = 'a'", "'a'", "sel", "k += 1", "1", "k", "def LIST() : return list(MAP())", "def LIST() : return list(MAP())", "LIST", "c = input()", "input()", "c", "a = input()", "input()", "a" ]
import bisect,copy,heapq,string from collections import * from math import * from itertools import * import sys def input() : return sys.stdin.readline().strip() def INT() : return int(input()) def MAP() : return map(int,input().split()) def LIST() : return list(MAP()) a = input() b = input() c = input() i = j = k = -1 sel = 'a' while i<len(a) and j<len(b) and k<len(c): if sel == 'a': i += 1 if i < len(a): sel = a[i] elif sel == 'b': j += 1 if j < len(b): sel = b[j] elif sel == 'c': k += 1 if k < len(c): sel = c[k] if i == len(a): print('A') elif j == len(b): print('B') elif k == len(c): print('C')
[ 7, 0, 13, 39, 0, 13, 4, 13, 4, 18, 13, 13, 4, 13, 4, 18, 4, 18, 4, 18, 13, 13, 17, 17, 13, 17, 17, 13, 17, 17, 0, 13, 4, 13, 4, 18, 13, 13, 4, 13, 4, 18, 4, 18, 4, 18, 13, 13, 17, 17, 13, 17, 17, 13, 17, 17, 0, 13, 4, 13, 4, 18, 13, 13, 4, 13, 4, 18, 4, 18, 4, 18, 13, 13, 17, 17, 13, 17, 17, 13, 17, 17, 0, 13, 2, 39, 17, 17, 0, 13, 17, 0, 13, 4, 13, 13, 0, 13, 4, 13, 13, 0, 13, 4, 13, 13, 42, 17, 14, 2, 2, 2, 2, 18, 13, 17, 13, 2, 13, 17, 2, 2, 18, 13, 17, 13, 2, 13, 17, 2, 2, 18, 13, 17, 13, 2, 13, 17, 3, 0, 13, 18, 18, 13, 13, 18, 13, 13, 0, 18, 13, 13, 17, 0, 13, 4, 13, 13, 4, 13, 4, 13, 2, 4, 13, 17, 13, 10, 18, 13, 10, 4, 13, 10, 39, 13, 10, 2, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 17, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13 ]
[ [ 174, 2 ], [ 171, 5 ], [ 175, 10 ], [ 172, 20 ], [ 183, 31 ], [ 175, 36 ], [ 184, 46 ], [ 198, 57 ], [ 175, 62 ], [ 199, 72 ], [ 177, 83 ], [ 189, 89 ], [ 195, 92 ], [ 172, 95 ], [ 192, 97 ], [ 184, 100 ], [ 186, 102 ], [ 199, 105 ], [ 178, 114 ], [ 196, 116 ], [ 190, 118 ], [ 181, 118 ], [ 178, 123 ], [ 193, 125 ], [ 190, 127 ], [ 181, 127 ], [ 178, 132 ], [ 187, 134 ], [ 190, 136 ], [ 181, 136 ], [ 168, 140 ], [ 175, 143 ], [ 190, 144 ], [ 181, 144 ], [ 149, 145 ], [ 178, 146 ], [ 190, 147 ], [ 181, 147 ], [ 152, 149 ], [ 178, 150 ], [ 190, 151 ], [ 181, 151 ], [ 180, 154 ], [ 169, 157 ], [ 181, 166 ], [ 190, 166 ], [ 168, 169 ], [ 171, 172 ], [ 174, 175 ], [ 177, 178 ], [ 180, 181 ], [ 183, 184 ], [ 186, 187 ], [ 189, 190 ], [ 192, 193 ], [ 195, 196 ], [ 198, 199 ] ]
[ "S = []\nSa = input()\nS.append(list(Sa.replace('a', '0').replace('b', '1').replace('c', '2')))\nSb = input()\nS.append(list(Sb.replace('a', '0').replace('b', '1').replace('c', '2')))\nSc = input()\nS.append(list(Sc.replace('a', '0').replace('b', '1').replace('c', '2')))\n\nnow = [0] * 3\nturn = 0\nlen_a = len(Sa)\nlen_b = len(Sb)\nlen_c = len(Sc)\n\nwhile True:\n if (now[0] == len_a and turn == 0) or (now[1] == len_b and turn == 1) or (now[2] == len_c and turn == 2):\n break\n next_turn = S[turn][now[turn]]\n now[turn] += 1\n turn = int(next_turn)\n\nprint(chr(ord('A') + turn))", "S = []", "S", "[]", "Sa = input()", "Sa", "input()", "input", "S.append(list(Sa.replace('a', '0').replace('b', '1').replace('c', '2')))", "S.append", "S", "append", "list(Sa.replace('a', '0').replace('b', '1').replace('c', '2'))", "list", "Sa.replace('a', '0').replace('b', '1').replace('c', '2')", "Sa.replace('a', '0').replace('b', '1').replace", "Sa.replace('a', '0').replace('b', '1')", "Sa.replace('a', '0').replace", "Sa.replace('a', '0')", "Sa.replace", "Sa", "replace", "'a'", "'0'", "replace", "'b'", "'1'", "replace", "'c'", "'2'", "Sb = input()", "Sb", "input()", "input", "S.append(list(Sb.replace('a', '0').replace('b', '1').replace('c', '2')))", "S.append", "S", "append", "list(Sb.replace('a', '0').replace('b', '1').replace('c', '2'))", "list", "Sb.replace('a', '0').replace('b', '1').replace('c', '2')", "Sb.replace('a', '0').replace('b', '1').replace", "Sb.replace('a', '0').replace('b', '1')", "Sb.replace('a', '0').replace", "Sb.replace('a', '0')", "Sb.replace", "Sb", "replace", "'a'", "'0'", "replace", "'b'", "'1'", "replace", "'c'", "'2'", "Sc = input()", "Sc", "input()", "input", "S.append(list(Sc.replace('a', '0').replace('b', '1').replace('c', '2')))", "S.append", "S", "append", "list(Sc.replace('a', '0').replace('b', '1').replace('c', '2'))", "list", "Sc.replace('a', '0').replace('b', '1').replace('c', '2')", "Sc.replace('a', '0').replace('b', '1').replace", "Sc.replace('a', '0').replace('b', '1')", "Sc.replace('a', '0').replace", "Sc.replace('a', '0')", "Sc.replace", "Sc", "replace", "'a'", "'0'", "replace", "'b'", "'1'", "replace", "'c'", "'2'", "now = [0] * 3", "now", "[0] * 3", "[0]", "0", "3", "turn = 0", "turn", "0", "len_a = len(Sa)", "len_a", "len(Sa)", "len", "Sa", "len_b = len(Sb)", "len_b", "len(Sb)", "len", "Sb", "len_c = len(Sc)", "len_c", "len(Sc)", "len", "Sc", "while True:\n if (now[0] == len_a and turn == 0) or (now[1] == len_b and turn == 1) or (now[2] == len_c and turn == 2):\n break\n next_turn = S[turn][now[turn]]\n now[turn] += 1\n turn = int(next_turn)", "True", "if (now[0] == len_a and turn == 0) or (now[1] == len_b and turn == 1) or (now[2] == len_c and turn == 2):\n break\n ", "(now[0] == len_a and turn == 0) or (now[1] == len_b and turn == 1) or (now[2] == len_c and turn == 2)", "(now[0] == len_a and turn == 0) or (now[1] == len_b and turn == 1)", "now[0] == len_a and turn == 0", "now[0] == len_a", "now[0]", "now", "0", "len_a", "turn == 0", "turn", "0", "now[1] == len_b and turn == 1", "now[1] == len_b", "now[1]", "now", "1", "len_b", "turn == 1", "turn", "1", "now[2] == len_c and turn == 2", "now[2] == len_c", "now[2]", "now", "2", "len_c", "turn == 2", "turn", "2", "break", "next_turn = S[turn][now[turn]]", "next_turn", "S[turn][now[turn]]", "[turn]", "S", "turn", "now[turn]", "now", "turn", "now[turn] += 1", "now[turn]", "now", "turn", "1", "turn = int(next_turn)", "turn", "int(next_turn)", "int", "next_turn", "print(chr(ord('A') + turn))", "print", "chr(ord('A') + turn)", "chr", "ord('A') + turn", "ord('A')", "ord", "'A'", "turn", "next_turn = S[turn][now[turn]]", "S[turn][now[turn]]", "next_turn", "Sa = input()", "input()", "Sa", "S = []", "[]", "S", "now = [0] * 3", "[0] * 3", "now", "turn = int(next_turn)", "int(next_turn)", "turn", "Sb = input()", "input()", "Sb", "len_c = len(Sc)", "len(Sc)", "len_c", "turn = 0", "0", "turn", "len_b = len(Sb)", "len(Sb)", "len_b", "len_a = len(Sa)", "len(Sa)", "len_a", "Sc = input()", "input()", "Sc" ]
S = [] Sa = input() S.append(list(Sa.replace('a', '0').replace('b', '1').replace('c', '2'))) Sb = input() S.append(list(Sb.replace('a', '0').replace('b', '1').replace('c', '2'))) Sc = input() S.append(list(Sc.replace('a', '0').replace('b', '1').replace('c', '2'))) now = [0] * 3 turn = 0 len_a = len(Sa) len_b = len(Sb) len_c = len(Sc) while True: if (now[0] == len_a and turn == 0) or (now[1] == len_b and turn == 1) or (now[2] == len_c and turn == 2): break next_turn = S[turn][now[turn]] now[turn] += 1 turn = int(next_turn) print(chr(ord('A') + turn))
[ 7, 15, 13, 15, 12, 13, 0, 13, 4, 13, 13, 0, 13, 4, 13, 13, 0, 13, 4, 13, 13, 0, 13, 21, 22, 17, 13, 22, 17, 13, 22, 17, 13, 0, 13, 17, 42, 17, 0, 13, 4, 18, 18, 13, 13, 13, 0, 13, 13, 14, 40, 18, 13, 13, 29, 4, 18, 13, 13, 23, 13, 23, 13, 23, 13, 0, 13, 4, 18, 4, 18, 18, 13, 13, 13, 13, 0, 13, 4, 18, 4, 18, 18, 13, 13, 13, 13, 0, 13, 4, 18, 4, 18, 18, 13, 13, 13, 13, 4, 13, 4, 13, 13, 13, 13, 10, 4, 13, 10, 4, 13, 10, 12, 13, 10, 4, 13 ]
[ [ 8, 7 ], [ 60, 10 ], [ 13, 12 ], [ 62, 15 ], [ 18, 17 ], [ 64, 20 ], [ 23, 22 ], [ 35, 34 ], [ 40, 39 ], [ 22, 43 ], [ 34, 44 ], [ 47, 44 ], [ 48, 47 ], [ 39, 48 ], [ 22, 52 ], [ 47, 53 ], [ 34, 53 ], [ 47, 57 ], [ 34, 57 ], [ 60, 60 ], [ 62, 62 ], [ 64, 64 ], [ 106, 66 ], [ 115, 77 ], [ 109, 88 ], [ 113, 101 ], [ 107, 102 ], [ 116, 103 ], [ 110, 104 ], [ 106, 107 ], [ 109, 110 ], [ 115, 116 ] ]
[ "import sys\nfrom collections import deque\n\ndef main(sa,sb,sc):\n sa=deque(sa)\n sb=deque(sb)\n sc=deque(sc)\n ms={'a':sa, 'b':sb, 'c':sc}\n ct='a'\n while True:\n cc=ms[ct].popleft()\n ct=cc\n if not ms[ct]:\n return ct.upper() \n\nsa=sys.stdin.readline().strip()\nsb=sys.stdin.readline().strip()\nsc=sys.stdin.readline().strip()\n\nprint(main(sa,sb,sc))", "import sys", "sys", "from collections import deque", "def main(sa,sb,sc):\n sa=deque(sa)\n sb=deque(sb)\n sc=deque(sc)\n ms={'a':sa, 'b':sb, 'c':sc}\n ct='a'\n while True:\n cc=ms[ct].popleft()\n ct=cc\n if not ms[ct]:\n return ct.upper() ", "main", "sa=deque(sa)", "sa", "deque(sa)", "deque", "sa", "sb=deque(sb)", "sb", "deque(sb)", "deque", "sb", "sc=deque(sc)", "sc", "deque(sc)", "deque", "sc", "ms={'a':sa, 'b':sb, 'c':sc}", "ms", "{'a':sa, 'b':sb, 'c':sc}", "'a'", "'a'", "sa", "'b'", "'b'", "sb", "'c'", "'c'", "sc", "ct='a'", "ct", "'a'", "while True:\n cc=ms[ct].popleft()\n ct=cc\n if not ms[ct]:\n return ct.upper() ", "True", "cc=ms[ct].popleft()", "cc", "ms[ct].popleft()", "[ct].popleft", "[ct]", "ms", "ct", "popleft", "ct=cc", "ct", "cc", "if not ms[ct]:\n return ct.upper() ", "not ms[ct]", "ms[ct]", "ms", "ct", "return ct.upper()", "ct.upper()", "ct.upper", "ct", "upper", "sa", "sa", "sb", "sb", "sc", "sc", "sa=sys.stdin.readline().strip()", "sa", "sys.stdin.readline().strip()", "sys.stdin.readline().strip", "sys.stdin.readline()", "sys.stdin.readline", "sys.stdin", "sys", "stdin", "readline", "strip", "sb=sys.stdin.readline().strip()", "sb", "sys.stdin.readline().strip()", "sys.stdin.readline().strip", "sys.stdin.readline()", "sys.stdin.readline", "sys.stdin", "sys", "stdin", "readline", "strip", "sc=sys.stdin.readline().strip()", "sc", "sys.stdin.readline().strip()", "sys.stdin.readline().strip", "sys.stdin.readline()", "sys.stdin.readline", "sys.stdin", "sys", "stdin", "readline", "strip", "print(main(sa,sb,sc))", "print", "main(sa,sb,sc)", "main", "sa", "sb", "sc", "sa=sys.stdin.readline().strip()", "sys.stdin.readline().strip()", "sa", "sc=sys.stdin.readline().strip()", "sys.stdin.readline().strip()", "sc", "def main(sa,sb,sc):\n sa=deque(sa)\n sb=deque(sb)\n sc=deque(sc)\n ms={'a':sa, 'b':sb, 'c':sc}\n ct='a'\n while True:\n cc=ms[ct].popleft()\n ct=cc\n if not ms[ct]:\n return ct.upper() ", "def main(sa,sb,sc):\n sa=deque(sa)\n sb=deque(sb)\n sc=deque(sc)\n ms={'a':sa, 'b':sb, 'c':sc}\n ct='a'\n while True:\n cc=ms[ct].popleft()\n ct=cc\n if not ms[ct]:\n return ct.upper() ", "main", "sb=sys.stdin.readline().strip()", "sys.stdin.readline().strip()", "sb" ]
import sys from collections import deque def main(sa,sb,sc): sa=deque(sa) sb=deque(sb) sc=deque(sc) ms={'a':sa, 'b':sb, 'c':sc} ct='a' while True: cc=ms[ct].popleft() ct=cc if not ms[ct]: return ct.upper() sa=sys.stdin.readline().strip() sb=sys.stdin.readline().strip() sc=sys.stdin.readline().strip() print(main(sa,sb,sc))
[ 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, 14, 2, 18, 13, 13, 39, 4, 13, 4, 18, 13, 13, 3, 10, 4, 13, 10, 13, 13, 10, 17, 13 ]
[ [ 4, 3 ], [ 3, 6 ], [ 47, 12 ], [ 50, 15 ], [ 48, 19 ], [ 51, 20 ], [ 45, 20 ], [ 44, 22 ], [ 48, 26 ], [ 51, 27 ], [ 45, 27 ], [ 48, 33 ], [ 45, 34 ], [ 51, 34 ], [ 45, 40 ], [ 51, 40 ], [ 44, 45 ], [ 47, 48 ], [ 50, 51 ] ]
[ "S = {c: list(input()) for c in 'abc'}\ns = \"a\"\nwhile(S[s]):\n s = S[s].pop(0)\n if(S[s] == []):\n print(s.upper())\n break", "c: list(input()) for c in 'abc'", "for c in 'abc'", "c", "'abc'", "for c in 'abc'", "c", "list(input())", "list", "input()", "input", "S = {c: list(input()) for c in 'abc'}", "S", "{c: list(input()) for c in 'abc'}", "s = \"a\"", "s", "\"a\"", "while(S[s]):\n s = S[s].pop(0)\n if(S[s] == []):\n print(s.upper())\n break", "S[s]", "S", "s", "s = S[s].pop(0)", "s", "S[s].pop(0)", "[s].pop", "[s]", "S", "s", "pop", "0", "if(S[s] == []):\n print(s.upper())\n break", "S[s] == []", "S[s]", "S", "s", "[]", "print(s.upper())", "print", "s.upper()", "s.upper", "s", "upper", "break", "s = S[s].pop(0)", "S[s].pop(0)", "s", "S = {c: list(input()) for c in 'abc'}", "{c: list(input()) for c in 'abc'}", "S", "s = \"a\"", "\"a\"", "s" ]
S = {c: list(input()) for c in 'abc'} s = "a" while(S[s]): s = S[s].pop(0) if(S[s] == []): print(s.upper()) break
[ 7, 15, 13, 0, 13, 18, 18, 18, 13, 13, 13, 13, 0, 13, 18, 18, 18, 13, 13, 13, 13, 0, 13, 18, 18, 18, 13, 13, 13, 13, 12, 13, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 4, 13, 17, 4, 13, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 4, 13, 17, 4, 13, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 14, 2, 4, 13, 13, 17, 4, 13, 17, 4, 13, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 29, 4, 13, 13, 13, 13, 13, 23, 13, 23, 13, 23, 13, 23, 13, 0, 13, 18, 4, 18, 4, 18, 4, 13, 13, 13, 39, 17, 0, 13, 18, 4, 18, 4, 18, 4, 13, 13, 13, 39, 17, 0, 13, 18, 4, 18, 4, 18, 4, 13, 13, 13, 39, 17, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 4, 13, 4, 13, 13, 13, 13, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 12, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13 ]
[ [ 201, 4 ], [ 189, 13 ], [ 183, 22 ], [ 114, 34 ], [ 116, 40 ], [ 49, 48 ], [ 116, 50 ], [ 54, 53 ], [ 116, 55 ], [ 114, 60 ], [ 118, 66 ], [ 75, 74 ], [ 118, 76 ], [ 80, 79 ], [ 118, 81 ], [ 120, 88 ], [ 97, 96 ], [ 120, 98 ], [ 102, 101 ], [ 120, 103 ], [ 96, 109 ], [ 74, 109 ], [ 48, 109 ], [ 53, 110 ], [ 116, 110 ], [ 79, 111 ], [ 118, 111 ], [ 101, 112 ], [ 120, 112 ], [ 114, 114 ], [ 116, 116 ], [ 118, 118 ], [ 120, 120 ], [ 186, 122 ], [ 190, 129 ], [ 195, 135 ], [ 190, 142 ], [ 204, 148 ], [ 190, 155 ], [ 180, 161 ], [ 187, 163 ], [ 198, 166 ], [ 187, 168 ], [ 193, 174 ], [ 181, 175 ], [ 199, 176 ], [ 187, 176 ], [ 196, 177 ], [ 205, 178 ], [ 180, 181 ], [ 183, 184 ], [ 186, 187 ], [ 189, 190 ], [ 195, 196 ], [ 198, 199 ], [ 201, 202 ], [ 204, 205 ] ]
[ "import sys\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\ndef turn(s,sa,sb,sc):\n if s == 'a':\n if len(sa) == 0:\n print('A')\n exit()\n trash = sa[-1]\n sa = sa[:-1:]\n elif s == 'b':\n if len(sb) == 0:\n print('B')\n exit()\n trash = sb[-1]\n sb = sb[:-1:]\n else:\n if len(sc) == 0:\n print('C')\n exit()\n trash = sc[-1]\n sc = sc[:-1:]\n return turn(trash,sa,sb,sc)\n\nsa = readline().decode().rstrip()[::-1]\nsb = readline().decode().rstrip()[::-1]\nsc = readline().decode().rstrip()[::-1]\n\ntrash = sa[-1]\nsa = sa[:-1:]\n\nprint(turn(trash,sa,sb,sc))", "import sys", "sys", "read = sys.stdin.buffer.read", "read", "sys.stdin.buffer.read", "sys.stdin.buffer", "sys.stdin", "sys", "stdin", "buffer", "read", "readline = sys.stdin.buffer.readline", "readline", "sys.stdin.buffer.readline", "sys.stdin.buffer", "sys.stdin", "sys", "stdin", "buffer", "readline", "readlines = sys.stdin.buffer.readlines", "readlines", "sys.stdin.buffer.readlines", "sys.stdin.buffer", "sys.stdin", "sys", "stdin", "buffer", "readlines", "def turn(s,sa,sb,sc):\n if s == 'a':\n if len(sa) == 0:\n print('A')\n exit()\n trash = sa[-1]\n sa = sa[:-1:]\n elif s == 'b':\n if len(sb) == 0:\n print('B')\n exit()\n trash = sb[-1]\n sb = sb[:-1:]\n else:\n if len(sc) == 0:\n print('C')\n exit()\n trash = sc[-1]\n sc = sc[:-1:]\n return turn(trash,sa,sb,sc)", "turn", "if s == 'a':\n if len(sa) == 0:\n print('A')\n exit()\n trash = sa[-1]\n sa = sa[:-1:]\n elif s == 'b':\n if len(sb) == 0:\n print('B')\n exit()\n trash = sb[-1]\n sb = sb[:-1:]\n else:\n if len(sc) == 0:\n print('C')\n exit()\n trash = sc[-1]\n sc = sc[:-1:]\n ", "s == 'a'", "s", "'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", "trash = sa[-1]", "trash", "sa[-1]", "sa", "-1", "sa = sa[:-1:]", "sa", "sa[:-1:]", "sa", ":-1:", "-1", "elif s == 'b':\n if len(sb) == 0:\n print('B')\n exit()\n trash = sb[-1]\n sb = sb[:-1:]\n ", "s == 'b'", "s", "'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", "trash = sb[-1]", "trash", "sb[-1]", "sb", "-1", "sb = sb[:-1:]", "sb", "sb[:-1:]", "sb", ":-1:", "-1", "if len(sc) == 0:\n print('C')\n exit()\n ", "len(sc) == 0", "len(sc)", "len", "sc", "0", "print('C')", "print", "'C'", "exit()", "exit", "trash = sc[-1]", "trash", "sc[-1]", "sc", "-1", "sc = sc[:-1:]", "sc", "sc[:-1:]", "sc", ":-1:", "-1", "return turn(trash,sa,sb,sc)", "turn(trash,sa,sb,sc)", "turn", "trash", "sa", "sb", "sc", "s", "s", "sa", "sa", "sb", "sb", "sc", "sc", "sa = readline().decode().rstrip()[::-1]", "sa", "readline().decode().rstrip()[::-1]", "().decode().rstrip()", "().decode().rstrip", "().decode()", "().decode", "()", "readline", "decode", "rstrip", "::-1", "-1", "sb = readline().decode().rstrip()[::-1]", "sb", "readline().decode().rstrip()[::-1]", "().decode().rstrip()", "().decode().rstrip", "().decode()", "().decode", "()", "readline", "decode", "rstrip", "::-1", "-1", "sc = readline().decode().rstrip()[::-1]", "sc", "readline().decode().rstrip()[::-1]", "().decode().rstrip()", "().decode().rstrip", "().decode()", "().decode", "()", "readline", "decode", "rstrip", "::-1", "-1", "trash = sa[-1]", "trash", "sa[-1]", "sa", "-1", "sa = sa[:-1:]", "sa", "sa[:-1:]", "sa", ":-1:", "-1", "print(turn(trash,sa,sb,sc))", "print", "turn(trash,sa,sb,sc)", "turn", "trash", "sa", "sb", "sc", "trash = sa[-1]", "sa[-1]", "trash", "readlines = sys.stdin.buffer.readlines", "sys.stdin.buffer.readlines", "readlines", "sa = readline().decode().rstrip()[::-1]", "readline().decode().rstrip()[::-1]", "sa", "readline = sys.stdin.buffer.readline", "sys.stdin.buffer.readline", "readline", "def turn(s,sa,sb,sc):\n if s == 'a':\n if len(sa) == 0:\n print('A')\n exit()\n trash = sa[-1]\n sa = sa[:-1:]\n elif s == 'b':\n if len(sb) == 0:\n print('B')\n exit()\n trash = sb[-1]\n sb = sb[:-1:]\n else:\n if len(sc) == 0:\n print('C')\n exit()\n trash = sc[-1]\n sc = sc[:-1:]\n return turn(trash,sa,sb,sc)", "def turn(s,sa,sb,sc):\n if s == 'a':\n if len(sa) == 0:\n print('A')\n exit()\n trash = sa[-1]\n sa = sa[:-1:]\n elif s == 'b':\n if len(sb) == 0:\n print('B')\n exit()\n trash = sb[-1]\n sb = sb[:-1:]\n else:\n if len(sc) == 0:\n print('C')\n exit()\n trash = sc[-1]\n sc = sc[:-1:]\n return turn(trash,sa,sb,sc)", "turn", "sb = readline().decode().rstrip()[::-1]", "readline().decode().rstrip()[::-1]", "sb", "sa = sa[:-1:]", "sa[:-1:]", "sa", "read = sys.stdin.buffer.read", "sys.stdin.buffer.read", "read", "sc = readline().decode().rstrip()[::-1]", "readline().decode().rstrip()[::-1]", "sc" ]
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines def turn(s,sa,sb,sc): if s == 'a': if len(sa) == 0: print('A') exit() trash = sa[-1] sa = sa[:-1:] elif s == 'b': if len(sb) == 0: print('B') exit() trash = sb[-1] sb = sb[:-1:] else: if len(sc) == 0: print('C') exit() trash = sc[-1] sc = sc[:-1:] return turn(trash,sa,sb,sc) sa = readline().decode().rstrip()[::-1] sb = readline().decode().rstrip()[::-1] sc = readline().decode().rstrip()[::-1] trash = sa[-1] sa = sa[:-1:] print(turn(trash,sa,sb,sc))
[ 7, 15, 13, 15, 13, 15, 0, 13, 12, 4, 13, 4, 18, 18, 13, 13, 13, 0, 13, 12, 4, 13, 13, 4, 18, 4, 18, 18, 13, 13, 13, 13, 0, 13, 12, 4, 13, 4, 13, 0, 13, 12, 4, 13, 13, 4, 18, 4, 18, 18, 13, 13, 13, 13, 0, 13, 12, 4, 13, 4, 13, 0, 13, 18, 4, 13, 39, 17, 0, 13, 18, 4, 13, 39, 17, 0, 13, 18, 4, 13, 39, 17, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 4, 13, 28, 13, 4, 13, 4, 13, 13, 4, 18, 13, 13, 18, 13, 13, 28, 13, 4, 13, 4, 13, 13, 4, 18, 13, 13, 18, 13, 13, 28, 13, 4, 13, 4, 13, 13, 4, 18, 13, 13, 18, 13, 13, 0, 13, 17, 42, 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, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 4, 13, 17, 4, 13, 0, 13, 18, 13, 17, 4, 18, 13, 13, 14, 2, 4, 13, 13, 17, 4, 13, 17, 4, 13, 0, 13, 18, 13, 17, 4, 18, 13, 13, 10, 4, 13, 10, 18, 13, 10, 4, 13, 10, 18, 13, 10, 12, 13, 10, 18, 13, 10, 17, 13, 10, 18, 13, 10, 12, 13, 10, 18, 13, 10, 18, 13, 10, 12, 13, 10, 4, 13, 10, 12, 13, 10, 12, 13 ]
[ [ 243, 7 ], [ 252, 18 ], [ 249, 33 ], [ 253, 38 ], [ 222, 40 ], [ 234, 55 ], [ 223, 60 ], [ 237, 62 ], [ 231, 69 ], [ 225, 76 ], [ 216, 83 ], [ 210, 87 ], [ 246, 91 ], [ 96, 95 ], [ 238, 100 ], [ 217, 103 ], [ 238, 106 ], [ 95, 107 ], [ 110, 109 ], [ 232, 114 ], [ 211, 117 ], [ 232, 120 ], [ 109, 121 ], [ 124, 123 ], [ 226, 128 ], [ 247, 131 ], [ 226, 134 ], [ 123, 135 ], [ 228, 137 ], [ 229, 143 ], [ 220, 143 ], [ 214, 143 ], [ 241, 143 ], [ 217, 149 ], [ 240, 157 ], [ 217, 159 ], [ 217, 163 ], [ 229, 167 ], [ 220, 167 ], [ 214, 167 ], [ 241, 167 ], [ 211, 173 ], [ 213, 181 ], [ 211, 183 ], [ 211, 187 ], [ 247, 193 ], [ 219, 201 ], [ 247, 203 ], [ 247, 207 ], [ 210, 211 ], [ 213, 214 ], [ 216, 217 ], [ 219, 220 ], [ 222, 223 ], [ 225, 226 ], [ 228, 229 ], [ 231, 232 ], [ 234, 235 ], [ 237, 238 ], [ 240, 241 ], [ 243, 244 ], [ 246, 247 ], [ 249, 250 ], [ 252, 253 ] ]
[ "import sys\nimport math\nfrom collections import deque\n\n\ninint = lambda: int(sys.stdin.readline())\ninintm = lambda: map(int, sys.stdin.readline().split())\ninintl = lambda: list(inintm())\ninstrm = lambda: map(str, sys.stdin.readline().split())\ninstrl = lambda: list(instrm())\n\ns_at = input()[::-1]\ns_bt = input()[::-1]\ns_ct = input()[::-1]\n\ns_a = deque()\ns_b = deque()\ns_c = deque()\n\nfor i in range(len(s_at)):\n s_a.append(s_at[i])\n\nfor i in range(len(s_bt)):\n s_b.append(s_bt[i])\n\nfor i in range(len(s_ct)):\n s_c.append(s_ct[i])\n\nnow = \"a\"\n\nwhile True:\n if now == \"a\":\n if len(s_a) == 0:\n print(\"A\")\n exit()\n now = s_a[-1]\n s_a.pop()\n elif now == \"b\":\n if len(s_b) == 0:\n print(\"B\")\n exit()\n now = s_b[-1]\n s_b.pop()\n else:\n if len(s_c) == 0:\n print(\"C\")\n exit()\n now = s_c[-1]\n s_c.pop()", "import sys", "sys", "import math", "math", "from collections import deque", "inint = lambda: int(sys.stdin.readline())", "inint", "lambda: int(sys.stdin.readline())", "int(sys.stdin.readline())", "int", "sys.stdin.readline()", "sys.stdin.readline", "sys.stdin", "sys", "stdin", "readline", "inintm = lambda: map(int, sys.stdin.readline().split())", "inintm", "lambda: map(int, sys.stdin.readline().split())", "map(int, sys.stdin.readline().split())", "map", "int", "sys.stdin.readline().split()", "sys.stdin.readline().split", "sys.stdin.readline()", "sys.stdin.readline", "sys.stdin", "sys", "stdin", "readline", "split", "inintl = lambda: list(inintm())", "inintl", "lambda: list(inintm())", "list(inintm())", "list", "inintm()", "inintm", "instrm = lambda: map(str, sys.stdin.readline().split())", "instrm", "lambda: map(str, sys.stdin.readline().split())", "map(str, sys.stdin.readline().split())", "map", "str", "sys.stdin.readline().split()", "sys.stdin.readline().split", "sys.stdin.readline()", "sys.stdin.readline", "sys.stdin", "sys", "stdin", "readline", "split", "instrl = lambda: list(instrm())", "instrl", "lambda: list(instrm())", "list(instrm())", "list", "instrm()", "instrm", "s_at = input()[::-1]", "s_at", "input()[::-1]", "()", "input", "::-1", "-1", "s_bt = input()[::-1]", "s_bt", "input()[::-1]", "()", "input", "::-1", "-1", "s_ct = input()[::-1]", "s_ct", "input()[::-1]", "()", "input", "::-1", "-1", "s_a = deque()", "s_a", "deque()", "deque", "s_b = deque()", "s_b", "deque()", "deque", "s_c = deque()", "s_c", "deque()", "deque", "for i in range(len(s_at)):\n s_a.append(s_at[i])", "i", "range(len(s_at))", "range", "len(s_at)", "len", "s_at", "s_a.append(s_at[i])", "s_a.append", "s_a", "append", "s_at[i]", "s_at", "i", "for i in range(len(s_bt)):\n s_b.append(s_bt[i])", "i", "range(len(s_bt))", "range", "len(s_bt)", "len", "s_bt", "s_b.append(s_bt[i])", "s_b.append", "s_b", "append", "s_bt[i]", "s_bt", "i", "for i in range(len(s_ct)):\n s_c.append(s_ct[i])", "i", "range(len(s_ct))", "range", "len(s_ct)", "len", "s_ct", "s_c.append(s_ct[i])", "s_c.append", "s_c", "append", "s_ct[i]", "s_ct", "i", "now = \"a\"", "now", "\"a\"", "while True:\n if now == \"a\":\n if len(s_a) == 0:\n print(\"A\")\n exit()\n now = s_a[-1]\n s_a.pop()\n elif now == \"b\":\n if len(s_b) == 0:\n print(\"B\")\n exit()\n now = s_b[-1]\n s_b.pop()\n else:\n if len(s_c) == 0:\n print(\"C\")\n exit()\n now = s_c[-1]\n s_c.pop()", "True", "if now == \"a\":\n if len(s_a) == 0:\n print(\"A\")\n exit()\n now = s_a[-1]\n s_a.pop()\n elif now == \"b\":\n if len(s_b) == 0:\n print(\"B\")\n exit()\n now = s_b[-1]\n s_b.pop()\n else:\n if len(s_c) == 0:\n print(\"C\")\n exit()\n now = s_c[-1]\n s_c.pop()", "now == \"a\"", "now", "\"a\"", "if len(s_a) == 0:\n print(\"A\")\n exit()\n ", "len(s_a) == 0", "len(s_a)", "len", "s_a", "0", "print(\"A\")", "print", "\"A\"", "exit()", "exit", "now = s_a[-1]", "now", "s_a[-1]", "s_a", "-1", "s_a.pop()", "s_a.pop", "s_a", "pop", "elif now == \"b\":\n if len(s_b) == 0:\n print(\"B\")\n exit()\n now = s_b[-1]\n s_b.pop()\n ", "now == \"b\"", "now", "\"b\"", "if len(s_b) == 0:\n print(\"B\")\n exit()\n ", "len(s_b) == 0", "len(s_b)", "len", "s_b", "0", "print(\"B\")", "print", "\"B\"", "exit()", "exit", "now = s_b[-1]", "now", "s_b[-1]", "s_b", "-1", "s_b.pop()", "s_b.pop", "s_b", "pop", "if len(s_c) == 0:\n print(\"C\")\n exit()\n ", "len(s_c) == 0", "len(s_c)", "len", "s_c", "0", "print(\"C\")", "print", "\"C\"", "exit()", "exit", "now = s_c[-1]", "now", "s_c[-1]", "s_c", "-1", "s_c.pop()", "s_c.pop", "s_c", "pop", "s_b = deque()", "deque()", "s_b", "now = s_b[-1]", "s_b[-1]", "now", "s_a = deque()", "deque()", "s_a", "now = s_c[-1]", "s_c[-1]", "now", "instrm = lambda: map(str, sys.stdin.readline().split())", "lambda: map(str, sys.stdin.readline().split())", "instrm", "s_ct = input()[::-1]", "input()[::-1]", "s_ct", "now = \"a\"", "\"a\"", "now", "s_bt = input()[::-1]", "input()[::-1]", "s_bt", "instrl = lambda: list(instrm())", "lambda: list(instrm())", "instrl", "s_at = input()[::-1]", "input()[::-1]", "s_at", "now = s_a[-1]", "s_a[-1]", "now", "inint = lambda: int(sys.stdin.readline())", "lambda: int(sys.stdin.readline())", "inint", "s_c = deque()", "deque()", "s_c", "inintl = lambda: list(inintm())", "lambda: list(inintm())", "inintl", "inintm = lambda: map(int, sys.stdin.readline().split())", "lambda: map(int, sys.stdin.readline().split())", "inintm" ]
import sys import math from collections import deque inint = lambda: int(sys.stdin.readline()) inintm = lambda: map(int, sys.stdin.readline().split()) inintl = lambda: list(inintm()) instrm = lambda: map(str, sys.stdin.readline().split()) instrl = lambda: list(instrm()) s_at = input()[::-1] s_bt = input()[::-1] s_ct = input()[::-1] s_a = deque() s_b = deque() s_c = deque() for i in range(len(s_at)): s_a.append(s_at[i]) for i in range(len(s_bt)): s_b.append(s_bt[i]) for i in range(len(s_ct)): s_c.append(s_ct[i]) now = "a" while True: if now == "a": if len(s_a) == 0: print("A") exit() now = s_a[-1] s_a.pop() elif now == "b": if len(s_b) == 0: print("B") exit() now = s_b[-1] s_b.pop() else: if len(s_c) == 0: print("C") exit() now = s_c[-1] s_c.pop()
[ 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, 3, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 3, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 14, 2, 4, 13, 13, 17, 3, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 14, 2, 13, 17, 0, 13, 17, 14, 2, 13, 17, 0, 13, 17, 0, 13, 17, 4, 13, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 17, 13, 10, 18, 13, 10, 18, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 18, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13 ]
[ [ 119, 2 ], [ 125, 6 ], [ 122, 10 ], [ 110, 14 ], [ 111, 20 ], [ 132, 20 ], [ 135, 20 ], [ 138, 20 ], [ 120, 26 ], [ 105, 26 ], [ 101, 30 ], [ 120, 32 ], [ 105, 32 ], [ 104, 35 ], [ 120, 37 ], [ 105, 37 ], [ 111, 42 ], [ 132, 42 ], [ 135, 42 ], [ 138, 42 ], [ 126, 48 ], [ 108, 48 ], [ 116, 52 ], [ 126, 54 ], [ 108, 54 ], [ 107, 57 ], [ 126, 59 ], [ 108, 59 ], [ 123, 66 ], [ 129, 66 ], [ 113, 70 ], [ 123, 72 ], [ 129, 72 ], [ 128, 75 ], [ 123, 77 ], [ 129, 77 ], [ 114, 82 ], [ 117, 82 ], [ 102, 82 ], [ 137, 85 ], [ 114, 89 ], [ 117, 89 ], [ 102, 89 ], [ 134, 92 ], [ 131, 95 ], [ 132, 99 ], [ 135, 99 ], [ 138, 99 ], [ 111, 99 ], [ 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 ] ]
[ "a = input()\nb = input()\nc = input()\n\nd = 'A'\nwhile True:\n if d == 'A':\n if len(a) == 0:\n break\n s = a[0]\n a = a[1:]\n elif d == 'B':\n if len(b) == 0:\n break\n s = b[0]\n b = b[1:]\n else:\n if len(c) == 0:\n break\n s = c[0]\n c = c[1:]\n if s == 'a':\n d = 'A'\n elif s == 'b':\n d = 'B'\n else:\n d = 'C'\nprint (d)", "a = input()", "a", "input()", "input", "b = input()", "b", "input()", "input", "c = input()", "c", "input()", "input", "d = 'A'", "d", "'A'", "while True:\n if d == 'A':\n if len(a) == 0:\n break\n s = a[0]\n a = a[1:]\n elif d == 'B':\n if len(b) == 0:\n break\n s = b[0]\n b = b[1:]\n else:\n if len(c) == 0:\n break\n s = c[0]\n c = c[1:]\n if s == 'a':\n d = 'A'\n elif s == 'b':\n d = 'B'\n else:\n d = 'C'", "True", "if d == 'A':\n if len(a) == 0:\n break\n s = a[0]\n a = a[1:]\n elif d == 'B':\n if len(b) == 0:\n break\n s = b[0]\n b = b[1:]\n else:\n if len(c) == 0:\n break\n s = c[0]\n c = c[1:]\n ", "d == 'A'", "d", "'A'", "if len(a) == 0:\n break\n ", "len(a) == 0", "len(a)", "len", "a", "0", "break", "s = a[0]", "s", "a[0]", "a", "0", "a = a[1:]", "a", "a[1:]", "a", "1:", "1", "elif d == 'B':\n if len(b) == 0:\n break\n s = b[0]\n b = b[1:]\n ", "d == 'B'", "d", "'B'", "if len(b) == 0:\n break\n ", "len(b) == 0", "len(b)", "len", "b", "0", "break", "s = b[0]", "s", "b[0]", "b", "0", "b = b[1:]", "b", "b[1:]", "b", "1:", "1", "if len(c) == 0:\n break\n ", "len(c) == 0", "len(c)", "len", "c", "0", "break", "s = c[0]", "s", "c[0]", "c", "0", "c = c[1:]", "c", "c[1:]", "c", "1:", "1", "if s == 'a':\n d = 'A'\n elif s == 'b':\n d = 'B'\n else:\n d = 'C'", "s == 'a'", "s", "'a'", "d = 'A'", "d", "'A'", "elif s == 'b':\n d = 'B'\n ", "s == 'b'", "s", "'b'", "d = 'B'", "d", "'B'", "d = 'C'", "d", "'C'", "print (d)", "print", "d", "s = a[0]", "a[0]", "s", "a = a[1:]", "a[1:]", "a", "b = b[1:]", "b[1:]", "b", "d = 'A'", "'A'", "d", "s = c[0]", "c[0]", "s", "s = b[0]", "b[0]", "s", "a = input()", "input()", "a", "c = input()", "input()", "c", "b = input()", "input()", "b", "c = c[1:]", "c[1:]", "c", "d = 'C'", "'C'", "d", "d = 'B'", "'B'", "d", "d = 'A'", "'A'", "d" ]
a = input() b = input() c = input() d = 'A' while True: if d == 'A': if len(a) == 0: break s = a[0] a = a[1:] elif d == 'B': if len(b) == 0: break s = b[0] b = b[1:] else: if len(c) == 0: break s = c[0] c = c[1:] if s == 'a': d = 'A' elif s == 'b': d = 'B' else: d = 'C' print (d)
[ 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, 40, 13, 4, 13, 17, 3, 0, 13, 4, 18, 13, 13, 17, 10, 17, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13 ]
[ [ 93, 2 ], [ 90, 8 ], [ 87, 14 ], [ 75, 20 ], [ 76, 26 ], [ 85, 26 ], [ 82, 26 ], [ 79, 26 ], [ 94, 30 ], [ 78, 36 ], [ 94, 39 ], [ 76, 44 ], [ 85, 44 ], [ 82, 44 ], [ 79, 44 ], [ 91, 48 ], [ 81, 54 ], [ 91, 57 ], [ 88, 62 ], [ 84, 68 ], [ 88, 71 ], [ 75, 76 ], [ 78, 79 ], [ 81, 82 ], [ 84, 85 ], [ 87, 88 ], [ 90, 91 ], [ 93, 94 ] ]
[ "A=list(input())\nB=list(input())\nC=list(input())\nt=\"a\"\nwhile True:\n if t==\"a\":\n if not A:\n print(\"A\")\n break\n else:\n t=A.pop(0)\n elif t==\"b\":\n if not B:\n print(\"B\")\n break\n else:\n t=B.pop(0)\n else:\n if not C:\n print(\"C\")\n break\n else:\n t=C.pop(0)", "A=list(input())", "A", "list(input())", "list", "input()", "input", "B=list(input())", "B", "list(input())", "list", "input()", "input", "C=list(input())", "C", "list(input())", "list", "input()", "input", "t=\"a\"", "t", "\"a\"", "while True:\n if t==\"a\":\n if not A:\n print(\"A\")\n break\n else:\n t=A.pop(0)\n elif t==\"b\":\n if not B:\n print(\"B\")\n break\n else:\n t=B.pop(0)\n else:\n if not C:\n print(\"C\")\n break\n else:\n t=C.pop(0)", "True", "if t==\"a\":\n if not A:\n print(\"A\")\n break\n else:\n t=A.pop(0)\n elif t==\"b\":\n if not B:\n print(\"B\")\n break\n else:\n t=B.pop(0)\n else:\n if not C:\n print(\"C\")\n break\n else:\n t=C.pop(0)", "t==\"a\"", "t", "\"a\"", "if not A:\n print(\"A\")\n break\n else:\n t=A.pop(0)\n ", "not A", "A", "print(\"A\")", "print", "\"A\"", "break", "t=A.pop(0)", "t", "A.pop(0)", "A.pop", "A", "pop", "0", "elif t==\"b\":\n if not B:\n print(\"B\")\n break\n else:\n t=B.pop(0)\n ", "t==\"b\"", "t", "\"b\"", "if not B:\n print(\"B\")\n break\n else:\n t=B.pop(0)\n ", "not B", "B", "print(\"B\")", "print", "\"B\"", "break", "t=B.pop(0)", "t", "B.pop(0)", "B.pop", "B", "pop", "0", "if not C:\n print(\"C\")\n break\n else:\n t=C.pop(0)", "not C", "C", "print(\"C\")", "print", "\"C\"", "break", "t=C.pop(0)", "t", "C.pop(0)", "C.pop", "C", "pop", "0", "t=\"a\"", "\"a\"", "t", "t=A.pop(0)", "A.pop(0)", "t", "t=B.pop(0)", "B.pop(0)", "t", "t=C.pop(0)", "C.pop(0)", "t", "C=list(input())", "list(input())", "C", "B=list(input())", "list(input())", "B", "A=list(input())", "list(input())", "A" ]
A=list(input()) B=list(input()) C=list(input()) t="a" while True: if t=="a": if not A: print("A") break else: t=A.pop(0) elif t=="b": if not B: print("B") break else: t=B.pop(0) else: if not C: print("C") break else: t=C.pop(0)
[ 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, 13, 0, 13, 17, 0, 13, 17, 42, 40, 13, 17, 14, 2, 13, 17, 0, 13, 18, 13, 13, 0, 13, 17, 0, 13, 17, 14, 2, 13, 17, 0, 13, 18, 13, 13, 0, 13, 17, 0, 13, 17, 14, 2, 13, 17, 0, 13, 18, 13, 13, 0, 13, 17, 0, 13, 17, 4, 13, 13, 10, 17, 13, 10, 17, 13, 10, 2, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 18, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 18, 13, 10, 18, 13, 10, 2, 13, 10, 17, 13, 10, 17, 13, 10, 2, 13 ]
[ [ 124, 2 ], [ 133, 8 ], [ 91, 14 ], [ 127, 20 ], [ 127, 23 ], [ 127, 25 ], [ 115, 27 ], [ 94, 30 ], [ 116, 34 ], [ 119, 34 ], [ 107, 34 ], [ 122, 34 ], [ 116, 38 ], [ 119, 38 ], [ 107, 38 ], [ 122, 38 ], [ 121, 41 ], [ 125, 43 ], [ 86, 44 ], [ 110, 44 ], [ 109, 46 ], [ 130, 49 ], [ 116, 53 ], [ 119, 53 ], [ 107, 53 ], [ 122, 53 ], [ 106, 56 ], [ 134, 58 ], [ 113, 59 ], [ 89, 59 ], [ 88, 61 ], [ 100, 64 ], [ 116, 68 ], [ 119, 68 ], [ 107, 68 ], [ 122, 68 ], [ 118, 71 ], [ 92, 73 ], [ 128, 74 ], [ 104, 74 ], [ 103, 76 ], [ 97, 79 ], [ 98, 83 ], [ 101, 83 ], [ 131, 83 ], [ 95, 83 ], [ 127, 86 ], [ 88, 89 ], [ 91, 92 ], [ 94, 95 ], [ 97, 98 ], [ 100, 101 ], [ 103, 104 ], [ 106, 107 ], [ 109, 110 ], [ 127, 113 ], [ 115, 116 ], [ 118, 119 ], [ 121, 122 ], [ 124, 125 ], [ 127, 128 ], [ 130, 131 ], [ 133, 134 ] ]
[ "A = input() + \"x\"\nB = input() + \"x\"\nC = input() + \"x\"\n\na=b=c=0\n\nx = 'a'\nans = \"\"\nwhile x!='x':\n if x=='a':\n x = A[a]\n a += 1\n ans = \"A\"\n elif x=='b':\n x = B[b]\n b += 1\n ans = \"B\"\n elif x=='c':\n x = C[c]\n c += 1\n ans = \"C\"\n\n # print(a,b,c)\n\nprint(ans)", "A = input() + \"x\"", "A", "input() + \"x\"", "input()", "input", "\"x\"", "B = input() + \"x\"", "B", "input() + \"x\"", "input()", "input", "\"x\"", "C = input() + \"x\"", "C", "input() + \"x\"", "input()", "input", "\"x\"", "a=b=c=0", "a", "0", "=b=c=0", "b", "0", "c", "x = 'a'", "x", "'a'", "ans = \"\"", "ans", "\"\"", "while x!='x':\n if x=='a':\n x = A[a]\n a += 1\n ans = \"A\"\n elif x=='b':\n x = B[b]\n b += 1\n ans = \"B\"\n elif x=='c':\n x = C[c]\n c += 1\n ans = \"C\"\n\n # print(a,b,c)", "x!='x'", "x", "'x'", "if x=='a':\n x = A[a]\n a += 1\n ans = \"A\"\n elif x=='b':\n x = B[b]\n b += 1\n ans = \"B\"\n elif x=='c':\n x = C[c]\n c += 1\n ans = \"C\"\n\n # print(a,b,c)", "x=='a'", "x", "'a'", "x = A[a]", "x", "A[a]", "A", "a", "a += 1", "a", "1", "ans = \"A\"", "ans", "\"A\"", "elif x=='b':\n x = B[b]\n b += 1\n ans = \"B\"\n ", "x=='b'", "x", "'b'", "x = B[b]", "x", "B[b]", "B", "b", "b += 1", "b", "1", "ans = \"B\"", "ans", "\"B\"", "elif x=='c':\n x = C[c]\n c += 1\n ans = \"C\"\n\n # print(a,b,c)", "x=='c'", "x", "'c'", "x = C[c]", "x", "C[c]", "C", "c", "c += 1", "c", "1", "ans = \"C\"", "ans", "\"C\"", "print(ans)", "print", "ans", "a=b=c=0", "0", "a", "b += 1", "1", "b", "C = input() + \"x\"", "input() + \"x\"", "C", "ans = \"\"", "\"\"", "ans", "ans = \"C\"", "\"C\"", "ans", "ans = \"B\"", "\"B\"", "ans", "c += 1", "1", "c", "x = B[b]", "B[b]", "x", "a += 1", "1", "a", "b=c=0", "0", "b", "x = 'a'", "'a'", "x", "x = C[c]", "C[c]", "x", "x = A[a]", "A[a]", "x", "A = input() + \"x\"", "input() + \"x\"", "A", "c=0", "0", "c", "ans = \"A\"", "\"A\"", "ans", "B = input() + \"x\"", "input() + \"x\"", "B" ]
A = input() + "x" B = input() + "x" C = input() + "x" a=b=c=0 x = 'a' ans = "" while x!='x': if x=='a': x = A[a] a += 1 ans = "A" elif x=='b': x = B[b] b += 1 ans = "B" elif x=='c': x = C[c] c += 1 ans = "C" # print(a,b,c) print(ans)
[ 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, 0, 13, 13, 14, 2, 13, 17, 0, 13, 13, 14, 2, 13, 17, 0, 13, 13, 38, 5, 4, 13, 4, 18, 13, 13, 3, 0, 13, 4, 18, 13, 13, 17, 10, 4, 13, 10, 4, 13, 10, 13, 13, 10, 4, 13, 10, 4, 13, 10, 13, 13, 10, 4, 13, 10, 13, 13 ]
[ [ 78, 2 ], [ 66, 8 ], [ 69, 14 ], [ 75, 20 ], [ 79, 23 ], [ 76, 30 ], [ 85, 30 ], [ 87, 33 ], [ 79, 34 ], [ 76, 37 ], [ 85, 37 ], [ 72, 40 ], [ 67, 41 ], [ 76, 44 ], [ 85, 44 ], [ 81, 47 ], [ 70, 48 ], [ 76, 55 ], [ 85, 55 ], [ 84, 59 ], [ 82, 62 ], [ 73, 62 ], [ 88, 62 ], [ 66, 67 ], [ 69, 70 ], [ 67, 72 ], [ 72, 73 ], [ 75, 76 ], [ 78, 79 ], [ 70, 81 ], [ 81, 82 ], [ 84, 85 ], [ 79, 87 ], [ 87, 88 ] ]
[ "Sa = list(input())\nSb = list(input())\nSc = list(input())\ncard = Sa.pop(0)\nwhile True:\n if card == 'a':\n S = Sa\n if card == 'b':\n S = Sb\n if card == 'c':\n S = Sc\n try:\n card = S.pop(0)\n except:\n print(card.upper())\n break", "Sa = list(input())", "Sa", "list(input())", "list", "input()", "input", "Sb = list(input())", "Sb", "list(input())", "list", "input()", "input", "Sc = list(input())", "Sc", "list(input())", "list", "input()", "input", "card = Sa.pop(0)", "card", "Sa.pop(0)", "Sa.pop", "Sa", "pop", "0", "while True:\n if card == 'a':\n S = Sa\n if card == 'b':\n S = Sb\n if card == 'c':\n S = Sc\n try:\n card = S.pop(0)\n except:\n print(card.upper())\n break", "True", "if card == 'a':\n S = Sa\n ", "card == 'a'", "card", "'a'", "S = Sa", "S", "Sa", "if card == 'b':\n S = Sb\n ", "card == 'b'", "card", "'b'", "S = Sb", "S", "Sb", "if card == 'c':\n S = Sc\n ", "card == 'c'", "card", "'c'", "S = Sc", "S", "Sc", "try:\n card = S.pop(0)\n except:\n print(card.upper())\n break", "except:\n print(card.upper())\n break", "print(card.upper())", "print", "card.upper()", "card.upper", "card", "upper", "break", "card = S.pop(0)", "card", "S.pop(0)", "S.pop", "S", "pop", "0", "Sb = list(input())", "list(input())", "Sb", "Sc = list(input())", "list(input())", "Sc", "S = Sb", "Sb", "S", "card = Sa.pop(0)", "Sa.pop(0)", "card", "Sa = list(input())", "list(input())", "Sa", "S = Sc", "Sc", "S", "card = S.pop(0)", "S.pop(0)", "card", "S = Sa", "Sa", "S" ]
Sa = list(input()) Sb = list(input()) Sc = list(input()) card = Sa.pop(0) while True: if card == 'a': S = Sa if card == 'b': S = Sb if card == 'c': S = Sc try: card = S.pop(0) except: print(card.upper()) break
[ 7, 0, 13, 4, 13, 4, 13, 0, 13, 4, 13, 4, 13, 0, 13, 4, 13, 4, 13, 0, 13, 17, 42, 17, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 4, 13, 17, 4, 13, 0, 13, 4, 18, 13, 13, 17, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 4, 13, 17, 4, 13, 0, 13, 4, 18, 13, 13, 17, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 4, 13, 17, 4, 13, 0, 13, 4, 18, 13, 13, 17, 10, 4, 13, 10, 4, 13, 10, 17, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13 ]
[ [ 103, 2 ], [ 91, 8 ], [ 100, 14 ], [ 97, 20 ], [ 98, 26 ], [ 110, 26 ], [ 95, 26 ], [ 107, 26 ], [ 104, 32 ], [ 106, 40 ], [ 104, 43 ], [ 98, 48 ], [ 110, 48 ], [ 95, 48 ], [ 107, 48 ], [ 92, 54 ], [ 94, 62 ], [ 92, 65 ], [ 98, 70 ], [ 110, 70 ], [ 95, 70 ], [ 107, 70 ], [ 101, 76 ], [ 109, 84 ], [ 101, 87 ], [ 91, 92 ], [ 94, 95 ], [ 97, 98 ], [ 100, 101 ], [ 103, 104 ], [ 106, 107 ], [ 109, 110 ] ]
[ "sa = list(input())\nsb = list(input())\nsc = list(input())\nmode = \"a\"\nwhile True:\n if mode == \"a\":\n if len(sa) == 0:\n print(\"A\")\n exit()\n mode = sa.pop(0)\n elif mode == \"b\":\n if len(sb) == 0:\n print(\"B\")\n exit()\n mode = sb.pop(0)\n elif mode == \"c\":\n if len(sc) == 0:\n print(\"C\")\n exit()\n mode = 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", "mode = \"a\"", "mode", "\"a\"", "while True:\n if mode == \"a\":\n if len(sa) == 0:\n print(\"A\")\n exit()\n mode = sa.pop(0)\n elif mode == \"b\":\n if len(sb) == 0:\n print(\"B\")\n exit()\n mode = sb.pop(0)\n elif mode == \"c\":\n if len(sc) == 0:\n print(\"C\")\n exit()\n mode = sc.pop(0)", "True", "if mode == \"a\":\n if len(sa) == 0:\n print(\"A\")\n exit()\n mode = sa.pop(0)\n elif mode == \"b\":\n if len(sb) == 0:\n print(\"B\")\n exit()\n mode = sb.pop(0)\n elif mode == \"c\":\n if len(sc) == 0:\n print(\"C\")\n exit()\n mode = sc.pop(0)", "mode == \"a\"", "mode", "\"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", "mode = sa.pop(0)", "mode", "sa.pop(0)", "sa.pop", "sa", "pop", "0", "elif mode == \"b\":\n if len(sb) == 0:\n print(\"B\")\n exit()\n mode = sb.pop(0)\n ", "mode == \"b\"", "mode", "\"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", "mode = sb.pop(0)", "mode", "sb.pop(0)", "sb.pop", "sb", "pop", "0", "elif mode == \"c\":\n if len(sc) == 0:\n print(\"C\")\n exit()\n mode = sc.pop(0)", "mode == \"c\"", "mode", "\"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", "mode = sc.pop(0)", "mode", "sc.pop(0)", "sc.pop", "sc", "pop", "0", "sb = list(input())", "list(input())", "sb", "mode = sb.pop(0)", "sb.pop(0)", "mode", "mode = \"a\"", "\"a\"", "mode", "sc = list(input())", "list(input())", "sc", "sa = list(input())", "list(input())", "sa", "mode = sa.pop(0)", "sa.pop(0)", "mode", "mode = sc.pop(0)", "sc.pop(0)", "mode" ]
sa = list(input()) sb = list(input()) sc = list(input()) mode = "a" while True: if mode == "a": if len(sa) == 0: print("A") exit() mode = sa.pop(0) elif mode == "b": if len(sb) == 0: print("B") exit() mode = sb.pop(0) elif mode == "c": if len(sc) == 0: print("C") exit() mode = sc.pop(0)
[ 7, 15, 13, 15, 13, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 4, 18, 13, 13, 39, 0, 13, 4, 18, 13, 13, 39, 0, 13, 4, 18, 13, 13, 39, 28, 13, 4, 13, 4, 13, 13, 4, 18, 13, 13, 18, 13, 13, 28, 13, 4, 13, 4, 13, 13, 4, 18, 13, 13, 18, 13, 13, 28, 13, 4, 13, 4, 13, 13, 4, 18, 13, 13, 18, 13, 13, 0, 13, 17, 42, 17, 14, 2, 13, 17, 14, 13, 0, 13, 4, 18, 13, 13, 4, 13, 17, 4, 18, 13, 13, 14, 2, 13, 17, 14, 13, 0, 13, 4, 18, 13, 13, 4, 13, 17, 4, 18, 13, 13, 14, 2, 13, 17, 14, 13, 0, 13, 4, 18, 13, 13, 4, 13, 17, 4, 18, 13, 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, 10, 4, 13 ]
[ [ 164, 6 ], [ 167, 10 ], [ 143, 14 ], [ 155, 18 ], [ 146, 25 ], [ 152, 32 ], [ 40, 39 ], [ 165, 44 ], [ 156, 47 ], [ 165, 50 ], [ 39, 51 ], [ 54, 53 ], [ 168, 58 ], [ 147, 61 ], [ 168, 64 ], [ 53, 65 ], [ 68, 67 ], [ 144, 72 ], [ 153, 75 ], [ 144, 78 ], [ 67, 79 ], [ 158, 81 ], [ 159, 87 ], [ 150, 87 ], [ 162, 87 ], [ 171, 87 ], [ 170, 92 ], [ 156, 95 ], [ 171, 106 ], [ 159, 106 ], [ 150, 106 ], [ 162, 106 ], [ 161, 111 ], [ 147, 114 ], [ 162, 125 ], [ 171, 125 ], [ 159, 125 ], [ 150, 125 ], [ 149, 130 ], [ 153, 133 ], [ 143, 144 ], [ 146, 147 ], [ 149, 150 ], [ 152, 153 ], [ 155, 156 ], [ 158, 159 ], [ 161, 162 ], [ 164, 165 ], [ 167, 168 ], [ 170, 171 ] ]
[ "import collections\nimport sys\nsa=input()\nsb=input()\nsc=input()\na=collections.deque([])\nb=collections.deque([])\nc=collections.deque([])\nfor i in range(len(sa)):\n a.append(sa[i])\nfor i in range(len(sb)):\n b.append(sb[i])\nfor i in range(len(sc)):\n c.append(sc[i])\ncurrent='a'\nwhile True:\n if current=='a':\n if a:\n current=a.popleft()\n else:\n print('A')\n sys.exit()\n if current=='b':\n if b:\n current=b.popleft()\n else:\n print('B')\n sys.exit()\n if current=='c':\n if c:\n current=c.popleft()\n else:\n print('C')\n sys.exit()", "import collections", "collections", "import sys", "sys", "sa=input()", "sa", "input()", "input", "sb=input()", "sb", "input()", "input", "sc=input()", "sc", "input()", "input", "a=collections.deque([])", "a", "collections.deque([])", "collections.deque", "collections", "deque", "[]", "b=collections.deque([])", "b", "collections.deque([])", "collections.deque", "collections", "deque", "[]", "c=collections.deque([])", "c", "collections.deque([])", "collections.deque", "collections", "deque", "[]", "for i in range(len(sa)):\n a.append(sa[i])", "i", "range(len(sa))", "range", "len(sa)", "len", "sa", "a.append(sa[i])", "a.append", "a", "append", "sa[i]", "sa", "i", "for i in range(len(sb)):\n b.append(sb[i])", "i", "range(len(sb))", "range", "len(sb)", "len", "sb", "b.append(sb[i])", "b.append", "b", "append", "sb[i]", "sb", "i", "for i in range(len(sc)):\n c.append(sc[i])", "i", "range(len(sc))", "range", "len(sc)", "len", "sc", "c.append(sc[i])", "c.append", "c", "append", "sc[i]", "sc", "i", "current='a'", "current", "'a'", "while True:\n if current=='a':\n if a:\n current=a.popleft()\n else:\n print('A')\n sys.exit()\n if current=='b':\n if b:\n current=b.popleft()\n else:\n print('B')\n sys.exit()\n if current=='c':\n if c:\n current=c.popleft()\n else:\n print('C')\n sys.exit()", "True", "if current=='a':\n if a:\n current=a.popleft()\n else:\n print('A')\n sys.exit()\n ", "current=='a'", "current", "'a'", "if a:\n current=a.popleft()\n else:\n print('A')\n sys.exit()\n ", "a", "current=a.popleft()", "current", "a.popleft()", "a.popleft", "a", "popleft", "print('A')", "print", "'A'", "sys.exit()", "sys.exit", "sys", "exit", "if current=='b':\n if b:\n current=b.popleft()\n else:\n print('B')\n sys.exit()\n ", "current=='b'", "current", "'b'", "if b:\n current=b.popleft()\n else:\n print('B')\n sys.exit()\n ", "b", "current=b.popleft()", "current", "b.popleft()", "b.popleft", "b", "popleft", "print('B')", "print", "'B'", "sys.exit()", "sys.exit", "sys", "exit", "if current=='c':\n if c:\n current=c.popleft()\n else:\n print('C')\n sys.exit()", "current=='c'", "current", "'c'", "if c:\n current=c.popleft()\n else:\n print('C')\n sys.exit()", "c", "current=c.popleft()", "current", "c.popleft()", "c.popleft", "c", "popleft", "print('C')", "print", "'C'", "sys.exit()", "sys.exit", "sys", "exit", "sc=input()", "input()", "sc", "b=collections.deque([])", "collections.deque([])", "b", "current=c.popleft()", "c.popleft()", "current", "c=collections.deque([])", "collections.deque([])", "c", "a=collections.deque([])", "collections.deque([])", "a", "current='a'", "'a'", "current", "current=b.popleft()", "b.popleft()", "current", "sa=input()", "input()", "sa", "sb=input()", "input()", "sb", "current=a.popleft()", "a.popleft()", "current" ]
import collections import sys sa=input() sb=input() sc=input() a=collections.deque([]) b=collections.deque([]) c=collections.deque([]) for i in range(len(sa)): a.append(sa[i]) for i in range(len(sb)): b.append(sb[i]) for i in range(len(sc)): c.append(sc[i]) current='a' while True: if current=='a': if a: current=a.popleft() else: print('A') sys.exit() if current=='b': if b: current=b.popleft() else: print('B') sys.exit() if current=='c': if c: current=c.popleft() else: print('C') sys.exit()
[ 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, 17, 0, 13, 17, 28, 13, 4, 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, 2, 4, 13, 13, 17, 2, 13, 17, 0, 13, 17, 3, 14, 2, 2, 4, 13, 13, 17, 2, 13, 17, 0, 13, 17, 3, 14, 2, 2, 4, 13, 13, 17, 2, 13, 17, 0, 13, 17, 3, 4, 13, 13, 10, 17, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 17, 13, 10, 4, 13, 10, 4, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 17, 13 ]
[ [ 144, 2 ], [ 129, 6 ], [ 132, 10 ], [ 120, 14 ], [ 145, 17 ], [ 147, 19 ], [ 130, 22 ], [ 150, 24 ], [ 133, 27 ], [ 126, 29 ], [ 114, 32 ], [ 36, 35 ], [ 127, 41 ], [ 118, 41 ], [ 139, 41 ], [ 124, 41 ], [ 123, 44 ], [ 121, 47 ], [ 127, 52 ], [ 118, 52 ], [ 139, 52 ], [ 124, 52 ], [ 138, 55 ], [ 148, 58 ], [ 117, 62 ], [ 151, 65 ], [ 121, 73 ], [ 118, 76 ], [ 139, 76 ], [ 124, 76 ], [ 127, 76 ], [ 153, 79 ], [ 148, 87 ], [ 118, 90 ], [ 139, 90 ], [ 124, 90 ], [ 127, 90 ], [ 141, 93 ], [ 151, 101 ], [ 118, 104 ], [ 139, 104 ], [ 124, 104 ], [ 127, 104 ], [ 135, 107 ], [ 136, 112 ], [ 142, 112 ], [ 154, 112 ], [ 115, 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 ] ]
[ "A=input()\nB=input()\nC=input()\nListA=list(A)\nListB=list(B)\nListC=list(C)\npile = \"a\"\nres = \"\"\nfor i in range(400):\n if pile == \"a\":\n pile = ListA.pop(0)\n elif pile == \"b\":\n pile = ListB.pop(0)\n else:\n pile = ListC.pop(0)\n if len(ListA) == 0 and pile == \"a\":\n res = \"A\"\n break\n elif len(ListB) == 0 and pile == \"b\":\n res = \"B\"\n break\n elif len(ListC) == 0 and pile == \"c\":\n res = \"C\"\n break\n else:\n pass\nprint(res)", "A=input()", "A", "input()", "input", "B=input()", "B", "input()", "input", "C=input()", "C", "input()", "input", "ListA=list(A)", "ListA", "list(A)", "list", "A", "ListB=list(B)", "ListB", "list(B)", "list", "B", "ListC=list(C)", "ListC", "list(C)", "list", "C", "pile = \"a\"", "pile", "\"a\"", "res = \"\"", "res", "\"\"", "for i in range(400):\n if pile == \"a\":\n pile = ListA.pop(0)\n elif pile == \"b\":\n pile = ListB.pop(0)\n else:\n pile = ListC.pop(0)\n if len(ListA) == 0 and pile == \"a\":\n res = \"A\"\n break\n elif len(ListB) == 0 and pile == \"b\":\n res = \"B\"\n break\n elif len(ListC) == 0 and pile == \"c\":\n res = \"C\"\n break\n else:\n pass", "i", "range(400)", "range", "400", "if pile == \"a\":\n pile = ListA.pop(0)\n elif pile == \"b\":\n pile = ListB.pop(0)\n else:\n pile = ListC.pop(0)\n ", "pile == \"a\"", "pile", "\"a\"", "pile = ListA.pop(0)", "pile", "ListA.pop(0)", "ListA.pop", "ListA", "pop", "0", "elif pile == \"b\":\n pile = ListB.pop(0)\n ", "pile == \"b\"", "pile", "\"b\"", "pile = ListB.pop(0)", "pile", "ListB.pop(0)", "ListB.pop", "ListB", "pop", "0", "pile = ListC.pop(0)", "pile", "ListC.pop(0)", "ListC.pop", "ListC", "pop", "0", "if len(ListA) == 0 and pile == \"a\":\n res = \"A\"\n break\n elif len(ListB) == 0 and pile == \"b\":\n res = \"B\"\n break\n elif len(ListC) == 0 and pile == \"c\":\n res = \"C\"\n break\n else:\n pass", "len(ListA) == 0 and pile == \"a\"", "len(ListA) == 0", "len(ListA)", "len", "ListA", "0", "pile == \"a\"", "pile", "\"a\"", "res = \"A\"", "res", "\"A\"", "break", "elif len(ListB) == 0 and pile == \"b\":\n res = \"B\"\n break\n ", "len(ListB) == 0 and pile == \"b\"", "len(ListB) == 0", "len(ListB)", "len", "ListB", "0", "pile == \"b\"", "pile", "\"b\"", "res = \"B\"", "res", "\"B\"", "break", "elif len(ListC) == 0 and pile == \"c\":\n res = \"C\"\n break\n ", "len(ListC) == 0 and pile == \"c\"", "len(ListC) == 0", "len(ListC)", "len", "ListC", "0", "pile == \"c\"", "pile", "\"c\"", "res = \"C\"", "res", "\"C\"", "break", "print(res)", "print", "res", "res = \"\"", "\"\"", "res", "pile = ListC.pop(0)", "ListC.pop(0)", "pile", "ListA=list(A)", "list(A)", "ListA", "pile = ListA.pop(0)", "ListA.pop(0)", "pile", "pile = \"a\"", "\"a\"", "pile", "B=input()", "input()", "B", "C=input()", "input()", "C", "res = \"C\"", "\"C\"", "res", "pile = ListB.pop(0)", "ListB.pop(0)", "pile", "res = \"B\"", "\"B\"", "res", "A=input()", "input()", "A", "ListB=list(B)", "list(B)", "ListB", "ListC=list(C)", "list(C)", "ListC", "res = \"A\"", "\"A\"", "res" ]
A=input() B=input() C=input() ListA=list(A) ListB=list(B) ListC=list(C) pile = "a" res = "" for i in range(400): if pile == "a": pile = ListA.pop(0) elif pile == "b": pile = ListB.pop(0) else: pile = ListC.pop(0) if len(ListA) == 0 and pile == "a": res = "A" break elif len(ListB) == 0 and pile == "b": res = "B" break elif len(ListC) == 0 and pile == "c": res = "C" break else: pass print(res)
[ 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, 2, 4, 13, 13, 17, 2, 13, 17, 4, 13, 17, 4, 13, 14, 2, 2, 4, 13, 13, 17, 2, 13, 17, 4, 13, 17, 4, 13, 14, 2, 2, 4, 13, 13, 17, 2, 13, 17, 4, 13, 17, 4, 13, 14, 2, 13, 17, 0, 13, 4, 18, 13, 13, 14, 2, 13, 17, 0, 13, 4, 18, 13, 13, 14, 2, 13, 17, 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, 17, 13 ]
[ [ 116, 3 ], [ 104, 9 ], [ 101, 15 ], [ 119, 21 ], [ 117, 30 ], [ 120, 33 ], [ 111, 33 ], [ 108, 33 ], [ 114, 33 ], [ 105, 45 ], [ 120, 48 ], [ 111, 48 ], [ 108, 48 ], [ 114, 48 ], [ 102, 60 ], [ 120, 63 ], [ 111, 63 ], [ 108, 63 ], [ 114, 63 ], [ 120, 72 ], [ 111, 72 ], [ 108, 72 ], [ 114, 72 ], [ 113, 75 ], [ 117, 78 ], [ 120, 82 ], [ 111, 82 ], [ 108, 82 ], [ 114, 82 ], [ 107, 85 ], [ 105, 88 ], [ 120, 92 ], [ 111, 92 ], [ 108, 92 ], [ 114, 92 ], [ 110, 95 ], [ 102, 98 ], [ 101, 102 ], [ 104, 105 ], [ 107, 108 ], [ 110, 111 ], [ 113, 114 ], [ 116, 117 ], [ 119, 120 ] ]
[ "# ABC045\nfrom collections import deque\nS_A = deque(input())\nS_B = deque(input())\nS_C = deque(input())\n\n# 最初はAから\nnext_turn = 'a'\n\nwhile True:\n # 勝利判定\n if len(S_A) == 0 and next_turn == 'a':\n print(\"A\")\n exit()\n elif len(S_B) == 0 and next_turn == 'b':\n print(\"B\")\n exit()\n elif len(S_C) == 0 and next_turn == 'c':\n print(\"C\")\n exit()\n else:\n if next_turn == 'a':\n next_turn = S_A.popleft()\n elif next_turn == 'b':\n next_turn = S_B.popleft()\n elif next_turn == 'c':\n next_turn = S_C.popleft()", "from collections import deque", "S_A = deque(input())", "S_A", "deque(input())", "deque", "input()", "input", "S_B = deque(input())", "S_B", "deque(input())", "deque", "input()", "input", "S_C = deque(input())", "S_C", "deque(input())", "deque", "input()", "input", "next_turn = 'a'", "next_turn", "'a'", "while True:\n # 勝利判定\n if len(S_A) == 0 and next_turn == 'a':\n print(\"A\")\n exit()\n elif len(S_B) == 0 and next_turn == 'b':\n print(\"B\")\n exit()\n elif len(S_C) == 0 and next_turn == 'c':\n print(\"C\")\n exit()\n else:\n if next_turn == 'a':\n next_turn = S_A.popleft()\n elif next_turn == 'b':\n next_turn = S_B.popleft()\n elif next_turn == 'c':\n next_turn = S_C.popleft()", "True", "if len(S_A) == 0 and next_turn == 'a':\n print(\"A\")\n exit()\n elif len(S_B) == 0 and next_turn == 'b':\n print(\"B\")\n exit()\n elif len(S_C) == 0 and next_turn == 'c':\n print(\"C\")\n exit()\n else:\n if next_turn == 'a':\n next_turn = S_A.popleft()\n elif next_turn == 'b':\n next_turn = S_B.popleft()\n elif next_turn == 'c':\n next_turn = S_C.popleft()", "len(S_A) == 0 and next_turn == 'a'", "len(S_A) == 0", "len(S_A)", "len", "S_A", "0", "next_turn == 'a'", "next_turn", "'a'", "print(\"A\")", "print", "\"A\"", "exit()", "exit", "elif len(S_B) == 0 and next_turn == 'b':\n print(\"B\")\n exit()\n ", "len(S_B) == 0 and next_turn == 'b'", "len(S_B) == 0", "len(S_B)", "len", "S_B", "0", "next_turn == 'b'", "next_turn", "'b'", "print(\"B\")", "print", "\"B\"", "exit()", "exit", "elif len(S_C) == 0 and next_turn == 'c':\n print(\"C\")\n exit()\n ", "len(S_C) == 0 and next_turn == 'c'", "len(S_C) == 0", "len(S_C)", "len", "S_C", "0", "next_turn == 'c'", "next_turn", "'c'", "print(\"C\")", "print", "\"C\"", "exit()", "exit", "if next_turn == 'a':\n next_turn = S_A.popleft()\n elif next_turn == 'b':\n next_turn = S_B.popleft()\n elif next_turn == 'c':\n next_turn = S_C.popleft()", "next_turn == 'a'", "next_turn", "'a'", "next_turn = S_A.popleft()", "next_turn", "S_A.popleft()", "S_A.popleft", "S_A", "popleft", "elif next_turn == 'b':\n next_turn = S_B.popleft()\n ", "next_turn == 'b'", "next_turn", "'b'", "next_turn = S_B.popleft()", "next_turn", "S_B.popleft()", "S_B.popleft", "S_B", "popleft", "elif next_turn == 'c':\n next_turn = S_C.popleft()", "next_turn == 'c'", "next_turn", "'c'", "next_turn = S_C.popleft()", "next_turn", "S_C.popleft()", "S_C.popleft", "S_C", "popleft", "S_C = deque(input())", "deque(input())", "S_C", "S_B = deque(input())", "deque(input())", "S_B", "next_turn = S_B.popleft()", "S_B.popleft()", "next_turn", "next_turn = S_C.popleft()", "S_C.popleft()", "next_turn", "next_turn = S_A.popleft()", "S_A.popleft()", "next_turn", "S_A = deque(input())", "deque(input())", "S_A", "next_turn = 'a'", "'a'", "next_turn" ]
# ABC045 from collections import deque S_A = deque(input()) S_B = deque(input()) S_C = deque(input()) # 最初はAから next_turn = 'a' while True: # 勝利判定 if len(S_A) == 0 and next_turn == 'a': print("A") exit() elif len(S_B) == 0 and next_turn == 'b': print("B") exit() elif len(S_C) == 0 and next_turn == 'c': print("C") exit() else: if next_turn == 'a': next_turn = S_A.popleft() elif next_turn == 'b': next_turn = S_B.popleft() elif next_turn == 'c': next_turn = S_C.popleft()
[ 7, 0, 13, 4, 18, 4, 13, 13, 0, 13, 4, 18, 4, 13, 13, 0, 13, 4, 18, 4, 13, 13, 0, 13, 17, 42, 17, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 0, 13, 17, 3, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 0, 13, 17, 3, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 14, 2, 4, 13, 13, 17, 0, 13, 17, 3, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 4, 13, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 4, 13, 10, 4, 13, 10, 17, 13, 10, 18, 13, 10, 18, 13 ]
[ [ 129, 2 ], [ 126, 9 ], [ 105, 16 ], [ 108, 23 ], [ 109, 29 ], [ 139, 29 ], [ 103, 29 ], [ 115, 29 ], [ 112, 29 ], [ 136, 29 ], [ 133, 29 ], [ 130, 35 ], [ 124, 35 ], [ 132, 38 ], [ 135, 42 ], [ 130, 44 ], [ 124, 44 ], [ 123, 47 ], [ 130, 49 ], [ 124, 49 ], [ 109, 54 ], [ 139, 54 ], [ 103, 54 ], [ 115, 54 ], [ 112, 54 ], [ 136, 54 ], [ 133, 54 ], [ 127, 60 ], [ 118, 60 ], [ 111, 63 ], [ 114, 67 ], [ 127, 69 ], [ 118, 69 ], [ 117, 72 ], [ 127, 74 ], [ 118, 74 ], [ 106, 81 ], [ 121, 81 ], [ 102, 84 ], [ 138, 88 ], [ 106, 90 ], [ 121, 90 ], [ 120, 93 ], [ 106, 95 ], [ 121, 95 ], [ 139, 100 ], [ 103, 100 ], [ 115, 100 ], [ 112, 100 ], [ 136, 100 ], [ 133, 100 ], [ 109, 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 ] ]
[ "a = input().upper()\nb = input().upper()\nc = input().upper()\nt = 'A'\nwhile True:\n if t=='A':\n if len(a)<1:\n t = 'A'\n break\n t = a[0]\n a = a[1:]\n elif t=='B':\n if len(b)<1:\n t = 'B'\n break\n t = b[0]\n b = b[1:]\n else:\n if len(c)<1:\n t = 'C'\n break\n t = c[0]\n c = c[1:]\nprint(t)", "a = input().upper()", "a", "input().upper()", "().upper", "()", "input", "upper", "b = input().upper()", "b", "input().upper()", "().upper", "()", "input", "upper", "c = input().upper()", "c", "input().upper()", "().upper", "()", "input", "upper", "t = 'A'", "t", "'A'", "while True:\n if t=='A':\n if len(a)<1:\n t = 'A'\n break\n t = a[0]\n a = a[1:]\n elif t=='B':\n if len(b)<1:\n t = 'B'\n break\n t = b[0]\n b = b[1:]\n else:\n if len(c)<1:\n t = 'C'\n break\n t = c[0]\n c = c[1:]", "True", "if t=='A':\n if len(a)<1:\n t = 'A'\n break\n t = a[0]\n a = a[1:]\n elif t=='B':\n if len(b)<1:\n t = 'B'\n break\n t = b[0]\n b = b[1:]\n else:\n if len(c)<1:\n t = 'C'\n break\n t = c[0]\n c = c[1:]", "t=='A'", "t", "'A'", "if len(a)<1:\n t = 'A'\n break\n ", "len(a)<1", "len(a)", "len", "a", "1", "t = 'A'", "t", "'A'", "break", "t = a[0]", "t", "a[0]", "a", "0", "a = a[1:]", "a", "a[1:]", "a", "1:", "1", "elif t=='B':\n if len(b)<1:\n t = 'B'\n break\n t = b[0]\n b = b[1:]\n ", "t=='B'", "t", "'B'", "if len(b)<1:\n t = 'B'\n break\n ", "len(b)<1", "len(b)", "len", "b", "1", "t = 'B'", "t", "'B'", "break", "t = b[0]", "t", "b[0]", "b", "0", "b = b[1:]", "b", "b[1:]", "b", "1:", "1", "if len(c)<1:\n t = 'C'\n break\n ", "len(c)<1", "len(c)", "len", "c", "1", "t = 'C'", "t", "'C'", "break", "t = c[0]", "t", "c[0]", "c", "0", "c = c[1:]", "c", "c[1:]", "c", "1:", "1", "print(t)", "print", "t", "t = 'C'", "'C'", "t", "c = input().upper()", "input().upper()", "c", "t = 'A'", "'A'", "t", "t = 'B'", "'B'", "t", "t = b[0]", "b[0]", "t", "b = b[1:]", "b[1:]", "b", "c = c[1:]", "c[1:]", "c", "a = a[1:]", "a[1:]", "a", "b = input().upper()", "input().upper()", "b", "a = input().upper()", "input().upper()", "a", "t = 'A'", "'A'", "t", "t = a[0]", "a[0]", "t", "t = c[0]", "c[0]", "t" ]
a = input().upper() b = input().upper() c = input().upper() t = 'A' while True: if t=='A': if len(a)<1: t = 'A' break t = a[0] a = a[1:] elif t=='B': if len(b)<1: t = 'B' break t = b[0] b = b[1:] else: if len(c)<1: t = 'C' break t = c[0] c = c[1:] print(t)
[ 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, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 4, 13, 4, 18, 13, 13, 10, 18, 13, 10, 18, 13, 10, 4, 13, 10, 4, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 17, 13, 10, 4, 13, 10, 18, 13 ]
[ [ 112, 2 ], [ 97, 6 ], [ 94, 10 ], [ 109, 14 ], [ 110, 20 ], [ 92, 20 ], [ 89, 20 ], [ 104, 20 ], [ 113, 26 ], [ 107, 26 ], [ 103, 29 ], [ 113, 31 ], [ 107, 31 ], [ 106, 34 ], [ 113, 36 ], [ 107, 36 ], [ 110, 41 ], [ 92, 41 ], [ 89, 41 ], [ 104, 41 ], [ 98, 47 ], [ 101, 47 ], [ 88, 50 ], [ 98, 52 ], [ 101, 52 ], [ 100, 55 ], [ 98, 57 ], [ 101, 57 ], [ 110, 62 ], [ 92, 62 ], [ 89, 62 ], [ 104, 62 ], [ 95, 68 ], [ 116, 68 ], [ 91, 71 ], [ 95, 73 ], [ 116, 73 ], [ 115, 76 ], [ 95, 78 ], [ 116, 78 ], [ 92, 85 ], [ 89, 85 ], [ 104, 85 ], [ 110, 85 ], [ 88, 89 ], [ 91, 92 ], [ 94, 95 ], [ 97, 98 ], [ 100, 101 ], [ 103, 104 ], [ 106, 107 ], [ 109, 110 ], [ 112, 113 ], [ 115, 116 ] ]
[ "sa = input()\nsb = input()\nsc = input()\n\nt = \"a\"\nwhile True:\n if t == \"a\":\n if len(sa) == 0: break\n t = sa[0]\n sa = sa[1:]\n elif t == \"b\":\n if len(sb) == 0: break\n t = sb[0]\n sb = sb[1:]\n elif t == \"c\":\n if len(sc) == 0: break\n t = sc[0]\n sc = sc[1:]\n\nprint(t.upper())", "sa = input()", "sa", "input()", "input", "sb = input()", "sb", "input()", "input", "sc = input()", "sc", "input()", "input", "t = \"a\"", "t", "\"a\"", "while True:\n if t == \"a\":\n if len(sa) == 0: break\n t = sa[0]\n sa = sa[1:]\n elif t == \"b\":\n if len(sb) == 0: break\n t = sb[0]\n sb = sb[1:]\n elif t == \"c\":\n if len(sc) == 0: break\n t = sc[0]\n sc = sc[1:]", "True", "if t == \"a\":\n if len(sa) == 0: break\n t = sa[0]\n sa = sa[1:]\n elif t == \"b\":\n if len(sb) == 0: break\n t = sb[0]\n sb = sb[1:]\n elif t == \"c\":\n if len(sc) == 0: break\n t = sc[0]\n sc = sc[1:]", "t == \"a\"", "t", "\"a\"", "if len(sa) == 0: break\n ", "len(sa) == 0", "len(sa)", "len", "sa", "0", "t = sa[0]", "t", "sa[0]", "sa", "0", "sa = sa[1:]", "sa", "sa[1:]", "sa", "1:", "1", "elif t == \"b\":\n if len(sb) == 0: break\n t = sb[0]\n sb = sb[1:]\n ", "t == \"b\"", "t", "\"b\"", "if len(sb) == 0: break\n ", "len(sb) == 0", "len(sb)", "len", "sb", "0", "t = sb[0]", "t", "sb[0]", "sb", "0", "sb = sb[1:]", "sb", "sb[1:]", "sb", "1:", "1", "elif t == \"c\":\n if len(sc) == 0: break\n t = sc[0]\n sc = sc[1:]", "t == \"c\"", "t", "\"c\"", "if len(sc) == 0: break\n ", "len(sc) == 0", "len(sc)", "len", "sc", "0", "t = sc[0]", "t", "sc[0]", "sc", "0", "sc = sc[1:]", "sc", "sc[1:]", "sc", "1:", "1", "print(t.upper())", "print", "t.upper()", "t.upper", "t", "upper", "t = sb[0]", "sb[0]", "t", "t = sc[0]", "sc[0]", "t", "sc = input()", "input()", "sc", "sb = input()", "input()", "sb", "sb = sb[1:]", "sb[1:]", "sb", "t = sa[0]", "sa[0]", "t", "sa = sa[1:]", "sa[1:]", "sa", "t = \"a\"", "\"a\"", "t", "sa = input()", "input()", "sa", "sc = sc[1:]", "sc[1:]", "sc" ]
sa = input() sb = input() sc = input() t = "a" while True: if t == "a": if len(sa) == 0: break t = sa[0] sa = sa[1:] elif t == "b": if len(sb) == 0: break t = sb[0] sb = sb[1:] elif t == "c": if len(sc) == 0: break t = sc[0] sc = sc[1:] print(t.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, 18, 13, 13, 39, 14, 2, 13, 17, 4, 13, 17, 3, 14, 2, 13, 17, 4, 13, 17, 3, 14, 2, 13, 17, 4, 13, 17, 3, 14, 2, 18, 18, 13, 13, 17, 17, 4, 18, 18, 13, 13, 13, 18, 18, 13, 13, 17, 0, 13, 17, 14, 2, 18, 18, 13, 13, 17, 17, 4, 18, 18, 13, 13, 13, 18, 18, 13, 13, 17, 0, 13, 17, 14, 2, 18, 18, 13, 13, 17, 17, 4, 18, 18, 13, 13, 13, 18, 18, 13, 13, 17, 0, 13, 17, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 4, 13, 10, 4, 13, 10, 39, 13, 10, 17, 13 ]
[ [ 133, 2 ], [ 142, 8 ], [ 139, 14 ], [ 145, 20 ], [ 127, 26 ], [ 146, 33 ], [ 128, 34 ], [ 137, 34 ], [ 149, 34 ], [ 131, 34 ], [ 128, 38 ], [ 137, 38 ], [ 149, 38 ], [ 131, 38 ], [ 128, 46 ], [ 137, 46 ], [ 149, 46 ], [ 131, 46 ], [ 128, 54 ], [ 137, 54 ], [ 149, 54 ], [ 131, 54 ], [ 146, 64 ], [ 128, 65 ], [ 137, 65 ], [ 149, 65 ], [ 131, 65 ], [ 146, 71 ], [ 128, 72 ], [ 137, 72 ], [ 149, 72 ], [ 131, 72 ], [ 146, 76 ], [ 128, 77 ], [ 137, 77 ], [ 149, 77 ], [ 131, 77 ], [ 130, 80 ], [ 146, 86 ], [ 128, 87 ], [ 137, 87 ], [ 149, 87 ], [ 131, 87 ], [ 146, 93 ], [ 128, 94 ], [ 137, 94 ], [ 149, 94 ], [ 131, 94 ], [ 146, 98 ], [ 128, 99 ], [ 137, 99 ], [ 149, 99 ], [ 131, 99 ], [ 148, 102 ], [ 146, 108 ], [ 128, 109 ], [ 137, 109 ], [ 149, 109 ], [ 131, 109 ], [ 146, 115 ], [ 128, 116 ], [ 137, 116 ], [ 149, 116 ], [ 131, 116 ], [ 146, 120 ], [ 128, 121 ], [ 137, 121 ], [ 149, 121 ], [ 131, 121 ], [ 136, 124 ], [ 127, 128 ], [ 130, 131 ], [ 133, 134 ], [ 136, 137 ], [ 139, 140 ], [ 142, 143 ], [ 145, 146 ], [ 148, 149 ] ]
[ "# -*- coding : utf-8 -*-\n\nA = list(input())\nB = list(input())\nC = list(input())\nX = [A,B,C]\nt = 0\n\nwhile True:\n if X[t] == []:\n if t == 0:\n print(\"A\")\n break\n elif t == 1 :\n print(\"B\")\n break\n elif t == 2:\n print(\"C\")\n break\n else:\n if X[t][0] == \"a\":\n X[t].remove(X[t][0])\n t = 0\n elif X[t][0] == \"b\":\n X[t].remove(X[t][0])\n t = 1\n elif X[t][0] == \"c\":\n X[t].remove(X[t][0])\n t = 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", "X = [A,B,C]", "X", "[A,B,C]", "A", "B", "C", "t = 0", "t", "0", "while True:\n if X[t] == []:\n if t == 0:\n print(\"A\")\n break\n elif t == 1 :\n print(\"B\")\n break\n elif t == 2:\n print(\"C\")\n break\n else:\n if X[t][0] == \"a\":\n X[t].remove(X[t][0])\n t = 0\n elif X[t][0] == \"b\":\n X[t].remove(X[t][0])\n t = 1\n elif X[t][0] == \"c\":\n X[t].remove(X[t][0])\n t = 2", "True", "if X[t] == []:\n if t == 0:\n print(\"A\")\n break\n elif t == 1 :\n print(\"B\")\n break\n elif t == 2:\n print(\"C\")\n break\n else:\n if X[t][0] == \"a\":\n X[t].remove(X[t][0])\n t = 0\n elif X[t][0] == \"b\":\n X[t].remove(X[t][0])\n t = 1\n elif X[t][0] == \"c\":\n X[t].remove(X[t][0])\n t = 2", "X[t] == []", "X[t]", "X", "t", "[]", "if t == 0:\n print(\"A\")\n break\n elif t == 1 :\n print(\"B\")\n break\n elif t == 2:\n print(\"C\")\n break\n ", "t == 0", "t", "0", "print(\"A\")", "print", "\"A\"", "break", "elif t == 1 :\n print(\"B\")\n break\n ", "t == 1", "t", "1", "print(\"B\")", "print", "\"B\"", "break", "elif t == 2:\n print(\"C\")\n break\n ", "t == 2", "t", "2", "print(\"C\")", "print", "\"C\"", "break", "if X[t][0] == \"a\":\n X[t].remove(X[t][0])\n t = 0\n elif X[t][0] == \"b\":\n X[t].remove(X[t][0])\n t = 1\n elif X[t][0] == \"c\":\n X[t].remove(X[t][0])\n t = 2", "X[t][0] == \"a\"", "X[t][0]", "[t]", "X", "t", "0", "\"a\"", "X[t].remove(X[t][0])", "[t].remove", "[t]", "X", "t", "remove", "X[t][0]", "[t]", "X", "t", "0", "t = 0", "t", "0", "elif X[t][0] == \"b\":\n X[t].remove(X[t][0])\n t = 1\n ", "X[t][0] == \"b\"", "X[t][0]", "[t]", "X", "t", "0", "\"b\"", "X[t].remove(X[t][0])", "[t].remove", "[t]", "X", "t", "remove", "X[t][0]", "[t]", "X", "t", "0", "t = 1", "t", "1", "elif X[t][0] == \"c\":\n X[t].remove(X[t][0])\n t = 2", "X[t][0] == \"c\"", "X[t][0]", "[t]", "X", "t", "0", "\"c\"", "X[t].remove(X[t][0])", "[t].remove", "[t]", "X", "t", "remove", "X[t][0]", "[t]", "X", "t", "0", "t = 2", "t", "2", "t = 0", "0", "t", "t = 0", "0", "t", "A = list(input())", "list(input())", "A", "t = 2", "2", "t", "C = list(input())", "list(input())", "C", "B = list(input())", "list(input())", "B", "X = [A,B,C]", "[A,B,C]", "X", "t = 1", "1", "t" ]
# -*- coding : utf-8 -*- A = list(input()) B = list(input()) C = list(input()) X = [A,B,C] t = 0 while True: if X[t] == []: if t == 0: print("A") break elif t == 1 : print("B") break elif t == 2: print("C") break else: if X[t][0] == "a": X[t].remove(X[t][0]) t = 0 elif X[t][0] == "b": X[t].remove(X[t][0]) t = 1 elif X[t][0] == "c": X[t].remove(X[t][0]) t = 2
[ 7, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 39, 17, 17, 17, 0, 13, 39, 13, 13, 13, 0, 13, 18, 13, 17, 0, 13, 4, 13, 13, 0, 13, 4, 13, 13, 0, 13, 4, 13, 13, 0, 13, 39, 17, 17, 17, 0, 13, 39, 13, 13, 13, 14, 40, 13, 17, 4, 13, 17, 4, 13, 0, 13, 21, 22, 17, 17, 22, 17, 17, 22, 17, 17, 42, 17, 0, 13, 18, 13, 13, 14, 40, 18, 13, 13, 18, 13, 13, 4, 13, 18, 13, 13, 4, 13, 0, 13, 18, 18, 13, 13, 18, 13, 13, 0, 18, 13, 13, 17, 0, 13, 13, 10, 18, 13, 10, 13, 13, 10, 18, 13, 10, 4, 13, 10, 21, 13, 10, 39, 13, 10, 4, 13, 10, 4, 13, 10, 18, 13, 10, 4, 13, 10, 4, 13, 10, 39, 13, 10, 39, 13, 10, 39, 13, 10, 4, 13 ]
[ [ 148, 2 ], [ 145, 6 ], [ 127, 10 ], [ 151, 14 ], [ 154, 20 ], [ 124, 26 ], [ 149, 28 ], [ 160, 31 ], [ 149, 34 ], [ 139, 36 ], [ 146, 39 ], [ 136, 41 ], [ 128, 44 ], [ 157, 46 ], [ 133, 52 ], [ 161, 59 ], [ 130, 67 ], [ 142, 81 ], [ 131, 83 ], [ 125, 84 ], [ 122, 84 ], [ 110, 87 ], [ 152, 88 ], [ 143, 89 ], [ 134, 91 ], [ 143, 92 ], [ 158, 96 ], [ 143, 97 ], [ 118, 101 ], [ 155, 104 ], [ 143, 105 ], [ 110, 106 ], [ 152, 107 ], [ 143, 108 ], [ 113, 110 ], [ 152, 111 ], [ 143, 112 ], [ 121, 115 ], [ 119, 116 ], [ 118, 119 ], [ 119, 121 ], [ 121, 122 ], [ 124, 125 ], [ 127, 128 ], [ 130, 131 ], [ 133, 134 ], [ 136, 137 ], [ 139, 140 ], [ 142, 143 ], [ 145, 146 ], [ 148, 149 ], [ 151, 152 ], [ 154, 155 ], [ 157, 158 ], [ 160, 161 ] ]
[ "sa=input();sb=input();sc=input()\ns=[1,0,0]\nss=[sa,sb,sc]\nnow = sa[0]\n\nla=len(sa);lb=len(sb);lc=len(sc)\nans=[\"A\",\"B\",\"C\"]\nl=[la,lb,lc]\nif la<=1:\n print(\"A\")\n exit()\n\np2n={'a':0,'b':1,'c':2}\n\nwhile 1:\n nxt=p2n[now]\n if s[nxt]>=l[nxt]:\n print(ans[nxt])\n exit()\n tmp=ss[nxt][s[nxt]]\n s[nxt]+=1\n now=tmp", "sa=input()", "sa", "input()", "input", "sb=input()", "sb", "input()", "input", "sc=input()", "sc", "input()", "input", "s=[1,0,0]", "s", "[1,0,0]", "1", "0", "0", "ss=[sa,sb,sc]", "ss", "[sa,sb,sc]", "sa", "sb", "sc", "now = sa[0]", "now", "sa[0]", "sa", "0", "la=len(sa)", "la", "len(sa)", "len", "sa", "lb=len(sb)", "lb", "len(sb)", "len", "sb", "lc=len(sc)", "lc", "len(sc)", "len", "sc", "ans=[\"A\",\"B\",\"C\"]", "ans", "[\"A\",\"B\",\"C\"]", "\"A\"", "\"B\"", "\"C\"", "l=[la,lb,lc]", "l", "[la,lb,lc]", "la", "lb", "lc", "if la<=1:\n print(\"A\")\n exit()", "la<=1", "la", "1", "print(\"A\")", "print", "\"A\"", "exit()", "exit", "p2n={'a':0,'b':1,'c':2}", "p2n", "{'a':0,'b':1,'c':2}", "'a'", "'a'", "0", "'b'", "'b'", "1", "'c'", "'c'", "2", "while 1:\n nxt=p2n[now]\n if s[nxt]>=l[nxt]:\n print(ans[nxt])\n exit()\n tmp=ss[nxt][s[nxt]]\n s[nxt]+=1\n now=tmp", "1", "nxt=p2n[now]", "nxt", "p2n[now]", "p2n", "now", "if s[nxt]>=l[nxt]:\n print(ans[nxt])\n exit()\n ", "s[nxt]>=l[nxt]", "s[nxt]", "s", "nxt", "l[nxt]", "l", "nxt", "print(ans[nxt])", "print", "ans[nxt]", "ans", "nxt", "exit()", "exit", "tmp=ss[nxt][s[nxt]]", "tmp", "ss[nxt][s[nxt]]", "[nxt]", "ss", "nxt", "s[nxt]", "s", "nxt", "s[nxt]+=1", "s[nxt]", "s", "nxt", "1", "now=tmp", "now", "tmp", "tmp=ss[nxt][s[nxt]]", "ss[nxt][s[nxt]]", "tmp", "now=tmp", "tmp", "now", "now = sa[0]", "sa[0]", "now", "sc=input()", "input()", "sc", "p2n={'a':0,'b':1,'c':2}", "{'a':0,'b':1,'c':2}", "p2n", "l=[la,lb,lc]", "[la,lb,lc]", "l", "lc=len(sc)", "len(sc)", "lc", "lb=len(sb)", "len(sb)", "lb", "nxt=p2n[now]", "p2n[now]", "nxt", "sb=input()", "input()", "sb", "sa=input()", "input()", "sa", "s=[1,0,0]", "[1,0,0]", "s", "ss=[sa,sb,sc]", "[sa,sb,sc]", "ss", "ans=[\"A\",\"B\",\"C\"]", "[\"A\",\"B\",\"C\"]", "ans", "la=len(sa)", "len(sa)", "la" ]
sa=input();sb=input();sc=input() s=[1,0,0] ss=[sa,sb,sc] now = sa[0] la=len(sa);lb=len(sb);lc=len(sc) ans=["A","B","C"] l=[la,lb,lc] if la<=1: print("A") exit() p2n={'a':0,'b':1,'c':2} while 1: nxt=p2n[now] if s[nxt]>=l[nxt]: print(ans[nxt]) exit() tmp=ss[nxt][s[nxt]] s[nxt]+=1 now=tmp
[ 7, 15, 13, 15, 13, 15, 13, 15, 15, 13, 15, 13, 15, 13, 15, 15, 4, 18, 13, 13, 2, 17, 17, 0, 13, 2, 17, 17, 12, 13, 12, 13, 12, 13, 12, 13, 41, 28, 13, 4, 13, 13, 4, 4, 13, 12, 13, 23, 13, 41, 28, 13, 4, 13, 13, 4, 4, 13, 12, 13, 23, 13, 41, 28, 13, 4, 13, 13, 4, 4, 13, 12, 13, 23, 13, 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, 41, 28, 13, 4, 13, 13, 4, 13, 12, 13, 23, 13, 12, 13, 23, 13, 12, 13, 23, 13, 23, 13, 12, 13, 23, 13, 23, 13, 0, 13, 17, 12, 13, 0, 13, 4, 13, 4, 13, 0, 13, 4, 13, 4, 13, 0, 13, 4, 13, 4, 13, 0, 13, 17, 0, 13, 39, 13, 13, 13, 42, 17, 0, 13, 18, 13, 13, 14, 2, 4, 13, 13, 17, 0, 13, 39, 17, 17, 17, 4, 13, 18, 13, 13, 3, 0, 13, 4, 18, 13, 13, 17, 0, 13, 39, 17, 17, 17, 0, 13, 4, 18, 13, 13, 13, 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, 12, 13, 10, 12, 13, 10, 12, 13, 10, 2, 13, 10, 12, 13, 10, 12, 13, 10, 17, 13, 10, 12, 13, 10, 12, 13 ]
[ [ 245, 24 ], [ 39, 38 ], [ 222, 44 ], [ 48, 48 ], [ 52, 51 ], [ 231, 57 ], [ 61, 61 ], [ 65, 64 ], [ 228, 70 ], [ 74, 74 ], [ 78, 77 ], [ 216, 83 ], [ 87, 87 ], [ 91, 90 ], [ 228, 98 ], [ 102, 102 ], [ 106, 105 ], [ 114, 114 ], [ 118, 118 ], [ 122, 122 ], [ 124, 124 ], [ 128, 128 ], [ 130, 130 ], [ 254, 132 ], [ 138, 137 ], [ 228, 141 ], [ 144, 143 ], [ 228, 147 ], [ 150, 149 ], [ 228, 153 ], [ 156, 155 ], [ 159, 158 ], [ 167, 166 ], [ 158, 168 ], [ 155, 169 ], [ 202, 169 ], [ 166, 174 ], [ 178, 177 ], [ 177, 185 ], [ 155, 186 ], [ 202, 186 ], [ 190, 189 ], [ 166, 192 ], [ 197, 196 ], [ 203, 202 ], [ 196, 205 ], [ 189, 207 ], [ 261, 213 ], [ 245, 246 ], [ 254, 255 ] ]
[ "import sys\nimport numpy as np\nimport random\nfrom decimal import Decimal\nimport itertools\nimport re\nimport bisect\nfrom collections import deque, Counter\nfrom functools import lru_cache\n\nsys.setrecursionlimit(10**9)\nINF = 10**13\ndef LI(): return list(map(int, sys.stdin.buffer.readline().split()))\ndef I(): return int(sys.stdin.buffer.readline())\ndef LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()\ndef S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')\ndef IR(n): return [I() for i in range(n)]\ndef LIR(n): return [LI() for i in range(n)]\ndef SR(n): return [S() for i in range(n)]\ndef LSR(n): return [LS() for i in range(n)]\ndef SRL(n): return [list(S()) for i in range(n)]\ndef MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]\ndef SERIES(n): return np.fromstring(sys.stdin.buffer.read(), dtype=np.int32, sep=' ')\ndef GRID(h,w): return np.fromstring(sys.stdin.buffer.read(), dtype=np.int32, sep=' ').reshape(h,-1)[:,:w]\ndef GRIDfromString(h,w): return np.frombuffer(sys.stdin.buffer.read(), 'S1').reshape(h,-1)[:,:w]\nMOD = 1000000007\n\ndef main():\n\tsa = list(S())\n\tsb = list(S())\n\tsc = list(S())\n\tfield = 0\n\ts_list = [sa,sb,sc]\n\twhile True:\n\t\ts = s_list[field]\n\t\tif len(s) == 0:\n\t\t\tabc = ['A','B','C']\n\t\t\tprint(abc[field])\n\t\t\tbreak\n\t\telse:\n\t\t\tfield_text = s.pop(0)\n\t\t\tabc_text = ['a','b','c']\n\t\t\tfield = abc_text.index(field_text)\n\n\nif __name__ == '__main__':\n main()", "import sys", "sys", "import numpy as np", "numpy", "import random", "random", "from decimal import Decimal", "import itertools", "itertools", "import re", "re", "import bisect", "bisect", "from collections import deque, Counter", "from functools import lru_cache", "sys.setrecursionlimit(10**9)", "sys.setrecursionlimit", "sys", "setrecursionlimit", "10**9", "10", "9", "INF = 10**13", "INF", "10**13", "10", "13", "def LI(): return list(map(int, sys.stdin.buffer.readline().split()))", "LI", "def I(): return int(sys.stdin.buffer.readline())", "I", "def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()", "LS", "def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')", "S", "I() for i in range(n)", "for i in range(n)", "i", "range(n)", "range", "n", "for i in range(n)", "I()", "I", "def IR(n): return [I() for i in range(n)]", "IR", "n", "n", "LI() for i in range(n)", "for i in range(n)", "i", "range(n)", "range", "n", "for i in range(n)", "LI()", "LI", "def LIR(n): return [LI() for i in range(n)]", "LIR", "n", "n", "S() for i in range(n)", "for i in range(n)", "i", "range(n)", "range", "n", "for i in range(n)", "S()", "S", "def SR(n): return [S() for i in range(n)]", "SR", "n", "n", "LS() for i in range(n)", "for i in range(n)", "i", "range(n)", "range", "n", "for i in range(n)", "LS()", "LS", "def LSR(n): return [LS() for i in range(n)]", "LSR", "n", "n", "list(S()) for i in range(n)", "for i in range(n)", "i", "range(n)", "range", "n", "for i in range(n)", "list(S())", "list", "S()", "S", "def SRL(n): return [list(S()) for i in range(n)]", "SRL", "n", "n", "[int(j) for j in list(S())] for i in range(n)", "for i in range(n)", "i", "range(n)", "range", "n", "for i in range(n)", "[int(j) for j in list(S())]", "def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]", "MSRL", "n", "n", "def SERIES(n): return np.fromstring(sys.stdin.buffer.read(), dtype=np.int32, sep=' ')", "SERIES", "n", "n", "def GRID(h,w): return np.fromstring(sys.stdin.buffer.read(), dtype=np.int32, sep=' ').reshape(h,-1)[:,:w]", "GRID", "h", "h", "w", "w", "def GRIDfromString(h,w): return np.frombuffer(sys.stdin.buffer.read(), 'S1').reshape(h,-1)[:,:w]", "GRIDfromString", "h", "h", "w", "w", "MOD = 1000000007", "MOD", "1000000007", "def main():\n\tsa = list(S())\n\tsb = list(S())\n\tsc = list(S())\n\tfield = 0\n\ts_list = [sa,sb,sc]\n\twhile True:\n\t\ts = s_list[field]\n\t\tif len(s) == 0:\n\t\t\tabc = ['A','B','C']\n\t\t\tprint(abc[field])\n\t\t\tbreak\n\t\telse:\n\t\t\tfield_text = s.pop(0)\n\t\t\tabc_text = ['a','b','c']\n\t\t\tfield = abc_text.index(field_text)", "main", "sa = list(S())", "sa", "list(S())", "list", "S()", "S", "sb = list(S())", "sb", "list(S())", "list", "S()", "S", "sc = list(S())", "sc", "list(S())", "list", "S()", "S", "field = 0", "field", "0", "s_list = [sa,sb,sc]", "s_list", "[sa,sb,sc]", "sa", "sb", "sc", "while True:\n\t\ts = s_list[field]\n\t\tif len(s) == 0:\n\t\t\tabc = ['A','B','C']\n\t\t\tprint(abc[field])\n\t\t\tbreak\n\t\telse:\n\t\t\tfield_text = s.pop(0)\n\t\t\tabc_text = ['a','b','c']\n\t\t\tfield = abc_text.index(field_text)", "True", "s = s_list[field]", "s", "s_list[field]", "s_list", "field", "if len(s) == 0:\n\t\t\tabc = ['A','B','C']\n\t\t\tprint(abc[field])\n\t\t\tbreak\n\t\telse:\n\t\t\tfield_text = s.pop(0)\n\t\t\tabc_text = ['a','b','c']\n\t\t\tfield = abc_text.index(field_text)", "len(s) == 0", "len(s)", "len", "s", "0", "abc = ['A','B','C']", "abc", "['A','B','C']", "'A'", "'B'", "'C'", "print(abc[field])", "print", "abc[field]", "abc", "field", "break", "field_text = s.pop(0)", "field_text", "s.pop(0)", "s.pop", "s", "pop", "0", "abc_text = ['a','b','c']", "abc_text", "['a','b','c']", "'a'", "'b'", "'c'", "field = abc_text.index(field_text)", "field", "abc_text.index(field_text)", "abc_text.index", "abc_text", "index", "field_text", "if __name__ == '__main__':\n main()", "__name__ == '__main__'", "__name__", "'__main__'", "main()", "main", "def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()", "def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()", "LS", "def LSR(n): return [LS() for i in range(n)]", "def LSR(n): return [LS() for i in range(n)]", "LSR", "def I(): return int(sys.stdin.buffer.readline())", "def I(): return int(sys.stdin.buffer.readline())", "I", "def SR(n): return [S() for i in range(n)]", "def SR(n): return [S() for i in range(n)]", "SR", "def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')", "def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')", "S", "def LI(): return list(map(int, sys.stdin.buffer.readline().split()))", "def LI(): return list(map(int, sys.stdin.buffer.readline().split()))", "LI", "def GRID(h,w): return np.fromstring(sys.stdin.buffer.read(), dtype=np.int32, sep=' ').reshape(h,-1)[:,:w]", "def GRID(h,w): return np.fromstring(sys.stdin.buffer.read(), dtype=np.int32, sep=' ').reshape(h,-1)[:,:w]", "GRID", "def LIR(n): return [LI() for i in range(n)]", "def LIR(n): return [LI() for i in range(n)]", "LIR", "def IR(n): return [I() for i in range(n)]", "def IR(n): return [I() for i in range(n)]", "IR", "def SRL(n): return [list(S()) for i in range(n)]", "def SRL(n): return [list(S()) for i in range(n)]", "SRL", "INF = 10**13", "10**13", "INF", "def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]", "def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]", "MSRL", "def GRIDfromString(h,w): return np.frombuffer(sys.stdin.buffer.read(), 'S1').reshape(h,-1)[:,:w]", "def GRIDfromString(h,w): return np.frombuffer(sys.stdin.buffer.read(), 'S1').reshape(h,-1)[:,:w]", "GRIDfromString", "MOD = 1000000007", "1000000007", "MOD", "def SERIES(n): return np.fromstring(sys.stdin.buffer.read(), dtype=np.int32, sep=' ')", "def SERIES(n): return np.fromstring(sys.stdin.buffer.read(), dtype=np.int32, sep=' ')", "SERIES", "def main():\n\tsa = list(S())\n\tsb = list(S())\n\tsc = list(S())\n\tfield = 0\n\ts_list = [sa,sb,sc]\n\twhile True:\n\t\ts = s_list[field]\n\t\tif len(s) == 0:\n\t\t\tabc = ['A','B','C']\n\t\t\tprint(abc[field])\n\t\t\tbreak\n\t\telse:\n\t\t\tfield_text = s.pop(0)\n\t\t\tabc_text = ['a','b','c']\n\t\t\tfield = abc_text.index(field_text)", "def main():\n\tsa = list(S())\n\tsb = list(S())\n\tsc = list(S())\n\tfield = 0\n\ts_list = [sa,sb,sc]\n\twhile True:\n\t\ts = s_list[field]\n\t\tif len(s) == 0:\n\t\t\tabc = ['A','B','C']\n\t\t\tprint(abc[field])\n\t\t\tbreak\n\t\telse:\n\t\t\tfield_text = s.pop(0)\n\t\t\tabc_text = ['a','b','c']\n\t\t\tfield = abc_text.index(field_text)", "main" ]
import sys import numpy as np import random from decimal import Decimal import itertools import re import bisect from collections import deque, Counter from functools import lru_cache sys.setrecursionlimit(10**9) INF = 10**13 def LI(): return list(map(int, sys.stdin.buffer.readline().split())) def I(): return int(sys.stdin.buffer.readline()) def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split() def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8') def IR(n): return [I() for i in range(n)] def LIR(n): return [LI() for i in range(n)] def SR(n): return [S() for i in range(n)] def LSR(n): return [LS() for i in range(n)] def SRL(n): return [list(S()) for i in range(n)] def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)] def SERIES(n): return np.fromstring(sys.stdin.buffer.read(), dtype=np.int32, sep=' ') def GRID(h,w): return np.fromstring(sys.stdin.buffer.read(), dtype=np.int32, sep=' ').reshape(h,-1)[:,:w] def GRIDfromString(h,w): return np.frombuffer(sys.stdin.buffer.read(), 'S1').reshape(h,-1)[:,:w] MOD = 1000000007 def main(): sa = list(S()) sb = list(S()) sc = list(S()) field = 0 s_list = [sa,sb,sc] while True: s = s_list[field] if len(s) == 0: abc = ['A','B','C'] print(abc[field]) break else: field_text = s.pop(0) abc_text = ['a','b','c'] field = abc_text.index(field_text) if __name__ == '__main__': main()
[ 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, 17, 13, 10, 21, 13, 10, 13, 13, 10, 18, 13 ]
[ [ 55, 2 ], [ 52, 17 ], [ 33, 21 ], [ 56, 22 ], [ 53, 23 ], [ 59, 23 ], [ 61, 26 ], [ 33, 28 ], [ 56, 29 ], [ 53, 30 ], [ 59, 30 ], [ 36, 33 ], [ 56, 34 ], [ 53, 35 ], [ 59, 35 ], [ 33, 37 ], [ 56, 38 ], [ 53, 39 ], [ 59, 39 ], [ 58, 43 ], [ 62, 44 ], [ 59, 49 ], [ 53, 49 ], [ 52, 53 ], [ 55, 56 ], [ 62, 58 ], [ 58, 59 ], [ 61, 62 ] ]
[ "s = {'a':input(), 'b':input(), 'c':input()}\nt = 'a'\nwhile s[t] != '':\n tmp = s[t][0]\n s[t] = s[t][1:]\n t = tmp\nprint(t.upper())", "s = {'a':input(), 'b':input(), 'c':input()}", "s", "{'a':input(), 'b':input(), 'c':input()}", "'a'", "'a'", "input()", "input", "'b'", "'b'", "input()", "input", "'c'", "'c'", "input()", "input", "t = 'a'", "t", "'a'", "while s[t] != '':\n tmp = s[t][0]\n s[t] = s[t][1:]\n t = tmp", "s[t] != ''", "s[t]", "s", "t", "''", "tmp = s[t][0]", "tmp", "s[t][0]", "[t]", "s", "t", "0", "s[t] = s[t][1:]", "s[t]", "s", "t", "s[t][1:]", "[t]", "s", "t", "1:", "1", "t = tmp", "t", "tmp", "print(t.upper())", "print", "t.upper()", "t.upper", "t", "upper", "t = 'a'", "'a'", "t", "s = {'a':input(), 'b':input(), 'c':input()}", "{'a':input(), 'b':input(), 'c':input()}", "s", "t = tmp", "tmp", "t", "tmp = s[t][0]", "s[t][0]", "tmp" ]
s = {'a':input(), 'b':input(), 'c':input()} t = 'a' while s[t] != '': tmp = s[t][0] s[t] = s[t][1:] t = tmp print(t.upper())
[ 7, 15, 15, 15, 15, 13, 15, 13, 12, 13, 29, 4, 13, 4, 13, 12, 13, 29, 4, 13, 4, 13, 13, 4, 18, 4, 13, 13, 12, 13, 29, 4, 13, 12, 13, 29, 4, 18, 4, 13, 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, 4, 13, 13, 17, 4, 13, 4, 18, 13, 13, 4, 13, 14, 2, 13, 17, 0, 13, 18, 13, 17, 24, 18, 13, 17, 4, 13, 13, 14, 2, 13, 17, 0, 13, 18, 13, 17, 24, 18, 13, 17, 4, 13, 13, 0, 13, 18, 13, 17, 24, 18, 13, 17, 4, 13, 13, 23, 13, 4, 13, 17, 10, 4, 13, 10, 12, 13, 10, 12, 13, 10, 4, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 4, 13 ]
[ [ 148, 42 ], [ 127, 48 ], [ 136, 54 ], [ 122, 67 ], [ 122, 73 ], [ 122, 79 ], [ 83, 82 ], [ 149, 84 ], [ 149, 88 ], [ 82, 92 ], [ 122, 95 ], [ 99, 98 ], [ 128, 100 ], [ 128, 104 ], [ 98, 108 ], [ 111, 110 ], [ 137, 112 ], [ 137, 116 ], [ 110, 120 ], [ 122, 122 ], [ 134, 124 ], [ 127, 128 ], [ 136, 137 ], [ 148, 149 ] ]
[ "from collections import defaultdict\nfrom collections import deque\nfrom collections import Counter\nimport itertools\nimport math\n\ndef readInt():\n return int(input())\ndef readInts():\n return list(map(int, input().split()))\ndef readChar():\n return input()\ndef readChars():\n return input().split()\n\na = list(input())\nb = list(input())\nc = list(input())\n\ndef solve(tar):\n if len(eval(tar))==0:\n print(tar.upper())\n exit()\n if tar==\"a\":\n x = a[0]\n del a[0]\n solve(x)\n elif tar==\"b\":\n x = b[0]\n del b[0]\n solve(x)\n else:\n x = c[0]\n del c[0]\n solve(x)\nsolve(\"a\")", "from collections import defaultdict", "from collections import deque", "from collections import Counter", "import itertools", "itertools", "import math", "math", "def readInt():\n return int(input())", "readInt", "return int(input())", "int(input())", "int", "input()", "input", "def readInts():\n return list(map(int, input().split()))", "readInts", "return list(map(int, input().split()))", "list(map(int, input().split()))", "list", "map(int, input().split())", "map", "int", "input().split()", "().split", "()", "input", "split", "def readChar():\n return input()", "readChar", "return input()", "input()", "input", "def readChars():\n return input().split()", "readChars", "return input().split()", "input().split()", "().split", "()", "input", "split", "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", "def solve(tar):\n if len(eval(tar))==0:\n print(tar.upper())\n exit()\n if tar==\"a\":\n x = a[0]\n del a[0]\n solve(x)\n elif tar==\"b\":\n x = b[0]\n del b[0]\n solve(x)\n else:\n x = c[0]\n del c[0]\n solve(x)", "solve", "if len(eval(tar))==0:\n print(tar.upper())\n exit()\n ", "len(eval(tar))==0", "len(eval(tar))", "len", "eval(tar)", "eval", "tar", "0", "print(tar.upper())", "print", "tar.upper()", "tar.upper", "tar", "upper", "exit()", "exit", "if tar==\"a\":\n x = a[0]\n del a[0]\n solve(x)\n elif tar==\"b\":\n x = b[0]\n del b[0]\n solve(x)\n else:\n x = c[0]\n del c[0]\n solve(x)", "tar==\"a\"", "tar", "\"a\"", "x = a[0]", "x", "a[0]", "a", "0", "del a[0]", "a[0]", "a", "0", "solve(x)", "solve", "x", "elif tar==\"b\":\n x = b[0]\n del b[0]\n solve(x)\n ", "tar==\"b\"", "tar", "\"b\"", "x = b[0]", "x", "b[0]", "b", "0", "del b[0]", "b[0]", "b", "0", "solve(x)", "solve", "x", "x = c[0]", "x", "c[0]", "c", "0", "del c[0]", "c[0]", "c", "0", "solve(x)", "solve", "x", "tar", "tar", "solve(\"a\")", "solve", "\"a\"", "b = list(input())", "list(input())", "b", "def readChar():\n return input()", "def readChar():\n return input()", "readChar", "def solve(tar):\n if len(eval(tar))==0:\n print(tar.upper())\n exit()\n if tar==\"a\":\n x = a[0]\n del a[0]\n solve(x)\n elif tar==\"b\":\n x = b[0]\n del b[0]\n solve(x)\n else:\n x = c[0]\n del c[0]\n solve(x)", "def solve(tar):\n if len(eval(tar))==0:\n print(tar.upper())\n exit()\n if tar==\"a\":\n x = a[0]\n del a[0]\n solve(x)\n elif tar==\"b\":\n x = b[0]\n del b[0]\n solve(x)\n else:\n x = c[0]\n del c[0]\n solve(x)", "solve", "c = list(input())", "list(input())", "c", "def readInts():\n return list(map(int, input().split()))", "def readInts():\n return list(map(int, input().split()))", "readInts", "def readInt():\n return int(input())", "def readInt():\n return int(input())", "readInt", "def readChars():\n return input().split()", "def readChars():\n return input().split()", "readChars", "a = list(input())", "list(input())", "a" ]
from collections import defaultdict from collections import deque from collections import Counter import itertools import math def readInt(): return int(input()) def readInts(): return list(map(int, input().split())) def readChar(): return input() def readChars(): return input().split() a = list(input()) b = list(input()) c = list(input()) def solve(tar): if len(eval(tar))==0: print(tar.upper()) exit() if tar=="a": x = a[0] del a[0] solve(x) elif tar=="b": x = b[0] del b[0] solve(x) else: x = c[0] del c[0] solve(x) solve("a")
[ 7, 15, 13, 41, 28, 13, 17, 4, 13, 4, 18, 13, 13, 4, 13, 4, 13, 0, 13, 13, 13, 17, 42, 18, 13, 13, 13, 4, 18, 13, 13, 10, 13, 13, 10, 17, 13 ]
[ [ 6, 5 ], [ 5, 8 ], [ 32, 18 ], [ 35, 20 ], [ 33, 24 ], [ 36, 25 ], [ 36, 29 ], [ 32, 33 ], [ 35, 36 ] ]
[ "import collections\nh,t= {p: collections.deque(list(raw_input())) for p in 'abc'},'a'\nwhile(h[t]): t = h[t].popleft()\nprint t.upper()", "import collections", "collections", "p: collections.deque(list(raw_input())) for p in 'abc'", "for p in 'abc'", "p", "'abc'", "for p in 'abc'", "p", "collections.deque(list(raw_input()))", "collections.deque", "collections", "deque", "list(raw_input())", "list", "raw_input()", "raw_input", "h,t= {p: collections.deque(list(raw_input())) for p in 'abc'},'a'", "h", "{p: collections.deque(list(raw_input())) for p in 'abc'}", "t", "'a'", "while(h[t]): t = h[t].popleft()", "h[t]", "h", "t", "print", "t.upper()", "t.upper", "t", "upper", "h,t= {p: collections.deque(list(raw_input())) for p in 'abc'},'a'", "{p: collections.deque(list(raw_input())) for p in 'abc'}", "h", "t= {p: collections.deque(list(raw_input())) for p in 'abc'},'a'", "'a'", "t" ]
import collections h,t= {p: collections.deque(list(raw_input())) for p in 'abc'},'a' while(h[t]): t = h[t].popleft() print t.upper()
[ 7, 15, 13, 4, 18, 13, 13, 2, 17, 17, 0, 13, 12, 2, 4, 13, 13, 17, 23, 0, 13, 12, 4, 13, 31, 13, 0, 13, 17, 23, 12, 13, 12, 13, 12, 13, 41, 28, 13, 4, 13, 13, 4, 4, 13, 12, 13, 23, 13, 12, 13, 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, 18, 17, 13, 3, 0, 13, 4, 18, 17, 13, 18, 18, 13, 13, 18, 13, 13, 0, 18, 13, 13, 17, 0, 13, 13, 10, 13, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 17, 13, 10, 13, 13, 10, 12, 13, 10, 12, 13, 10, 39, 13, 10, 12, 13, 10, 12, 13, 10, 4, 13 ]
[ [ 130, 11 ], [ 115, 20 ], [ 28, 27 ], [ 39, 38 ], [ 119, 44 ], [ 48, 48 ], [ 54, 53 ], [ 122, 59 ], [ 112, 61 ], [ 136, 64 ], [ 124, 70 ], [ 104, 76 ], [ 137, 77 ], [ 125, 78 ], [ 128, 78 ], [ 113, 82 ], [ 125, 83 ], [ 128, 83 ], [ 125, 88 ], [ 128, 88 ], [ 145, 91 ], [ 113, 98 ], [ 125, 99 ], [ 128, 99 ], [ 104, 100 ], [ 137, 101 ], [ 125, 102 ], [ 128, 102 ], [ 107, 104 ], [ 137, 105 ], [ 125, 106 ], [ 128, 106 ], [ 127, 109 ], [ 146, 110 ], [ 112, 113 ], [ 115, 116 ], [ 124, 125 ], [ 146, 127 ], [ 127, 128 ], [ 130, 131 ], [ 136, 137 ], [ 145, 146 ] ]
[ "import sys\n\nsys.setrecursionlimit(10 ** 6)\nint1 = lambda x: int(x) - 1\np2D = lambda x: print(*x, sep=\"\\n\")\ndef II(): return int(sys.stdin.readline())\ndef MI(): return map(int, sys.stdin.readline().split())\ndef LI(): return list(map(int, sys.stdin.readline().split()))\ndef LLI(rows_number): return [LI() for _ in range(rows_number)]\ndef SI(): return sys.stdin.readline()[:-1]\n\nss=[SI() for _ in range(3)]\nii=[0,0,0]\nt=0\nwhile 1:\n if ii[t]==len(ss[t]):\n print(\"ABC\"[t])\n break\n nt=\"abc\".index(ss[t][ii[t]])\n ii[t]+=1\n t=nt", "import sys", "sys", "sys.setrecursionlimit(10 ** 6)", "sys.setrecursionlimit", "sys", "setrecursionlimit", "10 ** 6", "10", "6", "int1 = lambda x: int(x) - 1", "int1", "lambda x: int(x) - 1", "int(x) - 1", "int(x)", "int", "x", "1", "x", "p2D = lambda x: print(*x, sep=\"\\n\")", "p2D", "lambda x: print(*x, sep=\"\\n\")", "print(*x, sep=\"\\n\")", "print", "*x", "x", "sep=\"\\n\"", "sep", "\"\\n\"", "x", "def II(): return int(sys.stdin.readline())", "II", "def MI(): return map(int, sys.stdin.readline().split())", "MI", "def LI(): return list(map(int, sys.stdin.readline().split()))", "LI", "LI() for _ in range(rows_number)", "for _ in range(rows_number)", "_", "range(rows_number)", "range", "rows_number", "for _ in range(rows_number)", "LI()", "LI", "def LLI(rows_number): return [LI() for _ in range(rows_number)]", "LLI", "rows_number", "rows_number", "def SI(): return sys.stdin.readline()[:-1]", "SI", "SI() for _ in range(3)", "for _ in range(3)", "_", "range(3)", "range", "3", "for _ in range(3)", "SI()", "SI", "ss=[SI() for _ in range(3)]", "ss", "[SI() for _ in range(3)]", "ii=[0,0,0]", "ii", "[0,0,0]", "0", "0", "0", "t=0", "t", "0", "while 1:\n if ii[t]==len(ss[t]):\n print(\"ABC\"[t])\n break\n nt=\"abc\".index(ss[t][ii[t]])\n ii[t]+=1\n t=nt", "1", "if ii[t]==len(ss[t]):\n print(\"ABC\"[t])\n break\n ", "ii[t]==len(ss[t])", "ii[t]", "ii", "t", "len(ss[t])", "len", "ss[t]", "ss", "t", "print(\"ABC\"[t])", "print", "\"ABC\"[t]", "\"ABC\"", "t", "break", "nt=\"abc\".index(ss[t][ii[t]])", "nt", "\"abc\".index(ss[t][ii[t]])", "\"abc\".index", "\"abc\"", "index", "ss[t][ii[t]]", "[t]", "ss", "t", "ii[t]", "ii", "t", "ii[t]+=1", "ii[t]", "ii", "t", "1", "t=nt", "t", "nt", "ss=[SI() for _ in range(3)]", "[SI() for _ in range(3)]", "ss", "p2D = lambda x: print(*x, sep=\"\\n\")", "lambda x: print(*x, sep=\"\\n\")", "p2D", "def LI(): return list(map(int, sys.stdin.readline().split()))", "def LI(): return list(map(int, sys.stdin.readline().split()))", "LI", "def SI(): return sys.stdin.readline()[:-1]", "def SI(): return sys.stdin.readline()[:-1]", "SI", "t=0", "0", "t", "t=nt", "nt", "t", "int1 = lambda x: int(x) - 1", "lambda x: int(x) - 1", "int1", "def LLI(rows_number): return [LI() for _ in range(rows_number)]", "def LLI(rows_number): return [LI() for _ in range(rows_number)]", "LLI", "ii=[0,0,0]", "[0,0,0]", "ii", "def MI(): return map(int, sys.stdin.readline().split())", "def MI(): return map(int, sys.stdin.readline().split())", "MI", "def II(): return int(sys.stdin.readline())", "def II(): return int(sys.stdin.readline())", "II", "nt=\"abc\".index(ss[t][ii[t]])", "\"abc\".index(ss[t][ii[t]])", "nt" ]
import sys sys.setrecursionlimit(10 ** 6) int1 = lambda x: int(x) - 1 p2D = lambda x: print(*x, sep="\n") def II(): return int(sys.stdin.readline()) def MI(): return map(int, sys.stdin.readline().split()) def LI(): return list(map(int, sys.stdin.readline().split())) def LLI(rows_number): return [LI() for _ in range(rows_number)] def SI(): return sys.stdin.readline()[:-1] ss=[SI() for _ in range(3)] ii=[0,0,0] t=0 while 1: if ii[t]==len(ss[t]): print("ABC"[t]) break nt="abc".index(ss[t][ii[t]]) ii[t]+=1 t=nt
[ 7, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 39, 17, 17, 17, 0, 13, 17, 28, 13, 4, 13, 17, 14, 2, 13, 17, 14, 2, 13, 17, 4, 13, 17, 4, 13, 0, 13, 4, 18, 13, 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, 4, 18, 13, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 14, 2, 13, 17, 4, 13, 17, 4, 13, 0, 13, 4, 18, 13, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 10, 4, 13, 10, 18, 13, 10, 4, 13, 10, 39, 13, 10, 17, 13, 10, 4, 13, 10, 4, 13, 10, 18, 13, 10, 4, 13, 10, 4, 13, 10, 18, 13 ]
[ [ 123, 2 ], [ 132, 6 ], [ 126, 10 ], [ 117, 14 ], [ 120, 20 ], [ 24, 23 ], [ 121, 29 ], [ 109, 29 ], [ 115, 29 ], [ 136, 29 ], [ 124, 33 ], [ 130, 33 ], [ 135, 41 ], [ 118, 44 ], [ 124, 47 ], [ 130, 47 ], [ 129, 50 ], [ 124, 52 ], [ 130, 52 ], [ 121, 57 ], [ 109, 57 ], [ 115, 57 ], [ 136, 57 ], [ 133, 61 ], [ 139, 61 ], [ 114, 69 ], [ 118, 72 ], [ 133, 75 ], [ 139, 75 ], [ 138, 78 ], [ 133, 80 ], [ 139, 80 ], [ 127, 85 ], [ 112, 85 ], [ 108, 93 ], [ 118, 96 ], [ 127, 99 ], [ 112, 99 ], [ 111, 102 ], [ 127, 104 ], [ 112, 104 ], [ 108, 109 ], [ 111, 112 ], [ 114, 115 ], [ 117, 118 ], [ 120, 121 ], [ 123, 124 ], [ 126, 127 ], [ 129, 130 ], [ 132, 133 ], [ 135, 136 ], [ 138, 139 ] ]
[ "a = input()\nb = input()\nc = input()\nli=[\"a\",\"b\",\"c\"]\nturn = 0\nfor i in range(300):\n if turn == 0:\n if a == \"\":\n print(\"A\")\n exit()\n else:\n turn = li.index(a[0])\n a = a[1:]\n elif turn == 1:\n if b == \"\":\n print(\"B\")\n exit()\n else:\n turn = li.index(b[0])\n b = b[1:]\n else:\n if c == \"\":\n print(\"C\")\n exit()\n else:\n turn = li.index(c[0])\n c = c[1:]", "a = input()", "a", "input()", "input", "b = input()", "b", "input()", "input", "c = input()", "c", "input()", "input", "li=[\"a\",\"b\",\"c\"]", "li", "[\"a\",\"b\",\"c\"]", "\"a\"", "\"b\"", "\"c\"", "turn = 0", "turn", "0", "for i in range(300):\n if turn == 0:\n if a == \"\":\n print(\"A\")\n exit()\n else:\n turn = li.index(a[0])\n a = a[1:]\n elif turn == 1:\n if b == \"\":\n print(\"B\")\n exit()\n else:\n turn = li.index(b[0])\n b = b[1:]\n else:\n if c == \"\":\n print(\"C\")\n exit()\n else:\n turn = li.index(c[0])\n c = c[1:]", "i", "range(300)", "range", "300", "if turn == 0:\n if a == \"\":\n print(\"A\")\n exit()\n else:\n turn = li.index(a[0])\n a = a[1:]\n elif turn == 1:\n if b == \"\":\n print(\"B\")\n exit()\n else:\n turn = li.index(b[0])\n b = b[1:]\n else:\n if c == \"\":\n print(\"C\")\n exit()\n else:\n turn = li.index(c[0])\n c = c[1:]", "turn == 0", "turn", "0", "if a == \"\":\n print(\"A\")\n exit()\n else:\n turn = li.index(a[0])\n a = a[1:]\n ", "a == \"\"", "a", "\"\"", "print(\"A\")", "print", "\"A\"", "exit()", "exit", "turn = li.index(a[0])", "turn", "li.index(a[0])", "li.index", "li", "index", "a[0]", "a", "0", "a = a[1:]", "a", "a[1:]", "a", "1:", "1", "elif turn == 1:\n if b == \"\":\n print(\"B\")\n exit()\n else:\n turn = li.index(b[0])\n b = b[1:]\n ", "turn == 1", "turn", "1", "if b == \"\":\n print(\"B\")\n exit()\n else:\n turn = li.index(b[0])\n b = b[1:]\n ", "b == \"\"", "b", "\"\"", "print(\"B\")", "print", "\"B\"", "exit()", "exit", "turn = li.index(b[0])", "turn", "li.index(b[0])", "li.index", "li", "index", "b[0]", "b", "0", "b = b[1:]", "b", "b[1:]", "b", "1:", "1", "if c == \"\":\n print(\"C\")\n exit()\n else:\n turn = li.index(c[0])\n c = c[1:]", "c == \"\"", "c", "\"\"", "print(\"C\")", "print", "\"C\"", "exit()", "exit", "turn = li.index(c[0])", "turn", "li.index(c[0])", "li.index", "li", "index", "c[0]", "c", "0", "c = c[1:]", "c", "c[1:]", "c", "1:", "1", "turn = li.index(c[0])", "li.index(c[0])", "turn", "c = c[1:]", "c[1:]", "c", "turn = li.index(b[0])", "li.index(b[0])", "turn", "li=[\"a\",\"b\",\"c\"]", "[\"a\",\"b\",\"c\"]", "li", "turn = 0", "0", "turn", "a = input()", "input()", "a", "c = input()", "input()", "c", "a = a[1:]", "a[1:]", "a", "b = input()", "input()", "b", "turn = li.index(a[0])", "li.index(a[0])", "turn", "b = b[1:]", "b[1:]", "b" ]
a = input() b = input() c = input() li=["a","b","c"] turn = 0 for i in range(300): if turn == 0: if a == "": print("A") exit() else: turn = li.index(a[0]) a = a[1:] elif turn == 1: if b == "": print("B") exit() else: turn = li.index(b[0]) b = b[1:] else: if c == "": print("C") exit() else: turn = li.index(c[0]) c = c[1:]
[ 7, 0, 13, 39, 28, 13, 4, 13, 17, 4, 18, 13, 13, 4, 13, 0, 13, 39, 17, 17, 17, 0, 13, 17, 42, 17, 14, 2, 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, 0, 13, 17, 0, 18, 13, 13, 18, 18, 13, 13, 39, 17, 0, 13, 13, 4, 13, 18, 13, 13, 10, 13, 13, 10, 17, 13, 10, 17, 13, 10, 13, 13, 10, 39, 13, 10, 17, 13, 10, 17, 13, 10, 39, 13 ]
[ [ 92, 2 ], [ 6, 5 ], [ 93, 11 ], [ 101, 16 ], [ 86, 22 ], [ 62, 28 ], [ 93, 29 ], [ 87, 30 ], [ 81, 30 ], [ 89, 33 ], [ 87, 34 ], [ 81, 34 ], [ 62, 39 ], [ 93, 40 ], [ 87, 41 ], [ 81, 41 ], [ 83, 45 ], [ 62, 50 ], [ 93, 51 ], [ 87, 52 ], [ 81, 52 ], [ 95, 56 ], [ 98, 59 ], [ 65, 62 ], [ 93, 63 ], [ 87, 64 ], [ 81, 64 ], [ 62, 66 ], [ 93, 67 ], [ 87, 68 ], [ 81, 68 ], [ 80, 72 ], [ 99, 73 ], [ 96, 73 ], [ 84, 73 ], [ 102, 77 ], [ 90, 78 ], [ 99, 80 ], [ 96, 80 ], [ 84, 80 ], [ 80, 81 ], [ 83, 84 ], [ 86, 87 ], [ 87, 89 ], [ 81, 89 ], [ 89, 90 ], [ 92, 93 ], [ 95, 96 ], [ 98, 99 ], [ 101, 102 ] ]
[ "s=[]\nfor i in range(3):\n s.append(input())\nmember=[\"A\",\"B\",\"C\"]\nturn=0\n\nwhile True:\n if s[turn]==\"\":\n winner=turn\n break\n if s[turn][0]==\"a\":\n next=0\n elif s[turn][0]==\"b\":\n next=1\n else:\n next=2\n s[turn]=s[turn][1:]\n turn=next\n\nprint(member[winner])", "s=[]", "s", "[]", "for i in range(3):\n s.append(input())", "i", "range(3)", "range", "3", "s.append(input())", "s.append", "s", "append", "input()", "input", "member=[\"A\",\"B\",\"C\"]", "member", "[\"A\",\"B\",\"C\"]", "\"A\"", "\"B\"", "\"C\"", "turn=0", "turn", "0", "while True:\n if s[turn]==\"\":\n winner=turn\n break\n if s[turn][0]==\"a\":\n next=0\n elif s[turn][0]==\"b\":\n next=1\n else:\n next=2\n s[turn]=s[turn][1:]\n turn=next", "True", "if s[turn]==\"\":\n winner=turn\n break\n ", "s[turn]==\"\"", "s[turn]", "s", "turn", "\"\"", "winner=turn", "winner", "turn", "break", "if s[turn][0]==\"a\":\n next=0\n elif s[turn][0]==\"b\":\n next=1\n else:\n next=2\n ", "s[turn][0]==\"a\"", "s[turn][0]", "[turn]", "s", "turn", "0", "\"a\"", "next=0", "next", "0", "elif s[turn][0]==\"b\":\n next=1\n ", "s[turn][0]==\"b\"", "s[turn][0]", "[turn]", "s", "turn", "0", "\"b\"", "next=1", "next", "1", "next=2", "next", "2", "s[turn]=s[turn][1:]", "s[turn]", "s", "turn", "s[turn][1:]", "[turn]", "s", "turn", "1:", "1", "turn=next", "turn", "next", "print(member[winner])", "print", "member[winner]", "member", "winner", "turn=next", "next", "turn", "next=0", "0", "next", "turn=0", "0", "turn", "winner=turn", "turn", "winner", "s=[]", "[]", "s", "next=1", "1", "next", "next=2", "2", "next", "member=[\"A\",\"B\",\"C\"]", "[\"A\",\"B\",\"C\"]", "member" ]
s=[] for i in range(3): s.append(input()) member=["A","B","C"] turn=0 while True: if s[turn]=="": winner=turn break if s[turn][0]=="a": next=0 elif s[turn][0]=="b": next=1 else: next=2 s[turn]=s[turn][1:] turn=next print(member[winner])
[ 7, 0, 13, 17, 0, 18, 13, 17, 4, 13, 0, 18, 13, 17, 4, 13, 0, 18, 13, 17, 4, 13, 0, 13, 18, 13, 17, 0, 13, 17, 42, 40, 18, 13, 13, 17, 14, 2, 18, 13, 17, 17, 0, 18, 13, 13, 18, 13, 39, 17, 0, 13, 18, 13, 17, 0, 13, 17, 14, 2, 18, 13, 17, 17, 0, 18, 13, 13, 18, 13, 39, 17, 0, 13, 18, 13, 17, 0, 13, 17, 0, 18, 13, 13, 18, 13, 39, 17, 0, 13, 18, 13, 17, 0, 13, 17, 4, 13, 4, 18, 13, 13, 10, 18, 13, 10, 17, 13, 10, 18, 13, 10, 17, 13, 10, 17, 13, 10, 18, 13, 10, 17, 13, 10, 17, 13, 10, 18, 13 ]
[ [ 112, 2 ], [ 8, 5 ], [ 113, 6 ], [ 14, 11 ], [ 113, 12 ], [ 20, 17 ], [ 113, 18 ], [ 118, 23 ], [ 113, 25 ], [ 106, 28 ], [ 81, 32 ], [ 65, 32 ], [ 43, 32 ], [ 113, 33 ], [ 107, 34 ], [ 116, 34 ], [ 125, 34 ], [ 122, 34 ], [ 119, 39 ], [ 104, 39 ], [ 110, 39 ], [ 128, 39 ], [ 46, 43 ], [ 113, 44 ], [ 107, 45 ], [ 116, 45 ], [ 125, 45 ], [ 122, 45 ], [ 119, 47 ], [ 104, 47 ], [ 110, 47 ], [ 128, 47 ], [ 127, 51 ], [ 113, 53 ], [ 121, 56 ], [ 119, 61 ], [ 104, 61 ], [ 110, 61 ], [ 128, 61 ], [ 68, 65 ], [ 113, 66 ], [ 107, 67 ], [ 116, 67 ], [ 125, 67 ], [ 122, 67 ], [ 119, 69 ], [ 104, 69 ], [ 110, 69 ], [ 128, 69 ], [ 109, 73 ], [ 113, 75 ], [ 124, 78 ], [ 84, 81 ], [ 113, 82 ], [ 107, 83 ], [ 116, 83 ], [ 125, 83 ], [ 122, 83 ], [ 119, 85 ], [ 104, 85 ], [ 110, 85 ], [ 128, 85 ], [ 103, 89 ], [ 113, 91 ], [ 115, 94 ], [ 116, 100 ], [ 125, 100 ], [ 122, 100 ], [ 107, 100 ], [ 103, 104 ], [ 106, 107 ], [ 109, 110 ], [ 112, 113 ], [ 115, 116 ], [ 118, 119 ], [ 121, 122 ], [ 124, 125 ], [ 127, 128 ] ]
[ "dic = {}\ndic['a'] = input()\ndic['b'] = input()\ndic['c'] = input()\nturn = dic['a']\nnext = 'a'\nwhile dic[next] !='':\n if turn[0] == 'a':\n dic[next] = turn[1:]\n turn = dic['a']\n next = 'a'\n elif turn[0] == 'b':\n dic[next] = turn[1:]\n turn = dic['b']\n next = 'b'\n else:\n dic[next] = turn[1:]\n turn = dic['c']\n next = 'c'\nprint(next.upper())", "dic = {}", "dic", "{}", "dic['a'] = input()", "dic['a']", "dic", "'a'", "input()", "input", "dic['b'] = input()", "dic['b']", "dic", "'b'", "input()", "input", "dic['c'] = input()", "dic['c']", "dic", "'c'", "input()", "input", "turn = dic['a']", "turn", "dic['a']", "dic", "'a'", "next = 'a'", "next", "'a'", "while dic[next] !='':\n if turn[0] == 'a':\n dic[next] = turn[1:]\n turn = dic['a']\n next = 'a'\n elif turn[0] == 'b':\n dic[next] = turn[1:]\n turn = dic['b']\n next = 'b'\n else:\n dic[next] = turn[1:]\n turn = dic['c']\n next = 'c'", "dic[next] !=''", "dic[next]", "dic", "next", "''", "if turn[0] == 'a':\n dic[next] = turn[1:]\n turn = dic['a']\n next = 'a'\n elif turn[0] == 'b':\n dic[next] = turn[1:]\n turn = dic['b']\n next = 'b'\n else:\n dic[next] = turn[1:]\n turn = dic['c']\n next = 'c'", "turn[0] == 'a'", "turn[0]", "turn", "0", "'a'", "dic[next] = turn[1:]", "dic[next]", "dic", "next", "turn[1:]", "turn", "1:", "1", "turn = dic['a']", "turn", "dic['a']", "dic", "'a'", "next = 'a'", "next", "'a'", "elif turn[0] == 'b':\n dic[next] = turn[1:]\n turn = dic['b']\n next = 'b'\n ", "turn[0] == 'b'", "turn[0]", "turn", "0", "'b'", "dic[next] = turn[1:]", "dic[next]", "dic", "next", "turn[1:]", "turn", "1:", "1", "turn = dic['b']", "turn", "dic['b']", "dic", "'b'", "next = 'b'", "next", "'b'", "dic[next] = turn[1:]", "dic[next]", "dic", "next", "turn[1:]", "turn", "1:", "1", "turn = dic['c']", "turn", "dic['c']", "dic", "'c'", "next = 'c'", "next", "'c'", "print(next.upper())", "print", "next.upper()", "next.upper", "next", "upper", "turn = dic['c']", "dic['c']", "turn", "next = 'a'", "'a'", "next", "turn = dic['b']", "dic['b']", "turn", "dic = {}", "{}", "dic", "next = 'c'", "'c'", "next", "turn = dic['a']", "dic['a']", "turn", "next = 'a'", "'a'", "next", "next = 'b'", "'b'", "next", "turn = dic['a']", "dic['a']", "turn" ]
dic = {} dic['a'] = input() dic['b'] = input() dic['c'] = input() turn = dic['a'] next = 'a' while dic[next] !='': if turn[0] == 'a': dic[next] = turn[1:] turn = dic['a'] next = 'a' elif turn[0] == 'b': dic[next] = turn[1:] turn = dic['b'] next = 'b' else: dic[next] = turn[1:] turn = dic['c'] next = 'c' print(next.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, 38, 5, 4, 13, 4, 18, 13, 13, 3, 14, 2, 13, 17, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 14, 2, 13, 17, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 14, 2, 13, 17, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 10, 17, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 18, 13 ]
[ [ 100, 2 ], [ 97, 8 ], [ 103, 14 ], [ 79, 20 ], [ 80, 30 ], [ 107, 30 ], [ 89, 30 ], [ 83, 30 ], [ 80, 35 ], [ 107, 35 ], [ 89, 35 ], [ 83, 35 ], [ 82, 38 ], [ 101, 40 ], [ 95, 40 ], [ 94, 43 ], [ 101, 45 ], [ 95, 45 ], [ 80, 50 ], [ 107, 50 ], [ 89, 50 ], [ 83, 50 ], [ 88, 53 ], [ 98, 55 ], [ 92, 55 ], [ 91, 58 ], [ 98, 60 ], [ 92, 60 ], [ 80, 65 ], [ 107, 65 ], [ 89, 65 ], [ 83, 65 ], [ 106, 68 ], [ 104, 70 ], [ 86, 70 ], [ 85, 73 ], [ 104, 75 ], [ 86, 75 ], [ 79, 80 ], [ 82, 83 ], [ 85, 86 ], [ 88, 89 ], [ 91, 92 ], [ 94, 95 ], [ 97, 98 ], [ 100, 101 ], [ 103, 104 ], [ 106, 107 ] ]
[ "a=list(input())\nb=list(input())\nc=list(input())\nans=\"a\"\nwhile True:\n try:\n if ans == \"a\":\n ans=a[0]\n a=a[1:]\n elif ans == \"b\":\n ans = b[0]\n b=b[1:]\n elif ans == \"c\":\n ans = c[0]\n c=c[1:]\n except:\n print(ans.upper())\n break", "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", "ans=\"a\"", "ans", "\"a\"", "while True:\n try:\n if ans == \"a\":\n ans=a[0]\n a=a[1:]\n elif ans == \"b\":\n ans = b[0]\n b=b[1:]\n elif ans == \"c\":\n ans = c[0]\n c=c[1:]\n except:\n print(ans.upper())\n break", "True", "try:\n if ans == \"a\":\n ans=a[0]\n a=a[1:]\n elif ans == \"b\":\n ans = b[0]\n b=b[1:]\n elif ans == \"c\":\n ans = c[0]\n c=c[1:]\n except:\n print(ans.upper())\n break", "except:\n print(ans.upper())\n break", "print(ans.upper())", "print", "ans.upper()", "ans.upper", "ans", "upper", "break", "if ans == \"a\":\n ans=a[0]\n a=a[1:]\n elif ans == \"b\":\n ans = b[0]\n b=b[1:]\n elif ans == \"c\":\n ans = c[0]\n c=c[1:]\n ", "ans == \"a\"", "ans", "\"a\"", "ans=a[0]", "ans", "a[0]", "a", "0", "a=a[1:]", "a", "a[1:]", "a", "1:", "1", "elif ans == \"b\":\n ans = b[0]\n b=b[1:]\n ", "ans == \"b\"", "ans", "\"b\"", "ans = b[0]", "ans", "b[0]", "b", "0", "b=b[1:]", "b", "b[1:]", "b", "1:", "1", "elif ans == \"c\":\n ans = c[0]\n c=c[1:]\n ", "ans == \"c\"", "ans", "\"c\"", "ans = c[0]", "ans", "c[0]", "c", "0", "c=c[1:]", "c", "c[1:]", "c", "1:", "1", "ans=\"a\"", "\"a\"", "ans", "ans=a[0]", "a[0]", "ans", "c=c[1:]", "c[1:]", "c", "ans = b[0]", "b[0]", "ans", "b=b[1:]", "b[1:]", "b", "a=a[1:]", "a[1:]", "a", "b=list(input())", "list(input())", "b", "a=list(input())", "list(input())", "a", "c=list(input())", "list(input())", "c", "ans = c[0]", "c[0]", "ans" ]
a=list(input()) b=list(input()) c=list(input()) ans="a" while True: try: if ans == "a": ans=a[0] a=a[1:] elif ans == "b": ans = b[0] b=b[1:] elif ans == "c": ans = c[0] c=c[1:] except: print(ans.upper()) break
[ 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, 39, 13, 13, 13, 0, 13, 2, 4, 13, 13, 17, 0, 13, 2, 4, 13, 13, 17, 0, 13, 2, 4, 13, 13, 17, 0, 13, 17, 0, 13, 17, 0, 13, 17, 0, 13, 17, 0, 13, 17, 42, 2, 13, 17, 14, 2, 13, 17, 0, 13, 17, 0, 13, 18, 18, 13, 17, 2, 13, 17, 14, 2, 13, 17, 0, 13, 17, 0, 13, 18, 18, 13, 17, 2, 13, 17, 0, 13, 17, 0, 13, 18, 18, 13, 17, 2, 13, 17, 14, 2, 13, 2, 13, 17, 4, 13, 17, 4, 13, 14, 2, 13, 2, 13, 17, 4, 13, 17, 4, 13, 14, 2, 13, 2, 13, 17, 4, 13, 17, 4, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 18, 13, 10, 18, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 2, 13, 10, 18, 13, 10, 39, 13, 10, 2, 13, 10, 17, 13, 10, 2, 13, 10, 4, 13 ]
[ [ 161, 2 ], [ 209, 8 ], [ 179, 14 ], [ 162, 21 ], [ 210, 26 ], [ 180, 31 ], [ 197, 35 ], [ 206, 41 ], [ 162, 45 ], [ 200, 48 ], [ 210, 52 ], [ 191, 55 ], [ 180, 59 ], [ 203, 62 ], [ 173, 65 ], [ 185, 68 ], [ 182, 71 ], [ 188, 74 ], [ 183, 78 ], [ 189, 82 ], [ 195, 82 ], [ 168, 82 ], [ 171, 82 ], [ 158, 85 ], [ 170, 88 ], [ 198, 91 ], [ 159, 94 ], [ 204, 94 ], [ 189, 98 ], [ 195, 98 ], [ 168, 98 ], [ 171, 98 ], [ 164, 101 ], [ 167, 104 ], [ 198, 107 ], [ 165, 110 ], [ 174, 110 ], [ 176, 113 ], [ 194, 116 ], [ 198, 119 ], [ 177, 122 ], [ 186, 122 ], [ 159, 126 ], [ 204, 126 ], [ 207, 128 ], [ 165, 137 ], [ 174, 137 ], [ 201, 139 ], [ 177, 148 ], [ 186, 148 ], [ 192, 150 ], [ 158, 159 ], [ 161, 162 ], [ 164, 165 ], [ 167, 168 ], [ 170, 171 ], [ 173, 174 ], [ 176, 177 ], [ 179, 180 ], [ 182, 183 ], [ 185, 186 ], [ 188, 189 ], [ 191, 192 ], [ 194, 195 ], [ 197, 198 ], [ 200, 201 ], [ 203, 204 ], [ 206, 207 ], [ 209, 210 ] ]
[ "sa=list(input())\nsb=list(input())\nsc=list(input())\nsa.append(\"x\")\nsb.append(\"x\")\nsc.append(\"x\")\nl=[sa,sb,sc]\nna=len(sa)-1\nnb=len(sb)-1\nnc=len(sc)-1\na=0\nb=0\nc=0\nf=0\nturn=\"a\"\nwhile f==0:\n if turn==\"a\":\n a+=1\n turn=l[0][a-1]\n \n elif turn==\"b\":\n b+=1\n turn=l[1][b-1]\n else:\n c+=1\n turn=l[2][c-1]\n if a==na+1:\n print(\"A\")\n exit()\n elif b==nb+1:\n print(\"B\")\n exit()\n elif c==nc+1:\n print(\"C\")\n exit()\n \n ", "sa=list(input())", "sa", "list(input())", "list", "input()", "input", "sb=list(input())", "sb", "list(input())", "list", "input()", "input", "sc=list(input())", "sc", "list(input())", "list", "input()", "input", "sa.append(\"x\")", "sa.append", "sa", "append", "\"x\"", "sb.append(\"x\")", "sb.append", "sb", "append", "\"x\"", "sc.append(\"x\")", "sc.append", "sc", "append", "\"x\"", "l=[sa,sb,sc]", "l", "[sa,sb,sc]", "sa", "sb", "sc", "na=len(sa)-1", "na", "len(sa)-1", "len(sa)", "len", "sa", "1", "nb=len(sb)-1", "nb", "len(sb)-1", "len(sb)", "len", "sb", "1", "nc=len(sc)-1", "nc", "len(sc)-1", "len(sc)", "len", "sc", "1", "a=0", "a", "0", "b=0", "b", "0", "c=0", "c", "0", "f=0", "f", "0", "turn=\"a\"", "turn", "\"a\"", "while f==0:\n if turn==\"a\":\n a+=1\n turn=l[0][a-1]\n \n elif turn==\"b\":\n b+=1\n turn=l[1][b-1]\n else:\n c+=1\n turn=l[2][c-1]\n if a==na+1:\n print(\"A\")\n exit()\n elif b==nb+1:\n print(\"B\")\n exit()\n elif c==nc+1:\n print(\"C\")\n exit()\n \n ", "f==0", "f", "0", "if turn==\"a\":\n a+=1\n turn=l[0][a-1]\n \n elif turn==\"b\":\n b+=1\n turn=l[1][b-1]\n else:\n c+=1\n turn=l[2][c-1]\n ", "turn==\"a\"", "turn", "\"a\"", "a+=1", "a", "1", "turn=l[0][a-1]", "turn", "l[0][a-1]", "[0]", "l", "0", "a-1", "a", "1", "elif turn==\"b\":\n b+=1\n turn=l[1][b-1]\n ", "turn==\"b\"", "turn", "\"b\"", "b+=1", "b", "1", "turn=l[1][b-1]", "turn", "l[1][b-1]", "[1]", "l", "1", "b-1", "b", "1", "c+=1", "c", "1", "turn=l[2][c-1]", "turn", "l[2][c-1]", "[2]", "l", "2", "c-1", "c", "1", "if a==na+1:\n print(\"A\")\n exit()\n elif b==nb+1:\n print(\"B\")\n exit()\n elif c==nc+1:\n print(\"C\")\n exit()\n \n ", "a==na+1", "a", "na+1", "na", "1", "print(\"A\")", "print", "\"A\"", "exit()", "exit", "elif b==nb+1:\n print(\"B\")\n exit()\n ", "b==nb+1", "b", "nb+1", "nb", "1", "print(\"B\")", "print", "\"B\"", "exit()", "exit", "elif c==nc+1:\n print(\"C\")\n exit()\n \n ", "c==nc+1", "c", "nc+1", "nc", "1", "print(\"C\")", "print", "\"C\"", "exit()", "exit", "a+=1", "1", "a", "sa=list(input())", "list(input())", "sa", "b+=1", "1", "b", "turn=l[1][b-1]", "l[1][b-1]", "turn", "turn=l[0][a-1]", "l[0][a-1]", "turn", "b=0", "0", "b", "c+=1", "1", "c", "sc=list(input())", "list(input())", "sc", "f=0", "0", "f", "c=0", "0", "c", "turn=\"a\"", "\"a\"", "turn", "nc=len(sc)-1", "len(sc)-1", "nc", "turn=l[2][c-1]", "l[2][c-1]", "turn", "l=[sa,sb,sc]", "[sa,sb,sc]", "l", "nb=len(sb)-1", "len(sb)-1", "nb", "a=0", "0", "a", "na=len(sa)-1", "len(sa)-1", "na", "sb=list(input())", "list(input())", "sb" ]
sa=list(input()) sb=list(input()) sc=list(input()) sa.append("x") sb.append("x") sc.append("x") l=[sa,sb,sc] na=len(sa)-1 nb=len(sb)-1 nc=len(sc)-1 a=0 b=0 c=0 f=0 turn="a" while f==0: if turn=="a": a+=1 turn=l[0][a-1] elif turn=="b": b+=1 turn=l[1][b-1] else: c+=1 turn=l[2][c-1] if a==na+1: print("A") exit() elif b==nb+1: print("B") exit() elif c==nc+1: print("C") exit()
[ 7, 41, 28, 13, 4, 13, 17, 17, 4, 4, 13, 0, 13, 13, 13, 13, 0, 13, 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, 18, 13, 10, 18, 13, 10, 18, 13, 10, 13, 13, 10, 17, 13, 10, 13, 13, 10, 18, 13, 10, 18, 13, 10, 13, 13, 10, 18, 13 ]
[ [ 4, 3 ], [ 111, 12 ], [ 111, 14 ], [ 111, 15 ], [ 99, 17 ], [ 100, 23 ], [ 115, 23 ], [ 109, 23 ], [ 94, 23 ], [ 112, 27 ], [ 88, 27 ], [ 93, 34 ], [ 112, 36 ], [ 88, 36 ], [ 87, 39 ], [ 112, 41 ], [ 88, 41 ], [ 100, 46 ], [ 115, 46 ], [ 109, 46 ], [ 94, 46 ], [ 97, 50 ], [ 91, 50 ], [ 108, 57 ], [ 97, 59 ], [ 91, 59 ], [ 90, 62 ], [ 97, 64 ], [ 91, 64 ], [ 103, 69 ], [ 106, 69 ], [ 114, 76 ], [ 103, 78 ], [ 106, 78 ], [ 105, 81 ], [ 103, 83 ], [ 106, 83 ], [ 87, 88 ], [ 90, 91 ], [ 93, 94 ], [ 111, 97 ], [ 99, 100 ], [ 111, 103 ], [ 105, 106 ], [ 108, 109 ], [ 111, 112 ], [ 114, 115 ] ]
[ "A,B,C=[input() for i in range(0,3)]\n\nturn='a'\nwhile True:\n if turn == 'a':\n if A ==\"\":\n print('A')\n break\n turn=A[0]\n A=A[1:]\n elif turn=='b':\n if B==\"\":\n print('B')\n break\n turn=B[0]\n B=B[1:]\n else:\n if C==\"\":\n print('C')\n break\n turn=C[0]\n C=C[1:]", "input() for i in range(0,3)", "for i in range(0,3)", "i", "range(0,3)", "range", "0", "3", "for i in range(0,3)", "input()", "input", "A,B,C=[input() for i in range(0,3)]", "A", "[input() for i in range(0,3)]", "B", "C", "turn='a'", "turn", "'a'", "while True:\n if turn == 'a':\n if A ==\"\":\n print('A')\n break\n turn=A[0]\n A=A[1:]\n elif turn=='b':\n if B==\"\":\n print('B')\n break\n turn=B[0]\n B=B[1:]\n else:\n if C==\"\":\n print('C')\n break\n turn=C[0]\n C=C[1:]", "True", "if turn == 'a':\n if A ==\"\":\n print('A')\n break\n turn=A[0]\n A=A[1:]\n elif turn=='b':\n if B==\"\":\n print('B')\n break\n turn=B[0]\n B=B[1:]\n else:\n if C==\"\":\n print('C')\n break\n turn=C[0]\n C=C[1:]", "turn == 'a'", "turn", "'a'", "if A ==\"\":\n print('A')\n break\n ", "A ==\"\"", "A", "\"\"", "print('A')", "print", "'A'", "break", "turn=A[0]", "turn", "A[0]", "A", "0", "A=A[1:]", "A", "A[1:]", "A", "1:", "1", "elif turn=='b':\n if B==\"\":\n print('B')\n break\n turn=B[0]\n B=B[1:]\n ", "turn=='b'", "turn", "'b'", "if B==\"\":\n print('B')\n break\n ", "B==\"\"", "B", "\"\"", "print('B')", "print", "'B'", "break", "turn=B[0]", "turn", "B[0]", "B", "0", "B=B[1:]", "B", "B[1:]", "B", "1:", "1", "if C==\"\":\n print('C')\n break\n ", "C==\"\"", "C", "\"\"", "print('C')", "print", "'C'", "break", "turn=C[0]", "turn", "C[0]", "C", "0", "C=C[1:]", "C", "C[1:]", "C", "1:", "1", "A=A[1:]", "A[1:]", "A", "B=B[1:]", "B[1:]", "B", "turn=A[0]", "A[0]", "turn", "B,C=[input() for i in range(0,3)]", "[input() for i in range(0,3)]", "B", "turn='a'", "'a'", "turn", "C=[input() for i in range(0,3)]", "[input() for i in range(0,3)]", "C", "C=C[1:]", "C[1:]", "C", "turn=B[0]", "B[0]", "turn", "A,B,C=[input() for i in range(0,3)]", "[input() for i in range(0,3)]", "A", "turn=C[0]", "C[0]", "turn" ]
A,B,C=[input() for i in range(0,3)] turn='a' while True: if turn == 'a': if A =="": print('A') break turn=A[0] A=A[1:] elif turn=='b': if B=="": print('B') break turn=B[0] B=B[1:] else: if C=="": print('C') break turn=C[0] C=C[1:]
[ 7, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 17, 28, 13, 4, 13, 17, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 4, 13, 17, 4, 13, 14, 2, 4, 13, 13, 17, 0, 13, 18, 13, 17, 0, 13, 17, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 4, 13, 17, 4, 13, 14, 2, 4, 13, 13, 17, 0, 13, 18, 13, 17, 0, 13, 17, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 14, 2, 4, 13, 13, 17, 4, 13, 17, 4, 13, 14, 2, 4, 13, 13, 17, 0, 13, 18, 13, 17, 0, 13, 17, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 10, 18, 13, 10, 18, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 17, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 4, 13 ]
[ [ 147, 2 ], [ 183, 6 ], [ 156, 10 ], [ 153, 14 ], [ 18, 17 ], [ 154, 23 ], [ 160, 23 ], [ 175, 23 ], [ 169, 23 ], [ 181, 23 ], [ 142, 23 ], [ 166, 23 ], [ 148, 29 ], [ 178, 29 ], [ 145, 29 ], [ 148, 40 ], [ 178, 40 ], [ 145, 40 ], [ 165, 43 ], [ 148, 45 ], [ 178, 45 ], [ 145, 45 ], [ 144, 48 ], [ 141, 51 ], [ 148, 53 ], [ 178, 53 ], [ 145, 53 ], [ 177, 56 ], [ 148, 58 ], [ 178, 58 ], [ 145, 58 ], [ 154, 63 ], [ 160, 63 ], [ 175, 63 ], [ 169, 63 ], [ 181, 63 ], [ 142, 63 ], [ 166, 63 ], [ 184, 69 ], [ 139, 69 ], [ 172, 69 ], [ 184, 80 ], [ 139, 80 ], [ 172, 80 ], [ 180, 83 ], [ 184, 85 ], [ 139, 85 ], [ 172, 85 ], [ 171, 88 ], [ 168, 91 ], [ 184, 93 ], [ 139, 93 ], [ 172, 93 ], [ 138, 96 ], [ 184, 98 ], [ 139, 98 ], [ 172, 98 ], [ 157, 105 ], [ 163, 105 ], [ 151, 105 ], [ 157, 116 ], [ 163, 116 ], [ 151, 116 ], [ 174, 119 ], [ 157, 121 ], [ 163, 121 ], [ 151, 121 ], [ 150, 124 ], [ 159, 127 ], [ 157, 129 ], [ 163, 129 ], [ 151, 129 ], [ 162, 132 ], [ 157, 134 ], [ 163, 134 ], [ 151, 134 ], [ 138, 139 ], [ 141, 142 ], [ 144, 145 ], [ 147, 148 ], [ 150, 151 ], [ 153, 154 ], [ 156, 157 ], [ 159, 160 ], [ 162, 163 ], [ 165, 166 ], [ 168, 169 ], [ 171, 172 ], [ 174, 175 ], [ 177, 178 ], [ 180, 181 ], [ 183, 184 ] ]
[ "A=input()\nB=input()\nC=input()\n\nl='a'\n\nfor i in range(300):\n if l=='a':\n if len(A)==0:\n print('A')\n exit()\n elif len(A)==1:\n l=A[0]\n A=''\n else:\n l=A[0]\n A=A[1:]\n elif l=='b':\n if len(B)==0:\n print('B')\n exit()\n elif len(B)==1:\n l=B[0]\n B=''\n else:\n l=B[0]\n B=B[1:]\n else:\n if len(C)==0:\n print('C')\n exit()\n elif len(C)==1:\n l=C[0]\n C=''\n else:\n l=C[0]\n C=C[1:] \n", "A=input()", "A", "input()", "input", "B=input()", "B", "input()", "input", "C=input()", "C", "input()", "input", "l='a'", "l", "'a'", "for i in range(300):\n if l=='a':\n if len(A)==0:\n print('A')\n exit()\n elif len(A)==1:\n l=A[0]\n A=''\n else:\n l=A[0]\n A=A[1:]\n elif l=='b':\n if len(B)==0:\n print('B')\n exit()\n elif len(B)==1:\n l=B[0]\n B=''\n else:\n l=B[0]\n B=B[1:]\n else:\n if len(C)==0:\n print('C')\n exit()\n elif len(C)==1:\n l=C[0]\n C=''\n else:\n l=C[0]\n C=C[1:] ", "i", "range(300)", "range", "300", "if l=='a':\n if len(A)==0:\n print('A')\n exit()\n elif len(A)==1:\n l=A[0]\n A=''\n else:\n l=A[0]\n A=A[1:]\n elif l=='b':\n if len(B)==0:\n print('B')\n exit()\n elif len(B)==1:\n l=B[0]\n B=''\n else:\n l=B[0]\n B=B[1:]\n else:\n if len(C)==0:\n print('C')\n exit()\n elif len(C)==1:\n l=C[0]\n C=''\n else:\n l=C[0]\n C=C[1:] ", "l=='a'", "l", "'a'", "if len(A)==0:\n print('A')\n exit()\n elif len(A)==1:\n l=A[0]\n A=''\n else:\n l=A[0]\n A=A[1:]\n ", "len(A)==0", "len(A)", "len", "A", "0", "print('A')", "print", "'A'", "exit()", "exit", "elif len(A)==1:\n l=A[0]\n A=''\n ", "len(A)==1", "len(A)", "len", "A", "1", "l=A[0]", "l", "A[0]", "A", "0", "A=''", "A", "''", "l=A[0]", "l", "A[0]", "A", "0", "A=A[1:]", "A", "A[1:]", "A", "1:", "1", "elif l=='b':\n if len(B)==0:\n print('B')\n exit()\n elif len(B)==1:\n l=B[0]\n B=''\n else:\n l=B[0]\n B=B[1:]\n ", "l=='b'", "l", "'b'", "if len(B)==0:\n print('B')\n exit()\n elif len(B)==1:\n l=B[0]\n B=''\n else:\n l=B[0]\n B=B[1:]\n ", "len(B)==0", "len(B)", "len", "B", "0", "print('B')", "print", "'B'", "exit()", "exit", "elif len(B)==1:\n l=B[0]\n B=''\n ", "len(B)==1", "len(B)", "len", "B", "1", "l=B[0]", "l", "B[0]", "B", "0", "B=''", "B", "''", "l=B[0]", "l", "B[0]", "B", "0", "B=B[1:]", "B", "B[1:]", "B", "1:", "1", "if len(C)==0:\n print('C')\n exit()\n elif len(C)==1:\n l=C[0]\n C=''\n else:\n l=C[0]\n C=C[1:] ", "len(C)==0", "len(C)", "len", "C", "0", "print('C')", "print", "'C'", "exit()", "exit", "elif len(C)==1:\n l=C[0]\n C=''\n ", "len(C)==1", "len(C)", "len", "C", "1", "l=C[0]", "l", "C[0]", "C", "0", "C=''", "C", "''", "l=C[0]", "l", "C[0]", "C", "0", "C=C[1:]", "C", "C[1:]", "C", "1:", "1", "B=B[1:]", "B[1:]", "B", "l=A[0]", "A[0]", "l", "A=''", "''", "A", "A=input()", "input()", "A", "C=''", "''", "C", "l='a'", "'a'", "l", "C=input()", "input()", "C", "l=C[0]", "C[0]", "l", "C=C[1:]", "C[1:]", "C", "l=A[0]", "A[0]", "l", "l=B[0]", "B[0]", "l", "B=''", "''", "B", "l=C[0]", "C[0]", "l", "A=A[1:]", "A[1:]", "A", "l=B[0]", "B[0]", "l", "B=input()", "input()", "B" ]
A=input() B=input() C=input() l='a' for i in range(300): if l=='a': if len(A)==0: print('A') exit() elif len(A)==1: l=A[0] A='' else: l=A[0] A=A[1:] elif l=='b': if len(B)==0: print('B') exit() elif len(B)==1: l=B[0] B='' else: l=B[0] B=B[1:] else: if len(C)==0: print('C') exit() elif len(C)==1: l=C[0] C='' else: l=C[0] C=C[1:]
[ 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, 0, 13, 21, 22, 17, 17, 22, 17, 17, 22, 17, 17, 42, 4, 13, 18, 13, 13, 0, 13, 18, 13, 4, 18, 18, 13, 13, 13, 17, 4, 13, 18, 13, 13, 10, 13, 13, 10, 21, 13, 10, 21, 13, 10, 17, 13, 10, 18, 13 ]
[ [ 4, 3 ], [ 65, 13 ], [ 74, 16 ], [ 68, 19 ], [ 71, 31 ], [ 66, 46 ], [ 75, 47 ], [ 78, 47 ], [ 77, 49 ], [ 72, 51 ], [ 66, 55 ], [ 75, 56 ], [ 78, 56 ], [ 69, 62 ], [ 78, 63 ], [ 75, 63 ], [ 65, 66 ], [ 68, 69 ], [ 71, 72 ], [ 74, 75 ], [ 77, 78 ] ]
[ "s = [list(input()) for _ in range(3)]\n\nn_row = 0\n\ndic = {0:\"A\",1:\"B\",2:\"C\"}\ns_fix = {\"a\":0,\"b\":1,\"c\":2}\n\nwhile len(s[n_row]): \n n_row = s_fix[s[n_row].pop(0)] \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\"", "s_fix = {\"a\":0,\"b\":1,\"c\":2}", "s_fix", "{\"a\":0,\"b\":1,\"c\":2}", "\"a\"", "\"a\"", "0", "\"b\"", "\"b\"", "1", "\"c\"", "\"c\"", "2", "while len(s[n_row]): \n n_row = s_fix[s[n_row].pop(0)] ", "len(s[n_row])", "len", "s[n_row]", "s", "n_row", "n_row = s_fix[s[n_row].pop(0)]", "n_row", "s_fix[s[n_row].pop(0)]", "s_fix", "s[n_row].pop(0)", "[n_row].pop", "[n_row]", "s", "n_row", "pop", "0", "print(dic[n_row])", "print", "dic[n_row]", "dic", "n_row", "s = [list(input()) for _ in range(3)]", "[list(input()) for _ in range(3)]", "s", "dic = {0:\"A\",1:\"B\",2:\"C\"}", "{0:\"A\",1:\"B\",2:\"C\"}", "dic", "s_fix = {\"a\":0,\"b\":1,\"c\":2}", "{\"a\":0,\"b\":1,\"c\":2}", "s_fix", "n_row = 0", "0", "n_row", "n_row = s_fix[s[n_row].pop(0)]", "s_fix[s[n_row].pop(0)]", "n_row" ]
s = [list(input()) for _ in range(3)] n_row = 0 dic = {0:"A",1:"B",2:"C"} s_fix = {"a":0,"b":1,"c":2} while len(s[n_row]): n_row = s_fix[s[n_row].pop(0)] print(dic[n_row])
[ 7, 15, 13, 0, 13, 4, 13, 4, 13, 0, 13, 4, 13, 4, 13, 0, 13, 4, 13, 4, 13, 0, 13, 4, 18, 13, 13, 0, 13, 4, 18, 13, 13, 0, 13, 4, 18, 13, 13, 28, 13, 4, 13, 17, 4, 13, 13, 4, 18, 13, 13, 18, 13, 13, 28, 13, 4, 13, 17, 4, 13, 13, 4, 18, 13, 13, 18, 13, 13, 28, 13, 4, 13, 17, 4, 13, 13, 4, 18, 13, 13, 18, 13, 13, 0, 13, 39, 17, 17, 17, 0, 13, 17, 28, 13, 4, 13, 17, 17, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 4, 13, 17, 4, 13, 0, 13, 4, 18, 13, 13, 0, 13, 4, 18, 13, 13, 13, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 4, 13, 17, 4, 13, 0, 13, 4, 18, 13, 13, 0, 13, 4, 18, 13, 13, 13, 14, 2, 4, 13, 13, 17, 4, 13, 17, 4, 13, 0, 13, 4, 18, 13, 13, 0, 13, 4, 18, 13, 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, 10, 4, 13, 10, 39, 13, 10, 17, 13, 10, 4, 13 ]
[ [ 186, 4 ], [ 201, 10 ], [ 180, 16 ], [ 192, 22 ], [ 195, 28 ], [ 219, 34 ], [ 41, 40 ], [ 187, 46 ], [ 193, 49 ], [ 187, 52 ], [ 40, 53 ], [ 56, 55 ], [ 202, 61 ], [ 196, 64 ], [ 202, 67 ], [ 55, 68 ], [ 71, 70 ], [ 181, 76 ], [ 220, 79 ], [ 181, 82 ], [ 70, 83 ], [ 213, 85 ], [ 216, 91 ], [ 95, 94 ], [ 217, 101 ], [ 199, 101 ], [ 190, 101 ], [ 208, 101 ], [ 193, 107 ], [ 183, 115 ], [ 193, 118 ], [ 207, 121 ], [ 214, 124 ], [ 184, 126 ], [ 211, 126 ], [ 205, 126 ], [ 217, 129 ], [ 199, 129 ], [ 190, 129 ], [ 208, 129 ], [ 196, 135 ], [ 204, 143 ], [ 196, 146 ], [ 189, 149 ], [ 214, 152 ], [ 205, 154 ], [ 211, 154 ], [ 184, 154 ], [ 220, 159 ], [ 210, 167 ], [ 220, 170 ], [ 198, 173 ], [ 214, 176 ], [ 211, 178 ], [ 205, 178 ], [ 184, 178 ], [ 180, 181 ], [ 183, 184 ], [ 186, 187 ], [ 189, 190 ], [ 192, 193 ], [ 195, 196 ], [ 198, 199 ], [ 201, 202 ], [ 204, 205 ], [ 207, 208 ], [ 210, 211 ], [ 213, 214 ], [ 216, 217 ], [ 219, 220 ] ]
[ "import collections as col\n\nA = str(input())\nB = str(input())\nC = str(input())\n\nA_queue = col.deque()\nB_queue = col.deque()\nC_queue = col.deque()\n\nfor i in range (0, len(A)):\n\tA_queue.append(A[i])\nfor i in range (0, len(B)):\n\tB_queue.append(B[i])\nfor i in range (0, len(C)):\n\tC_queue.append(C[i])\n\nD = ['a','b','c']\n \nstart = 0 \nfor i in range (0, 300):\n\tif start == 0:\n\t\tif len(A_queue) == 0:\n\t\t\tprint('A')\n\t\t\texit()\n\t\telse:\n\t\t\tV = A_queue.popleft()\n\t\t\tstart = D.index(V)\n\telif start == 1:\n\t\tif len(B_queue) == 0:\n\t\t\tprint('B')\n\t\t\texit()\n\t\telse:\n\t\t\tV = B_queue.popleft()\n\t\t\tstart = D.index(V) \n\telse:\n\t\tif len(C_queue) == 0:\n\t\t\tprint('C')\n\t\t\texit()\n\t\telse:\n\t\t\tV = C_queue.popleft()\n\t\t\tstart = D.index(V) ", "import collections as col", "collections", "A = str(input())", "A", "str(input())", "str", "input()", "input", "B = str(input())", "B", "str(input())", "str", "input()", "input", "C = str(input())", "C", "str(input())", "str", "input()", "input", "A_queue = col.deque()", "A_queue", "col.deque()", "col.deque", "col", "deque", "B_queue = col.deque()", "B_queue", "col.deque()", "col.deque", "col", "deque", "C_queue = col.deque()", "C_queue", "col.deque()", "col.deque", "col", "deque", "for i in range (0, len(A)):\n\tA_queue.append(A[i])", "i", "range (0, len(A))", "range", "0", "len(A)", "len", "A", "A_queue.append(A[i])", "A_queue.append", "A_queue", "append", "A[i]", "A", "i", "for i in range (0, len(B)):\n\tB_queue.append(B[i])", "i", "range (0, len(B))", "range", "0", "len(B)", "len", "B", "B_queue.append(B[i])", "B_queue.append", "B_queue", "append", "B[i]", "B", "i", "for i in range (0, len(C)):\n\tC_queue.append(C[i])", "i", "range (0, len(C))", "range", "0", "len(C)", "len", "C", "C_queue.append(C[i])", "C_queue.append", "C_queue", "append", "C[i]", "C", "i", "D = ['a','b','c']", "D", "['a','b','c']", "'a'", "'b'", "'c'", "start = 0", "start", "0", "for i in range (0, 300):\n\tif start == 0:\n\t\tif len(A_queue) == 0:\n\t\t\tprint('A')\n\t\t\texit()\n\t\telse:\n\t\t\tV = A_queue.popleft()\n\t\t\tstart = D.index(V)\n\telif start == 1:\n\t\tif len(B_queue) == 0:\n\t\t\tprint('B')\n\t\t\texit()\n\t\telse:\n\t\t\tV = B_queue.popleft()\n\t\t\tstart = D.index(V) \n\telse:\n\t\tif len(C_queue) == 0:\n\t\t\tprint('C')\n\t\t\texit()\n\t\telse:\n\t\t\tV = C_queue.popleft()\n\t\t\tstart = D.index(V) ", "i", "range (0, 300)", "range", "0", "300", "if start == 0:\n\t\tif len(A_queue) == 0:\n\t\t\tprint('A')\n\t\t\texit()\n\t\telse:\n\t\t\tV = A_queue.popleft()\n\t\t\tstart = D.index(V)\n\telif start == 1:\n\t\tif len(B_queue) == 0:\n\t\t\tprint('B')\n\t\t\texit()\n\t\telse:\n\t\t\tV = B_queue.popleft()\n\t\t\tstart = D.index(V) \n\telse:\n\t\tif len(C_queue) == 0:\n\t\t\tprint('C')\n\t\t\texit()\n\t\telse:\n\t\t\tV = C_queue.popleft()\n\t\t\tstart = D.index(V) ", "start == 0", "start", "0", "if len(A_queue) == 0:\n\t\t\tprint('A')\n\t\t\texit()\n\t\telse:\n\t\t\tV = A_queue.popleft()\n\t\t\tstart = D.index(V)\n\t", "len(A_queue) == 0", "len(A_queue)", "len", "A_queue", "0", "print('A')", "print", "'A'", "exit()", "exit", "V = A_queue.popleft()", "V", "A_queue.popleft()", "A_queue.popleft", "A_queue", "popleft", "start = D.index(V)", "start", "D.index(V)", "D.index", "D", "index", "V", "elif start == 1:\n\t\tif len(B_queue) == 0:\n\t\t\tprint('B')\n\t\t\texit()\n\t\telse:\n\t\t\tV = B_queue.popleft()\n\t\t\tstart = D.index(V) \n\t", "start == 1", "start", "1", "if len(B_queue) == 0:\n\t\t\tprint('B')\n\t\t\texit()\n\t\telse:\n\t\t\tV = B_queue.popleft()\n\t\t\tstart = D.index(V) \n\t", "len(B_queue) == 0", "len(B_queue)", "len", "B_queue", "0", "print('B')", "print", "'B'", "exit()", "exit", "V = B_queue.popleft()", "V", "B_queue.popleft()", "B_queue.popleft", "B_queue", "popleft", "start = D.index(V)", "start", "D.index(V)", "D.index", "D", "index", "V", "if len(C_queue) == 0:\n\t\t\tprint('C')\n\t\t\texit()\n\t\telse:\n\t\t\tV = C_queue.popleft()\n\t\t\tstart = D.index(V) ", "len(C_queue) == 0", "len(C_queue)", "len", "C_queue", "0", "print('C')", "print", "'C'", "exit()", "exit", "V = C_queue.popleft()", "V", "C_queue.popleft()", "C_queue.popleft", "C_queue", "popleft", "start = D.index(V)", "start", "D.index(V)", "D.index", "D", "index", "V", "C = str(input())", "str(input())", "C", "V = A_queue.popleft()", "A_queue.popleft()", "V", "A = str(input())", "str(input())", "A", "start = D.index(V)", "D.index(V)", "start", "A_queue = col.deque()", "col.deque()", "A_queue", "B_queue = col.deque()", "col.deque()", "B_queue", "start = D.index(V)", "D.index(V)", "start", "B = str(input())", "str(input())", "B", "V = B_queue.popleft()", "B_queue.popleft()", "V", "start = D.index(V)", "D.index(V)", "start", "V = C_queue.popleft()", "C_queue.popleft()", "V", "D = ['a','b','c']", "['a','b','c']", "D", "start = 0", "0", "start", "C_queue = col.deque()", "col.deque()", "C_queue" ]
import collections as col A = str(input()) B = str(input()) C = str(input()) A_queue = col.deque() B_queue = col.deque() C_queue = col.deque() for i in range (0, len(A)): A_queue.append(A[i]) for i in range (0, len(B)): B_queue.append(B[i]) for i in range (0, len(C)): C_queue.append(C[i]) D = ['a','b','c'] start = 0 for i in range (0, 300): if start == 0: if len(A_queue) == 0: print('A') exit() else: V = A_queue.popleft() start = D.index(V) elif start == 1: if len(B_queue) == 0: print('B') exit() else: V = B_queue.popleft() start = D.index(V) else: if len(C_queue) == 0: print('C') exit() else: V = C_queue.popleft() start = D.index(V)
[ 7, 41, 28, 13, 4, 13, 17, 4, 4, 13, 0, 13, 13, 0, 13, 17, 0, 13, 17, 42, 17, 14, 2, 13, 17, 14, 2, 13, 17, 14, 2, 18, 13, 13, 17, 4, 13, 4, 18, 13, 13, 4, 13, 0, 13, 18, 18, 13, 13, 17, 0, 18, 13, 13, 18, 18, 13, 13, 39, 17, 10, 13, 13, 10, 18, 13, 10, 17, 13, 10, 17, 13 ]
[ [ 4, 3 ], [ 61, 11 ], [ 70, 14 ], [ 67, 17 ], [ 68, 23 ], [ 65, 23 ], [ 68, 27 ], [ 65, 27 ], [ 51, 31 ], [ 62, 32 ], [ 71, 33 ], [ 68, 39 ], [ 65, 39 ], [ 64, 44 ], [ 51, 46 ], [ 62, 47 ], [ 71, 48 ], [ 54, 51 ], [ 62, 52 ], [ 71, 53 ], [ 51, 55 ], [ 62, 56 ], [ 71, 57 ], [ 61, 62 ], [ 64, 65 ], [ 67, 68 ], [ 70, 71 ] ]
[ "s = [input() for i in range(3)]\ndex = 0\nnext = 'a'\nwhile True:\n if next == 'a': dex = 0\n elif next == 'b': dex = 1\n else: dex = 2\n if s[dex] == \"\":\n print(next.upper())\n exit()\n next = s[dex][0]\n s[dex] = s[dex][1:]", "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)]", "dex = 0", "dex", "0", "next = 'a'", "next", "'a'", "while True:\n if next == 'a': dex = 0\n elif next == 'b': dex = 1\n else: dex = 2\n if s[dex] == \"\":\n print(next.upper())\n exit()\n next = s[dex][0]\n s[dex] = s[dex][1:]", "True", "if next == 'a': dex = 0\n elif next == 'b': dex = 1\n else: dex = 2\n ", "next == 'a'", "next", "'a'", "elif next == 'b': dex = 1\n ", "next == 'b'", "next", "'b'", "if s[dex] == \"\":\n print(next.upper())\n exit()\n ", "s[dex] == \"\"", "s[dex]", "s", "dex", "\"\"", "print(next.upper())", "print", "next.upper()", "next.upper", "next", "upper", "exit()", "exit", "next = s[dex][0]", "next", "s[dex][0]", "[dex]", "s", "dex", "0", "s[dex] = s[dex][1:]", "s[dex]", "s", "dex", "s[dex][1:]", "[dex]", "s", "dex", "1:", "1", "s = [input() for i in range(3)]", "[input() for i in range(3)]", "s", "next = s[dex][0]", "s[dex][0]", "next", "next = 'a'", "'a'", "next", "dex = 0", "0", "dex" ]
s = [input() for i in range(3)] dex = 0 next = 'a' while True: if next == 'a': dex = 0 elif next == 'b': dex = 1 else: dex = 2 if s[dex] == "": print(next.upper()) exit() next = s[dex][0] s[dex] = s[dex][1:]
[ 7, 15, 13, 4, 18, 13, 13, 2, 17, 17, 0, 13, 18, 18, 13, 13, 13, 0, 13, 13, 0, 13, 13, 12, 13, 23, 13, 17, 23, 12, 13, 12, 13, 12, 13, 17, 0, 13, 39, 28, 13, 4, 13, 13, 4, 18, 13, 13, 4, 13, 4, 13, 13, 4, 18, 4, 13, 13, 29, 4, 13, 4, 13, 13, 4, 13, 31, 13, 23, 13, 12, 13, 17, 0, 13, 39, 28, 13, 4, 13, 13, 4, 18, 13, 13, 4, 13, 4, 13, 13, 4, 18, 4, 13, 13, 29, 13, 23, 13, 12, 13, 17, 0, 13, 39, 28, 13, 4, 13, 13, 4, 18, 13, 13, 4, 13, 4, 13, 13, 4, 18, 4, 13, 13, 29, 13, 23, 13, 0, 13, 2, 2, 17, 17, 17, 0, 13, 2, 17, 17, 15, 15, 15, 15, 15, 0, 13, 21, 22, 17, 4, 13, 4, 13, 4, 13, 22, 17, 4, 13, 4, 13, 4, 13, 22, 17, 4, 13, 4, 13, 4, 13, 0, 13, 17, 42, 18, 13, 13, 0, 13, 4, 18, 18, 13, 13, 13, 4, 13, 4, 18, 13, 13, 10, 2, 13, 10, 4, 13, 10, 12, 13, 10, 21, 13, 10, 12, 13, 10, 12, 13, 10, 18, 13, 10, 12, 13, 10, 12, 13, 10, 2, 13, 10, 17, 13, 10, 13, 13, 10, 13, 13, 10, 12, 13 ]
[ [ 212, 11 ], [ 230, 18 ], [ 227, 21 ], [ 27, 26 ], [ 38, 37 ], [ 41, 40 ], [ 69, 43 ], [ 37, 46 ], [ 213, 56 ], [ 37, 67 ], [ 69, 69 ], [ 75, 74 ], [ 78, 77 ], [ 98, 80 ], [ 74, 83 ], [ 213, 93 ], [ 74, 96 ], [ 98, 98 ], [ 104, 103 ], [ 107, 106 ], [ 127, 109 ], [ 103, 112 ], [ 213, 122 ], [ 103, 125 ], [ 127, 127 ], [ 194, 129 ], [ 221, 136 ], [ 203, 146 ], [ 224, 173 ], [ 204, 177 ], [ 225, 178 ], [ 198, 178 ], [ 197, 180 ], [ 204, 184 ], [ 225, 185 ], [ 198, 185 ], [ 198, 191 ], [ 225, 191 ], [ 194, 195 ], [ 197, 198 ], [ 203, 204 ], [ 212, 213 ], [ 221, 222 ], [ 224, 225 ], [ 227, 228 ], [ 230, 231 ] ]
[ "import sys\nsys.setrecursionlimit(1 << 25)\nread = sys.stdin.readline\nra = range\nenu = enumerate\n\n\ndef mina(*argv, sub=1): return list(map(lambda x: x - sub, argv))\n# 受け渡されたすべての要素からsubだけ引く.リストを*をつけて展開しておくこと\n\n\ndef read_a_int(): return int(read())\n\n\ndef read_ints(): return list(map(int, read().split()))\n\n\ndef read_col(H):\n '''H is number of rows\n A列、B列が与えられるようなとき\n ex1)A,B=read_col(H) ex2) A,=read_col(H) #一列の場合'''\n ret = []\n for _ in range(H):\n ret.append(list(map(int, read().split())))\n return tuple(map(list, zip(*ret)))\n\n\ndef read_tuple(H):\n '''H is number of rows'''\n ret = []\n for _ in range(H):\n ret.append(tuple(map(int, read().split())))\n return ret\n\n\ndef read_matrix(H):\n '''H is number of rows'''\n ret = []\n for _ in range(H):\n ret.append(list(map(int, read().split())))\n return ret\n # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため\n\n\nMOD = 10**9 + 7\nINF = 2**31 # 2147483648 > 10**9\n# default import\nfrom collections import defaultdict, Counter, deque\nfrom operator import itemgetter\nfrom itertools import product, permutations, combinations\nfrom bisect import bisect_left, bisect_right # , insort_left, insort_right\n# https://atcoder.jp/contests/abc045/tasks/abc045_b\n\n# 愚直シミュレーション\nfrom collections import deque\nS = {'a': deque(list(input())),\n 'b': deque(list(input())),\n 'c': deque(list(input()))}\n\nnow = 'a'\nwhile S[now]:\n now = S[now].popleft()\n\nprint(now.upper())", "import sys", "sys", "sys.setrecursionlimit(1 << 25)", "sys.setrecursionlimit", "sys", "setrecursionlimit", "1 << 25", "1", "25", "read = sys.stdin.readline", "read", "sys.stdin.readline", "sys.stdin", "sys", "stdin", "readline", "ra = range", "ra", "range", "enu = enumerate", "enu", "enumerate", "def mina(*argv, sub=1): return list(map(lambda x: x - sub, argv))\n# 受け渡されたすべての要素からsubだけ引く.リストを*をつけて展開しておくこと", "mina", "sub=1", "sub", "1", "*argv", "def read_a_int(): return int(read())", "read_a_int", "def read_ints(): return list(map(int, read().split()))", "read_ints", "def read_col(H):\n '''H is number of rows\n A列、B列が与えられるようなとき\n ex1)A,B=read_col(H) ex2) A,=read_col(H) #一列の場合'''\n ret = []\n for _ in range(H):\n ret.append(list(map(int, read().split())))\n return tuple(map(list, zip(*ret)))", "read_col", "'''H is number of rows\n A列、B列が与えられるようなとき\n ex1)A,B=read_col(H) ex2) A,=read_col(H) #一列の場合'''", "ret = []", "ret", "[]", "for _ in range(H):\n ret.append(list(map(int, read().split())))\n ", "_", "range(H)", "range", "H", "ret.append(list(map(int, read().split())))", "ret.append", "ret", "append", "list(map(int, read().split()))", "list", "map(int, read().split())", "map", "int", "read().split()", "().split", "()", "read", "split", "return tuple(map(list, zip(*ret)))", "tuple(map(list, zip(*ret)))", "tuple", "map(list, zip(*ret))", "map", "list", "zip(*ret)", "zip", "*ret", "ret", "H", "H", "def read_tuple(H):\n '''H is number of rows'''\n ret = []\n for _ in range(H):\n ret.append(tuple(map(int, read().split())))\n return ret", "read_tuple", "'''H is number of rows'''", "ret = []", "ret", "[]", "for _ in range(H):\n ret.append(tuple(map(int, read().split())))\n ", "_", "range(H)", "range", "H", "ret.append(tuple(map(int, read().split())))", "ret.append", "ret", "append", "tuple(map(int, read().split()))", "tuple", "map(int, read().split())", "map", "int", "read().split()", "().split", "()", "read", "split", "return ret", "ret", "H", "H", "def read_matrix(H):\n '''H is number of rows'''\n ret = []\n for _ in range(H):\n ret.append(list(map(int, read().split())))\n return ret\n # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため", "read_matrix", "'''H is number of rows'''", "ret = []", "ret", "[]", "for _ in range(H):\n ret.append(list(map(int, read().split())))\n ", "_", "range(H)", "range", "H", "ret.append(list(map(int, read().split())))", "ret.append", "ret", "append", "list(map(int, read().split()))", "list", "map(int, read().split())", "map", "int", "read().split()", "().split", "()", "read", "split", "return ret", "ret", "H", "H", "MOD = 10**9 + 7", "MOD", "10**9 + 7", "10**9", "10", "9", "7", "INF = 2**31", "INF", "2**31", "2", "31", "from collections import defaultdict, Counter, deque", "from operator import itemgetter", "from itertools import product, permutations, combinations", "from bisect import bisect_left, bisect_right", "from collections import deque", "S = {'a': deque(list(input())),\n 'b': deque(list(input())),\n 'c': deque(list(input()))}", "S", "{'a': deque(list(input())),\n 'b': deque(list(input())),\n 'c': deque(list(input()))}", "'a'", "'a'", "deque(list(input()))", "deque", "list(input())", "list", "input()", "input", "'b'", "'b'", "deque(list(input()))", "deque", "list(input())", "list", "input()", "input", "'c'", "'c'", "deque(list(input()))", "deque", "list(input())", "list", "input()", "input", "now = 'a'", "now", "'a'", "while S[now]:\n now = S[now].popleft()", "S[now]", "S", "now", "now = S[now].popleft()", "now", "S[now].popleft()", "[now].popleft", "[now]", "S", "now", "popleft", "print(now.upper())", "print", "now.upper()", "now.upper", "now", "upper", "MOD = 10**9 + 7", "10**9 + 7", "MOD", "now = S[now].popleft()", "S[now].popleft()", "now", "def read_ints(): return list(map(int, read().split()))", "def read_ints(): return list(map(int, read().split()))", "read_ints", "S = {'a': deque(list(input())),\n 'b': deque(list(input())),\n 'c': deque(list(input()))}", "{'a': deque(list(input())),\n 'b': deque(list(input())),\n 'c': deque(list(input()))}", "S", "def read_tuple(H):\n '''H is number of rows'''\n ret = []\n for _ in range(H):\n ret.append(tuple(map(int, read().split())))\n return ret", "def read_tuple(H):\n '''H is number of rows'''\n ret = []\n for _ in range(H):\n ret.append(tuple(map(int, read().split())))\n return ret", "read_tuple", "def read_col(H):\n '''H is number of rows\n A列、B列が与えられるようなとき\n ex1)A,B=read_col(H) ex2) A,=read_col(H) #一列の場合'''\n ret = []\n for _ in range(H):\n ret.append(list(map(int, read().split())))\n return tuple(map(list, zip(*ret)))", "def read_col(H):\n '''H is number of rows\n A列、B列が与えられるようなとき\n ex1)A,B=read_col(H) ex2) A,=read_col(H) #一列の場合'''\n ret = []\n for _ in range(H):\n ret.append(list(map(int, read().split())))\n return tuple(map(list, zip(*ret)))", "read_col", "read = sys.stdin.readline", "sys.stdin.readline", "read", "def read_a_int(): return int(read())", "def read_a_int(): return int(read())", "read_a_int", "def read_matrix(H):\n '''H is number of rows'''\n ret = []\n for _ in range(H):\n ret.append(list(map(int, read().split())))\n return ret\n # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため", "def read_matrix(H):\n '''H is number of rows'''\n ret = []\n for _ in range(H):\n ret.append(list(map(int, read().split())))\n return ret\n # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため", "read_matrix", "INF = 2**31", "2**31", "INF", "now = 'a'", "'a'", "now", "enu = enumerate", "enumerate", "enu", "ra = range", "range", "ra", "def mina(*argv, sub=1): return list(map(lambda x: x - sub, argv))\n# 受け渡されたすべての要素からsubだけ引く.リストを*をつけて展開しておくこと", "def mina(*argv, sub=1): return list(map(lambda x: x - sub, argv))\n# 受け渡されたすべての要素からsubだけ引く.リストを*をつけて展開しておくこと", "mina" ]
import sys sys.setrecursionlimit(1 << 25) read = sys.stdin.readline ra = range enu = enumerate def mina(*argv, sub=1): return list(map(lambda x: x - sub, argv)) # 受け渡されたすべての要素からsubだけ引く.リストを*をつけて展開しておくこと def read_a_int(): return int(read()) def read_ints(): return list(map(int, read().split())) def read_col(H): '''H is number of rows A列、B列が与えられるようなとき ex1)A,B=read_col(H) ex2) A,=read_col(H) #一列の場合''' ret = [] for _ in range(H): ret.append(list(map(int, read().split()))) return tuple(map(list, zip(*ret))) def read_tuple(H): '''H is number of rows''' ret = [] for _ in range(H): ret.append(tuple(map(int, read().split()))) return ret def read_matrix(H): '''H is number of rows''' ret = [] for _ in range(H): ret.append(list(map(int, read().split()))) return ret # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため MOD = 10**9 + 7 INF = 2**31 # 2147483648 > 10**9 # default import from collections import defaultdict, Counter, deque from operator import itemgetter from itertools import product, permutations, combinations from bisect import bisect_left, bisect_right # , insort_left, insort_right # https://atcoder.jp/contests/abc045/tasks/abc045_b # 愚直シミュレーション from collections import deque S = {'a': deque(list(input())), 'b': deque(list(input())), 'c': deque(list(input()))} now = 'a' while S[now]: now = S[now].popleft() print(now.upper())
[ 7, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 17, 42, 17, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 4, 13, 17, 3, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 4, 13, 17, 3, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 14, 2, 13, 17, 14, 2, 4, 13, 13, 17, 4, 13, 17, 3, 0, 13, 18, 13, 17, 0, 13, 18, 13, 39, 17, 10, 4, 13, 10, 18, 13, 10, 4, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 18, 13, 10, 4, 13, 10, 17, 13, 10, 18, 13 ]
[ [ 94, 2 ], [ 115, 6 ], [ 100, 10 ], [ 118, 14 ], [ 119, 20 ], [ 110, 20 ], [ 98, 20 ], [ 113, 20 ], [ 95, 26 ], [ 107, 26 ], [ 112, 33 ], [ 95, 35 ], [ 107, 35 ], [ 106, 38 ], [ 95, 40 ], [ 107, 40 ], [ 119, 45 ], [ 110, 45 ], [ 98, 45 ], [ 113, 45 ], [ 116, 51 ], [ 122, 51 ], [ 97, 58 ], [ 116, 60 ], [ 122, 60 ], [ 121, 63 ], [ 116, 65 ], [ 122, 65 ], [ 119, 70 ], [ 110, 70 ], [ 98, 70 ], [ 113, 70 ], [ 101, 76 ], [ 104, 76 ], [ 109, 83 ], [ 101, 85 ], [ 104, 85 ], [ 103, 88 ], [ 101, 90 ], [ 104, 90 ], [ 94, 95 ], [ 97, 98 ], [ 100, 101 ], [ 103, 104 ], [ 106, 107 ], [ 109, 110 ], [ 112, 113 ], [ 115, 116 ], [ 118, 119 ], [ 121, 122 ] ]
[ "sa=input()\nsb=input()\nsc=input()\nx=\"a\"\nwhile True:\n if x==\"a\":\n if len(sa)==0:\n print(\"A\")\n break\n x=sa[0]\n sa=sa[1:]\n elif x==\"b\":\n if len(sb)==0:\n print(\"B\")\n break\n x=sb[0]\n sb=sb[1:]\n elif x==\"c\":\n if len(sc)==0:\n print(\"C\")\n break\n x=sc[0]\n sc=sc[1:] ", "sa=input()", "sa", "input()", "input", "sb=input()", "sb", "input()", "input", "sc=input()", "sc", "input()", "input", "x=\"a\"", "x", "\"a\"", "while True:\n if x==\"a\":\n if len(sa)==0:\n print(\"A\")\n break\n x=sa[0]\n sa=sa[1:]\n elif x==\"b\":\n if len(sb)==0:\n print(\"B\")\n break\n x=sb[0]\n sb=sb[1:]\n elif x==\"c\":\n if len(sc)==0:\n print(\"C\")\n break\n x=sc[0]\n sc=sc[1:] ", "True", "if x==\"a\":\n if len(sa)==0:\n print(\"A\")\n break\n x=sa[0]\n sa=sa[1:]\n elif x==\"b\":\n if len(sb)==0:\n print(\"B\")\n break\n x=sb[0]\n sb=sb[1:]\n elif x==\"c\":\n if len(sc)==0:\n print(\"C\")\n break\n x=sc[0]\n sc=sc[1:] ", "x==\"a\"", "x", "\"a\"", "if len(sa)==0:\n print(\"A\")\n break\n ", "len(sa)==0", "len(sa)", "len", "sa", "0", "print(\"A\")", "print", "\"A\"", "break", "x=sa[0]", "x", "sa[0]", "sa", "0", "sa=sa[1:]", "sa", "sa[1:]", "sa", "1:", "1", "elif x==\"b\":\n if len(sb)==0:\n print(\"B\")\n break\n x=sb[0]\n sb=sb[1:]\n ", "x==\"b\"", "x", "\"b\"", "if len(sb)==0:\n print(\"B\")\n break\n ", "len(sb)==0", "len(sb)", "len", "sb", "0", "print(\"B\")", "print", "\"B\"", "break", "x=sb[0]", "x", "sb[0]", "sb", "0", "sb=sb[1:]", "sb", "sb[1:]", "sb", "1:", "1", "elif x==\"c\":\n if len(sc)==0:\n print(\"C\")\n break\n x=sc[0]\n sc=sc[1:] ", "x==\"c\"", "x", "\"c\"", "if len(sc)==0:\n print(\"C\")\n break\n ", "len(sc)==0", "len(sc)", "len", "sc", "0", "print(\"C\")", "print", "\"C\"", "break", "x=sc[0]", "x", "sc[0]", "sc", "0", "sc=sc[1:]", "sc", "sc[1:]", "sc", "1:", "1", "sa=input()", "input()", "sa", "x=sb[0]", "sb[0]", "x", "sc=input()", "input()", "sc", "sc=sc[1:]", "sc[1:]", "sc", "sa=sa[1:]", "sa[1:]", "sa", "x=sc[0]", "sc[0]", "x", "x=sa[0]", "sa[0]", "x", "sb=input()", "input()", "sb", "x=\"a\"", "\"a\"", "x", "sb=sb[1:]", "sb[1:]", "sb" ]
sa=input() sb=input() sc=input() x="a" while True: if x=="a": if len(sa)==0: print("A") break x=sa[0] sa=sa[1:] elif x=="b": if len(sb)==0: print("B") break x=sb[0] sb=sb[1:] elif x=="c": if len(sc)==0: print("C") break x=sc[0] sc=sc[1:]
[ 7, 0, 13, 21, 22, 17, 39, 22, 17, 39, 22, 17, 39, 0, 13, 21, 28, 13, 13, 0, 18, 13, 13, 4, 13, 4, 13, 12, 4, 18, 13, 13, 23, 4, 13, 0, 13, 17, 38, 5, 4, 13, 13, 42, 17, 0, 13, 4, 18, 18, 13, 13, 13, 17, 10, 21, 13, 10, 4, 13, 10, 17, 13, 10, 21, 13 ]
[ [ 64, 2 ], [ 64, 14 ], [ 18, 17 ], [ 56, 17 ], [ 65, 17 ], [ 23, 20 ], [ 56, 21 ], [ 65, 21 ], [ 17, 22 ], [ 61, 36 ], [ 62, 42 ], [ 58, 46 ], [ 56, 50 ], [ 65, 50 ], [ 62, 51 ], [ 59, 51 ], [ 64, 56 ], [ 58, 59 ], [ 61, 62 ], [ 64, 65 ] ]
[ "S=S={\"A\":[],\"B\":[],\"C\":[]}\nfor X in S:\n S[X]=list(map(lambda x:x.upper(),input()))\n\nT=\"A\"\ntry:\n while True:\n T=S[T].pop(0)\nexcept:\n print(T)", "S=S={\"A\":[],\"B\":[],\"C\":[]}", "S", "{\"A\":[],\"B\":[],\"C\":[]}", "\"A\"", "\"A\"", "[]", "\"B\"", "\"B\"", "[]", "\"C\"", "\"C\"", "[]", "=S={\"A\":[],\"B\":[],\"C\":[]}", "S", "{\"A\":[],\"B\":[],\"C\":[]}", "for X in S:\n S[X]=list(map(lambda x:x.upper(),input()))", "X", "S", "S[X]=list(map(lambda x:x.upper(),input()))", "S[X]", "S", "X", "list(map(lambda x:x.upper(),input()))", "list", "map(lambda x:x.upper(),input())", "map", "lambda x:x.upper()", "x.upper()", "x.upper", "x", "upper", "x", "input()", "input", "T=\"A\"", "T", "\"A\"", "try:\n while True:\n T=S[T].pop(0)\nexcept:\n print(T)", "except:\n print(T)", "print(T)", "print", "T", "while True:\n T=S[T].pop(0)", "True", "T=S[T].pop(0)", "T", "S[T].pop(0)", "[T].pop", "[T]", "S", "T", "pop", "0", "S={\"A\":[],\"B\":[],\"C\":[]}", "{\"A\":[],\"B\":[],\"C\":[]}", "S", "T=S[T].pop(0)", "S[T].pop(0)", "T", "T=\"A\"", "\"A\"", "T", "S=S={\"A\":[],\"B\":[],\"C\":[]}", "{\"A\":[],\"B\":[],\"C\":[]}", "S" ]
S=S={"A":[],"B":[],"C":[]} for X in S: S[X]=list(map(lambda x:x.upper(),input())) T="A" try: while True: T=S[T].pop(0) except: print(T)
[ 7, 0, 13, 39, 4, 13, 4, 13, 4, 13, 0, 13, 39, 17, 17, 17, 0, 13, 39, 17, 17, 17, 13, 17, 42, 17, 0, 13, 18, 18, 13, 13, 18, 13, 13, 0, 18, 13, 13, 17, 0, 13, 4, 18, 13, 13, 13, 14, 40, 18, 13, 13, 4, 13, 18, 13, 13, 4, 13, 4, 18, 18, 13, 13, 13, 3, 10, 39, 13, 10, 18, 13, 10, 39, 13, 10, 4, 13, 10, 39, 13, 10, 17, 13 ]
[ [ 67, 2 ], [ 73, 11 ], [ 79, 17 ], [ 82, 22 ], [ 70, 27 ], [ 68, 30 ], [ 83, 31 ], [ 77, 31 ], [ 36, 32 ], [ 80, 33 ], [ 83, 34 ], [ 77, 34 ], [ 39, 36 ], [ 80, 37 ], [ 83, 38 ], [ 77, 38 ], [ 76, 41 ], [ 74, 44 ], [ 71, 46 ], [ 36, 49 ], [ 80, 50 ], [ 77, 51 ], [ 83, 51 ], [ 68, 55 ], [ 77, 56 ], [ 83, 56 ], [ 74, 62 ], [ 77, 63 ], [ 83, 63 ], [ 67, 68 ], [ 70, 71 ], [ 73, 74 ], [ 76, 77 ], [ 79, 80 ], [ 82, 83 ] ]
[ "strin = [input(), input(), input()]\n\nl = ['a','b','c']\ncnt, nxt = [0, 0, 0], 0\nwhile True:\n lttr = strin[nxt][cnt[nxt]]\n cnt[nxt] += 1\n nxt = l.index(lttr)\n if cnt[nxt] >= len(strin[nxt]):\n print(l[nxt].upper())\n break", "strin = [input(), input(), input()]", "strin", "[input(), input(), input()]", "input()", "input", "input()", "input", "input()", "input", "l = ['a','b','c']", "l", "['a','b','c']", "'a'", "'b'", "'c'", "cnt, nxt = [0, 0, 0], 0", "cnt", "[0, 0, 0]", "0", "0", "0", "nxt", "0", "while True:\n lttr = strin[nxt][cnt[nxt]]\n cnt[nxt] += 1\n nxt = l.index(lttr)\n if cnt[nxt] >= len(strin[nxt]):\n print(l[nxt].upper())\n break", "True", "lttr = strin[nxt][cnt[nxt]]", "lttr", "strin[nxt][cnt[nxt]]", "[nxt]", "strin", "nxt", "cnt[nxt]", "cnt", "nxt", "cnt[nxt] += 1", "cnt[nxt]", "cnt", "nxt", "1", "nxt = l.index(lttr)", "nxt", "l.index(lttr)", "l.index", "l", "index", "lttr", "if cnt[nxt] >= len(strin[nxt]):\n print(l[nxt].upper())\n break", "cnt[nxt] >= len(strin[nxt])", "cnt[nxt]", "cnt", "nxt", "len(strin[nxt])", "len", "strin[nxt]", "strin", "nxt", "print(l[nxt].upper())", "print", "l[nxt].upper()", "[nxt].upper", "[nxt]", "l", "nxt", "upper", "break", "strin = [input(), input(), input()]", "[input(), input(), input()]", "strin", "lttr = strin[nxt][cnt[nxt]]", "strin[nxt][cnt[nxt]]", "lttr", "l = ['a','b','c']", "['a','b','c']", "l", "nxt = l.index(lttr)", "l.index(lttr)", "nxt", "cnt, nxt = [0, 0, 0], 0", "[0, 0, 0]", "cnt", "nxt = [0, 0, 0], 0", "0", "nxt" ]
strin = [input(), input(), input()] l = ['a','b','c'] cnt, nxt = [0, 0, 0], 0 while True: lttr = strin[nxt][cnt[nxt]] cnt[nxt] += 1 nxt = l.index(lttr) if cnt[nxt] >= len(strin[nxt]): print(l[nxt].upper()) break
[ 7, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 17, 0, 18, 13, 17, 13, 0, 18, 13, 17, 13, 0, 18, 13, 17, 13, 0, 13, 17, 0, 13, 17, 42, 40, 13, 17, 14, 2, 18, 13, 13, 17, 0, 13, 17, 4, 13, 4, 18, 13, 13, 0, 13, 4, 13, 18, 13, 13, 0, 13, 18, 18, 13, 13, 17, 0, 18, 13, 13, 18, 18, 13, 13, 39, 17, 13, 0, 13, 13, 10, 17, 13, 10, 4, 13, 10, 4, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 4, 13, 10, 18, 13, 10, 17, 13, 10, 13, 13 ]
[ [ 97, 2 ], [ 91, 6 ], [ 103, 10 ], [ 85, 14 ], [ 20, 17 ], [ 86, 18 ], [ 98, 20 ], [ 25, 22 ], [ 86, 23 ], [ 92, 25 ], [ 30, 27 ], [ 86, 28 ], [ 104, 30 ], [ 109, 32 ], [ 94, 35 ], [ 110, 39 ], [ 101, 39 ], [ 71, 43 ], [ 86, 44 ], [ 95, 45 ], [ 113, 45 ], [ 100, 48 ], [ 95, 54 ], [ 113, 54 ], [ 88, 57 ], [ 71, 60 ], [ 86, 61 ], [ 95, 62 ], [ 113, 62 ], [ 106, 64 ], [ 71, 66 ], [ 86, 67 ], [ 95, 68 ], [ 113, 68 ], [ 74, 71 ], [ 86, 72 ], [ 95, 73 ], [ 113, 73 ], [ 71, 75 ], [ 86, 76 ], [ 95, 77 ], [ 113, 77 ], [ 112, 82 ], [ 107, 83 ], [ 85, 86 ], [ 88, 89 ], [ 91, 92 ], [ 94, 95 ], [ 97, 98 ], [ 100, 101 ], [ 103, 104 ], [ 106, 107 ], [ 109, 110 ], [ 107, 112 ], [ 112, 113 ] ]
[ "first = input()\nsecond = input()\nthird = input()\n\nd = {}\nd[\"a\"]=first\nd[\"b\"]=second\nd[\"c\"]=third\n\n\nflag = False\nrun = \"a\"\nwhile flag != True:\n \n if d[run] == \"\":\n flag = True\n print(run.upper())\n else:\n l = len(d[run])\n temp = d[run][0]\n \n d[run] = d[run][1:l]\n \n run = temp", "first = input()", "first", "input()", "input", "second = input()", "second", "input()", "input", "third = input()", "third", "input()", "input", "d = {}", "d", "{}", "d[\"a\"]=first", "d[\"a\"]", "d", "\"a\"", "first", "d[\"b\"]=second", "d[\"b\"]", "d", "\"b\"", "second", "d[\"c\"]=third", "d[\"c\"]", "d", "\"c\"", "third", "flag = False", "flag", "False", "run = \"a\"", "run", "\"a\"", "while flag != True:\n \n if d[run] == \"\":\n flag = True\n print(run.upper())\n else:\n l = len(d[run])\n temp = d[run][0]\n \n d[run] = d[run][1:l]\n \n run = temp", "flag != True", "flag", "True", "if d[run] == \"\":\n flag = True\n print(run.upper())\n else:\n l = len(d[run])\n temp = d[run][0]\n \n d[run] = d[run][1:l]\n \n run = temp", "d[run] == \"\"", "d[run]", "d", "run", "\"\"", "flag = True", "flag", "True", "print(run.upper())", "print", "run.upper()", "run.upper", "run", "upper", "l = len(d[run])", "l", "len(d[run])", "len", "d[run]", "d", "run", "temp = d[run][0]", "temp", "d[run][0]", "[run]", "d", "run", "0", "d[run] = d[run][1:l]", "d[run]", "d", "run", "d[run][1:l]", "[run]", "d", "run", "1:l", "1", "l", "run = temp", "run", "temp", "d = {}", "{}", "d", "l = len(d[run])", "len(d[run])", "l", "second = input()", "input()", "second", "run = \"a\"", "\"a\"", "run", "first = input()", "input()", "first", "flag = True", "True", "flag", "third = input()", "input()", "third", "temp = d[run][0]", "d[run][0]", "temp", "flag = False", "False", "flag", "run = temp", "temp", "run" ]
first = input() second = input() third = input() d = {} d["a"]=first d["b"]=second d["c"]=third flag = False run = "a" while flag != True: if d[run] == "": flag = True print(run.upper()) else: l = len(d[run]) temp = d[run][0] d[run] = d[run][1:l] run = temp
[ 7, 15, 13, 15, 15, 12, 13, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 4, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 0, 13, 17, 42, 17, 14, 2, 13, 17, 14, 2, 13, 4, 13, 13, 4, 13, 17, 29, 0, 13, 18, 13, 13, 0, 13, 17, 14, 2, 13, 17, 14, 2, 13, 4, 13, 13, 4, 13, 17, 29, 0, 13, 18, 13, 13, 0, 13, 17, 14, 2, 13, 4, 13, 13, 4, 13, 17, 29, 0, 13, 18, 13, 13, 0, 13, 17, 0, 13, 17, 28, 13, 4, 13, 17, 2, 13, 17, 0, 13, 4, 13, 17, 10, 12, 13, 10, 4, 13, 10, 17, 13 ]
[ [ 9, 8 ], [ 13, 12 ], [ 17, 16 ], [ 21, 20 ], [ 24, 23 ], [ 27, 26 ], [ 30, 29 ], [ 29, 35 ], [ 88, 35 ], [ 70, 35 ], [ 48, 35 ], [ 20, 39 ], [ 53, 39 ], [ 8, 42 ], [ 49, 48 ], [ 8, 50 ], [ 20, 51 ], [ 53, 51 ], [ 54, 53 ], [ 29, 57 ], [ 88, 57 ], [ 70, 57 ], [ 48, 57 ], [ 23, 61 ], [ 75, 61 ], [ 12, 64 ], [ 71, 70 ], [ 12, 72 ], [ 23, 73 ], [ 75, 73 ], [ 76, 75 ], [ 26, 79 ], [ 93, 79 ], [ 16, 82 ], [ 89, 88 ], [ 16, 90 ], [ 26, 91 ], [ 93, 91 ], [ 94, 93 ], [ 118, 96 ], [ 100, 99 ], [ 119, 104 ], [ 115, 107 ], [ 113, 109 ], [ 115, 116 ], [ 118, 119 ] ]
[ "# -*- coding: utf-8 -*-\nimport sys\nfrom collections import deque, defaultdict\nfrom math import sqrt, factorial, gcd\n# def input(): return sys.stdin.readline()[:-1] # warning not \\n\n# def input(): return sys.stdin.buffer.readline().strip() # warning bytes\n# def input(): return sys.stdin.buffer.readline().decode('utf-8')\n\n\ndef solve():\n a = input()\n b = input()\n c = input()\n i = 0\n j = 0\n k = 0\n t = 'a'\n while 1:\n if t == 'a':\n if i == len(a):\n print('A')\n return\n t = a[i]\n i += 1\n elif t == 'b':\n if j == len(b):\n print('B')\n return\n t = b[j]\n j += 1\n else:\n if k == len(c):\n print('C')\n return\n t = c[k]\n k += 1\n \n \nt = 1\n# t = int(input())\nfor case in range(1,t+1):\n ans = solve()\n\n\n\"\"\"\n\n7\n3 1\n4 1\n5 9\n2 6\n5 3\n5 8\n9 7 5\n\n\"\"\"", "import sys", "sys", "from collections import deque, defaultdict", "from math import sqrt, factorial, gcd", "def solve():\n a = input()\n b = input()\n c = input()\n i = 0\n j = 0\n k = 0\n t = 'a'\n while 1:\n if t == 'a':\n if i == len(a):\n print('A')\n return\n t = a[i]\n i += 1\n elif t == 'b':\n if j == len(b):\n print('B')\n return\n t = b[j]\n j += 1\n else:\n if k == len(c):\n print('C')\n return\n t = c[k]\n k += 1\n \n ", "solve", "a = input()", "a", "input()", "input", "b = input()", "b", "input()", "input", "c = input()", "c", "input()", "input", "i = 0", "i", "0", "j = 0", "j", "0", "k = 0", "k", "0", "t = 'a'", "t", "'a'", "while 1:\n if t == 'a':\n if i == len(a):\n print('A')\n return\n t = a[i]\n i += 1\n elif t == 'b':\n if j == len(b):\n print('B')\n return\n t = b[j]\n j += 1\n else:\n if k == len(c):\n print('C')\n return\n t = c[k]\n k += 1\n \n ", "1", "if t == 'a':\n if i == len(a):\n print('A')\n return\n t = a[i]\n i += 1\n elif t == 'b':\n if j == len(b):\n print('B')\n return\n t = b[j]\n j += 1\n else:\n if k == len(c):\n print('C')\n return\n t = c[k]\n k += 1\n \n ", "t == 'a'", "t", "'a'", "if i == len(a):\n print('A')\n return\n ", "i == len(a)", "i", "len(a)", "len", "a", "print('A')", "print", "'A'", "return", "t = a[i]", "t", "a[i]", "a", "i", "i += 1", "i", "1", "elif t == 'b':\n if j == len(b):\n print('B')\n return\n t = b[j]\n j += 1\n ", "t == 'b'", "t", "'b'", "if j == len(b):\n print('B')\n return\n ", "j == len(b)", "j", "len(b)", "len", "b", "print('B')", "print", "'B'", "return", "t = b[j]", "t", "b[j]", "b", "j", "j += 1", "j", "1", "if k == len(c):\n print('C')\n return\n ", "k == len(c)", "k", "len(c)", "len", "c", "print('C')", "print", "'C'", "return", "t = c[k]", "t", "c[k]", "c", "k", "k += 1", "k", "1", "t = 1", "t", "1", "for case in range(1,t+1):\n ans = solve()", "case", "range(1,t+1)", "range", "1", "t+1", "t", "1", "ans = solve()", "ans", "solve()", "solve", "\"\"\"\n\n7\n3 1\n4 1\n5 9\n2 6\n5 3\n5 8\n9 7 5\n\n\"\"\"", "def solve():\n a = input()\n b = input()\n c = input()\n i = 0\n j = 0\n k = 0\n t = 'a'\n while 1:\n if t == 'a':\n if i == len(a):\n print('A')\n return\n t = a[i]\n i += 1\n elif t == 'b':\n if j == len(b):\n print('B')\n return\n t = b[j]\n j += 1\n else:\n if k == len(c):\n print('C')\n return\n t = c[k]\n k += 1\n \n ", "def solve():\n a = input()\n b = input()\n c = input()\n i = 0\n j = 0\n k = 0\n t = 'a'\n while 1:\n if t == 'a':\n if i == len(a):\n print('A')\n return\n t = a[i]\n i += 1\n elif t == 'b':\n if j == len(b):\n print('B')\n return\n t = b[j]\n j += 1\n else:\n if k == len(c):\n print('C')\n return\n t = c[k]\n k += 1\n \n ", "solve", "ans = solve()", "solve()", "ans", "t = 1", "1", "t" ]
# -*- coding: utf-8 -*- import sys from collections import deque, defaultdict from math import sqrt, factorial, gcd # def input(): return sys.stdin.readline()[:-1] # warning not \n # def input(): return sys.stdin.buffer.readline().strip() # warning bytes # def input(): return sys.stdin.buffer.readline().decode('utf-8') def solve(): a = input() b = input() c = input() i = 0 j = 0 k = 0 t = 'a' while 1: if t == 'a': if i == len(a): print('A') return t = a[i] i += 1 elif t == 'b': if j == len(b): print('B') return t = b[j] j += 1 else: if k == len(c): print('C') return t = c[k] k += 1 t = 1 # t = int(input()) for case in range(1,t+1): ans = solve() """ 7 3 1 4 1 5 9 2 6 5 3 5 8 9 7 5 """
[ 7, 15, 0, 13, 4, 13, 13, 4, 18, 4, 13, 13, 13, 13, 0, 13, 39, 28, 13, 4, 13, 13, 0, 13, 4, 13, 13, 4, 18, 4, 13, 13, 13, 28, 13, 4, 13, 17, 28, 13, 4, 13, 17, 14, 2, 40, 40, 17, 2, 13, 13, 2, 13, 17, 40, 40, 17, 2, 13, 13, 2, 13, 17, 4, 18, 13, 13, 39, 2, 13, 13, 2, 13, 13, 0, 13, 4, 13, 13, 41, 28, 13, 4, 13, 17, 4, 17, 0, 13, 13, 0, 13, 17, 28, 13, 13, 0, 18, 13, 18, 13, 13, 17, 0, 13, 17, 0, 18, 13, 17, 2, 2, 2, 13, 17, 2, 13, 17, 13, 28, 13, 13, 4, 13, 13, 10, 13, 13, 10, 4, 13, 10, 4, 13, 10, 39, 13, 10, 17, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 17, 13, 10, 4, 13 ]
[ [ 141, 3 ], [ 141, 12 ], [ 141, 13 ], [ 135, 15 ], [ 19, 18 ], [ 133, 21 ], [ 147, 23 ], [ 147, 32 ], [ 35, 34 ], [ 40, 39 ], [ 148, 49 ], [ 34, 50 ], [ 142, 52 ], [ 145, 58 ], [ 39, 59 ], [ 130, 61 ], [ 136, 65 ], [ 148, 69 ], [ 34, 70 ], [ 145, 72 ], [ 39, 73 ], [ 153, 75 ], [ 136, 78 ], [ 82, 81 ], [ 126, 88 ], [ 150, 91 ], [ 95, 94 ], [ 154, 94 ], [ 102, 97 ], [ 127, 98 ], [ 154, 100 ], [ 94, 101 ], [ 138, 104 ], [ 110, 107 ], [ 127, 108 ], [ 142, 113 ], [ 130, 116 ], [ 139, 118 ], [ 151, 118 ], [ 121, 120 ], [ 127, 120 ], [ 120, 124 ], [ 126, 127 ], [ 141, 130 ], [ 141, 133 ], [ 135, 136 ], [ 138, 139 ], [ 141, 142 ], [ 147, 145 ], [ 147, 148 ], [ 150, 151 ], [ 153, 154 ] ]
[ "# ABC 045 D\nfrom collections import Counter\nH, W, N = map(int, input().split())\nL = []\nfor k in range(N):\n a, b = map(int, input().split())\n for k in range(3):\n for l in range(3):\n if 1 <= a-k <= H-2 and 1 <= b-l <= W-2:\n L.append((a-k,b-l))\n\nM = Counter(L)\nA = [0 for k in range(10)]\ns = 0\nfor e in M:\n A[M[e]] += 1\n s += 1\n\nA[0] = (H-2)*(W-2)-s\nfor a in A:\n print(a)", "from collections import Counter", "H, W, N = map(int, input().split())", "H", "map(int, input().split())", "map", "int", "input().split()", "().split", "()", "input", "split", "W", "N", "L = []", "L", "[]", "for k in range(N):\n a, b = map(int, input().split())\n for k in range(3):\n for l in range(3):\n if 1 <= a-k <= H-2 and 1 <= b-l <= W-2:\n L.append((a-k,b-l))", "k", "range(N)", "range", "N", "a, b = map(int, input().split())", "a", "map(int, input().split())", "map", "int", "input().split()", "().split", "()", "input", "split", "b", "for k in range(3):\n for l in range(3):\n if 1 <= a-k <= H-2 and 1 <= b-l <= W-2:\n L.append((a-k,b-l))", "k", "range(3)", "range", "3", "for l in range(3):\n if 1 <= a-k <= H-2 and 1 <= b-l <= W-2:\n L.append((a-k,b-l))", "l", "range(3)", "range", "3", "if 1 <= a-k <= H-2 and 1 <= b-l <= W-2:\n L.append((a-k,b-l))", "1 <= a-k <= H-2 and 1 <= b-l <= W-2", "1 <= a-k <= H-2", "1 <= a-k", "1", "a-k", "a", "k", "H-2", "H", "2", "1 <= b-l <= W-2", "1 <= b-l", "1", "b-l", "b", "l", "W-2", "W", "2", "L.append((a-k,b-l))", "L.append", "L", "append", "(a-k,b-l)", "a-k", "a", "k", "b-l", "b", "l", "M = Counter(L)", "M", "Counter(L)", "Counter", "L", "0 for k in range(10)", "for k in range(10)", "k", "range(10)", "range", "10", "for k in range(10)", "0", "A = [0 for k in range(10)]", "A", "[0 for k in range(10)]", "s = 0", "s", "0", "for e in M:\n A[M[e]] += 1\n s += 1", "e", "M", "A[M[e]] += 1", "A[M[e]]", "A", "M[e]", "M", "e", "1", "s += 1", "s", "1", "A[0] = (H-2)*(W-2)-s", "A[0]", "A", "0", "(H-2)*(W-2)-s", "(H-2)*(W-2)", "H-2", "H", "2", "W-2", "W", "2", "s", "for a in A:\n print(a)", "a", "A", "print(a)", "print", "a", "A = [0 for k in range(10)]", "[0 for k in range(10)]", "A", "W, N = map(int, input().split())", "map(int, input().split())", "W", "N = map(int, input().split())", "map(int, input().split())", "N", "L = []", "[]", "L", "s += 1", "1", "s", "H, W, N = map(int, input().split())", "map(int, input().split())", "H", "b = map(int, input().split())", "map(int, input().split())", "b", "a, b = map(int, input().split())", "map(int, input().split())", "a", "s = 0", "0", "s", "M = Counter(L)", "Counter(L)", "M" ]
# ABC 045 D from collections import Counter H, W, N = map(int, input().split()) L = [] for k in range(N): a, b = map(int, input().split()) for k in range(3): for l in range(3): if 1 <= a-k <= H-2 and 1 <= b-l <= W-2: L.append((a-k,b-l)) M = Counter(L) A = [0 for k in range(10)] s = 0 for e in M: A[M[e]] += 1 s += 1 A[0] = (H-2)*(W-2)-s for a in A: print(a)
[ 7, 15, 0, 13, 4, 13, 13, 4, 18, 4, 18, 4, 13, 17, 13, 13, 13, 13, 31, 13, 0, 13, 4, 13, 13, 28, 13, 13, 4, 13, 31, 2, 39, 4, 13, 13, 17, 0, 13, 17, 0, 13, 17, 28, 13, 4, 13, 17, 0, 18, 13, 2, 2, 13, 17, 2, 13, 17, 17, 0, 13, 2, 39, 17, 17, 28, 39, 13, 13, 13, 4, 18, 13, 13, 0, 18, 13, 13, 2, 2, 2, 2, 2, 13, 17, 13, 17, 13, 2, 13, 17, 0, 18, 13, 17, 2, 2, 2, 13, 17, 2, 13, 17, 4, 13, 13, 4, 13, 31, 13, 10, 4, 13, 10, 2, 13, 10, 4, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 4, 13 ]
[ [ 129, 3 ], [ 129, 16 ], [ 129, 17 ], [ 129, 18 ], [ 123, 21 ], [ 120, 38 ], [ 126, 41 ], [ 45, 44 ], [ 58, 49 ], [ 124, 50 ], [ 121, 53 ], [ 44, 56 ], [ 114, 60 ], [ 124, 72 ], [ 78, 75 ], [ 115, 76 ], [ 112, 83 ], [ 127, 85 ], [ 121, 87 ], [ 118, 89 ], [ 95, 92 ], [ 115, 93 ], [ 118, 98 ], [ 112, 101 ], [ 115, 105 ], [ 115, 109 ], [ 129, 112 ], [ 114, 115 ], [ 129, 118 ], [ 120, 121 ], [ 123, 124 ], [ 126, 127 ], [ 129, 130 ] ]
[ "from collections import defaultdict\n\n縦, 横, _, *点 = map(int, open(0).read().split())\n\nあー = defaultdict(int)\nfor y, x in zip(*[iter(点)]*2):\n y -= 1; x -= 1\n for i in range(9):\n あー[y - 1 + i//3, x - 1 + i%3] += 1\n\n答 = [0] * 10\nfor [y, x], c in あー.items():\n 答[c] += 横 - 1 > x > 0 < y < 縦 - 1\n答[0] = (縦 - 2) * (横 - 2) - sum(答)\nprint(*答)", "from collections import defaultdict", "縦, 横, _, *点 = map(int, open(0).read().split())", "縦", "map(int, open(0).read().split())", "map", "int", "open(0).read().split()", "(0).read().split", "(0).read()", "(0).read", "(0)", "open", "0", "read", "split", "横", "_", "*点", "点", "あー = defaultdict(int)", "あー", "defaultdict(int)", "defaultdict", "int", "for y, x in zip(*[iter(点)]*2):\n y -= 1; x -= 1\n for i in range(9):\n あー[y - 1 + i//3, x - 1 + i%3] += 1", "y", "x", "zip(*[iter(点)]*2)", "zip", "*[iter(点)]*2", "[iter(点)]*2", "[iter(点)]", "iter(点)", "iter", "点", "2", "y -= 1", "y", "1", "x -= 1", "x", "1", "for i in range(9):\n あー[y - 1 + i//3, x - 1 + i%3] += 1", "i", "range(9)", "range", "9", "あー[y - 1 + i//3, x - 1 + i%3] += 1", "あー[y - 1 + i//3, x - 1 + i%3]", "あー", "y - 1 + i//3", "y - 1", "y", "1", "i//3", "i", "3", "1", "答 = [0] * 10", "答", "[0] * 10", "[0]", "0", "10", "for [y, x], c in あー.items():\n 答[c] += 横 - 1 > x > 0 < y < 縦 - 1", "[y, x]", "y", "x", "c", "あー.items()", "あー.items", "あー", "items", "答[c] += 横 - 1 > x > 0 < y < 縦 - 1", "答[c]", "答", "c", "横 - 1 > x > 0 < y < 縦 - 1", "横 - 1 > x > 0 < y", "横 - 1 > x > 0", "横 - 1 > x", "横 - 1", "横", "1", "x", "0", "y", "縦 - 1", "縦", "1", "答[0] = (縦 - 2) * (横 - 2) - sum(答)", "答[0]", "答", "0", "(縦 - 2) * (横 - 2) - sum(答)", "(縦 - 2) * (横 - 2)", "縦 - 2", "縦", "2", "横 - 2", "横", "2", "sum(答)", "sum", "答", "print(*答)", "print", "*答", "答", "横, _, *点 = map(int, open(0).read().split())", "map(int, open(0).read().split())", "横", "答 = [0] * 10", "[0] * 10", "答", "縦, 横, _, *点 = map(int, open(0).read().split())", "map(int, open(0).read().split())", "縦", "y -= 1", "1", "y", "あー = defaultdict(int)", "defaultdict(int)", "あー", "x -= 1", "1", "x", "_, *点 = map(int, open(0).read().split())", "map(int, open(0).read().split())", "_" ]
from collections import defaultdict 縦, 横, _, *点 = map(int, open(0).read().split()) あー = defaultdict(int) for y, x in zip(*[iter(点)]*2): y -= 1; x -= 1 for i in range(9): あー[y - 1 + i//3, x - 1 + i%3] += 1 答 = [0] * 10 for [y, x], c in あー.items(): 答[c] += 横 - 1 > x > 0 < y < 縦 - 1 答[0] = (縦 - 2) * (横 - 2) - sum(答) print(*答)
[ 7, 15, 0, 13, 4, 13, 13, 4, 18, 4, 13, 13, 13, 13, 41, 28, 13, 4, 13, 13, 4, 4, 13, 4, 13, 13, 4, 18, 4, 13, 13, 0, 13, 13, 0, 13, 39, 17, 17, 17, 0, 13, 4, 13, 28, 13, 13, 13, 28, 13, 13, 28, 13, 13, 0, 13, 2, 13, 13, 0, 13, 2, 13, 13, 14, 2, 40, 40, 17, 13, 2, 13, 17, 40, 40, 17, 13, 2, 13, 17, 0, 18, 13, 39, 13, 13, 17, 0, 13, 4, 13, 4, 18, 13, 13, 0, 13, 2, 2, 2, 13, 17, 2, 13, 17, 4, 13, 4, 18, 13, 13, 4, 13, 13, 28, 13, 4, 13, 17, 17, 4, 13, 18, 13, 13, 10, 13, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 2, 13, 10, 39, 13, 10, 2, 13, 10, 4, 13, 10, 2, 13 ]
[ [ 150, 3 ], [ 150, 12 ], [ 150, 13 ], [ 17, 16 ], [ 130, 19 ], [ 126, 32 ], [ 144, 35 ], [ 135, 41 ], [ 50, 49 ], [ 145, 49 ], [ 53, 52 ], [ 145, 52 ], [ 147, 55 ], [ 49, 58 ], [ 153, 60 ], [ 52, 63 ], [ 148, 69 ], [ 151, 71 ], [ 154, 76 ], [ 133, 78 ], [ 86, 81 ], [ 136, 82 ], [ 138, 88 ], [ 136, 93 ], [ 141, 96 ], [ 151, 100 ], [ 133, 103 ], [ 139, 109 ], [ 142, 113 ], [ 116, 115 ], [ 139, 123 ], [ 115, 124 ], [ 126, 127 ], [ 150, 130 ], [ 150, 133 ], [ 135, 136 ], [ 138, 139 ], [ 141, 142 ], [ 144, 145 ], [ 147, 148 ], [ 150, 151 ], [ 153, 154 ] ]
[ "from collections import Counter\nh,w,n=map(int,input().split())\nab=[list(map(int,input().split())) for i in range(n)]\nd=(-1,0,1)\nc=Counter()\nfor a,b in ab:\n for da in d:\n for db in d:\n aa=a+da\n bb=b+db\n if 2<=aa<=h-1 and 2<=bb<=w-1:\n c[(aa,bb)]+=1\nans=Counter(c.values())\ncount_0=(h-2)*(w-2)-sum(ans.values())\nprint(count_0)\nfor i in range(1,10):\n print(ans[i])", "from collections import Counter", "h,w,n=map(int,input().split())", "h", "map(int,input().split())", "map", "int", "input().split()", "().split", "()", "input", "split", "w", "n", "list(map(int,input().split())) for i in range(n)", "for i in range(n)", "i", "range(n)", "range", "n", "for i in range(n)", "list(map(int,input().split()))", "list", "map(int,input().split())", "map", "int", "input().split()", "().split", "()", "input", "split", "ab=[list(map(int,input().split())) for i in range(n)]", "ab", "[list(map(int,input().split())) for i in range(n)]", "d=(-1,0,1)", "d", "(-1,0,1)", "-1", "0", "1", "c=Counter()", "c", "Counter()", "Counter", "for a,b in ab:\n for da in d:\n for db in d:\n aa=a+da\n bb=b+db\n if 2<=aa<=h-1 and 2<=bb<=w-1:\n c[(aa,bb)]+=1", "a", "b", "ab", "for da in d:\n for db in d:\n aa=a+da\n bb=b+db\n if 2<=aa<=h-1 and 2<=bb<=w-1:\n c[(aa,bb)]+=1", "da", "d", "for db in d:\n aa=a+da\n bb=b+db\n if 2<=aa<=h-1 and 2<=bb<=w-1:\n c[(aa,bb)]+=1", "db", "d", "aa=a+da", "aa", "a+da", "a", "da", "bb=b+db", "bb", "b+db", "b", "db", "if 2<=aa<=h-1 and 2<=bb<=w-1:\n c[(aa,bb)]+=1", "2<=aa<=h-1 and 2<=bb<=w-1", "2<=aa<=h-1", "2<=aa", "2", "aa", "h-1", "h", "1", "2<=bb<=w-1", "2<=bb", "2", "bb", "w-1", "w", "1", "c[(aa,bb)]+=1", "c[(aa,bb)]", "c", "(aa,bb)", "aa", "bb", "1", "ans=Counter(c.values())", "ans", "Counter(c.values())", "Counter", "c.values()", "c.values", "c", "values", "count_0=(h-2)*(w-2)-sum(ans.values())", "count_0", "(h-2)*(w-2)-sum(ans.values())", "(h-2)*(w-2)", "h-2", "h", "2", "w-2", "w", "2", "sum(ans.values())", "sum", "ans.values()", "ans.values", "ans", "values", "print(count_0)", "print", "count_0", "for i in range(1,10):\n print(ans[i])", "i", "range(1,10)", "range", "1", "10", "print(ans[i])", "print", "ans[i]", "ans", "i", "ab=[list(map(int,input().split())) for i in range(n)]", "[list(map(int,input().split())) for i in range(n)]", "ab", "n=map(int,input().split())", "map(int,input().split())", "n", "w,n=map(int,input().split())", "map(int,input().split())", "w", "c=Counter()", "Counter()", "c", "ans=Counter(c.values())", "Counter(c.values())", "ans", "count_0=(h-2)*(w-2)-sum(ans.values())", "(h-2)*(w-2)-sum(ans.values())", "count_0", "d=(-1,0,1)", "(-1,0,1)", "d", "aa=a+da", "a+da", "aa", "h,w,n=map(int,input().split())", "map(int,input().split())", "h", "bb=b+db", "b+db", "bb" ]
from collections import Counter h,w,n=map(int,input().split()) ab=[list(map(int,input().split())) for i in range(n)] d=(-1,0,1) c=Counter() for a,b in ab: for da in d: for db in d: aa=a+da bb=b+db if 2<=aa<=h-1 and 2<=bb<=w-1: c[(aa,bb)]+=1 ans=Counter(c.values()) count_0=(h-2)*(w-2)-sum(ans.values()) print(count_0) for i in range(1,10): print(ans[i])
[ 7, 0, 13, 4, 13, 13, 4, 18, 4, 13, 13, 13, 13, 0, 13, 17, 28, 13, 4, 13, 13, 0, 13, 4, 13, 13, 4, 18, 4, 13, 13, 13, 28, 13, 4, 13, 17, 28, 13, 4, 13, 17, 14, 2, 40, 40, 17, 2, 13, 13, 2, 13, 17, 40, 40, 17, 2, 13, 13, 2, 13, 17, 14, 2, 39, 2, 13, 13, 2, 13, 13, 13, 0, 18, 13, 39, 2, 13, 13, 2, 13, 13, 17, 0, 18, 13, 39, 2, 13, 13, 2, 13, 13, 17, 41, 28, 13, 4, 13, 17, 4, 17, 0, 13, 13, 0, 13, 17, 28, 13, 13, 0, 18, 13, 18, 13, 13, 17, 0, 13, 17, 0, 18, 13, 17, 2, 2, 2, 13, 17, 2, 13, 17, 13, 28, 13, 13, 4, 13, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 13, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13 ]
[ [ 150, 2 ], [ 150, 11 ], [ 150, 12 ], [ 159, 14 ], [ 18, 17 ], [ 148, 20 ], [ 153, 22 ], [ 153, 31 ], [ 34, 33 ], [ 39, 38 ], [ 154, 48 ], [ 33, 49 ], [ 145, 51 ], [ 142, 57 ], [ 38, 58 ], [ 151, 60 ], [ 154, 66 ], [ 33, 67 ], [ 142, 69 ], [ 38, 70 ], [ 160, 71 ], [ 82, 73 ], [ 160, 74 ], [ 154, 77 ], [ 33, 78 ], [ 142, 80 ], [ 38, 81 ], [ 93, 84 ], [ 160, 85 ], [ 154, 88 ], [ 33, 89 ], [ 142, 91 ], [ 38, 92 ], [ 97, 96 ], [ 156, 103 ], [ 165, 106 ], [ 110, 109 ], [ 160, 109 ], [ 117, 112 ], [ 157, 113 ], [ 160, 115 ], [ 109, 116 ], [ 162, 119 ], [ 125, 122 ], [ 157, 123 ], [ 145, 128 ], [ 151, 131 ], [ 163, 133 ], [ 166, 133 ], [ 136, 135 ], [ 157, 135 ], [ 135, 139 ], [ 153, 142 ], [ 150, 145 ], [ 150, 148 ], [ 150, 151 ], [ 153, 154 ], [ 156, 157 ], [ 159, 160 ], [ 162, 163 ], [ 165, 166 ] ]
[ "H, W, N = map(int, input().split())\n \nDic = {}\nfor i in range(N):\n a, b = map(int, input().split())\n for j in range(3):\n for k in range(3):\n if 1 <= a-j <= H-2 and 1 <= b-k <= W-2:\n if (a-j, b-k) in Dic:\n Dic[(a-j, b-k)] += 1\n else:\n Dic[(a-j, b-k)] = 1\n \nPainted = [0 for _ in range(10)]\ncolered = 0\n\nfor i in Dic:\n Painted[Dic[i]] += 1\n colered += 1\n\n#最後に黒が一か所も塗られていない場所を、総和-(1ヵ所以上黒)として求める\nPainted[0] = (H-2) * (W-2) - colered\n \nfor i in Painted:\n print(i)", "H, W, N = map(int, input().split())", "H", "map(int, input().split())", "map", "int", "input().split()", "().split", "()", "input", "split", "W", "N", "Dic = {}", "Dic", "{}", "for i in range(N):\n a, b = map(int, input().split())\n for j in range(3):\n for k in range(3):\n if 1 <= a-j <= H-2 and 1 <= b-k <= W-2:\n if (a-j, b-k) in Dic:\n Dic[(a-j, b-k)] += 1\n else:\n Dic[(a-j, b-k)] = 1\n ", "i", "range(N)", "range", "N", "a, b = map(int, input().split())", "a", "map(int, input().split())", "map", "int", "input().split()", "().split", "()", "input", "split", "b", "for j in range(3):\n for k in range(3):\n if 1 <= a-j <= H-2 and 1 <= b-k <= W-2:\n if (a-j, b-k) in Dic:\n Dic[(a-j, b-k)] += 1\n else:\n Dic[(a-j, b-k)] = 1\n ", "j", "range(3)", "range", "3", "for k in range(3):\n if 1 <= a-j <= H-2 and 1 <= b-k <= W-2:\n if (a-j, b-k) in Dic:\n Dic[(a-j, b-k)] += 1\n else:\n Dic[(a-j, b-k)] = 1\n ", "k", "range(3)", "range", "3", "if 1 <= a-j <= H-2 and 1 <= b-k <= W-2:\n if (a-j, b-k) in Dic:\n Dic[(a-j, b-k)] += 1\n else:\n Dic[(a-j, b-k)] = 1\n ", "1 <= a-j <= H-2 and 1 <= b-k <= W-2", "1 <= a-j <= H-2", "1 <= a-j", "1", "a-j", "a", "j", "H-2", "H", "2", "1 <= b-k <= W-2", "1 <= b-k", "1", "b-k", "b", "k", "W-2", "W", "2", "if (a-j, b-k) in Dic:\n Dic[(a-j, b-k)] += 1\n else:\n Dic[(a-j, b-k)] = 1\n ", "(a-j, b-k) in Dic", "(a-j, b-k)", "a-j", "a", "j", "b-k", "b", "k", "Dic", "Dic[(a-j, b-k)] += 1", "Dic[(a-j, b-k)]", "Dic", "(a-j, b-k)", "a-j", "a", "j", "b-k", "b", "k", "1", "Dic[(a-j, b-k)] = 1", "Dic[(a-j, b-k)]", "Dic", "(a-j, b-k)", "a-j", "a", "j", "b-k", "b", "k", "1", "0 for _ in range(10)", "for _ in range(10)", "_", "range(10)", "range", "10", "for _ in range(10)", "0", "Painted = [0 for _ in range(10)]", "Painted", "[0 for _ in range(10)]", "colered = 0", "colered", "0", "for i in Dic:\n Painted[Dic[i]] += 1\n colered += 1\n\n#最後に黒が一か所も塗られていない場所を、総和-(1ヵ所以上黒)として求める", "i", "Dic", "Painted[Dic[i]] += 1", "Painted[Dic[i]]", "Painted", "Dic[i]", "Dic", "i", "1", "colered += 1", "colered", "1", "Painted[0] = (H-2) * (W-2) - colered", "Painted[0]", "Painted", "0", "(H-2) * (W-2) - colered", "(H-2) * (W-2)", "H-2", "H", "2", "W-2", "W", "2", "colered", "for i in Painted:\n print(i)", "i", "Painted", "print(i)", "print", "i", "b = map(int, input().split())", "map(int, input().split())", "b", "H, W, N = map(int, input().split())", "map(int, input().split())", "H", "N = map(int, input().split())", "map(int, input().split())", "N", "W, N = map(int, input().split())", "map(int, input().split())", "W", "a, b = map(int, input().split())", "map(int, input().split())", "a", "Painted = [0 for _ in range(10)]", "[0 for _ in range(10)]", "Painted", "Dic = {}", "{}", "Dic", "colered += 1", "1", "colered", "colered = 0", "0", "colered" ]
H, W, N = map(int, input().split()) Dic = {} for i in range(N): a, b = map(int, input().split()) for j in range(3): for k in range(3): if 1 <= a-j <= H-2 and 1 <= b-k <= W-2: if (a-j, b-k) in Dic: Dic[(a-j, b-k)] += 1 else: Dic[(a-j, b-k)] = 1 Painted = [0 for _ in range(10)] colered = 0 for i in Dic: Painted[Dic[i]] += 1 colered += 1 #最後に黒が一か所も塗られていない場所を、総和-(1ヵ所以上黒)として求める Painted[0] = (H-2) * (W-2) - colered for i in Painted: print(i)
[ 7, 15, 0, 13, 4, 13, 17, 12, 13, 0, 13, 4, 13, 13, 4, 18, 4, 18, 4, 13, 17, 13, 13, 13, 13, 31, 13, 0, 13, 39, 0, 13, 2, 39, 2, 2, 13, 17, 2, 13, 17, 2, 39, 17, 17, 28, 13, 13, 4, 13, 31, 2, 39, 4, 13, 13, 17, 28, 13, 13, 28, 13, 13, 14, 2, 2, 2, 2, 2, 13, 17, 2, 13, 13, 17, 2, 13, 13, 2, 13, 17, 28, 13, 13, 4, 18, 4, 13, 4, 18, 4, 13, 13, 13, 13, 4, 13, 31, 13, 14, 2, 13, 17, 10, 12, 13, 10, 4, 13 ]
[ [ 107, 3 ], [ 11, 10 ], [ 11, 23 ], [ 11, 24 ], [ 11, 25 ], [ 29, 28 ], [ 32, 31 ], [ 10, 36 ], [ 23, 39 ], [ 59, 58 ], [ 108, 58 ], [ 62, 61 ], [ 108, 61 ], [ 10, 69 ], [ 61, 73 ], [ 58, 77 ], [ 23, 79 ], [ 28, 92 ], [ 31, 98 ], [ 107, 108 ] ]
[ "from collections import Counter as C;r=range(3)\ndef s():\n\tH,W,N,*L=map(int,open(0).read().split());K=[];M=[(H-2)*(W-2)]+[0]*9\n\tfor a,b in zip(*[iter(L)]*2):\n\t\tfor x in r:\n\t\t\tfor y in r:\n\t\t\t\tif H-1>a-y>0<b-x<W-1:K+=[(a-y)*W+b-x]\n\tfor k,v in C(C(K).values()).items():M[0]-=v;M[k]+=v\n\tprint(*M)\nif __name__==\"__main__\":s()", "from collections import Counter as C", "r=range(3)", "r", "range(3)", "range", "3", "def s():\n\tH,W,N,*L=map(int,open(0).read().split());K=[];M=[(H-2)*(W-2)]+[0]*9\n\tfor a,b in zip(*[iter(L)]*2):\n\t\tfor x in r:\n\t\t\tfor y in r:\n\t\t\t\tif H-1>a-y>0<b-x<W-1:K+=[(a-y)*W+b-x]\n\tfor k,v in C(C(K).values()).items():M[0]-=v;M[k]+=v\n\tprint(*M)", "s", "H,W,N,*L=map(int,open(0).read().split())", "H", "map(int,open(0).read().split())", "map", "int", "open(0).read().split()", "(0).read().split", "(0).read()", "(0).read", "(0)", "open", "0", "read", "split", "W", "N", "*L", "L", "K=[]", "K", "[]", "M=[(H-2)*(W-2)]+[0]*9", "M", "[(H-2)*(W-2)]+[0]*9", "[(H-2)*(W-2)]", "(H-2)*(W-2)", "H-2", "H", "2", "W-2", "W", "2", "[0]*9", "[0]", "0", "9", "for a,b in zip(*[iter(L)]*2):\n\t\tfor x in r:\n\t\t\tfor y in r:\n\t\t\t\tif H-1>a-y>0<b-x<W-1:K+=[(a-y)*W+b-x]\n\t", "a", "b", "zip(*[iter(L)]*2)", "zip", "*[iter(L)]*2", "[iter(L)]*2", "[iter(L)]", "iter(L)", "iter", "L", "2", "for x in r:\n\t\t\tfor y in r:\n\t\t\t\tif H-1>a-y>0<b-x<W-1:K+=[(a-y)*W+b-x]\n\t", "x", "r", "for y in r:\n\t\t\t\tif H-1>a-y>0<b-x<W-1:K+=[(a-y)*W+b-x]\n\t", "y", "r", "if H-1>a-y>0<b-x<W-1:K+=[(a-y)*W+b-x]\n\t", "H-1>a-y>0<b-x<W-1", "H-1>a-y>0<b-x", "H-1>a-y>0", "H-1>a-y", "H-1", "H", "1", "a-y", "a", "y", "0", "b-x", "b", "x", "W-1", "W", "1", "for k,v in C(C(K).values()).items():M[0]-=v;M[k]+=v\n\t", "k", "v", "C(C(K).values()).items()", "(C(K).values()).items", "(C(K).values())", "C", "C(K).values()", "(K).values", "(K)", "C", "K", "values", "items", "print(*M)", "print", "*M", "M", "if __name__==\"__main__\":s()", "__name__==\"__main__\"", "__name__", "\"__main__\"", "def s():\n\tH,W,N,*L=map(int,open(0).read().split());K=[];M=[(H-2)*(W-2)]+[0]*9\n\tfor a,b in zip(*[iter(L)]*2):\n\t\tfor x in r:\n\t\t\tfor y in r:\n\t\t\t\tif H-1>a-y>0<b-x<W-1:K+=[(a-y)*W+b-x]\n\tfor k,v in C(C(K).values()).items():M[0]-=v;M[k]+=v\n\tprint(*M)", "def s():\n\tH,W,N,*L=map(int,open(0).read().split());K=[];M=[(H-2)*(W-2)]+[0]*9\n\tfor a,b in zip(*[iter(L)]*2):\n\t\tfor x in r:\n\t\t\tfor y in r:\n\t\t\t\tif H-1>a-y>0<b-x<W-1:K+=[(a-y)*W+b-x]\n\tfor k,v in C(C(K).values()).items():M[0]-=v;M[k]+=v\n\tprint(*M)", "s", "r=range(3)", "range(3)", "r" ]
from collections import Counter as C;r=range(3) def s(): H,W,N,*L=map(int,open(0).read().split());K=[];M=[(H-2)*(W-2)]+[0]*9 for a,b in zip(*[iter(L)]*2): for x in r: for y in r: if H-1>a-y>0<b-x<W-1:K+=[(a-y)*W+b-x] for k,v in C(C(K).values()).items():M[0]-=v;M[k]+=v print(*M) if __name__=="__main__":s()
[ 7, 15, 0, 13, 4, 13, 13, 4, 18, 4, 13, 13, 13, 13, 0, 13, 4, 13, 13, 28, 13, 4, 13, 13, 0, 13, 4, 13, 13, 4, 18, 4, 13, 13, 13, 28, 13, 4, 13, 17, 17, 17, 28, 13, 4, 13, 17, 17, 17, 14, 2, 2, 2, 2, 2, 13, 13, 17, 40, 2, 13, 13, 2, 13, 17, 2, 2, 13, 13, 17, 40, 2, 13, 13, 2, 13, 17, 0, 18, 13, 39, 2, 13, 13, 2, 13, 13, 17, 41, 28, 13, 4, 13, 17, 4, 17, 0, 13, 13, 28, 13, 4, 18, 13, 13, 0, 18, 13, 13, 17, 0, 18, 13, 17, 2, 2, 2, 13, 17, 2, 13, 17, 4, 13, 18, 13, 39, 17, 28, 13, 4, 13, 17, 4, 13, 18, 13, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 13, 13, 10, 4, 13 ]
[ [ 151, 3 ], [ 151, 12 ], [ 151, 13 ], [ 145, 15 ], [ 21, 20 ], [ 152, 23 ], [ 157, 25 ], [ 157, 34 ], [ 37, 36 ], [ 44, 43 ], [ 143, 55 ], [ 36, 56 ], [ 143, 60 ], [ 36, 61 ], [ 140, 63 ], [ 158, 67 ], [ 43, 68 ], [ 158, 72 ], [ 43, 73 ], [ 149, 75 ], [ 87, 78 ], [ 146, 79 ], [ 143, 82 ], [ 36, 83 ], [ 158, 85 ], [ 43, 86 ], [ 91, 90 ], [ 154, 97 ], [ 101, 100 ], [ 146, 103 ], [ 109, 106 ], [ 155, 107 ], [ 100, 108 ], [ 114, 111 ], [ 155, 112 ], [ 140, 117 ], [ 149, 120 ], [ 155, 125 ], [ 130, 129 ], [ 155, 136 ], [ 129, 137 ], [ 151, 140 ], [ 157, 143 ], [ 145, 146 ], [ 151, 149 ], [ 151, 152 ], [ 154, 155 ], [ 157, 158 ] ]
[ "#ABC045D\nfrom collections import defaultdict\nh,w,n=map(int,input().split())\nans=defaultdict(int)\nfor i in range(n):\n a,b=map(int,input().split())\n for j in range(0,-3,-1):\n for k in range(0,-3,-1):\n if a+j>0 and a+j<=h-2 and b+k>0 and b+k<=w-2:\n ans[(a+j,b+k)]+=1\nres=[0 for i in range(10)]\nfor x in ans.values():\n res[x]+=1\nres[0]=((h-2)*(w-2))-sum(res[1:])\nfor i in range(10):\n print(res[i])", "from collections import defaultdict", "h,w,n=map(int,input().split())", "h", "map(int,input().split())", "map", "int", "input().split()", "().split", "()", "input", "split", "w", "n", "ans=defaultdict(int)", "ans", "defaultdict(int)", "defaultdict", "int", "for i in range(n):\n a,b=map(int,input().split())\n for j in range(0,-3,-1):\n for k in range(0,-3,-1):\n if a+j>0 and a+j<=h-2 and b+k>0 and b+k<=w-2:\n ans[(a+j,b+k)]+=1", "i", "range(n)", "range", "n", "a,b=map(int,input().split())", "a", "map(int,input().split())", "map", "int", "input().split()", "().split", "()", "input", "split", "b", "for j in range(0,-3,-1):\n for k in range(0,-3,-1):\n if a+j>0 and a+j<=h-2 and b+k>0 and b+k<=w-2:\n ans[(a+j,b+k)]+=1", "j", "range(0,-3,-1)", "range", "0", "-3", "-1", "for k in range(0,-3,-1):\n if a+j>0 and a+j<=h-2 and b+k>0 and b+k<=w-2:\n ans[(a+j,b+k)]+=1", "k", "range(0,-3,-1)", "range", "0", "-3", "-1", "if a+j>0 and a+j<=h-2 and b+k>0 and b+k<=w-2:\n ans[(a+j,b+k)]+=1", "a+j>0 and a+j<=h-2 and b+k>0 and b+k<=w-2", "a+j>0 and a+j<=h-2 and b+k>0", "a+j>0 and a+j<=h-2", "a+j>0", "a+j", "a", "j", "0", "a+j<=h-2", "a+j", "a", "j", "h-2", "h", "2", "b+k>0", "b+k", "b", "k", "0", "b+k<=w-2", "b+k", "b", "k", "w-2", "w", "2", "ans[(a+j,b+k)]+=1", "ans[(a+j,b+k)]", "ans", "(a+j,b+k)", "a+j", "a", "j", "b+k", "b", "k", "1", "0 for i in range(10)", "for i in range(10)", "i", "range(10)", "range", "10", "for i in range(10)", "0", "res=[0 for i in range(10)]", "res", "[0 for i in range(10)]", "for x in ans.values():\n res[x]+=1", "x", "ans.values()", "ans.values", "ans", "values", "res[x]+=1", "res[x]", "res", "x", "1", "res[0]=((h-2)*(w-2))-sum(res[1:])", "res[0]", "res", "0", "((h-2)*(w-2))-sum(res[1:])", "(h-2)*(w-2)", "h-2", "h", "2", "w-2", "w", "2", "sum(res[1:])", "sum", "res[1:]", "res", "1:", "1", "for i in range(10):\n print(res[i])", "i", "range(10)", "range", "10", "print(res[i])", "print", "res[i]", "res", "i", "h,w,n=map(int,input().split())", "map(int,input().split())", "h", "a,b=map(int,input().split())", "map(int,input().split())", "a", "ans=defaultdict(int)", "defaultdict(int)", "ans", "w,n=map(int,input().split())", "map(int,input().split())", "w", "n=map(int,input().split())", "map(int,input().split())", "n", "res=[0 for i in range(10)]", "[0 for i in range(10)]", "res", "b=map(int,input().split())", "map(int,input().split())", "b" ]
#ABC045D from collections import defaultdict h,w,n=map(int,input().split()) ans=defaultdict(int) for i in range(n): a,b=map(int,input().split()) for j in range(0,-3,-1): for k in range(0,-3,-1): if a+j>0 and a+j<=h-2 and b+k>0 and b+k<=w-2: ans[(a+j,b+k)]+=1 res=[0 for i in range(10)] for x in ans.values(): res[x]+=1 res[0]=((h-2)*(w-2))-sum(res[1:]) for i in range(10): print(res[i])
[ 7, 15, 13, 0, 13, 18, 18, 13, 13, 13, 15, 0, 13, 4, 13, 13, 4, 18, 4, 13, 13, 13, 13, 0, 13, 4, 13, 28, 13, 4, 13, 13, 0, 13, 4, 13, 13, 4, 18, 4, 13, 13, 13, 28, 13, 39, 17, 17, 17, 28, 13, 39, 17, 17, 17, 14, 2, 2, 40, 17, 2, 13, 13, 13, 2, 40, 17, 2, 13, 13, 13, 0, 18, 13, 2, 13, 13, 17, 0, 13, 4, 13, 4, 18, 13, 13, 4, 13, 2, 2, 2, 13, 17, 2, 13, 17, 4, 13, 4, 18, 13, 13, 28, 13, 4, 13, 17, 17, 4, 13, 18, 13, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 18, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13 ]
[ [ 126, 4 ], [ 132, 12 ], [ 127, 19 ], [ 132, 21 ], [ 132, 22 ], [ 123, 24 ], [ 29, 28 ], [ 133, 31 ], [ 129, 33 ], [ 127, 40 ], [ 129, 42 ], [ 45, 44 ], [ 51, 50 ], [ 130, 61 ], [ 44, 62 ], [ 121, 63 ], [ 115, 68 ], [ 50, 69 ], [ 118, 70 ], [ 77, 72 ], [ 124, 73 ], [ 130, 75 ], [ 44, 76 ], [ 135, 79 ], [ 124, 84 ], [ 118, 91 ], [ 121, 94 ], [ 136, 100 ], [ 104, 103 ], [ 136, 111 ], [ 103, 112 ], [ 129, 115 ], [ 132, 118 ], [ 132, 121 ], [ 123, 124 ], [ 126, 127 ], [ 129, 130 ], [ 132, 133 ], [ 135, 136 ] ]
[ "import sys\ninput = sys.stdin.readline\nfrom collections import Counter\nh,w,n=map(int,input().split())\nc=Counter()\nfor _ in range(n):\n b,a=map(int,input().split())\n for i in [-1,0,1]:\n for j in [-1,0,1]:\n if 2<=a+i<w and 2<=b+j<h:\n c[a+i,b+j]+=1\n#print(c.items())\nc2=Counter(c.values())\nprint((h-2)*(w-2)-sum(c2.values()))\nfor i in range(1,10):\n print(c2[i])", "import sys", "sys", "input = sys.stdin.readline", "input", "sys.stdin.readline", "sys.stdin", "sys", "stdin", "readline", "from collections import Counter", "h,w,n=map(int,input().split())", "h", "map(int,input().split())", "map", "int", "input().split()", "().split", "()", "input", "split", "w", "n", "c=Counter()", "c", "Counter()", "Counter", "for _ in range(n):\n b,a=map(int,input().split())\n for i in [-1,0,1]:\n for j in [-1,0,1]:\n if 2<=a+i<w and 2<=b+j<h:\n c[a+i,b+j]+=1\n#print(c.items())", "_", "range(n)", "range", "n", "b,a=map(int,input().split())", "b", "map(int,input().split())", "map", "int", "input().split()", "().split", "()", "input", "split", "a", "for i in [-1,0,1]:\n for j in [-1,0,1]:\n if 2<=a+i<w and 2<=b+j<h:\n c[a+i,b+j]+=1\n#print(c.items())", "i", "[-1,0,1]", "-1", "0", "1", "for j in [-1,0,1]:\n if 2<=a+i<w and 2<=b+j<h:\n c[a+i,b+j]+=1\n#print(c.items())", "j", "[-1,0,1]", "-1", "0", "1", "if 2<=a+i<w and 2<=b+j<h:\n c[a+i,b+j]+=1\n#print(c.items())", "2<=a+i<w and 2<=b+j<h", "2<=a+i<w", "2<=a+i", "2", "a+i", "a", "i", "w", "2<=b+j<h", "2<=b+j", "2", "b+j", "b", "j", "h", "c[a+i,b+j]+=1", "c[a+i,b+j]", "c", "a+i", "a", "i", "1", "c2=Counter(c.values())", "c2", "Counter(c.values())", "Counter", "c.values()", "c.values", "c", "values", "print((h-2)*(w-2)-sum(c2.values()))", "print", "(h-2)*(w-2)-sum(c2.values())", "(h-2)*(w-2)", "h-2", "h", "2", "w-2", "w", "2", "sum(c2.values())", "sum", "c2.values()", "c2.values", "c2", "values", "for i in range(1,10):\n print(c2[i])", "i", "range(1,10)", "range", "1", "10", "print(c2[i])", "print", "c2[i]", "c2", "i", "b,a=map(int,input().split())", "map(int,input().split())", "b", "h,w,n=map(int,input().split())", "map(int,input().split())", "h", "w,n=map(int,input().split())", "map(int,input().split())", "w", "c=Counter()", "Counter()", "c", "input = sys.stdin.readline", "sys.stdin.readline", "input", "a=map(int,input().split())", "map(int,input().split())", "a", "n=map(int,input().split())", "map(int,input().split())", "n", "c2=Counter(c.values())", "Counter(c.values())", "c2" ]
import sys input = sys.stdin.readline from collections import Counter h,w,n=map(int,input().split()) c=Counter() for _ in range(n): b,a=map(int,input().split()) for i in [-1,0,1]: for j in [-1,0,1]: if 2<=a+i<w and 2<=b+j<h: c[a+i,b+j]+=1 #print(c.items()) c2=Counter(c.values()) print((h-2)*(w-2)-sum(c2.values())) for i in range(1,10): print(c2[i])
[ 7, 0, 13, 4, 13, 13, 4, 18, 4, 13, 13, 13, 13, 0, 13, 4, 13, 28, 13, 4, 13, 13, 0, 13, 4, 13, 12, 2, 4, 13, 13, 17, 23, 4, 18, 4, 13, 13, 13, 4, 18, 13, 13, 39, 13, 13, 0, 13, 2, 39, 17, 17, 28, 13, 13, 13, 28, 13, 4, 13, 2, 13, 17, 2, 13, 17, 28, 13, 4, 13, 2, 13, 17, 2, 13, 17, 14, 2, 2, 2, 2, 13, 17, 2, 13, 17, 40, 2, 13, 17, 13, 40, 2, 13, 17, 13, 9, 0, 13, 17, 28, 13, 4, 13, 13, 2, 13, 17, 28, 13, 4, 13, 13, 2, 13, 17, 14, 2, 39, 13, 13, 13, 0, 13, 17, 0, 18, 13, 13, 17, 41, 28, 13, 4, 13, 17, 17, 4, 2, 18, 13, 13, 13, 0, 13, 2, 39, 17, 13, 0, 18, 13, 17, 2, 2, 2, 13, 17, 2, 13, 17, 4, 13, 13, 4, 13, 31, 13, 0, 13, 17, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 17, 13, 10, 4, 13, 10, 4, 13, 10, 2, 13, 10, 2, 13, 10, 17, 13 ]
[ [ 190, 2 ], [ 190, 11 ], [ 190, 12 ], [ 175, 14 ], [ 19, 18 ], [ 179, 21 ], [ 181, 23 ], [ 181, 38 ], [ 176, 41 ], [ 196, 47 ], [ 58, 57 ], [ 68, 67 ], [ 57, 81 ], [ 67, 84 ], [ 57, 88 ], [ 191, 90 ], [ 67, 93 ], [ 188, 95 ], [ 184, 98 ], [ 102, 101 ], [ 57, 104 ], [ 57, 106 ], [ 110, 109 ], [ 67, 112 ], [ 67, 114 ], [ 176, 121 ], [ 199, 123 ], [ 129, 126 ], [ 197, 127 ], [ 200, 128 ], [ 185, 128 ], [ 133, 132 ], [ 197, 140 ], [ 132, 141 ], [ 132, 142 ], [ 193, 144 ], [ 153, 150 ], [ 194, 151 ], [ 197, 151 ], [ 191, 156 ], [ 188, 159 ], [ 194, 163 ], [ 197, 163 ], [ 194, 167 ], [ 197, 167 ], [ 170, 169 ], [ 181, 173 ], [ 175, 176 ], [ 190, 179 ], [ 181, 182 ], [ 184, 185 ], [ 190, 188 ], [ 190, 191 ], [ 193, 194 ], [ 196, 197 ], [ 199, 200 ] ]
[ "H,W,N=map(int,input().split())\ns=set()\nfor i in range(N):\n a,b=map(lambda x:int(x)-1,input().split())\n s.add((a,b))\ncount=[0]*10\n\nfor x,y in s:\n for tx in range(x-2,x+1):\n for ty in range(y-2,y+1):\n if tx<0 or ty<0 or tx+2>=H or ty+2>=W:\n continue\n cnt=0\n for nx in range(tx,tx+3):\n for ny in range(ty,ty+3):\n if (nx,ny) in s:\n cnt+=1\n count[cnt]+=1\ncount=[0]+[count[i]//i for i in range(1,10)]\ncount[0]=(H-2)*(W-2)-sum(count)\nprint(*count,sep='\\n')", "H,W,N=map(int,input().split())", "H", "map(int,input().split())", "map", "int", "input().split()", "().split", "()", "input", "split", "W", "N", "s=set()", "s", "set()", "set", "for i in range(N):\n a,b=map(lambda x:int(x)-1,input().split())\n s.add((a,b))", "i", "range(N)", "range", "N", "a,b=map(lambda x:int(x)-1,input().split())", "a", "map(lambda x:int(x)-1,input().split())", "map", "lambda x:int(x)-1", "int(x)-1", "int(x)", "int", "x", "1", "x", "input().split()", "().split", "()", "input", "split", "b", "s.add((a,b))", "s.add", "s", "add", "(a,b)", "a", "b", "count=[0]*10", "count", "[0]*10", "[0]", "0", "10", "for x,y in s:\n for tx in range(x-2,x+1):\n for ty in range(y-2,y+1):\n if tx<0 or ty<0 or tx+2>=H or ty+2>=W:\n continue\n cnt=0\n for nx in range(tx,tx+3):\n for ny in range(ty,ty+3):\n if (nx,ny) in s:\n cnt+=1\n count[cnt]+=1", "x", "y", "s", "for tx in range(x-2,x+1):\n for ty in range(y-2,y+1):\n if tx<0 or ty<0 or tx+2>=H or ty+2>=W:\n continue\n cnt=0\n for nx in range(tx,tx+3):\n for ny in range(ty,ty+3):\n if (nx,ny) in s:\n cnt+=1\n count[cnt]+=1", "tx", "range(x-2,x+1)", "range", "x-2", "x", "2", "x+1", "x", "1", "for ty in range(y-2,y+1):\n if tx<0 or ty<0 or tx+2>=H or ty+2>=W:\n continue\n cnt=0\n for nx in range(tx,tx+3):\n for ny in range(ty,ty+3):\n if (nx,ny) in s:\n cnt+=1\n count[cnt]+=1", "ty", "range(y-2,y+1)", "range", "y-2", "y", "2", "y+1", "y", "1", "if tx<0 or ty<0 or tx+2>=H or ty+2>=W:\n continue\n ", "tx<0 or ty<0 or tx+2>=H or ty+2>=W", "tx<0 or ty<0 or tx+2>=H", "tx<0 or ty<0", "tx<0", "tx", "0", "ty<0", "ty", "0", "tx+2>=H", "tx+2", "tx", "2", "H", "ty+2>=W", "ty+2", "ty", "2", "W", "continue", "cnt=0", "cnt", "0", "for nx in range(tx,tx+3):\n for ny in range(ty,ty+3):\n if (nx,ny) in s:\n cnt+=1\n ", "nx", "range(tx,tx+3)", "range", "tx", "tx+3", "tx", "3", "for ny in range(ty,ty+3):\n if (nx,ny) in s:\n cnt+=1\n ", "ny", "range(ty,ty+3)", "range", "ty", "ty+3", "ty", "3", "if (nx,ny) in s:\n cnt+=1\n ", "(nx,ny) in s", "(nx,ny)", "nx", "ny", "s", "cnt+=1", "cnt", "1", "count[cnt]+=1", "count[cnt]", "count", "cnt", "1", "count[i]//i for i in range(1,10)", "for i in range(1,10)", "i", "range(1,10)", "range", "1", "10", "for i in range(1,10)", "count[i]//i", "count[i]", "count", "i", "i", "count=[0]+[count[i]//i for i in range(1,10)]", "count", "[0]+[count[i]//i for i in range(1,10)]", "[0]", "0", "[count[i]//i for i in range(1,10)]", "count[0]=(H-2)*(W-2)-sum(count)", "count[0]", "count", "0", "(H-2)*(W-2)-sum(count)", "(H-2)*(W-2)", "H-2", "H", "2", "W-2", "W", "2", "sum(count)", "sum", "count", "print(*count,sep='\\n')", "print", "*count", "count", "sep='\\n'", "sep", "'\\n'", "a,b=map(lambda x:int(x)-1,input().split())", "map(lambda x:int(x)-1,input().split())", "a", "s=set()", "set()", "s", "N=map(int,input().split())", "map(int,input().split())", "N", "b=map(lambda x:int(x)-1,input().split())", "map(lambda x:int(x)-1,input().split())", "b", "cnt=0", "0", "cnt", "W,N=map(int,input().split())", "map(int,input().split())", "W", "H,W,N=map(int,input().split())", "map(int,input().split())", "H", "count=[0]+[count[i]//i for i in range(1,10)]", "[0]+[count[i]//i for i in range(1,10)]", "count", "count=[0]*10", "[0]*10", "count", "cnt+=1", "1", "cnt" ]
H,W,N=map(int,input().split()) s=set() for i in range(N): a,b=map(lambda x:int(x)-1,input().split()) s.add((a,b)) count=[0]*10 for x,y in s: for tx in range(x-2,x+1): for ty in range(y-2,y+1): if tx<0 or ty<0 or tx+2>=H or ty+2>=W: continue cnt=0 for nx in range(tx,tx+3): for ny in range(ty,ty+3): if (nx,ny) in s: cnt+=1 count[cnt]+=1 count=[0]+[count[i]//i for i in range(1,10)] count[0]=(H-2)*(W-2)-sum(count) print(*count,sep='\n')
[ 7, 15, 13, 15, 13, 15, 13, 4, 18, 13, 13, 17, 15, 15, 15, 15, 15, 15, 15, 0, 13, 2, 2, 17, 17, 17, 0, 13, 4, 13, 13, 4, 18, 4, 13, 13, 13, 13, 0, 13, 4, 13, 12, 17, 28, 13, 4, 13, 13, 0, 13, 4, 13, 13, 4, 18, 4, 13, 13, 13, 14, 2, 40, 2, 13, 17, 17, 40, 2, 13, 17, 17, 0, 18, 13, 39, 2, 13, 17, 2, 13, 17, 17, 14, 2, 2, 40, 2, 13, 17, 17, 40, 2, 13, 17, 17, 40, 2, 13, 17, 13, 0, 18, 13, 39, 2, 13, 17, 2, 13, 17, 17, 14, 2, 40, 2, 13, 17, 17, 40, 2, 13, 17, 13, 0, 18, 13, 39, 2, 13, 17, 13, 17, 14, 2, 2, 40, 2, 13, 17, 17, 40, 2, 13, 17, 17, 40, 2, 13, 17, 13, 0, 18, 13, 39, 2, 13, 17, 2, 13, 17, 17, 14, 2, 2, 2, 40, 2, 13, 17, 17, 40, 2, 13, 17, 17, 40, 2, 13, 17, 13, 40, 2, 13, 17, 13, 0, 18, 13, 39, 2, 13, 17, 2, 13, 17, 17, 14, 2, 2, 40, 2, 13, 17, 17, 40, 2, 13, 17, 13, 40, 2, 13, 17, 13, 0, 18, 13, 39, 2, 13, 17, 13, 17, 14, 2, 40, 2, 13, 17, 13, 40, 2, 13, 17, 17, 0, 18, 13, 39, 13, 2, 13, 17, 17, 14, 2, 2, 40, 2, 13, 17, 13, 40, 2, 13, 17, 17, 40, 2, 13, 17, 13, 0, 18, 13, 39, 13, 2, 13, 17, 17, 14, 2, 40, 2, 13, 17, 13, 40, 2, 13, 17, 13, 0, 18, 13, 39, 13, 13, 17, 0, 13, 2, 39, 17, 17, 0, 13, 17, 28, 13, 4, 18, 13, 13, 0, 18, 13, 13, 17, 0, 13, 17, 0, 18, 13, 17, 2, 2, 2, 13, 17, 2, 13, 17, 13, 28, 13, 13, 4, 13, 13, 10, 4, 13, 10, 4, 13, 10, 17, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 2, 13, 10, 4, 13, 10, 2, 13, 10, 17, 13 ]
[ [ 352, 20 ], [ 349, 27 ], [ 349, 36 ], [ 349, 37 ], [ 355, 39 ], [ 46, 45 ], [ 350, 48 ], [ 337, 50 ], [ 337, 59 ], [ 335, 64 ], [ 338, 69 ], [ 82, 73 ], [ 356, 74 ], [ 335, 77 ], [ 338, 80 ], [ 335, 88 ], [ 338, 93 ], [ 338, 98 ], [ 347, 100 ], [ 111, 102 ], [ 356, 103 ], [ 335, 106 ], [ 338, 109 ], [ 335, 116 ], [ 338, 121 ], [ 347, 123 ], [ 132, 125 ], [ 356, 126 ], [ 335, 129 ], [ 335, 138 ], [ 338, 143 ], [ 335, 148 ], [ 344, 150 ], [ 161, 152 ], [ 356, 153 ], [ 335, 156 ], [ 338, 159 ], [ 335, 168 ], [ 338, 173 ], [ 335, 178 ], [ 344, 180 ], [ 338, 183 ], [ 347, 185 ], [ 196, 187 ], [ 356, 188 ], [ 335, 191 ], [ 338, 194 ], [ 335, 202 ], [ 338, 207 ], [ 347, 209 ], [ 335, 212 ], [ 344, 214 ], [ 223, 216 ], [ 356, 217 ], [ 335, 220 ], [ 335, 228 ], [ 344, 230 ], [ 338, 233 ], [ 244, 237 ], [ 356, 238 ], [ 338, 242 ], [ 335, 250 ], [ 344, 252 ], [ 338, 255 ], [ 338, 260 ], [ 347, 262 ], [ 271, 264 ], [ 356, 265 ], [ 338, 269 ], [ 335, 276 ], [ 344, 278 ], [ 338, 281 ], [ 347, 283 ], [ 290, 285 ], [ 356, 286 ], [ 358, 292 ], [ 340, 298 ], [ 302, 301 ], [ 356, 304 ], [ 310, 307 ], [ 359, 308 ], [ 301, 309 ], [ 361, 312 ], [ 318, 315 ], [ 359, 316 ], [ 344, 321 ], [ 347, 324 ], [ 362, 326 ], [ 341, 326 ], [ 329, 328 ], [ 359, 328 ], [ 328, 332 ], [ 337, 335 ], [ 337, 338 ], [ 340, 341 ], [ 349, 344 ], [ 349, 347 ], [ 349, 350 ], [ 352, 353 ], [ 355, 356 ], [ 358, 359 ], [ 361, 362 ] ]
[ "#!/usr/bin/env python3\n#ABC45 D\n\nimport sys\nimport math\nimport bisect\nsys.setrecursionlimit(1000000000)\nfrom heapq import heappush, heappop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\nmod = 10**9 + 7\n\nh,w,n = map(int,input().split())\nf = defaultdict(lambda : 0)\nfor _ in range(n):\n a,b = map(int,input().split())\n if a-2 >= 1 and b-2 >= 1:\n f[(a-2,b-2)] += 1\n if a-2 >= 1 and b-1 >= 1 and b+1 <= w:\n f[(a-2,b-1)] += 1\n if a-2 >= 1 and b+2 <= w:\n f[(a-2,b)] += 1\n if a-1 >= 1 and b-2 >= 1 and a+1 <= h:\n f[(a-1,b-2)] += 1\n if a-1 >= 1 and b-1 >= 1 and a+1 <= h and b+1 <= w:\n f[(a-1,b-1)] += 1\n if a-1 >= 1 and b+2 <= w and a+1 <= h:\n f[(a-1,b)] += 1\n if a+2 <= h and b-2 >= 1:\n f[(a,b-2)] += 1\n if a+2 <= h and b-1 >= 1 and b+1 <= w:\n f[(a,b-1)] += 1\n if a+2 <= h and b+2 <= w:\n f[(a,b)] += 1\nans = [0]*10\ncnt = 0\nfor i in f.values():\n ans[i] += 1\n cnt += 1\nans[0] = (h-2)*(w-2) - cnt\nfor i in ans:\n print(i)", "import sys", "sys", "import math", "math", "import bisect", "bisect", "sys.setrecursionlimit(1000000000)", "sys.setrecursionlimit", "sys", "setrecursionlimit", "1000000000", "from heapq import heappush, heappop", "from collections import defaultdict", "from itertools import accumulate", "from collections import Counter", "from collections import deque", "from operator import itemgetter", "from itertools import permutations", "mod = 10**9 + 7", "mod", "10**9 + 7", "10**9", "10", "9", "7", "h,w,n = map(int,input().split())", "h", "map(int,input().split())", "map", "int", "input().split()", "().split", "()", "input", "split", "w", "n", "f = defaultdict(lambda : 0)", "f", "defaultdict(lambda : 0)", "defaultdict", "lambda : 0", "0", "for _ in range(n):\n a,b = map(int,input().split())\n if a-2 >= 1 and b-2 >= 1:\n f[(a-2,b-2)] += 1\n if a-2 >= 1 and b-1 >= 1 and b+1 <= w:\n f[(a-2,b-1)] += 1\n if a-2 >= 1 and b+2 <= w:\n f[(a-2,b)] += 1\n if a-1 >= 1 and b-2 >= 1 and a+1 <= h:\n f[(a-1,b-2)] += 1\n if a-1 >= 1 and b-1 >= 1 and a+1 <= h and b+1 <= w:\n f[(a-1,b-1)] += 1\n if a-1 >= 1 and b+2 <= w and a+1 <= h:\n f[(a-1,b)] += 1\n if a+2 <= h and b-2 >= 1:\n f[(a,b-2)] += 1\n if a+2 <= h and b-1 >= 1 and b+1 <= w:\n f[(a,b-1)] += 1\n if a+2 <= h and b+2 <= w:\n f[(a,b)] += 1", "_", "range(n)", "range", "n", "a,b = map(int,input().split())", "a", "map(int,input().split())", "map", "int", "input().split()", "().split", "()", "input", "split", "b", "if a-2 >= 1 and b-2 >= 1:\n f[(a-2,b-2)] += 1\n ", "a-2 >= 1 and b-2 >= 1", "a-2 >= 1", "a-2", "a", "2", "1", "b-2 >= 1", "b-2", "b", "2", "1", "f[(a-2,b-2)] += 1", "f[(a-2,b-2)]", "f", "(a-2,b-2)", "a-2", "a", "2", "b-2", "b", "2", "1", "if a-2 >= 1 and b-1 >= 1 and b+1 <= w:\n f[(a-2,b-1)] += 1\n ", "a-2 >= 1 and b-1 >= 1 and b+1 <= w", "a-2 >= 1 and b-1 >= 1", "a-2 >= 1", "a-2", "a", "2", "1", "b-1 >= 1", "b-1", "b", "1", "1", "b+1 <= w", "b+1", "b", "1", "w", "f[(a-2,b-1)] += 1", "f[(a-2,b-1)]", "f", "(a-2,b-1)", "a-2", "a", "2", "b-1", "b", "1", "1", "if a-2 >= 1 and b+2 <= w:\n f[(a-2,b)] += 1\n ", "a-2 >= 1 and b+2 <= w", "a-2 >= 1", "a-2", "a", "2", "1", "b+2 <= w", "b+2", "b", "2", "w", "f[(a-2,b)] += 1", "f[(a-2,b)]", "f", "(a-2,b)", "a-2", "a", "2", "b", "1", "if a-1 >= 1 and b-2 >= 1 and a+1 <= h:\n f[(a-1,b-2)] += 1\n ", "a-1 >= 1 and b-2 >= 1 and a+1 <= h", "a-1 >= 1 and b-2 >= 1", "a-1 >= 1", "a-1", "a", "1", "1", "b-2 >= 1", "b-2", "b", "2", "1", "a+1 <= h", "a+1", "a", "1", "h", "f[(a-1,b-2)] += 1", "f[(a-1,b-2)]", "f", "(a-1,b-2)", "a-1", "a", "1", "b-2", "b", "2", "1", "if a-1 >= 1 and b-1 >= 1 and a+1 <= h and b+1 <= w:\n f[(a-1,b-1)] += 1\n ", "a-1 >= 1 and b-1 >= 1 and a+1 <= h and b+1 <= w", "a-1 >= 1 and b-1 >= 1 and a+1 <= h", "a-1 >= 1 and b-1 >= 1", "a-1 >= 1", "a-1", "a", "1", "1", "b-1 >= 1", "b-1", "b", "1", "1", "a+1 <= h", "a+1", "a", "1", "h", "b+1 <= w", "b+1", "b", "1", "w", "f[(a-1,b-1)] += 1", "f[(a-1,b-1)]", "f", "(a-1,b-1)", "a-1", "a", "1", "b-1", "b", "1", "1", "if a-1 >= 1 and b+2 <= w and a+1 <= h:\n f[(a-1,b)] += 1\n ", "a-1 >= 1 and b+2 <= w and a+1 <= h", "a-1 >= 1 and b+2 <= w", "a-1 >= 1", "a-1", "a", "1", "1", "b+2 <= w", "b+2", "b", "2", "w", "a+1 <= h", "a+1", "a", "1", "h", "f[(a-1,b)] += 1", "f[(a-1,b)]", "f", "(a-1,b)", "a-1", "a", "1", "b", "1", "if a+2 <= h and b-2 >= 1:\n f[(a,b-2)] += 1\n ", "a+2 <= h and b-2 >= 1", "a+2 <= h", "a+2", "a", "2", "h", "b-2 >= 1", "b-2", "b", "2", "1", "f[(a,b-2)] += 1", "f[(a,b-2)]", "f", "(a,b-2)", "a", "b-2", "b", "2", "1", "if a+2 <= h and b-1 >= 1 and b+1 <= w:\n f[(a,b-1)] += 1\n ", "a+2 <= h and b-1 >= 1 and b+1 <= w", "a+2 <= h and b-1 >= 1", "a+2 <= h", "a+2", "a", "2", "h", "b-1 >= 1", "b-1", "b", "1", "1", "b+1 <= w", "b+1", "b", "1", "w", "f[(a,b-1)] += 1", "f[(a,b-1)]", "f", "(a,b-1)", "a", "b-1", "b", "1", "1", "if a+2 <= h and b+2 <= w:\n f[(a,b)] += 1", "a+2 <= h and b+2 <= w", "a+2 <= h", "a+2", "a", "2", "h", "b+2 <= w", "b+2", "b", "2", "w", "f[(a,b)] += 1", "f[(a,b)]", "f", "(a,b)", "a", "b", "1", "ans = [0]*10", "ans", "[0]*10", "[0]", "0", "10", "cnt = 0", "cnt", "0", "for i in f.values():\n ans[i] += 1\n cnt += 1", "i", "f.values()", "f.values", "f", "values", "ans[i] += 1", "ans[i]", "ans", "i", "1", "cnt += 1", "cnt", "1", "ans[0] = (h-2)*(w-2) - cnt", "ans[0]", "ans", "0", "(h-2)*(w-2) - cnt", "(h-2)*(w-2)", "h-2", "h", "2", "w-2", "w", "2", "cnt", "for i in ans:\n print(i)", "i", "ans", "print(i)", "print", "i", "a,b = map(int,input().split())", "map(int,input().split())", "a", "b = map(int,input().split())", "map(int,input().split())", "b", "cnt = 0", "0", "cnt", "h,w,n = map(int,input().split())", "map(int,input().split())", "h", "w,n = map(int,input().split())", "map(int,input().split())", "w", "n = map(int,input().split())", "map(int,input().split())", "n", "mod = 10**9 + 7", "10**9 + 7", "mod", "f = defaultdict(lambda : 0)", "defaultdict(lambda : 0)", "f", "ans = [0]*10", "[0]*10", "ans", "cnt += 1", "1", "cnt" ]
#!/usr/bin/env python3 #ABC45 D import sys import math import bisect sys.setrecursionlimit(1000000000) from heapq import heappush, heappop from collections import defaultdict from itertools import accumulate from collections import Counter from collections import deque from operator import itemgetter from itertools import permutations mod = 10**9 + 7 h,w,n = map(int,input().split()) f = defaultdict(lambda : 0) for _ in range(n): a,b = map(int,input().split()) if a-2 >= 1 and b-2 >= 1: f[(a-2,b-2)] += 1 if a-2 >= 1 and b-1 >= 1 and b+1 <= w: f[(a-2,b-1)] += 1 if a-2 >= 1 and b+2 <= w: f[(a-2,b)] += 1 if a-1 >= 1 and b-2 >= 1 and a+1 <= h: f[(a-1,b-2)] += 1 if a-1 >= 1 and b-1 >= 1 and a+1 <= h and b+1 <= w: f[(a-1,b-1)] += 1 if a-1 >= 1 and b+2 <= w and a+1 <= h: f[(a-1,b)] += 1 if a+2 <= h and b-2 >= 1: f[(a,b-2)] += 1 if a+2 <= h and b-1 >= 1 and b+1 <= w: f[(a,b-1)] += 1 if a+2 <= h and b+2 <= w: f[(a,b)] += 1 ans = [0]*10 cnt = 0 for i in f.values(): ans[i] += 1 cnt += 1 ans[0] = (h-2)*(w-2) - cnt for i in ans: print(i)
[ 7, 15, 13, 15, 0, 13, 4, 13, 13, 4, 18, 4, 13, 13, 13, 13, 0, 13, 17, 28, 13, 4, 13, 13, 0, 13, 4, 13, 13, 4, 18, 4, 13, 13, 13, 0, 13, 2, 13, 17, 13, 2, 13, 17, 0, 13, 2, 2, 13, 17, 17, 0, 13, 2, 2, 13, 17, 2, 13, 17, 0, 13, 2, 2, 13, 17, 17, 0, 13, 2, 2, 13, 17, 2, 13, 17, 0, 13, 2, 2, 13, 17, 2, 13, 2, 13, 17, 0, 13, 2, 2, 13, 17, 2, 13, 2, 13, 17, 0, 13, 2, 13, 17, 0, 13, 2, 13, 17, 0, 13, 2, 13, 17, 0, 13, 2, 13, 17, 14, 13, 0, 13, 2, 13, 13, 14, 13, 0, 13, 2, 13, 13, 14, 40, 13, 13, 0, 18, 13, 13, 17, 0, 18, 13, 13, 17, 14, 13, 0, 13, 2, 13, 13, 14, 40, 13, 13, 0, 18, 13, 13, 17, 0, 18, 13, 13, 17, 14, 13, 0, 13, 2, 13, 13, 14, 40, 13, 13, 0, 18, 13, 13, 17, 0, 18, 13, 13, 17, 14, 13, 0, 13, 2, 13, 13, 14, 13, 0, 13, 2, 13, 13, 14, 40, 13, 13, 0, 18, 13, 13, 17, 0, 18, 13, 13, 17, 14, 13, 0, 13, 2, 13, 13, 14, 40, 13, 13, 0, 18, 13, 13, 17, 0, 18, 13, 13, 17, 14, 13, 0, 13, 2, 13, 13, 14, 40, 13, 13, 0, 18, 13, 13, 17, 0, 18, 13, 13, 17, 14, 13, 0, 13, 2, 13, 13, 14, 13, 0, 13, 2, 13, 13, 14, 40, 13, 13, 0, 18, 13, 13, 17, 0, 18, 13, 13, 17, 14, 13, 0, 13, 2, 13, 13, 14, 40, 13, 13, 0, 18, 13, 13, 17, 0, 18, 13, 13, 17, 14, 13, 0, 13, 2, 13, 13, 14, 40, 13, 13, 0, 18, 13, 13, 17, 0, 18, 13, 13, 17, 41, 28, 13, 4, 13, 17, 4, 17, 0, 13, 13, 28, 13, 4, 18, 13, 13, 0, 18, 13, 13, 17, 0, 18, 13, 17, 2, 2, 2, 13, 17, 2, 13, 17, 4, 13, 13, 28, 13, 13, 4, 13, 13, 10, 2, 13, 10, 4, 13, 10, 4, 13, 10, 2, 13, 10, 2, 13, 10, 2, 13, 10, 4, 13, 10, 2, 13, 10, 2, 13, 10, 2, 13, 10, 2, 13, 10, 17, 13, 10, 2, 13, 10, 2, 13, 10, 2, 13, 10, 2, 13, 10, 2, 13, 10, 2, 13, 10, 2, 13, 10, 2, 13, 10, 2, 13, 10, 2, 13, 10, 4, 13, 10, 13, 13, 10, 4, 13, 10, 2, 13, 10, 2, 13, 10, 2, 13, 10, 2, 13, 10, 2, 13, 10, 2, 13 ]
[ [ 444, 5 ], [ 444, 14 ], [ 444, 15 ], [ 405, 17 ], [ 21, 20 ], [ 445, 23 ], [ 378, 25 ], [ 378, 34 ], [ 414, 36 ], [ 376, 38 ], [ 415, 38 ], [ 459, 40 ], [ 379, 42 ], [ 460, 42 ], [ 420, 45 ], [ 415, 48 ], [ 376, 48 ], [ 447, 52 ], [ 415, 55 ], [ 376, 55 ], [ 439, 58 ], [ 372, 61 ], [ 460, 64 ], [ 379, 64 ], [ 408, 68 ], [ 460, 71 ], [ 379, 71 ], [ 391, 74 ], [ 387, 77 ], [ 415, 80 ], [ 376, 80 ], [ 415, 83 ], [ 376, 83 ], [ 439, 85 ], [ 462, 88 ], [ 460, 91 ], [ 379, 91 ], [ 460, 94 ], [ 379, 94 ], [ 391, 96 ], [ 399, 99 ], [ 415, 101 ], [ 376, 101 ], [ 384, 104 ], [ 415, 106 ], [ 376, 106 ], [ 429, 109 ], [ 460, 111 ], [ 379, 111 ], [ 381, 114 ], [ 460, 116 ], [ 379, 116 ], [ 417, 121 ], [ 400, 123 ], [ 391, 124 ], [ 426, 128 ], [ 418, 130 ], [ 397, 130 ], [ 457, 130 ], [ 460, 131 ], [ 379, 131 ], [ 427, 134 ], [ 424, 134 ], [ 412, 134 ], [ 394, 134 ], [ 403, 134 ], [ 451, 134 ], [ 433, 134 ], [ 454, 134 ], [ 436, 134 ], [ 406, 135 ], [ 140, 137 ], [ 406, 138 ], [ 427, 139 ], [ 424, 139 ], [ 412, 139 ], [ 394, 139 ], [ 403, 139 ], [ 451, 139 ], [ 433, 139 ], [ 454, 139 ], [ 436, 139 ], [ 145, 142 ], [ 406, 143 ], [ 427, 144 ], [ 424, 144 ], [ 412, 144 ], [ 394, 144 ], [ 403, 144 ], [ 451, 144 ], [ 433, 144 ], [ 454, 144 ], [ 436, 144 ], [ 435, 149 ], [ 418, 151 ], [ 397, 151 ], [ 457, 151 ], [ 430, 152 ], [ 436, 155 ], [ 427, 155 ], [ 424, 155 ], [ 412, 155 ], [ 394, 155 ], [ 403, 155 ], [ 451, 155 ], [ 433, 155 ], [ 454, 155 ], [ 406, 156 ], [ 161, 158 ], [ 406, 159 ], [ 436, 160 ], [ 427, 160 ], [ 424, 160 ], [ 412, 160 ], [ 394, 160 ], [ 403, 160 ], [ 451, 160 ], [ 433, 160 ], [ 454, 160 ], [ 166, 163 ], [ 406, 164 ], [ 436, 165 ], [ 427, 165 ], [ 424, 165 ], [ 412, 165 ], [ 394, 165 ], [ 403, 165 ], [ 451, 165 ], [ 433, 165 ], [ 454, 165 ], [ 453, 170 ], [ 418, 172 ], [ 397, 172 ], [ 457, 172 ], [ 382, 173 ], [ 454, 176 ], [ 436, 176 ], [ 427, 176 ], [ 424, 176 ], [ 412, 176 ], [ 394, 176 ], [ 403, 176 ], [ 451, 176 ], [ 433, 176 ], [ 406, 177 ], [ 182, 179 ], [ 406, 180 ], [ 454, 181 ], [ 436, 181 ], [ 427, 181 ], [ 424, 181 ], [ 412, 181 ], [ 394, 181 ], [ 403, 181 ], [ 451, 181 ], [ 433, 181 ], [ 187, 184 ], [ 406, 185 ], [ 454, 186 ], [ 436, 186 ], [ 427, 186 ], [ 424, 186 ], [ 412, 186 ], [ 394, 186 ], [ 403, 186 ], [ 451, 186 ], [ 433, 186 ], [ 456, 191 ], [ 385, 193 ], [ 391, 194 ], [ 432, 198 ], [ 457, 200 ], [ 418, 200 ], [ 397, 200 ], [ 460, 201 ], [ 379, 201 ], [ 433, 204 ], [ 454, 204 ], [ 436, 204 ], [ 427, 204 ], [ 424, 204 ], [ 412, 204 ], [ 394, 204 ], [ 403, 204 ], [ 451, 204 ], [ 406, 205 ], [ 210, 207 ], [ 406, 208 ], [ 433, 209 ], [ 454, 209 ], [ 436, 209 ], [ 427, 209 ], [ 424, 209 ], [ 412, 209 ], [ 394, 209 ], [ 403, 209 ], [ 451, 209 ], [ 215, 212 ], [ 406, 213 ], [ 433, 214 ], [ 454, 214 ], [ 436, 214 ], [ 427, 214 ], [ 424, 214 ], [ 412, 214 ], [ 394, 214 ], [ 403, 214 ], [ 451, 214 ], [ 450, 219 ], [ 457, 221 ], [ 418, 221 ], [ 397, 221 ], [ 430, 222 ], [ 451, 225 ], [ 433, 225 ], [ 454, 225 ], [ 436, 225 ], [ 427, 225 ], [ 424, 225 ], [ 412, 225 ], [ 394, 225 ], [ 403, 225 ], [ 406, 226 ], [ 231, 228 ], [ 406, 229 ], [ 451, 230 ], [ 433, 230 ], [ 454, 230 ], [ 436, 230 ], [ 427, 230 ], [ 424, 230 ], [ 412, 230 ], [ 394, 230 ], [ 403, 230 ], [ 236, 233 ], [ 406, 234 ], [ 451, 235 ], [ 433, 235 ], [ 454, 235 ], [ 436, 235 ], [ 427, 235 ], [ 424, 235 ], [ 412, 235 ], [ 394, 235 ], [ 403, 235 ], [ 402, 240 ], [ 457, 242 ], [ 418, 242 ], [ 397, 242 ], [ 382, 243 ], [ 403, 246 ], [ 451, 246 ], [ 433, 246 ], [ 454, 246 ], [ 436, 246 ], [ 427, 246 ], [ 424, 246 ], [ 412, 246 ], [ 394, 246 ], [ 406, 247 ], [ 252, 249 ], [ 406, 250 ], [ 403, 251 ], [ 451, 251 ], [ 433, 251 ], [ 454, 251 ], [ 436, 251 ], [ 427, 251 ], [ 424, 251 ], [ 412, 251 ], [ 394, 251 ], [ 257, 254 ], [ 406, 255 ], [ 403, 256 ], [ 451, 256 ], [ 433, 256 ], [ 454, 256 ], [ 436, 256 ], [ 427, 256 ], [ 424, 256 ], [ 412, 256 ], [ 394, 256 ], [ 396, 261 ], [ 415, 263 ], [ 376, 263 ], [ 391, 264 ], [ 393, 268 ], [ 397, 270 ], [ 457, 270 ], [ 418, 270 ], [ 460, 271 ], [ 379, 271 ], [ 394, 274 ], [ 403, 274 ], [ 451, 274 ], [ 433, 274 ], [ 454, 274 ], [ 436, 274 ], [ 427, 274 ], [ 424, 274 ], [ 412, 274 ], [ 406, 275 ], [ 280, 277 ], [ 406, 278 ], [ 394, 279 ], [ 403, 279 ], [ 451, 279 ], [ 433, 279 ], [ 454, 279 ], [ 436, 279 ], [ 427, 279 ], [ 424, 279 ], [ 412, 279 ], [ 285, 282 ], [ 406, 283 ], [ 394, 284 ], [ 403, 284 ], [ 451, 284 ], [ 433, 284 ], [ 454, 284 ], [ 436, 284 ], [ 427, 284 ], [ 424, 284 ], [ 412, 284 ], [ 411, 289 ], [ 397, 291 ], [ 457, 291 ], [ 418, 291 ], [ 430, 292 ], [ 412, 295 ], [ 394, 295 ], [ 403, 295 ], [ 451, 295 ], [ 433, 295 ], [ 454, 295 ], [ 436, 295 ], [ 427, 295 ], [ 424, 295 ], [ 406, 296 ], [ 301, 298 ], [ 406, 299 ], [ 412, 300 ], [ 394, 300 ], [ 403, 300 ], [ 451, 300 ], [ 433, 300 ], [ 454, 300 ], [ 436, 300 ], [ 427, 300 ], [ 424, 300 ], [ 306, 303 ], [ 406, 304 ], [ 412, 305 ], [ 394, 305 ], [ 403, 305 ], [ 451, 305 ], [ 433, 305 ], [ 454, 305 ], [ 436, 305 ], [ 427, 305 ], [ 424, 305 ], [ 423, 310 ], [ 397, 312 ], [ 457, 312 ], [ 418, 312 ], [ 382, 313 ], [ 424, 316 ], [ 412, 316 ], [ 394, 316 ], [ 403, 316 ], [ 451, 316 ], [ 433, 316 ], [ 454, 316 ], [ 436, 316 ], [ 427, 316 ], [ 406, 317 ], [ 322, 319 ], [ 406, 320 ], [ 424, 321 ], [ 412, 321 ], [ 394, 321 ], [ 403, 321 ], [ 451, 321 ], [ 433, 321 ], [ 454, 321 ], [ 436, 321 ], [ 427, 321 ], [ 327, 324 ], [ 406, 325 ], [ 424, 326 ], [ 412, 326 ], [ 394, 326 ], [ 403, 326 ], [ 451, 326 ], [ 433, 326 ], [ 454, 326 ], [ 436, 326 ], [ 427, 326 ], [ 331, 330 ], [ 441, 337 ], [ 341, 340 ], [ 406, 343 ], [ 349, 346 ], [ 442, 347 ], [ 340, 348 ], [ 354, 351 ], [ 442, 352 ], [ 439, 357 ], [ 391, 360 ], [ 442, 364 ], [ 367, 366 ], [ 442, 366 ], [ 366, 370 ], [ 372, 373 ], [ 378, 376 ], [ 378, 379 ], [ 381, 382 ], [ 384, 385 ], [ 387, 388 ], [ 444, 391 ], [ 393, 394 ], [ 396, 397 ], [ 399, 400 ], [ 402, 403 ], [ 405, 406 ], [ 408, 409 ], [ 411, 412 ], [ 414, 415 ], [ 417, 418 ], [ 420, 421 ], [ 423, 424 ], [ 426, 427 ], [ 429, 430 ], [ 432, 433 ], [ 435, 436 ], [ 444, 439 ], [ 441, 442 ], [ 444, 445 ], [ 447, 448 ], [ 450, 451 ], [ 453, 454 ], [ 456, 457 ], [ 459, 460 ], [ 462, 463 ] ]
[ "import numpy as np\nfrom collections import Counter\n\nh,w,n = map(int,input().split())\nd = {}\nfor i in range(n):\n a,b = map(int,input().split())\n a,b = a-1,b-1\n\n am1_f = a-1 > 0\n ap1_f = a+1 < h-1\n bm1_f = b-1 > 0\n bp1_f = b+1 < w-1\n a_f = a > 0 and a < h-1\n b_f = b > 0 and b < w-1\n\n am1 = a-1\n ap1 = a+1\n bm1 = b-1\n bp1 = b+1\n\n if am1_f:\n baseid = am1 * w\n if b_f:\n pid = baseid + b\n\n if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n\n if bm1_f:\n pid = baseid + bm1\n if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n\n if bp1_f:\n pid = baseid + bp1\n if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n\n if ap1_f:\n baseid = ap1*w\n if b_f:\n pid = baseid + b\n\n if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n\n if bm1_f:\n pid = baseid + bm1\n if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n\n if bp1_f:\n pid = baseid + bp1\n if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n if a_f:\n\n baseid = a * w\n if b_f:\n pid = baseid + b\n if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n\n if bm1_f:\n pid = baseid + bm1\n if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n\n if bp1_f:\n pid = baseid + bp1\n if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n # print(d)\n\nans = [0 for i in range(10)]\n\nfor val in d.values():\n ans[val] += 1\n\nans[0] = (h-2)*(w-2)-sum(ans)\n\nfor a in ans:\n print(a)", "import numpy as np", "numpy", "from collections import Counter", "h,w,n = map(int,input().split())", "h", "map(int,input().split())", "map", "int", "input().split()", "().split", "()", "input", "split", "w", "n", "d = {}", "d", "{}", "for i in range(n):\n a,b = map(int,input().split())\n a,b = a-1,b-1\n\n am1_f = a-1 > 0\n ap1_f = a+1 < h-1\n bm1_f = b-1 > 0\n bp1_f = b+1 < w-1\n a_f = a > 0 and a < h-1\n b_f = b > 0 and b < w-1\n\n am1 = a-1\n ap1 = a+1\n bm1 = b-1\n bp1 = b+1\n\n if am1_f:\n baseid = am1 * w\n if b_f:\n pid = baseid + b\n\n if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n\n if bm1_f:\n pid = baseid + bm1\n if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n\n if bp1_f:\n pid = baseid + bp1\n if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n\n if ap1_f:\n baseid = ap1*w\n if b_f:\n pid = baseid + b\n\n if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n\n if bm1_f:\n pid = baseid + bm1\n if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n\n if bp1_f:\n pid = baseid + bp1\n if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n if a_f:\n\n baseid = a * w\n if b_f:\n pid = baseid + b\n if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n\n if bm1_f:\n pid = baseid + bm1\n if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n\n if bp1_f:\n pid = baseid + bp1\n if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n # print(d)", "i", "range(n)", "range", "n", "a,b = map(int,input().split())", "a", "map(int,input().split())", "map", "int", "input().split()", "().split", "()", "input", "split", "b", "a,b = a-1,b-1", "a", "a-1", "a", "1", "b", "b-1", "b", "1", "am1_f = a-1 > 0", "am1_f", "a-1 > 0", "a-1", "a", "1", "0", "ap1_f = a+1 < h-1", "ap1_f", "a+1 < h-1", "a+1", "a", "1", "h-1", "h", "1", "bm1_f = b-1 > 0", "bm1_f", "b-1 > 0", "b-1", "b", "1", "0", "bp1_f = b+1 < w-1", "bp1_f", "b+1 < w-1", "b+1", "b", "1", "w-1", "w", "1", "a_f = a > 0 and a < h-1", "a_f", "a > 0 and a < h-1", "a > 0", "a", "0", "a < h-1", "a", "h-1", "h", "1", "b_f = b > 0 and b < w-1", "b_f", "b > 0 and b < w-1", "b > 0", "b", "0", "b < w-1", "b", "w-1", "w", "1", "am1 = a-1", "am1", "a-1", "a", "1", "ap1 = a+1", "ap1", "a+1", "a", "1", "bm1 = b-1", "bm1", "b-1", "b", "1", "bp1 = b+1", "bp1", "b+1", "b", "1", "if am1_f:\n baseid = am1 * w\n if b_f:\n pid = baseid + b\n\n if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n\n if bm1_f:\n pid = baseid + bm1\n if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n\n if bp1_f:\n pid = baseid + bp1\n if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n\n ", "am1_f", "baseid = am1 * w", "baseid", "am1 * w", "am1", "w", "if b_f:\n pid = baseid + b\n\n if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n\n ", "b_f", "pid = baseid + b", "pid", "baseid + b", "baseid", "b", "if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n\n ", "pid not in d", "pid", "d", "d[pid] = 1", "d[pid]", "d", "pid", "1", "d[pid] += 1", "d[pid]", "d", "pid", "1", "if bm1_f:\n pid = baseid + bm1\n if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n\n ", "bm1_f", "pid = baseid + bm1", "pid", "baseid + bm1", "baseid", "bm1", "if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n\n ", "pid not in d", "pid", "d", "d[pid] = 1", "d[pid]", "d", "pid", "1", "d[pid] += 1", "d[pid]", "d", "pid", "1", "if bp1_f:\n pid = baseid + bp1\n if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n\n ", "bp1_f", "pid = baseid + bp1", "pid", "baseid + bp1", "baseid", "bp1", "if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n\n ", "pid not in d", "pid", "d", "d[pid] = 1", "d[pid]", "d", "pid", "1", "d[pid] += 1", "d[pid]", "d", "pid", "1", "if ap1_f:\n baseid = ap1*w\n if b_f:\n pid = baseid + b\n\n if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n\n if bm1_f:\n pid = baseid + bm1\n if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n\n if bp1_f:\n pid = baseid + bp1\n if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n ", "ap1_f", "baseid = ap1*w", "baseid", "ap1*w", "ap1", "w", "if b_f:\n pid = baseid + b\n\n if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n\n ", "b_f", "pid = baseid + b", "pid", "baseid + b", "baseid", "b", "if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n\n ", "pid not in d", "pid", "d", "d[pid] = 1", "d[pid]", "d", "pid", "1", "d[pid] += 1", "d[pid]", "d", "pid", "1", "if bm1_f:\n pid = baseid + bm1\n if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n\n ", "bm1_f", "pid = baseid + bm1", "pid", "baseid + bm1", "baseid", "bm1", "if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n\n ", "pid not in d", "pid", "d", "d[pid] = 1", "d[pid]", "d", "pid", "1", "d[pid] += 1", "d[pid]", "d", "pid", "1", "if bp1_f:\n pid = baseid + bp1\n if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n ", "bp1_f", "pid = baseid + bp1", "pid", "baseid + bp1", "baseid", "bp1", "if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n ", "pid not in d", "pid", "d", "d[pid] = 1", "d[pid]", "d", "pid", "1", "d[pid] += 1", "d[pid]", "d", "pid", "1", "if a_f:\n\n baseid = a * w\n if b_f:\n pid = baseid + b\n if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n\n if bm1_f:\n pid = baseid + bm1\n if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n\n if bp1_f:\n pid = baseid + bp1\n if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n # print(d)", "a_f", "baseid = a * w", "baseid", "a * w", "a", "w", "if b_f:\n pid = baseid + b\n if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n\n ", "b_f", "pid = baseid + b", "pid", "baseid + b", "baseid", "b", "if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n\n ", "pid not in d", "pid", "d", "d[pid] = 1", "d[pid]", "d", "pid", "1", "d[pid] += 1", "d[pid]", "d", "pid", "1", "if bm1_f:\n pid = baseid + bm1\n if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n\n ", "bm1_f", "pid = baseid + bm1", "pid", "baseid + bm1", "baseid", "bm1", "if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n\n ", "pid not in d", "pid", "d", "d[pid] = 1", "d[pid]", "d", "pid", "1", "d[pid] += 1", "d[pid]", "d", "pid", "1", "if bp1_f:\n pid = baseid + bp1\n if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n # print(d)", "bp1_f", "pid = baseid + bp1", "pid", "baseid + bp1", "baseid", "bp1", "if pid not in d:\n d[pid] = 1\n else:\n d[pid] += 1\n # print(d)", "pid not in d", "pid", "d", "d[pid] = 1", "d[pid]", "d", "pid", "1", "d[pid] += 1", "d[pid]", "d", "pid", "1", "0 for i in range(10)", "for i in range(10)", "i", "range(10)", "range", "10", "for i in range(10)", "0", "ans = [0 for i in range(10)]", "ans", "[0 for i in range(10)]", "for val in d.values():\n ans[val] += 1", "val", "d.values()", "d.values", "d", "values", "ans[val] += 1", "ans[val]", "ans", "val", "1", "ans[0] = (h-2)*(w-2)-sum(ans)", "ans[0]", "ans", "0", "(h-2)*(w-2)-sum(ans)", "(h-2)*(w-2)", "h-2", "h", "2", "w-2", "w", "2", "sum(ans)", "sum", "ans", "for a in ans:\n print(a)", "a", "ans", "print(a)", "print", "a", "bm1_f = b-1 > 0", "b-1 > 0", "bm1_f", "a,b = map(int,input().split())", "map(int,input().split())", "a", "b = map(int,input().split())", "map(int,input().split())", "b", "bp1 = b+1", "b+1", "bp1", "ap1 = a+1", "a+1", "ap1", "a_f = a > 0 and a < h-1", "a > 0 and a < h-1", "a_f", "w,n = map(int,input().split())", "map(int,input().split())", "w", "pid = baseid + b", "baseid + b", "pid", "baseid = a * w", "a * w", "baseid", "am1 = a-1", "a-1", "am1", "pid = baseid + bp1", "baseid + bp1", "pid", "d = {}", "{}", "d", "bp1_f = b+1 < w-1", "b+1 < w-1", "bp1_f", "pid = baseid + bm1", "baseid + bm1", "pid", "a,b = a-1,b-1", "a-1", "a", "baseid = am1 * w", "am1 * w", "baseid", "am1_f = a-1 > 0", "a-1 > 0", "am1_f", "pid = baseid + bp1", "baseid + bp1", "pid", "pid = baseid + b", "baseid + b", "pid", "bm1 = b-1", "b-1", "bm1", "pid = baseid + b", "baseid + b", "pid", "pid = baseid + bm1", "baseid + bm1", "pid", "h,w,n = map(int,input().split())", "map(int,input().split())", "h", "ans = [0 for i in range(10)]", "[0 for i in range(10)]", "ans", "n = map(int,input().split())", "map(int,input().split())", "n", "ap1_f = a+1 < h-1", "a+1 < h-1", "ap1_f", "pid = baseid + bm1", "baseid + bm1", "pid", "pid = baseid + bp1", "baseid + bp1", "pid", "baseid = ap1*w", "ap1*w", "baseid", "b = a-1,b-1", "b-1", "b", "b_f = b > 0 and b < w-1", "b > 0 and b < w-1", "b_f" ]
import numpy as np from collections import Counter h,w,n = map(int,input().split()) d = {} for i in range(n): a,b = map(int,input().split()) a,b = a-1,b-1 am1_f = a-1 > 0 ap1_f = a+1 < h-1 bm1_f = b-1 > 0 bp1_f = b+1 < w-1 a_f = a > 0 and a < h-1 b_f = b > 0 and b < w-1 am1 = a-1 ap1 = a+1 bm1 = b-1 bp1 = b+1 if am1_f: baseid = am1 * w if b_f: pid = baseid + b if pid not in d: d[pid] = 1 else: d[pid] += 1 if bm1_f: pid = baseid + bm1 if pid not in d: d[pid] = 1 else: d[pid] += 1 if bp1_f: pid = baseid + bp1 if pid not in d: d[pid] = 1 else: d[pid] += 1 if ap1_f: baseid = ap1*w if b_f: pid = baseid + b if pid not in d: d[pid] = 1 else: d[pid] += 1 if bm1_f: pid = baseid + bm1 if pid not in d: d[pid] = 1 else: d[pid] += 1 if bp1_f: pid = baseid + bp1 if pid not in d: d[pid] = 1 else: d[pid] += 1 if a_f: baseid = a * w if b_f: pid = baseid + b if pid not in d: d[pid] = 1 else: d[pid] += 1 if bm1_f: pid = baseid + bm1 if pid not in d: d[pid] = 1 else: d[pid] += 1 if bp1_f: pid = baseid + bp1 if pid not in d: d[pid] = 1 else: d[pid] += 1 # print(d) ans = [0 for i in range(10)] for val in d.values(): ans[val] += 1 ans[0] = (h-2)*(w-2)-sum(ans) for a in ans: print(a)
[ 7, 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, 41, 28, 13, 4, 13, 13, 4, 4, 13, 4, 13, 29, 13, 23, 13, 12, 13, 29, 4, 18, 4, 18, 18, 13, 13, 13, 13, 12, 13, 29, 4, 18, 13, 13, 13, 13, 23, 13, 23, 13, 12, 13, 41, 28, 13, 4, 13, 13, 4, 4, 18, 13, 13, 13, 13, 29, 13, 23, 13, 23, 13, 23, 13, 12, 13, 0, 13, 39, 42, 2, 4, 13, 13, 13, 0, 13, 4, 18, 13, 13, 13, 13, 14, 40, 2, 13, 13, 4, 18, 13, 13, 13, 29, 4, 13, 13, 23, 13, 23, 13, 23, 13, 12, 13, 0, 13, 39, 42, 2, 4, 13, 13, 13, 0, 13, 4, 13, 13, 13, 17, 14, 40, 2, 13, 13, 4, 18, 13, 13, 13, 29, 4, 13, 13, 23, 13, 23, 13, 23, 13, 15, 15, 13, 4, 18, 13, 13, 17, 0, 13, 2, 2, 17, 17, 17, 0, 13, 4, 13, 13, 4, 18, 4, 13, 13, 13, 13, 41, 28, 13, 4, 13, 13, 4, 4, 13, 4, 13, 13, 4, 18, 4, 13, 13, 0, 13, 13, 0, 13, 4, 13, 13, 0, 13, 17, 0, 13, 17, 28, 13, 13, 13, 0, 13, 4, 13, 13, 13, 0, 13, 4, 13, 13, 13, 4, 18, 18, 13, 2, 13, 17, 13, 2, 13, 17, 0, 13, 39, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 13, 39, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 13, 2, 39, 17, 17, 12, 13, 14, 2, 2, 2, 40, 13, 17, 40, 2, 13, 17, 13, 40, 13, 17, 40, 2, 13, 17, 13, 29, 17, 0, 13, 17, 28, 13, 4, 13, 17, 0, 13, 2, 13, 18, 13, 13, 0, 13, 2, 13, 18, 13, 13, 14, 2, 2, 40, 17, 13, 13, 2, 40, 17, 13, 13, 14, 2, 13, 18, 13, 13, 0, 13, 17, 29, 13, 23, 13, 23, 13, 0, 13, 4, 13, 28, 13, 13, 13, 0, 13, 17, 0, 13, 17, 28, 13, 4, 13, 17, 0, 13, 2, 13, 18, 13, 13, 0, 13, 2, 13, 18, 13, 13, 4, 18, 13, 13, 39, 13, 13, 0, 13, 4, 13, 13, 28, 13, 13, 13, 14, 40, 2, 2, 2, 40, 13, 17, 40, 2, 13, 17, 13, 40, 13, 17, 40, 2, 13, 17, 13, 0, 18, 13, 4, 13, 13, 13, 17, 0, 13, 2, 2, 2, 13, 17, 2, 13, 17, 4, 13, 13, 0, 18, 13, 17, 13, 28, 13, 13, 4, 13, 13, 10, 12, 13, 10, 4, 13, 10, 39, 13, 10, 17, 13, 10, 12, 13, 10, 12, 13, 10, 2, 13, 10, 13, 13, 10, 12, 13, 10, 12, 13, 10, 4, 13, 10, 2, 13, 10, 12, 13, 10, 2, 13, 10, 4, 13, 10, 4, 13, 10, 2, 13, 10, 2, 13, 10, 12, 13, 10, 17, 13, 10, 4, 13, 10, 4, 13, 10, 12, 13, 10, 4, 13, 10, 17, 13, 10, 12, 13, 10, 17, 13, 10, 12, 13, 10, 4, 13, 10, 39, 13 ]
[ [ 37, 36 ], [ 48, 39 ], [ 48, 48 ], [ 71, 68 ], [ 73, 69 ], [ 71, 71 ], [ 73, 73 ], [ 79, 78 ], [ 96, 81 ], [ 92, 87 ], [ 94, 88 ], [ 92, 92 ], [ 94, 94 ], [ 96, 96 ], [ 101, 100 ], [ 100, 106 ], [ 135, 107 ], [ 110, 109 ], [ 131, 114 ], [ 133, 115 ], [ 109, 119 ], [ 100, 120 ], [ 100, 123 ], [ 109, 125 ], [ 100, 129 ], [ 131, 131 ], [ 133, 133 ], [ 135, 135 ], [ 140, 139 ], [ 139, 145 ], [ 173, 146 ], [ 149, 148 ], [ 481, 150 ], [ 169, 151 ], [ 171, 152 ], [ 148, 157 ], [ 139, 158 ], [ 139, 161 ], [ 148, 163 ], [ 139, 167 ], [ 169, 169 ], [ 171, 171 ], [ 173, 173 ], [ 516, 183 ], [ 528, 190 ], [ 541, 197 ], [ 528, 199 ], [ 528, 200 ], [ 204, 203 ], [ 529, 206 ], [ 541, 216 ], [ 486, 219 ], [ 468, 222 ], [ 474, 227 ], [ 522, 230 ], [ 549, 237 ], [ 475, 240 ], [ 550, 240 ], [ 534, 243 ], [ 523, 246 ], [ 535, 246 ], [ 469, 251 ], [ 552, 260 ], [ 471, 272 ], [ 498, 284 ], [ 359, 296 ], [ 511, 300 ], [ 359, 302 ], [ 361, 304 ], [ 496, 308 ], [ 361, 310 ], [ 315, 314 ], [ 318, 317 ], [ 323, 322 ], [ 359, 324 ], [ 553, 326 ], [ 317, 327 ], [ 330, 329 ], [ 361, 331 ], [ 472, 333 ], [ 317, 334 ], [ 322, 340 ], [ 511, 341 ], [ 329, 345 ], [ 496, 346 ], [ 322, 349 ], [ 469, 351 ], [ 329, 352 ], [ 355, 354 ], [ 354, 357 ], [ 314, 357 ], [ 359, 359 ], [ 361, 361 ], [ 507, 363 ], [ 537, 371 ], [ 543, 374 ], [ 378, 377 ], [ 513, 382 ], [ 538, 384 ], [ 553, 386 ], [ 377, 387 ], [ 483, 389 ], [ 544, 391 ], [ 472, 393 ], [ 377, 394 ], [ 508, 397 ], [ 525, 403 ], [ 508, 406 ], [ 538, 417 ], [ 511, 421 ], [ 538, 423 ], [ 544, 425 ], [ 496, 429 ], [ 544, 431 ], [ 439, 433 ], [ 499, 434 ], [ 532, 436 ], [ 538, 437 ], [ 544, 438 ], [ 504, 441 ], [ 496, 445 ], [ 511, 448 ], [ 499, 452 ], [ 457, 454 ], [ 499, 455 ], [ 505, 457 ], [ 460, 459 ], [ 499, 459 ], [ 459, 463 ], [ 468, 469 ], [ 471, 472 ], [ 474, 475 ], [ 483, 484 ], [ 486, 487 ], [ 528, 496 ], [ 498, 499 ], [ 504, 505 ], [ 507, 508 ], [ 528, 511 ], [ 513, 514 ], [ 516, 517 ], [ 522, 523 ], [ 525, 526 ], [ 528, 529 ], [ 534, 535 ], [ 537, 538 ], [ 543, 544 ], [ 549, 550 ], [ 552, 553 ] ]
[ "def getN():\n return int(input())\ndef getNM():\n return map(int, input().split())\ndef getList():\n return list(map(int, input().split()))\ndef getArray(intn):\n return [int(input()) for i in range(intn)]\ndef input():\n return sys.stdin.readline().rstrip()\ndef rand_N(ran1, ran2):\n return random.randint(ran1, ran2)\ndef rand_List(ran1, ran2, rantime):\n return [random.randint(ran1, ran2) for i in range(rantime)]\ndef rand_ints_nodup(ran1, ran2, rantime):\n ns = []\n while len(ns) < rantime:\n n = random.randint(ran1, ran2)\n if not n in ns:\n ns.append(n)\n return sorted(ns)\n\ndef rand_query(ran1, ran2, rantime):\n r_query = []\n while len(r_query) < rantime:\n n_q = rand_ints_nodup(ran1, ran2, 2)\n if not n_q in r_query:\n r_query.append(n_q)\n return sorted(r_query)\n\nfrom collections import defaultdict, deque, Counter\n\nimport sys\nsys.setrecursionlimit(1000000000)\nmod = 10 ** 9 + 7\n\n#############\n# Main Code #\n#############\n\nH, W, N = map(int, input().split())\nquery = [list(map(int, input().split())) for i in range(N)]\nlist_star = defaultdict(set)\nH_max = 0\nW_max = 0\nfor y, x in query:\n H_max = max(H_max, y)\n W_max = max(W_max, x)\n list_star[y - 1].add(x - 1)\n\ndx = [0, 0, 1, 1, 1, 0, -1, -1, -1]\ndy = [0, 1, 1, 0, -1, -1, -1, 0, 1]\n\n\nlista = [0] * 10\n\ndef counter(x, y):\n if x <= 0 or W - 1 <= x or y <= 0 or H - 1 <= y:\n return 0\n cnt = 0\n for i in range(9):\n nx = x + dx[i]\n ny = y + dy[i]\n if 0 <= nx < W and 0 <= ny < H:\n if nx in list_star[ny]:\n cnt += 1\n return cnt\n\nstar_list = set()\nfor y, x in query:\n x -= 1\n y -= 1\n for l in range(9):\n nx = x + dx[l]\n ny = y + dy[l]\n star_list.add((nx, ny))\n\nstar_list = list(star_list)\nfor x, y in star_list:\n if not (x <= 0 or W - 1 <= x or y <= 0 or H - 1 <= y):\n lista[counter(x, y)] += 1\n\nleft = (H - 2) * (W - 2) - sum(lista)\nlista[0] = left\nfor i in lista:\n print(i)", "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 getArray(intn):\n return [int(input()) for i in range(intn)]", "getArray", "int(input()) for i in range(intn)", "for i in range(intn)", "i", "range(intn)", "range", "intn", "for i in range(intn)", "int(input())", "int", "input()", "input", "return [int(input()) for i in range(intn)]", "[int(input()) for i in range(intn)]", "intn", "intn", "def input():\n return sys.stdin.readline().rstrip()", "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", "def rand_N(ran1, ran2):\n return random.randint(ran1, ran2)", "rand_N", "return random.randint(ran1, ran2)", "random.randint(ran1, ran2)", "random.randint", "random", "randint", "ran1", "ran2", "ran1", "ran1", "ran2", "ran2", "def rand_List(ran1, ran2, rantime):\n return [random.randint(ran1, ran2) for i in range(rantime)]", "rand_List", "random.randint(ran1, ran2) for i in range(rantime)", "for i in range(rantime)", "i", "range(rantime)", "range", "rantime", "for i in range(rantime)", "random.randint(ran1, ran2)", "random.randint", "random", "randint", "ran1", "ran2", "return [random.randint(ran1, ran2) for i in range(rantime)]", "[random.randint(ran1, ran2) for i in range(rantime)]", "ran1", "ran1", "ran2", "ran2", "rantime", "rantime", "def rand_ints_nodup(ran1, ran2, rantime):\n ns = []\n while len(ns) < rantime:\n n = random.randint(ran1, ran2)\n if not n in ns:\n ns.append(n)\n return sorted(ns)", "rand_ints_nodup", "ns = []", "ns", "[]", "while len(ns) < rantime:\n n = random.randint(ran1, ran2)\n if not n in ns:\n ns.append(n)\n ", "len(ns) < rantime", "len(ns)", "len", "ns", "rantime", "n = random.randint(ran1, ran2)", "n", "random.randint(ran1, ran2)", "random.randint", "random", "randint", "ran1", "ran2", "if not n in ns:\n ns.append(n)\n ", "not n in ns", "n in ns", "n", "ns", "ns.append(n)", "ns.append", "ns", "append", "n", "return sorted(ns)", "sorted(ns)", "sorted", "ns", "ran1", "ran1", "ran2", "ran2", "rantime", "rantime", "def rand_query(ran1, ran2, rantime):\n r_query = []\n while len(r_query) < rantime:\n n_q = rand_ints_nodup(ran1, ran2, 2)\n if not n_q in r_query:\n r_query.append(n_q)\n return sorted(r_query)", "rand_query", "r_query = []", "r_query", "[]", "while len(r_query) < rantime:\n n_q = rand_ints_nodup(ran1, ran2, 2)\n if not n_q in r_query:\n r_query.append(n_q)\n ", "len(r_query) < rantime", "len(r_query)", "len", "r_query", "rantime", "n_q = rand_ints_nodup(ran1, ran2, 2)", "n_q", "rand_ints_nodup(ran1, ran2, 2)", "rand_ints_nodup", "ran1", "ran2", "2", "if not n_q in r_query:\n r_query.append(n_q)\n ", "not n_q in r_query", "n_q in r_query", "n_q", "r_query", "r_query.append(n_q)", "r_query.append", "r_query", "append", "n_q", "return sorted(r_query)", "sorted(r_query)", "sorted", "r_query", "ran1", "ran1", "ran2", "ran2", "rantime", "rantime", "from collections import defaultdict, deque, Counter", "import sys", "sys", "sys.setrecursionlimit(1000000000)", "sys.setrecursionlimit", "sys", "setrecursionlimit", "1000000000", "mod = 10 ** 9 + 7", "mod", "10 ** 9 + 7", "10 ** 9", "10", "9", "7", "H, W, N = map(int, input().split())", "H", "map(int, input().split())", "map", "int", "input().split()", "().split", "()", "input", "split", "W", "N", "list(map(int, input().split())) for i in range(N)", "for i in range(N)", "i", "range(N)", "range", "N", "for i in range(N)", "list(map(int, input().split()))", "list", "map(int, input().split())", "map", "int", "input().split()", "().split", "()", "input", "split", "query = [list(map(int, input().split())) for i in range(N)]", "query", "[list(map(int, input().split())) for i in range(N)]", "list_star = defaultdict(set)", "list_star", "defaultdict(set)", "defaultdict", "set", "H_max = 0", "H_max", "0", "W_max = 0", "W_max", "0", "for y, x in query:\n H_max = max(H_max, y)\n W_max = max(W_max, x)\n list_star[y - 1].add(x - 1)", "y", "x", "query", "H_max = max(H_max, y)", "H_max", "max(H_max, y)", "max", "H_max", "y", "W_max = max(W_max, x)", "W_max", "max(W_max, x)", "max", "W_max", "x", "list_star[y - 1].add(x - 1)", "[y - 1].add", "[y - 1]", "list_star", "y - 1", "y", "1", "add", "x - 1", "x", "1", "dx = [0, 0, 1, 1, 1, 0, -1, -1, -1]", "dx", "[0, 0, 1, 1, 1, 0, -1, -1, -1]", "0", "0", "1", "1", "1", "0", "-1", "-1", "-1", "dy = [0, 1, 1, 0, -1, -1, -1, 0, 1]", "dy", "[0, 1, 1, 0, -1, -1, -1, 0, 1]", "0", "1", "1", "0", "-1", "-1", "-1", "0", "1", "lista = [0] * 10", "lista", "[0] * 10", "[0]", "0", "10", "def counter(x, y):\n if x <= 0 or W - 1 <= x or y <= 0 or H - 1 <= y:\n return 0\n cnt = 0\n for i in range(9):\n nx = x + dx[i]\n ny = y + dy[i]\n if 0 <= nx < W and 0 <= ny < H:\n if nx in list_star[ny]:\n cnt += 1\n return cnt", "counter", "if x <= 0 or W - 1 <= x or y <= 0 or H - 1 <= y:\n return 0\n ", "x <= 0 or W - 1 <= x or y <= 0 or H - 1 <= y", "x <= 0 or W - 1 <= x or y <= 0", "x <= 0 or W - 1 <= x", "x <= 0", "x", "0", "W - 1 <= x", "W - 1", "W", "1", "x", "y <= 0", "y", "0", "H - 1 <= y", "H - 1", "H", "1", "y", "return 0", "0", "cnt = 0", "cnt", "0", "for i in range(9):\n nx = x + dx[i]\n ny = y + dy[i]\n if 0 <= nx < W and 0 <= ny < H:\n if nx in list_star[ny]:\n cnt += 1\n ", "i", "range(9)", "range", "9", "nx = x + dx[i]", "nx", "x + dx[i]", "x", "dx[i]", "dx", "i", "ny = y + dy[i]", "ny", "y + dy[i]", "y", "dy[i]", "dy", "i", "if 0 <= nx < W and 0 <= ny < H:\n if nx in list_star[ny]:\n cnt += 1\n ", "0 <= nx < W and 0 <= ny < H", "0 <= nx < W", "0 <= nx", "0", "nx", "W", "0 <= ny < H", "0 <= ny", "0", "ny", "H", "if nx in list_star[ny]:\n cnt += 1\n ", "nx in list_star[ny]", "nx", "list_star[ny]", "list_star", "ny", "cnt += 1", "cnt", "1", "return cnt", "cnt", "x", "x", "y", "y", "star_list = set()", "star_list", "set()", "set", "for y, x in query:\n x -= 1\n y -= 1\n for l in range(9):\n nx = x + dx[l]\n ny = y + dy[l]\n star_list.add((nx, ny))", "y", "x", "query", "x -= 1", "x", "1", "y -= 1", "y", "1", "for l in range(9):\n nx = x + dx[l]\n ny = y + dy[l]\n star_list.add((nx, ny))", "l", "range(9)", "range", "9", "nx = x + dx[l]", "nx", "x + dx[l]", "x", "dx[l]", "dx", "l", "ny = y + dy[l]", "ny", "y + dy[l]", "y", "dy[l]", "dy", "l", "star_list.add((nx, ny))", "star_list.add", "star_list", "add", "(nx, ny)", "nx", "ny", "star_list = list(star_list)", "star_list", "list(star_list)", "list", "star_list", "for x, y in star_list:\n if not (x <= 0 or W - 1 <= x or y <= 0 or H - 1 <= y):\n lista[counter(x, y)] += 1", "x", "y", "star_list", "if not (x <= 0 or W - 1 <= x or y <= 0 or H - 1 <= y):\n lista[counter(x, y)] += 1", "not (x <= 0 or W - 1 <= x or y <= 0 or H - 1 <= y)", "x <= 0 or W - 1 <= x or y <= 0 or H - 1 <= y", "x <= 0 or W - 1 <= x or y <= 0", "x <= 0 or W - 1 <= x", "x <= 0", "x", "0", "W - 1 <= x", "W - 1", "W", "1", "x", "y <= 0", "y", "0", "H - 1 <= y", "H - 1", "H", "1", "y", "lista[counter(x, y)] += 1", "lista[counter(x, y)]", "lista", "counter(x, y)", "counter", "x", "y", "1", "left = (H - 2) * (W - 2) - sum(lista)", "left", "(H - 2) * (W - 2) - sum(lista)", "(H - 2) * (W - 2)", "H - 2", "H", "2", "W - 2", "W", "2", "sum(lista)", "sum", "lista", "lista[0] = left", "lista[0]", "lista", "0", "left", "for i in lista:\n print(i)", "i", "lista", "print(i)", "print", "i", "def rand_N(ran1, ran2):\n return random.randint(ran1, ran2)", "def rand_N(ran1, ran2):\n return random.randint(ran1, ran2)", "rand_N", "list_star = defaultdict(set)", "defaultdict(set)", "list_star", "dy = [0, 1, 1, 0, -1, -1, -1, 0, 1]", "[0, 1, 1, 0, -1, -1, -1, 0, 1]", "dy", "H_max = 0", "0", "H_max", "def getNM():\n return map(int, input().split())", "def getNM():\n return map(int, input().split())", "getNM", "def rand_ints_nodup(ran1, ran2, rantime):\n ns = []\n while len(ns) < rantime:\n n = random.randint(ran1, ran2)\n if not n in ns:\n ns.append(n)\n return sorted(ns)", "def rand_ints_nodup(ran1, ran2, rantime):\n ns = []\n while len(ns) < rantime:\n n = random.randint(ran1, ran2)\n if not n in ns:\n ns.append(n)\n return sorted(ns)", "rand_ints_nodup", "ny = y + dy[l]", "y + dy[l]", "ny", "query = [list(map(int, input().split())) for i in range(N)]", "[list(map(int, input().split())) for i in range(N)]", "query", "def rand_List(ran1, ran2, rantime):\n return [random.randint(ran1, ran2) for i in range(rantime)]", "def rand_List(ran1, ran2, rantime):\n return [random.randint(ran1, ran2) for i in range(rantime)]", "rand_List", "def getArray(intn):\n return [int(input()) for i in range(intn)]", "def getArray(intn):\n return [int(input()) for i in range(intn)]", "getArray", "H, W, N = map(int, input().split())", "map(int, input().split())", "H", "lista = [0] * 10", "[0] * 10", "lista", "def getList():\n return list(map(int, input().split()))", "def getList():\n return list(map(int, input().split()))", "getList", "left = (H - 2) * (W - 2) - sum(lista)", "(H - 2) * (W - 2) - sum(lista)", "left", "star_list = set()", "set()", "star_list", "W, N = map(int, input().split())", "map(int, input().split())", "W", "nx = x + dx[l]", "x + dx[l]", "nx", "mod = 10 ** 9 + 7", "10 ** 9 + 7", "mod", "def getN():\n return int(input())", "def getN():\n return int(input())", "getN", "W_max = 0", "0", "W_max", "star_list = list(star_list)", "list(star_list)", "star_list", "N = map(int, input().split())", "map(int, input().split())", "N", "def counter(x, y):\n if x <= 0 or W - 1 <= x or y <= 0 or H - 1 <= y:\n return 0\n cnt = 0\n for i in range(9):\n nx = x + dx[i]\n ny = y + dy[i]\n if 0 <= nx < W and 0 <= ny < H:\n if nx in list_star[ny]:\n cnt += 1\n return cnt", "def counter(x, y):\n if x <= 0 or W - 1 <= x or y <= 0 or H - 1 <= y:\n return 0\n cnt = 0\n for i in range(9):\n nx = x + dx[i]\n ny = y + dy[i]\n if 0 <= nx < W and 0 <= ny < H:\n if nx in list_star[ny]:\n cnt += 1\n return cnt", "counter", "W_max = max(W_max, x)", "max(W_max, x)", "W_max", "x -= 1", "1", "x", "def input():\n return sys.stdin.readline().rstrip()", "def input():\n return sys.stdin.readline().rstrip()", "input", "y -= 1", "1", "y", "def rand_query(ran1, ran2, rantime):\n r_query = []\n while len(r_query) < rantime:\n n_q = rand_ints_nodup(ran1, ran2, 2)\n if not n_q in r_query:\n r_query.append(n_q)\n return sorted(r_query)", "def rand_query(ran1, ran2, rantime):\n r_query = []\n while len(r_query) < rantime:\n n_q = rand_ints_nodup(ran1, ran2, 2)\n if not n_q in r_query:\n r_query.append(n_q)\n return sorted(r_query)", "rand_query", "H_max = max(H_max, y)", "max(H_max, y)", "H_max", "dx = [0, 0, 1, 1, 1, 0, -1, -1, -1]", "[0, 0, 1, 1, 1, 0, -1, -1, -1]", "dx" ]
def getN(): return int(input()) def getNM(): return map(int, input().split()) def getList(): return list(map(int, input().split())) def getArray(intn): return [int(input()) for i in range(intn)] def input(): return sys.stdin.readline().rstrip() def rand_N(ran1, ran2): return random.randint(ran1, ran2) def rand_List(ran1, ran2, rantime): return [random.randint(ran1, ran2) for i in range(rantime)] def rand_ints_nodup(ran1, ran2, rantime): ns = [] while len(ns) < rantime: n = random.randint(ran1, ran2) if not n in ns: ns.append(n) return sorted(ns) def rand_query(ran1, ran2, rantime): r_query = [] while len(r_query) < rantime: n_q = rand_ints_nodup(ran1, ran2, 2) if not n_q in r_query: r_query.append(n_q) return sorted(r_query) from collections import defaultdict, deque, Counter import sys sys.setrecursionlimit(1000000000) mod = 10 ** 9 + 7 ############# # Main Code # ############# H, W, N = map(int, input().split()) query = [list(map(int, input().split())) for i in range(N)] list_star = defaultdict(set) H_max = 0 W_max = 0 for y, x in query: H_max = max(H_max, y) W_max = max(W_max, x) list_star[y - 1].add(x - 1) dx = [0, 0, 1, 1, 1, 0, -1, -1, -1] dy = [0, 1, 1, 0, -1, -1, -1, 0, 1] lista = [0] * 10 def counter(x, y): if x <= 0 or W - 1 <= x or y <= 0 or H - 1 <= y: return 0 cnt = 0 for i in range(9): nx = x + dx[i] ny = y + dy[i] if 0 <= nx < W and 0 <= ny < H: if nx in list_star[ny]: cnt += 1 return cnt star_list = set() for y, x in query: x -= 1 y -= 1 for l in range(9): nx = x + dx[l] ny = y + dy[l] star_list.add((nx, ny)) star_list = list(star_list) for x, y in star_list: if not (x <= 0 or W - 1 <= x or y <= 0 or H - 1 <= y): lista[counter(x, y)] += 1 left = (H - 2) * (W - 2) - sum(lista) lista[0] = left for i in lista: print(i)
[ 7, 15, 0, 13, 4, 13, 13, 4, 18, 4, 13, 13, 13, 13, 41, 28, 13, 4, 13, 13, 4, 4, 13, 4, 13, 13, 4, 18, 4, 13, 13, 0, 13, 13, 0, 13, 4, 13, 13, 28, 13, 13, 13, 28, 13, 4, 13, 17, 28, 13, 4, 13, 17, 14, 2, 40, 40, 17, 2, 13, 13, 2, 13, 17, 40, 40, 17, 2, 13, 13, 2, 13, 17, 0, 18, 13, 39, 2, 13, 13, 2, 13, 13, 17, 0, 13, 4, 13, 4, 18, 13, 13, 28, 13, 4, 13, 17, 14, 2, 13, 17, 4, 13, 2, 2, 2, 13, 17, 2, 13, 17, 4, 13, 4, 18, 13, 13, 4, 13, 18, 13, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 13, 13, 10, 4, 13, 10, 4, 13 ]
[ [ 138, 3 ], [ 138, 12 ], [ 138, 13 ], [ 17, 16 ], [ 139, 19 ], [ 132, 32 ], [ 135, 35 ], [ 45, 44 ], [ 50, 49 ], [ 44, 60 ], [ 124, 62 ], [ 49, 69 ], [ 130, 71 ], [ 83, 74 ], [ 136, 75 ], [ 44, 79 ], [ 49, 82 ], [ 126, 85 ], [ 136, 90 ], [ 94, 93 ], [ 93, 99 ], [ 124, 106 ], [ 130, 109 ], [ 127, 115 ], [ 127, 120 ], [ 93, 121 ], [ 138, 124 ], [ 126, 127 ], [ 138, 130 ], [ 132, 133 ], [ 135, 136 ], [ 138, 139 ] ]
[ "from collections import defaultdict, Counter\n\nH, W, N = map(int, input().split())\nX = [list(map(int, input().split())) for _ in range(N)]\n\nctr = defaultdict(int)\nfor a, b in X:\n for k in range(3):\n for l in range(3):\n if 1 <= a - k <= H - 2 and 1 <= b - l <= W - 2:\n ctr[(a - k, b - l)] += 1\n\nd = Counter(ctr.values())\nfor i in range(10):\n if i == 0:\n print((H - 2) * (W - 2) - sum(d.values()))\n else:\n print(d[i])", "from collections import defaultdict, Counter", "H, W, N = map(int, input().split())", "H", "map(int, input().split())", "map", "int", "input().split()", "().split", "()", "input", "split", "W", "N", "list(map(int, input().split())) for _ in range(N)", "for _ in range(N)", "_", "range(N)", "range", "N", "for _ in range(N)", "list(map(int, input().split()))", "list", "map(int, input().split())", "map", "int", "input().split()", "().split", "()", "input", "split", "X = [list(map(int, input().split())) for _ in range(N)]", "X", "[list(map(int, input().split())) for _ in range(N)]", "ctr = defaultdict(int)", "ctr", "defaultdict(int)", "defaultdict", "int", "for a, b in X:\n for k in range(3):\n for l in range(3):\n if 1 <= a - k <= H - 2 and 1 <= b - l <= W - 2:\n ctr[(a - k, b - l)] += 1", "a", "b", "X", "for k in range(3):\n for l in range(3):\n if 1 <= a - k <= H - 2 and 1 <= b - l <= W - 2:\n ctr[(a - k, b - l)] += 1", "k", "range(3)", "range", "3", "for l in range(3):\n if 1 <= a - k <= H - 2 and 1 <= b - l <= W - 2:\n ctr[(a - k, b - l)] += 1", "l", "range(3)", "range", "3", "if 1 <= a - k <= H - 2 and 1 <= b - l <= W - 2:\n ctr[(a - k, b - l)] += 1", "1 <= a - k <= H - 2 and 1 <= b - l <= W - 2", "1 <= a - k <= H - 2", "1 <= a - k", "1", "a - k", "a", "k", "H - 2", "H", "2", "1 <= b - l <= W - 2", "1 <= b - l", "1", "b - l", "b", "l", "W - 2", "W", "2", "ctr[(a - k, b - l)] += 1", "ctr[(a - k, b - l)]", "ctr", "(a - k, b - l)", "a - k", "a", "k", "b - l", "b", "l", "1", "d = Counter(ctr.values())", "d", "Counter(ctr.values())", "Counter", "ctr.values()", "ctr.values", "ctr", "values", "for i in range(10):\n if i == 0:\n print((H - 2) * (W - 2) - sum(d.values()))\n else:\n print(d[i])", "i", "range(10)", "range", "10", "if i == 0:\n print((H - 2) * (W - 2) - sum(d.values()))\n else:\n print(d[i])", "i == 0", "i", "0", "print((H - 2) * (W - 2) - sum(d.values()))", "print", "(H - 2) * (W - 2) - sum(d.values())", "(H - 2) * (W - 2)", "H - 2", "H", "2", "W - 2", "W", "2", "sum(d.values())", "sum", "d.values()", "d.values", "d", "values", "print(d[i])", "print", "d[i]", "d", "i", "H, W, N = map(int, input().split())", "map(int, input().split())", "H", "d = Counter(ctr.values())", "Counter(ctr.values())", "d", "W, N = map(int, input().split())", "map(int, input().split())", "W", "X = [list(map(int, input().split())) for _ in range(N)]", "[list(map(int, input().split())) for _ in range(N)]", "X", "ctr = defaultdict(int)", "defaultdict(int)", "ctr", "N = map(int, input().split())", "map(int, input().split())", "N" ]
from collections import defaultdict, Counter H, W, N = map(int, input().split()) X = [list(map(int, input().split())) for _ in range(N)] ctr = defaultdict(int) for a, b in X: for k in range(3): for l in range(3): if 1 <= a - k <= H - 2 and 1 <= b - l <= W - 2: ctr[(a - k, b - l)] += 1 d = Counter(ctr.values()) for i in range(10): if i == 0: print((H - 2) * (W - 2) - sum(d.values())) else: print(d[i])
[ 7, 15, 15, 15, 15, 13, 15, 13, 15, 13, 15, 13, 15, 13, 4, 18, 13, 13, 2, 17, 17, 0, 13, 18, 13, 13, 0, 13, 18, 13, 13, 0, 13, 18, 13, 13, 12, 13, 12, 13, 12, 13, 12, 13, 12, 13, 12, 13, 12, 13, 41, 28, 13, 4, 13, 13, 4, 4, 13, 12, 13, 23, 13, 41, 28, 13, 4, 13, 13, 4, 4, 13, 12, 13, 23, 13, 41, 28, 13, 4, 13, 13, 4, 4, 13, 12, 13, 23, 13, 41, 28, 13, 4, 13, 13, 4, 4, 13, 12, 13, 23, 13, 41, 28, 13, 4, 13, 13, 4, 4, 13, 12, 13, 23, 13, 41, 28, 13, 4, 13, 13, 4, 4, 13, 12, 13, 23, 13, 41, 28, 13, 4, 13, 13, 4, 4, 13, 12, 13, 23, 13, 0, 13, 17, 0, 13, 4, 13, 17, 12, 13, 0, 13, 4, 13, 17, 13, 13, 4, 13, 2, 2, 2, 13, 13, 13, 17, 29, 12, 13, 0, 13, 4, 13, 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, 0, 13, 17, 42, 18, 13, 13, 0, 13, 4, 18, 18, 13, 13, 13, 4, 13, 4, 18, 13, 13, 13, 29, 12, 13, 0, 13, 4, 13, 13, 0, 13, 4, 13, 0, 13, 17, 28, 13, 4, 13, 2, 13, 17, 14, 2, 2, 18, 13, 13, 18, 13, 2, 13, 17, 13, 14, 2, 13, 18, 13, 13, 0, 13, 2, 2, 18, 13, 13, 18, 13, 2, 13, 17, 13, 0, 18, 13, 2, 13, 17, 2, 13, 18, 13, 13, 0, 13, 2, 2, 18, 13, 13, 18, 13, 2, 13, 17, 13, 0, 18, 13, 2, 13, 17, 17, 4, 13, 13, 29, 12, 13, 0, 13, 4, 13, 13, 13, 0, 13, 2, 39, 2, 2, 13, 17, 2, 13, 17, 2, 39, 17, 17, 0, 13, 4, 13, 13, 28, 13, 4, 13, 13, 0, 13, 4, 13, 13, 28, 13, 4, 13, 17, 17, 0, 13, 13, 28, 13, 4, 13, 17, 17, 14, 2, 2, 13, 13, 17, 9, 0, 13, 13, 14, 2, 2, 40, 17, 13, 13, 2, 40, 17, 13, 13, 0, 18, 13, 39, 13, 13, 17, 28, 13, 13, 4, 18, 13, 13, 0, 18, 13, 13, 17, 0, 18, 13, 17, 17, 4, 13, 4, 18, 17, 13, 4, 13, 13, 13, 29, 14, 2, 13, 17, 4, 13, 10, 12, 13, 10, 12, 13, 10, 18, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 17, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 18, 13, 10, 4, 13, 10, 12, 13, 10, 12, 13, 10, 18, 13, 10, 12, 13, 10, 12, 13 ]
[ [ 486, 22 ], [ 432, 27 ], [ 474, 32 ], [ 53, 52 ], [ 454, 58 ], [ 62, 62 ], [ 66, 65 ], [ 493, 71 ], [ 75, 75 ], [ 79, 78 ], [ 442, 84 ], [ 88, 88 ], [ 92, 91 ], [ 493, 97 ], [ 101, 101 ], [ 105, 104 ], [ 460, 110 ], [ 114, 114 ], [ 118, 117 ], [ 484, 123 ], [ 127, 127 ], [ 131, 130 ], [ 469, 136 ], [ 140, 140 ], [ 450, 142 ], [ 477, 145 ], [ 153, 152 ], [ 427, 154 ], [ 153, 156 ], [ 153, 157 ], [ 152, 163 ], [ 156, 164 ], [ 157, 165 ], [ 172, 171 ], [ 179, 176 ], [ 171, 177 ], [ 484, 182 ], [ 187, 184 ], [ 171, 185 ], [ 484, 190 ], [ 195, 192 ], [ 171, 193 ], [ 484, 198 ], [ 201, 200 ], [ 171, 204 ], [ 200, 205 ], [ 207, 205 ], [ 208, 207 ], [ 171, 211 ], [ 200, 212 ], [ 207, 212 ], [ 207, 220 ], [ 200, 220 ], [ 226, 225 ], [ 493, 227 ], [ 226, 228 ], [ 231, 230 ], [ 493, 232 ], [ 235, 234 ], [ 238, 237 ], [ 225, 241 ], [ 230, 247 ], [ 237, 248 ], [ 230, 250 ], [ 237, 252 ], [ 228, 254 ], [ 228, 257 ], [ 230, 259 ], [ 237, 260 ], [ 263, 262 ], [ 230, 266 ], [ 237, 267 ], [ 230, 269 ], [ 237, 271 ], [ 228, 273 ], [ 280, 275 ], [ 230, 276 ], [ 237, 278 ], [ 228, 281 ], [ 230, 283 ], [ 237, 284 ], [ 287, 286 ], [ 230, 290 ], [ 237, 291 ], [ 230, 293 ], [ 237, 295 ], [ 228, 297 ], [ 304, 299 ], [ 230, 300 ], [ 237, 302 ], [ 286, 307 ], [ 262, 307 ], [ 234, 307 ], [ 313, 312 ], [ 493, 314 ], [ 313, 315 ], [ 313, 316 ], [ 319, 318 ], [ 312, 323 ], [ 315, 326 ], [ 334, 333 ], [ 339, 338 ], [ 316, 341 ], [ 344, 343 ], [ 493, 345 ], [ 344, 346 ], [ 349, 348 ], [ 355, 354 ], [ 346, 355 ], [ 358, 357 ], [ 354, 365 ], [ 348, 365 ], [ 357, 366 ], [ 370, 366 ], [ 371, 370 ], [ 343, 371 ], [ 370, 377 ], [ 357, 377 ], [ 312, 378 ], [ 354, 382 ], [ 348, 382 ], [ 315, 383 ], [ 390, 385 ], [ 333, 386 ], [ 333, 396 ], [ 402, 399 ], [ 318, 400 ], [ 407, 404 ], [ 318, 405 ], [ 318, 417 ], [ 439, 424 ], [ 432, 433 ], [ 450, 451 ], [ 474, 475 ], [ 477, 478 ], [ 486, 487 ] ]
[ "#!/usr/bin/env python3\nfrom collections import defaultdict\nfrom collections import deque\nfrom heapq import heappush, heappop\nimport sys\nimport math\nimport bisect\nimport random\nimport itertools\nsys.setrecursionlimit(10**5)\nstdin = sys.stdin\nbisect_left = bisect.bisect_left\nbisect_right = bisect.bisect_right\ndef LI(): return list(map(int, stdin.readline().split()))\ndef LF(): return list(map(float, stdin.readline().split()))\ndef LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))\ndef II(): return int(stdin.readline())\ndef IF(): return float(stdin.readline())\ndef LS(): return list(map(list, stdin.readline().split()))\ndef S(): return list(stdin.readline().rstrip())\ndef IR(n): return [II() for _ in range(n)]\ndef LIR(n): return [LI() for _ in range(n)]\ndef FR(n): return [IF() for _ in range(n)]\ndef LFR(n): return [LI() for _ in range(n)]\ndef LIR_(n): return [LI_() for _ in range(n)]\ndef SR(n): return [S() for _ in range(n)]\ndef LSR(n): return [LS() for _ in range(n)]\nmod = 1000000007\ninf = float('INF')\n\n#A\ndef A():\n a, b, h = IR(3)\n print((a+b)*h//2)\n return\n\n#B\ndef B():\n d = defaultdict(int)\n d[\"a\"] = deque(S())\n d[\"b\"] = deque(S())\n d[\"c\"] = deque(S())\n tern = \"a\"\n while d[tern]:\n tern = d[tern].popleft()\n print(str.capitalize(tern))\n return\n\n#C\ndef C():\n n, x = LI()\n a = LI()\n ans = 0\n for i in range(n-1):\n if a[i] + a[i + 1] > x:\n if x > a[i]:\n ans += a[i] + a[i + 1] - x\n a[i + 1] = x - a[i]\n else:\n ans += a[i] + a[i + 1] - x\n a[i + 1] = 0\n print(ans)\n return\n\n#D\ndef D():\n h, w, n = LI()\n ans = [(h - 2) * (w - 2)] + [0] * 9\n d = defaultdict(int)\n for _ in range(n):\n a, b = LI()\n for mb in range(-1, 2):\n mb += b\n for ma in range(-1, 2):\n if mb == ma == 0:\n continue\n ma += a\n if 2 <= ma < h and 2 <= mb < w:\n d[(ma, mb)] += 1\n for _, value in d.items():\n ans[value] += 1\n ans[0] -= 1\n print(\"\\n\".join(map(str, ans)))\n return\n\n#Solve\nif __name__ == '__main__':\n D()", "from collections import defaultdict", "from collections import deque", "from heapq import heappush, heappop", "import sys", "sys", "import math", "math", "import bisect", "bisect", "import random", "random", "import itertools", "itertools", "sys.setrecursionlimit(10**5)", "sys.setrecursionlimit", "sys", "setrecursionlimit", "10**5", "10", "5", "stdin = sys.stdin", "stdin", "sys.stdin", "sys", "stdin", "bisect_left = bisect.bisect_left", "bisect_left", "bisect.bisect_left", "bisect", "bisect_left", "bisect_right = bisect.bisect_right", "bisect_right", "bisect.bisect_right", "bisect", "bisect_right", "def LI(): return list(map(int, stdin.readline().split()))", "LI", "def LF(): return list(map(float, stdin.readline().split()))", "LF", "def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))", "LI_", "def II(): return int(stdin.readline())", "II", "def IF(): return float(stdin.readline())", "IF", "def LS(): return list(map(list, stdin.readline().split()))", "LS", "def S(): return list(stdin.readline().rstrip())", "S", "II() for _ in range(n)", "for _ in range(n)", "_", "range(n)", "range", "n", "for _ in range(n)", "II()", "II", "def IR(n): return [II() for _ in range(n)]", "IR", "n", "n", "LI() for _ in range(n)", "for _ in range(n)", "_", "range(n)", "range", "n", "for _ in range(n)", "LI()", "LI", "def LIR(n): return [LI() for _ in range(n)]", "LIR", "n", "n", "IF() for _ in range(n)", "for _ in range(n)", "_", "range(n)", "range", "n", "for _ in range(n)", "IF()", "IF", "def FR(n): return [IF() for _ in range(n)]", "FR", "n", "n", "LI() for _ in range(n)", "for _ in range(n)", "_", "range(n)", "range", "n", "for _ in range(n)", "LI()", "LI", "def LFR(n): return [LI() for _ in range(n)]", "LFR", "n", "n", "LI_() for _ in range(n)", "for _ in range(n)", "_", "range(n)", "range", "n", "for _ in range(n)", "LI_()", "LI_", "def LIR_(n): return [LI_() for _ in range(n)]", "LIR_", "n", "n", "S() for _ in range(n)", "for _ in range(n)", "_", "range(n)", "range", "n", "for _ in range(n)", "S()", "S", "def SR(n): return [S() for _ in range(n)]", "SR", "n", "n", "LS() for _ in range(n)", "for _ in range(n)", "_", "range(n)", "range", "n", "for _ in range(n)", "LS()", "LS", "def LSR(n): return [LS() for _ in range(n)]", "LSR", "n", "n", "mod = 1000000007", "mod", "1000000007", "inf = float('INF')", "inf", "float('INF')", "float", "'INF'", "def A():\n a, b, h = IR(3)\n print((a+b)*h//2)\n return\n\n#B", "A", "a, b, h = IR(3)", "a", "IR(3)", "IR", "3", "b", "h", "print((a+b)*h//2)", "print", "(a+b)*h//2", "(a+b)*h", "a+b", "a", "b", "h", "2", "return", "def B():\n d = defaultdict(int)\n d[\"a\"] = deque(S())\n d[\"b\"] = deque(S())\n d[\"c\"] = deque(S())\n tern = \"a\"\n while d[tern]:\n tern = d[tern].popleft()\n print(str.capitalize(tern))\n return\n\n#C", "B", "d = defaultdict(int)", "d", "defaultdict(int)", "defaultdict", "int", "d[\"a\"] = deque(S())", "d[\"a\"]", "d", "\"a\"", "deque(S())", "deque", "S()", "S", "d[\"b\"] = deque(S())", "d[\"b\"]", "d", "\"b\"", "deque(S())", "deque", "S()", "S", "d[\"c\"] = deque(S())", "d[\"c\"]", "d", "\"c\"", "deque(S())", "deque", "S()", "S", "tern = \"a\"", "tern", "\"a\"", "while d[tern]:\n tern = d[tern].popleft()\n ", "d[tern]", "d", "tern", "tern = d[tern].popleft()", "tern", "d[tern].popleft()", "[tern].popleft", "[tern]", "d", "tern", "popleft", "print(str.capitalize(tern))", "print", "str.capitalize(tern)", "str.capitalize", "str", "capitalize", "tern", "return", "def C():\n n, x = LI()\n a = LI()\n ans = 0\n for i in range(n-1):\n if a[i] + a[i + 1] > x:\n if x > a[i]:\n ans += a[i] + a[i + 1] - x\n a[i + 1] = x - a[i]\n else:\n ans += a[i] + a[i + 1] - x\n a[i + 1] = 0\n print(ans)\n return\n\n#D", "C", "n, x = LI()", "n", "LI()", "LI", "x", "a = LI()", "a", "LI()", "LI", "ans = 0", "ans", "0", "for i in range(n-1):\n if a[i] + a[i + 1] > x:\n if x > a[i]:\n ans += a[i] + a[i + 1] - x\n a[i + 1] = x - a[i]\n else:\n ans += a[i] + a[i + 1] - x\n a[i + 1] = 0\n ", "i", "range(n-1)", "range", "n-1", "n", "1", "if a[i] + a[i + 1] > x:\n if x > a[i]:\n ans += a[i] + a[i + 1] - x\n a[i + 1] = x - a[i]\n else:\n ans += a[i] + a[i + 1] - x\n a[i + 1] = 0\n ", "a[i] + a[i + 1] > x", "a[i] + a[i + 1]", "a[i]", "a", "i", "a[i + 1]", "a", "i + 1", "i", "1", "x", "if x > a[i]:\n ans += a[i] + a[i + 1] - x\n a[i + 1] = x - a[i]\n else:\n ans += a[i] + a[i + 1] - x\n a[i + 1] = 0\n ", "x > a[i]", "x", "a[i]", "a", "i", "ans += a[i] + a[i + 1] - x", "ans", "a[i] + a[i + 1] - x", "a[i] + a[i + 1]", "a[i]", "a", "i", "a[i + 1]", "a", "i + 1", "i", "1", "x", "a[i + 1] = x - a[i]", "a[i + 1]", "a", "i + 1", "i", "1", "x - a[i]", "x", "a[i]", "a", "i", "ans += a[i] + a[i + 1] - x", "ans", "a[i] + a[i + 1] - x", "a[i] + a[i + 1]", "a[i]", "a", "i", "a[i + 1]", "a", "i + 1", "i", "1", "x", "a[i + 1] = 0", "a[i + 1]", "a", "i + 1", "i", "1", "0", "print(ans)", "print", "ans", "return", "def D():\n h, w, n = LI()\n ans = [(h - 2) * (w - 2)] + [0] * 9\n d = defaultdict(int)\n for _ in range(n):\n a, b = LI()\n for mb in range(-1, 2):\n mb += b\n for ma in range(-1, 2):\n if mb == ma == 0:\n continue\n ma += a\n if 2 <= ma < h and 2 <= mb < w:\n d[(ma, mb)] += 1\n for _, value in d.items():\n ans[value] += 1\n ans[0] -= 1\n print(\"\\n\".join(map(str, ans)))\n return\n\n#Solve", "D", "h, w, n = LI()", "h", "LI()", "LI", "w", "n", "ans = [(h - 2) * (w - 2)] + [0] * 9", "ans", "[(h - 2) * (w - 2)] + [0] * 9", "[(h - 2) * (w - 2)]", "(h - 2) * (w - 2)", "h - 2", "h", "2", "w - 2", "w", "2", "[0] * 9", "[0]", "0", "9", "d = defaultdict(int)", "d", "defaultdict(int)", "defaultdict", "int", "for _ in range(n):\n a, b = LI()\n for mb in range(-1, 2):\n mb += b\n for ma in range(-1, 2):\n if mb == ma == 0:\n continue\n ma += a\n if 2 <= ma < h and 2 <= mb < w:\n d[(ma, mb)] += 1\n ", "_", "range(n)", "range", "n", "a, b = LI()", "a", "LI()", "LI", "b", "for mb in range(-1, 2):\n mb += b\n for ma in range(-1, 2):\n if mb == ma == 0:\n continue\n ma += a\n if 2 <= ma < h and 2 <= mb < w:\n d[(ma, mb)] += 1\n ", "mb", "range(-1, 2)", "range", "-1", "2", "mb += b", "mb", "b", "for ma in range(-1, 2):\n if mb == ma == 0:\n continue\n ma += a\n if 2 <= ma < h and 2 <= mb < w:\n d[(ma, mb)] += 1\n ", "ma", "range(-1, 2)", "range", "-1", "2", "if mb == ma == 0:\n continue\n ", "mb == ma == 0", "mb == ma", "mb", "ma", "0", "continue", "ma += a", "ma", "a", "if 2 <= ma < h and 2 <= mb < w:\n d[(ma, mb)] += 1\n ", "2 <= ma < h and 2 <= mb < w", "2 <= ma < h", "2 <= ma", "2", "ma", "h", "2 <= mb < w", "2 <= mb", "2", "mb", "w", "d[(ma, mb)] += 1", "d[(ma, mb)]", "d", "(ma, mb)", "ma", "mb", "1", "for _, value in d.items():\n ans[value] += 1\n ans[0] -= 1\n ", "_", "value", "d.items()", "d.items", "d", "items", "ans[value] += 1", "ans[value]", "ans", "value", "1", "ans[0] -= 1", "ans[0]", "ans", "0", "1", "print(\"\\n\".join(map(str, ans)))", "print", "\"\\n\".join(map(str, ans))", "\"\\n\".join", "\"\\n\"", "join", "map(str, ans)", "map", "str", "ans", "return", "if __name__ == '__main__':\n D()", "__name__ == '__main__'", "__name__", "'__main__'", "D()", "D", "def IR(n): return [II() for _ in range(n)]", "def IR(n): return [II() for _ in range(n)]", "IR", "def B():\n d = defaultdict(int)\n d[\"a\"] = deque(S())\n d[\"b\"] = deque(S())\n d[\"c\"] = deque(S())\n tern = \"a\"\n while d[tern]:\n tern = d[tern].popleft()\n print(str.capitalize(tern))\n return\n\n#C", "def B():\n d = defaultdict(int)\n d[\"a\"] = deque(S())\n d[\"b\"] = deque(S())\n d[\"c\"] = deque(S())\n tern = \"a\"\n while d[tern]:\n tern = d[tern].popleft()\n print(str.capitalize(tern))\n return\n\n#C", "B", "bisect_left = bisect.bisect_left", "bisect.bisect_left", "bisect_left", "def FR(n): return [IF() for _ in range(n)]", "def FR(n): return [IF() for _ in range(n)]", "FR", "def D():\n h, w, n = LI()\n ans = [(h - 2) * (w - 2)] + [0] * 9\n d = defaultdict(int)\n for _ in range(n):\n a, b = LI()\n for mb in range(-1, 2):\n mb += b\n for ma in range(-1, 2):\n if mb == ma == 0:\n continue\n ma += a\n if 2 <= ma < h and 2 <= mb < w:\n d[(ma, mb)] += 1\n for _, value in d.items():\n ans[value] += 1\n ans[0] -= 1\n print(\"\\n\".join(map(str, ans)))\n return\n\n#Solve", "def D():\n h, w, n = LI()\n ans = [(h - 2) * (w - 2)] + [0] * 9\n d = defaultdict(int)\n for _ in range(n):\n a, b = LI()\n for mb in range(-1, 2):\n mb += b\n for ma in range(-1, 2):\n if mb == ma == 0:\n continue\n ma += a\n if 2 <= ma < h and 2 <= mb < w:\n d[(ma, mb)] += 1\n for _, value in d.items():\n ans[value] += 1\n ans[0] -= 1\n print(\"\\n\".join(map(str, ans)))\n return\n\n#Solve", "D", "def IF(): return float(stdin.readline())", "def IF(): return float(stdin.readline())", "IF", "def A():\n a, b, h = IR(3)\n print((a+b)*h//2)\n return\n\n#B", "def A():\n a, b, h = IR(3)\n print((a+b)*h//2)\n return\n\n#B", "A", "def LIR(n): return [LI() for _ in range(n)]", "def LIR(n): return [LI() for _ in range(n)]", "LIR", "mod = 1000000007", "1000000007", "mod", "def II(): return int(stdin.readline())", "def II(): return int(stdin.readline())", "II", "def SR(n): return [S() for _ in range(n)]", "def SR(n): return [S() for _ in range(n)]", "SR", "def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))", "def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))", "LI_", "def LF(): return list(map(float, stdin.readline().split()))", "def LF(): return list(map(float, stdin.readline().split()))", "LF", "def LIR_(n): return [LI_() for _ in range(n)]", "def LIR_(n): return [LI_() for _ in range(n)]", "LIR_", "def LS(): return list(map(list, stdin.readline().split()))", "def LS(): return list(map(list, stdin.readline().split()))", "LS", "def LSR(n): return [LS() for _ in range(n)]", "def LSR(n): return [LS() for _ in range(n)]", "LSR", "bisect_right = bisect.bisect_right", "bisect.bisect_right", "bisect_right", "inf = float('INF')", "float('INF')", "inf", "def LFR(n): return [LI() for _ in range(n)]", "def LFR(n): return [LI() for _ in range(n)]", "LFR", "def S(): return list(stdin.readline().rstrip())", "def S(): return list(stdin.readline().rstrip())", "S", "stdin = sys.stdin", "sys.stdin", "stdin", "def C():\n n, x = LI()\n a = LI()\n ans = 0\n for i in range(n-1):\n if a[i] + a[i + 1] > x:\n if x > a[i]:\n ans += a[i] + a[i + 1] - x\n a[i + 1] = x - a[i]\n else:\n ans += a[i] + a[i + 1] - x\n a[i + 1] = 0\n print(ans)\n return\n\n#D", "def C():\n n, x = LI()\n a = LI()\n ans = 0\n for i in range(n-1):\n if a[i] + a[i + 1] > x:\n if x > a[i]:\n ans += a[i] + a[i + 1] - x\n a[i + 1] = x - a[i]\n else:\n ans += a[i] + a[i + 1] - x\n a[i + 1] = 0\n print(ans)\n return\n\n#D", "C", "def LI(): return list(map(int, stdin.readline().split()))", "def LI(): return list(map(int, stdin.readline().split()))", "LI" ]
#!/usr/bin/env python3 from collections import defaultdict from collections import deque from heapq import heappush, heappop import sys import math import bisect import random import itertools sys.setrecursionlimit(10**5) stdin = sys.stdin bisect_left = bisect.bisect_left bisect_right = bisect.bisect_right def LI(): return list(map(int, stdin.readline().split())) def LF(): return list(map(float, stdin.readline().split())) def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split())) def II(): return int(stdin.readline()) def IF(): return float(stdin.readline()) def LS(): return list(map(list, stdin.readline().split())) def S(): return list(stdin.readline().rstrip()) def IR(n): return [II() for _ in range(n)] def LIR(n): return [LI() for _ in range(n)] def FR(n): return [IF() for _ in range(n)] def LFR(n): return [LI() for _ in range(n)] def LIR_(n): return [LI_() for _ in range(n)] def SR(n): return [S() for _ in range(n)] def LSR(n): return [LS() for _ in range(n)] mod = 1000000007 inf = float('INF') #A def A(): a, b, h = IR(3) print((a+b)*h//2) return #B def B(): d = defaultdict(int) d["a"] = deque(S()) d["b"] = deque(S()) d["c"] = deque(S()) tern = "a" while d[tern]: tern = d[tern].popleft() print(str.capitalize(tern)) return #C def C(): n, x = LI() a = LI() ans = 0 for i in range(n-1): if a[i] + a[i + 1] > x: if x > a[i]: ans += a[i] + a[i + 1] - x a[i + 1] = x - a[i] else: ans += a[i] + a[i + 1] - x a[i + 1] = 0 print(ans) return #D def D(): h, w, n = LI() ans = [(h - 2) * (w - 2)] + [0] * 9 d = defaultdict(int) for _ in range(n): a, b = LI() for mb in range(-1, 2): mb += b for ma in range(-1, 2): if mb == ma == 0: continue ma += a if 2 <= ma < h and 2 <= mb < w: d[(ma, mb)] += 1 for _, value in d.items(): ans[value] += 1 ans[0] -= 1 print("\n".join(map(str, ans))) return #Solve if __name__ == '__main__': D()
[ 7, 15, 13, 0, 13, 4, 13, 13, 4, 18, 4, 13, 13, 13, 13, 0, 13, 39, 17, 17, 17, 0, 13, 39, 28, 13, 4, 13, 13, 0, 13, 4, 13, 13, 4, 18, 4, 13, 13, 13, 28, 13, 13, 28, 13, 13, 14, 2, 40, 40, 17, 2, 2, 13, 17, 13, 2, 13, 17, 40, 40, 17, 2, 2, 13, 17, 13, 2, 13, 17, 4, 18, 13, 13, 39, 2, 2, 13, 17, 13, 2, 2, 13, 17, 13, 0, 13, 4, 18, 13, 13, 4, 18, 4, 18, 13, 13, 13, 13, 0, 13, 2, 2, 2, 13, 17, 2, 13, 17, 4, 13, 4, 18, 13, 13, 4, 13, 13, 28, 13, 4, 13, 17, 17, 4, 13, 18, 13, 13, 10, 39, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 39, 13, 10, 4, 13, 10, 2, 13, 10, 4, 13, 10, 4, 13 ]
[ [ 154, 4 ], [ 154, 13 ], [ 154, 14 ], [ 130, 16 ], [ 142, 22 ], [ 26, 25 ], [ 152, 28 ], [ 145, 30 ], [ 145, 39 ], [ 42, 41 ], [ 131, 41 ], [ 45, 44 ], [ 131, 44 ], [ 146, 53 ], [ 41, 55 ], [ 134, 57 ], [ 137, 64 ], [ 44, 66 ], [ 155, 68 ], [ 143, 72 ], [ 146, 77 ], [ 41, 79 ], [ 137, 82 ], [ 44, 84 ], [ 139, 86 ], [ 143, 97 ], [ 148, 100 ], [ 134, 104 ], [ 155, 107 ], [ 140, 113 ], [ 149, 117 ], [ 120, 119 ], [ 140, 127 ], [ 119, 128 ], [ 130, 131 ], [ 154, 134 ], [ 145, 137 ], [ 139, 140 ], [ 142, 143 ], [ 145, 146 ], [ 148, 149 ], [ 154, 152 ], [ 154, 155 ] ]
[ "import collections\nH, W, N = map(int, input().split())\n\ndelta = (-1, 0, 1)\n\nans = []\nfor i in range(N):\n a, b = map(int, input().split())\n for da in delta:\n for db in delta:\n if 1 <= a-1+da <= H-2 and 1 <= b-1+db <= W-2:\n ans.append((a-1+da, b-1+db))\n\ncc = collections.Counter(collections.Counter(ans).values())\nzc = (H-2)*(W-2)-sum(cc.values())\nprint(zc)\nfor i in range(1, 10):\n print(cc[i])", "import collections", "collections", "H, W, N = map(int, input().split())", "H", "map(int, input().split())", "map", "int", "input().split()", "().split", "()", "input", "split", "W", "N", "delta = (-1, 0, 1)", "delta", "(-1, 0, 1)", "-1", "0", "1", "ans = []", "ans", "[]", "for i in range(N):\n a, b = map(int, input().split())\n for da in delta:\n for db in delta:\n if 1 <= a-1+da <= H-2 and 1 <= b-1+db <= W-2:\n ans.append((a-1+da, b-1+db))", "i", "range(N)", "range", "N", "a, b = map(int, input().split())", "a", "map(int, input().split())", "map", "int", "input().split()", "().split", "()", "input", "split", "b", "for da in delta:\n for db in delta:\n if 1 <= a-1+da <= H-2 and 1 <= b-1+db <= W-2:\n ans.append((a-1+da, b-1+db))", "da", "delta", "for db in delta:\n if 1 <= a-1+da <= H-2 and 1 <= b-1+db <= W-2:\n ans.append((a-1+da, b-1+db))", "db", "delta", "if 1 <= a-1+da <= H-2 and 1 <= b-1+db <= W-2:\n ans.append((a-1+da, b-1+db))", "1 <= a-1+da <= H-2 and 1 <= b-1+db <= W-2", "1 <= a-1+da <= H-2", "1 <= a-1+da", "1", "a-1+da", "a-1", "a", "1", "da", "H-2", "H", "2", "1 <= b-1+db <= W-2", "1 <= b-1+db", "1", "b-1+db", "b-1", "b", "1", "db", "W-2", "W", "2", "ans.append((a-1+da, b-1+db))", "ans.append", "ans", "append", "(a-1+da, b-1+db)", "a-1+da", "a-1", "a", "1", "da", "b-1+db", "b-1", "b", "1", "db", "cc = collections.Counter(collections.Counter(ans).values())", "cc", "collections.Counter(collections.Counter(ans).values())", "collections.Counter", "collections", "Counter", "collections.Counter(ans).values()", "collections.Counter(ans).values", "collections.Counter(ans)", "collections.Counter", "collections", "Counter", "ans", "values", "zc = (H-2)*(W-2)-sum(cc.values())", "zc", "(H-2)*(W-2)-sum(cc.values())", "(H-2)*(W-2)", "H-2", "H", "2", "W-2", "W", "2", "sum(cc.values())", "sum", "cc.values()", "cc.values", "cc", "values", "print(zc)", "print", "zc", "for i in range(1, 10):\n print(cc[i])", "i", "range(1, 10)", "range", "1", "10", "print(cc[i])", "print", "cc[i]", "cc", "i", "delta = (-1, 0, 1)", "(-1, 0, 1)", "delta", "H, W, N = map(int, input().split())", "map(int, input().split())", "H", "b = map(int, input().split())", "map(int, input().split())", "b", "cc = collections.Counter(collections.Counter(ans).values())", "collections.Counter(collections.Counter(ans).values())", "cc", "ans = []", "[]", "ans", "a, b = map(int, input().split())", "map(int, input().split())", "a", "zc = (H-2)*(W-2)-sum(cc.values())", "(H-2)*(W-2)-sum(cc.values())", "zc", "N = map(int, input().split())", "map(int, input().split())", "N", "W, N = map(int, input().split())", "map(int, input().split())", "W" ]
import collections H, W, N = map(int, input().split()) delta = (-1, 0, 1) ans = [] for i in range(N): a, b = map(int, input().split()) for da in delta: for db in delta: if 1 <= a-1+da <= H-2 and 1 <= b-1+db <= W-2: ans.append((a-1+da, b-1+db)) cc = collections.Counter(collections.Counter(ans).values()) zc = (H-2)*(W-2)-sum(cc.values()) print(zc) for i in range(1, 10): print(cc[i])
[ 7, 12, 13, 15, 13, 0, 13, 18, 18, 13, 13, 13, 0, 13, 4, 13, 13, 4, 18, 4, 13, 13, 13, 13, 0, 13, 17, 28, 13, 4, 13, 13, 0, 13, 4, 13, 13, 4, 18, 4, 13, 13, 13, 14, 2, 39, 13, 13, 13, 0, 18, 13, 39, 13, 13, 17, 0, 18, 13, 39, 13, 13, 17, 14, 2, 40, 2, 13, 17, 13, 2, 39, 2, 13, 17, 13, 13, 0, 18, 13, 39, 2, 13, 17, 13, 17, 14, 40, 2, 13, 17, 13, 0, 18, 13, 39, 2, 13, 17, 13, 17, 14, 2, 40, 2, 13, 17, 13, 2, 39, 2, 13, 17, 13, 13, 0, 18, 13, 39, 2, 13, 17, 13, 17, 14, 40, 2, 13, 17, 13, 0, 18, 13, 39, 2, 13, 17, 13, 17, 14, 2, 40, 2, 13, 17, 13, 2, 39, 13, 2, 13, 17, 13, 0, 18, 13, 39, 13, 2, 13, 17, 17, 14, 40, 2, 13, 17, 13, 0, 18, 13, 39, 13, 2, 13, 17, 17, 14, 2, 40, 2, 13, 17, 13, 2, 39, 13, 2, 13, 17, 13, 0, 18, 13, 39, 13, 2, 13, 17, 17, 14, 40, 2, 13, 17, 13, 0, 18, 13, 39, 13, 2, 13, 17, 17, 14, 2, 2, 40, 2, 13, 17, 13, 40, 2, 13, 17, 13, 2, 39, 2, 13, 17, 2, 13, 17, 13, 0, 18, 13, 39, 2, 13, 17, 2, 13, 17, 17, 14, 2, 40, 2, 13, 17, 13, 40, 2, 13, 17, 13, 0, 18, 13, 39, 2, 13, 17, 2, 13, 17, 17, 14, 2, 2, 40, 2, 13, 17, 13, 40, 2, 13, 17, 13, 2, 39, 2, 13, 17, 2, 13, 17, 13, 0, 18, 13, 39, 2, 13, 17, 2, 13, 17, 17, 14, 2, 40, 2, 13, 17, 13, 40, 2, 13, 17, 13, 0, 18, 13, 39, 2, 13, 17, 2, 13, 17, 17, 14, 2, 2, 40, 2, 13, 17, 13, 40, 2, 13, 17, 13, 2, 39, 2, 13, 17, 2, 13, 17, 13, 0, 18, 13, 39, 2, 13, 17, 2, 13, 17, 17, 14, 2, 40, 2, 13, 17, 13, 40, 2, 13, 17, 13, 0, 18, 13, 39, 2, 13, 17, 2, 13, 17, 17, 14, 2, 2, 40, 2, 13, 17, 13, 40, 2, 13, 17, 13, 2, 39, 2, 13, 17, 2, 13, 17, 13, 0, 18, 13, 39, 2, 13, 17, 2, 13, 17, 17, 14, 2, 40, 2, 13, 17, 13, 40, 2, 13, 17, 13, 0, 18, 13, 39, 2, 13, 17, 2, 13, 17, 17, 0, 13, 2, 39, 17, 17, 28, 13, 13, 14, 2, 2, 18, 13, 17, 17, 2, 18, 13, 17, 17, 0, 18, 13, 18, 13, 13, 17, 0, 18, 13, 17, 2, 2, 2, 2, 2, 13, 13, 4, 13, 13, 2, 13, 17, 2, 13, 17, 17, 28, 13, 13, 4, 13, 13, 14, 2, 13, 17, 4, 13, 10, 12, 13 ]
[ [ 7, 6 ], [ 14, 13 ], [ 6, 20 ], [ 14, 22 ], [ 14, 23 ], [ 26, 25 ], [ 29, 28 ], [ 23, 31 ], [ 34, 33 ], [ 6, 40 ], [ 34, 42 ], [ 25, 48 ], [ 55, 50 ], [ 25, 51 ], [ 62, 57 ], [ 25, 58 ], [ 33, 67 ], [ 13, 69 ], [ 33, 73 ], [ 25, 76 ], [ 85, 78 ], [ 25, 79 ], [ 33, 82 ], [ 33, 89 ], [ 13, 91 ], [ 100, 93 ], [ 25, 94 ], [ 33, 97 ], [ 33, 105 ], [ 13, 107 ], [ 33, 111 ], [ 25, 114 ], [ 123, 116 ], [ 25, 117 ], [ 33, 120 ], [ 33, 127 ], [ 13, 129 ], [ 138, 131 ], [ 25, 132 ], [ 33, 135 ], [ 42, 143 ], [ 22, 145 ], [ 42, 150 ], [ 25, 152 ], [ 161, 154 ], [ 25, 155 ], [ 42, 159 ], [ 42, 165 ], [ 22, 167 ], [ 176, 169 ], [ 25, 170 ], [ 42, 174 ], [ 42, 181 ], [ 22, 183 ], [ 42, 188 ], [ 25, 190 ], [ 199, 192 ], [ 25, 193 ], [ 42, 197 ], [ 42, 203 ], [ 22, 205 ], [ 214, 207 ], [ 25, 208 ], [ 42, 212 ], [ 42, 220 ], [ 22, 222 ], [ 33, 225 ], [ 13, 227 ], [ 33, 231 ], [ 42, 234 ], [ 25, 236 ], [ 247, 238 ], [ 25, 239 ], [ 33, 242 ], [ 42, 245 ], [ 42, 252 ], [ 22, 254 ], [ 33, 257 ], [ 13, 259 ], [ 270, 261 ], [ 25, 262 ], [ 33, 265 ], [ 42, 268 ], [ 42, 276 ], [ 22, 278 ], [ 33, 281 ], [ 13, 283 ], [ 33, 287 ], [ 42, 290 ], [ 25, 292 ], [ 303, 294 ], [ 25, 295 ], [ 33, 298 ], [ 42, 301 ], [ 42, 308 ], [ 22, 310 ], [ 33, 313 ], [ 13, 315 ], [ 326, 317 ], [ 25, 318 ], [ 33, 321 ], [ 42, 324 ], [ 42, 332 ], [ 22, 334 ], [ 33, 337 ], [ 13, 339 ], [ 33, 343 ], [ 42, 346 ], [ 25, 348 ], [ 359, 350 ], [ 25, 351 ], [ 33, 354 ], [ 42, 357 ], [ 42, 364 ], [ 22, 366 ], [ 33, 369 ], [ 13, 371 ], [ 382, 373 ], [ 25, 374 ], [ 33, 377 ], [ 42, 380 ], [ 42, 388 ], [ 22, 390 ], [ 33, 393 ], [ 13, 395 ], [ 33, 399 ], [ 42, 402 ], [ 25, 404 ], [ 415, 406 ], [ 25, 407 ], [ 33, 410 ], [ 42, 413 ], [ 42, 420 ], [ 22, 422 ], [ 33, 425 ], [ 13, 427 ], [ 438, 429 ], [ 25, 430 ], [ 33, 433 ], [ 42, 436 ], [ 441, 440 ], [ 447, 446 ], [ 25, 446 ], [ 446, 452 ], [ 446, 457 ], [ 466, 461 ], [ 440, 462 ], [ 25, 464 ], [ 446, 465 ], [ 471, 468 ], [ 440, 469 ], [ 13, 476 ], [ 22, 477 ], [ 440, 480 ], [ 22, 482 ], [ 13, 485 ], [ 490, 489 ], [ 440, 489 ], [ 489, 493 ], [ 502, 499 ] ]
[ "def sol():\n import sys\n input=sys.stdin.readline\n h,w,n=map(int,input().split())\n d={}\n for i in range(n):\n y,x=map(int,input().split())\n if (y,x) in d:\n d[(y,x)]+=1\n else:\n d[(y,x)]=1\n if y+1<=h and (y+1,x) in d:\n d[(y+1,x)]+=1\n elif y+1<=h:\n d[(y+1,x)]=1\n if y+2<=h and (y+2,x) in d:\n d[(y+2,x)]+=1\n elif y+2<=h:\n d[(y+2,x)]=1\n \n if x+1<=w and (y,x+1) in d:\n d[(y,x+1)]+=1\n elif x+1<=w:\n d[(y,x+1)]=1\n if x+2<=w and (y,x+2) in d:\n d[(y,x+2)]+=1\n elif x+2<=w:\n d[(y,x+2)]=1\n if x+1<=w and y+1<=h and (y+1,x+1) in d:\n d[(y+1,x+1)]+=1\n elif x+1<=w and y+1<=h:\n d[(y+1,x+1)]=1\n if x+2<=w and y+1<=h and (y+1,x+2) in d:\n d[(y+1,x+2)]+=1\n elif x+2<=w and y+1<=h:\n d[(y+1,x+2)]=1\n if x+1<=w and y+2<=h and (y+2,x+1) in d:\n d[(y+2,x+1)]+=1\n elif x+1<=w and y+2<=h:\n d[(y+2,x+1)]=1\n if x+2<=w and y+2<=h and (y+2,x+2) in d:\n d[(y+2,x+2)]+=1\n elif x+2<=w and y+2<=h:\n d[(y+2,x+2)]=1\n ans=[0]*10\n for i in d:\n if i[0]>2 and i[1]>2:\n ans[d[i]]+=1\n \n ans[0]=h*w-sum(ans)-w*2-h*2+4\n for i in ans:\n print(i)\n \nif __name__==\"__main__\":\n sol()", "def sol():\n import sys\n input=sys.stdin.readline\n h,w,n=map(int,input().split())\n d={}\n for i in range(n):\n y,x=map(int,input().split())\n if (y,x) in d:\n d[(y,x)]+=1\n else:\n d[(y,x)]=1\n if y+1<=h and (y+1,x) in d:\n d[(y+1,x)]+=1\n elif y+1<=h:\n d[(y+1,x)]=1\n if y+2<=h and (y+2,x) in d:\n d[(y+2,x)]+=1\n elif y+2<=h:\n d[(y+2,x)]=1\n \n if x+1<=w and (y,x+1) in d:\n d[(y,x+1)]+=1\n elif x+1<=w:\n d[(y,x+1)]=1\n if x+2<=w and (y,x+2) in d:\n d[(y,x+2)]+=1\n elif x+2<=w:\n d[(y,x+2)]=1\n if x+1<=w and y+1<=h and (y+1,x+1) in d:\n d[(y+1,x+1)]+=1\n elif x+1<=w and y+1<=h:\n d[(y+1,x+1)]=1\n if x+2<=w and y+1<=h and (y+1,x+2) in d:\n d[(y+1,x+2)]+=1\n elif x+2<=w and y+1<=h:\n d[(y+1,x+2)]=1\n if x+1<=w and y+2<=h and (y+2,x+1) in d:\n d[(y+2,x+1)]+=1\n elif x+1<=w and y+2<=h:\n d[(y+2,x+1)]=1\n if x+2<=w and y+2<=h and (y+2,x+2) in d:\n d[(y+2,x+2)]+=1\n elif x+2<=w and y+2<=h:\n d[(y+2,x+2)]=1\n ans=[0]*10\n for i in d:\n if i[0]>2 and i[1]>2:\n ans[d[i]]+=1\n \n ans[0]=h*w-sum(ans)-w*2-h*2+4\n for i in ans:\n print(i)\n ", "sol", "import sys", "sys", "input=sys.stdin.readline", "input", "sys.stdin.readline", "sys.stdin", "sys", "stdin", "readline", "h,w,n=map(int,input().split())", "h", "map(int,input().split())", "map", "int", "input().split()", "().split", "()", "input", "split", "w", "n", "d={}", "d", "{}", "for i in range(n):\n y,x=map(int,input().split())\n if (y,x) in d:\n d[(y,x)]+=1\n else:\n d[(y,x)]=1\n if y+1<=h and (y+1,x) in d:\n d[(y+1,x)]+=1\n elif y+1<=h:\n d[(y+1,x)]=1\n if y+2<=h and (y+2,x) in d:\n d[(y+2,x)]+=1\n elif y+2<=h:\n d[(y+2,x)]=1\n \n if x+1<=w and (y,x+1) in d:\n d[(y,x+1)]+=1\n elif x+1<=w:\n d[(y,x+1)]=1\n if x+2<=w and (y,x+2) in d:\n d[(y,x+2)]+=1\n elif x+2<=w:\n d[(y,x+2)]=1\n if x+1<=w and y+1<=h and (y+1,x+1) in d:\n d[(y+1,x+1)]+=1\n elif x+1<=w and y+1<=h:\n d[(y+1,x+1)]=1\n if x+2<=w and y+1<=h and (y+1,x+2) in d:\n d[(y+1,x+2)]+=1\n elif x+2<=w and y+1<=h:\n d[(y+1,x+2)]=1\n if x+1<=w and y+2<=h and (y+2,x+1) in d:\n d[(y+2,x+1)]+=1\n elif x+1<=w and y+2<=h:\n d[(y+2,x+1)]=1\n if x+2<=w and y+2<=h and (y+2,x+2) in d:\n d[(y+2,x+2)]+=1\n elif x+2<=w and y+2<=h:\n d[(y+2,x+2)]=1\n ", "i", "range(n)", "range", "n", "y,x=map(int,input().split())", "y", "map(int,input().split())", "map", "int", "input().split()", "().split", "()", "input", "split", "x", "if (y,x) in d:\n d[(y,x)]+=1\n else:\n d[(y,x)]=1\n ", "(y,x) in d", "(y,x)", "y", "x", "d", "d[(y,x)]+=1", "d[(y,x)]", "d", "(y,x)", "y", "x", "1", "d[(y,x)]=1", "d[(y,x)]", "d", "(y,x)", "y", "x", "1", "if y+1<=h and (y+1,x) in d:\n d[(y+1,x)]+=1\n elif y+1<=h:\n d[(y+1,x)]=1\n ", "y+1<=h and (y+1,x) in d", "y+1<=h", "y+1", "y", "1", "h", "(y+1,x) in d", "(y+1,x)", "y+1", "y", "1", "x", "d", "d[(y+1,x)]+=1", "d[(y+1,x)]", "d", "(y+1,x)", "y+1", "y", "1", "x", "1", "elif y+1<=h:\n d[(y+1,x)]=1\n ", "y+1<=h", "y+1", "y", "1", "h", "d[(y+1,x)]=1", "d[(y+1,x)]", "d", "(y+1,x)", "y+1", "y", "1", "x", "1", "if y+2<=h and (y+2,x) in d:\n d[(y+2,x)]+=1\n elif y+2<=h:\n d[(y+2,x)]=1\n \n ", "y+2<=h and (y+2,x) in d", "y+2<=h", "y+2", "y", "2", "h", "(y+2,x) in d", "(y+2,x)", "y+2", "y", "2", "x", "d", "d[(y+2,x)]+=1", "d[(y+2,x)]", "d", "(y+2,x)", "y+2", "y", "2", "x", "1", "elif y+2<=h:\n d[(y+2,x)]=1\n \n ", "y+2<=h", "y+2", "y", "2", "h", "d[(y+2,x)]=1", "d[(y+2,x)]", "d", "(y+2,x)", "y+2", "y", "2", "x", "1", "if x+1<=w and (y,x+1) in d:\n d[(y,x+1)]+=1\n elif x+1<=w:\n d[(y,x+1)]=1\n ", "x+1<=w and (y,x+1) in d", "x+1<=w", "x+1", "x", "1", "w", "(y,x+1) in d", "(y,x+1)", "y", "x+1", "x", "1", "d", "d[(y,x+1)]+=1", "d[(y,x+1)]", "d", "(y,x+1)", "y", "x+1", "x", "1", "1", "elif x+1<=w:\n d[(y,x+1)]=1\n ", "x+1<=w", "x+1", "x", "1", "w", "d[(y,x+1)]=1", "d[(y,x+1)]", "d", "(y,x+1)", "y", "x+1", "x", "1", "1", "if x+2<=w and (y,x+2) in d:\n d[(y,x+2)]+=1\n elif x+2<=w:\n d[(y,x+2)]=1\n ", "x+2<=w and (y,x+2) in d", "x+2<=w", "x+2", "x", "2", "w", "(y,x+2) in d", "(y,x+2)", "y", "x+2", "x", "2", "d", "d[(y,x+2)]+=1", "d[(y,x+2)]", "d", "(y,x+2)", "y", "x+2", "x", "2", "1", "elif x+2<=w:\n d[(y,x+2)]=1\n ", "x+2<=w", "x+2", "x", "2", "w", "d[(y,x+2)]=1", "d[(y,x+2)]", "d", "(y,x+2)", "y", "x+2", "x", "2", "1", "if x+1<=w and y+1<=h and (y+1,x+1) in d:\n d[(y+1,x+1)]+=1\n elif x+1<=w and y+1<=h:\n d[(y+1,x+1)]=1\n ", "x+1<=w and y+1<=h and (y+1,x+1) in d", "x+1<=w and y+1<=h", "x+1<=w", "x+1", "x", "1", "w", "y+1<=h", "y+1", "y", "1", "h", "(y+1,x+1) in d", "(y+1,x+1)", "y+1", "y", "1", "x+1", "x", "1", "d", "d[(y+1,x+1)]+=1", "d[(y+1,x+1)]", "d", "(y+1,x+1)", "y+1", "y", "1", "x+1", "x", "1", "1", "elif x+1<=w and y+1<=h:\n d[(y+1,x+1)]=1\n ", "x+1<=w and y+1<=h", "x+1<=w", "x+1", "x", "1", "w", "y+1<=h", "y+1", "y", "1", "h", "d[(y+1,x+1)]=1", "d[(y+1,x+1)]", "d", "(y+1,x+1)", "y+1", "y", "1", "x+1", "x", "1", "1", "if x+2<=w and y+1<=h and (y+1,x+2) in d:\n d[(y+1,x+2)]+=1\n elif x+2<=w and y+1<=h:\n d[(y+1,x+2)]=1\n ", "x+2<=w and y+1<=h and (y+1,x+2) in d", "x+2<=w and y+1<=h", "x+2<=w", "x+2", "x", "2", "w", "y+1<=h", "y+1", "y", "1", "h", "(y+1,x+2) in d", "(y+1,x+2)", "y+1", "y", "1", "x+2", "x", "2", "d", "d[(y+1,x+2)]+=1", "d[(y+1,x+2)]", "d", "(y+1,x+2)", "y+1", "y", "1", "x+2", "x", "2", "1", "elif x+2<=w and y+1<=h:\n d[(y+1,x+2)]=1\n ", "x+2<=w and y+1<=h", "x+2<=w", "x+2", "x", "2", "w", "y+1<=h", "y+1", "y", "1", "h", "d[(y+1,x+2)]=1", "d[(y+1,x+2)]", "d", "(y+1,x+2)", "y+1", "y", "1", "x+2", "x", "2", "1", "if x+1<=w and y+2<=h and (y+2,x+1) in d:\n d[(y+2,x+1)]+=1\n elif x+1<=w and y+2<=h:\n d[(y+2,x+1)]=1\n ", "x+1<=w and y+2<=h and (y+2,x+1) in d", "x+1<=w and y+2<=h", "x+1<=w", "x+1", "x", "1", "w", "y+2<=h", "y+2", "y", "2", "h", "(y+2,x+1) in d", "(y+2,x+1)", "y+2", "y", "2", "x+1", "x", "1", "d", "d[(y+2,x+1)]+=1", "d[(y+2,x+1)]", "d", "(y+2,x+1)", "y+2", "y", "2", "x+1", "x", "1", "1", "elif x+1<=w and y+2<=h:\n d[(y+2,x+1)]=1\n ", "x+1<=w and y+2<=h", "x+1<=w", "x+1", "x", "1", "w", "y+2<=h", "y+2", "y", "2", "h", "d[(y+2,x+1)]=1", "d[(y+2,x+1)]", "d", "(y+2,x+1)", "y+2", "y", "2", "x+1", "x", "1", "1", "if x+2<=w and y+2<=h and (y+2,x+2) in d:\n d[(y+2,x+2)]+=1\n elif x+2<=w and y+2<=h:\n d[(y+2,x+2)]=1\n ", "x+2<=w and y+2<=h and (y+2,x+2) in d", "x+2<=w and y+2<=h", "x+2<=w", "x+2", "x", "2", "w", "y+2<=h", "y+2", "y", "2", "h", "(y+2,x+2) in d", "(y+2,x+2)", "y+2", "y", "2", "x+2", "x", "2", "d", "d[(y+2,x+2)]+=1", "d[(y+2,x+2)]", "d", "(y+2,x+2)", "y+2", "y", "2", "x+2", "x", "2", "1", "elif x+2<=w and y+2<=h:\n d[(y+2,x+2)]=1\n ", "x+2<=w and y+2<=h", "x+2<=w", "x+2", "x", "2", "w", "y+2<=h", "y+2", "y", "2", "h", "d[(y+2,x+2)]=1", "d[(y+2,x+2)]", "d", "(y+2,x+2)", "y+2", "y", "2", "x+2", "x", "2", "1", "ans=[0]*10", "ans", "[0]*10", "[0]", "0", "10", "for i in d:\n if i[0]>2 and i[1]>2:\n ans[d[i]]+=1\n \n ", "i", "d", "if i[0]>2 and i[1]>2:\n ans[d[i]]+=1\n \n ", "i[0]>2 and i[1]>2", "i[0]>2", "i[0]", "i", "0", "2", "i[1]>2", "i[1]", "i", "1", "2", "ans[d[i]]+=1", "ans[d[i]]", "ans", "d[i]", "d", "i", "1", "ans[0]=h*w-sum(ans)-w*2-h*2+4", "ans[0]", "ans", "0", "h*w-sum(ans)-w*2-h*2+4", "h*w-sum(ans)-w*2-h*2", "h*w-sum(ans)-w*2", "h*w-sum(ans)", "h*w", "h", "w", "sum(ans)", "sum", "ans", "w*2", "w", "2", "h*2", "h", "2", "4", "for i in ans:\n print(i)\n ", "i", "ans", "print(i)", "print", "i", "if __name__==\"__main__\":\n sol()", "__name__==\"__main__\"", "__name__", "\"__main__\"", "sol()", "sol", "def sol():\n import sys\n input=sys.stdin.readline\n h,w,n=map(int,input().split())\n d={}\n for i in range(n):\n y,x=map(int,input().split())\n if (y,x) in d:\n d[(y,x)]+=1\n else:\n d[(y,x)]=1\n if y+1<=h and (y+1,x) in d:\n d[(y+1,x)]+=1\n elif y+1<=h:\n d[(y+1,x)]=1\n if y+2<=h and (y+2,x) in d:\n d[(y+2,x)]+=1\n elif y+2<=h:\n d[(y+2,x)]=1\n \n if x+1<=w and (y,x+1) in d:\n d[(y,x+1)]+=1\n elif x+1<=w:\n d[(y,x+1)]=1\n if x+2<=w and (y,x+2) in d:\n d[(y,x+2)]+=1\n elif x+2<=w:\n d[(y,x+2)]=1\n if x+1<=w and y+1<=h and (y+1,x+1) in d:\n d[(y+1,x+1)]+=1\n elif x+1<=w and y+1<=h:\n d[(y+1,x+1)]=1\n if x+2<=w and y+1<=h and (y+1,x+2) in d:\n d[(y+1,x+2)]+=1\n elif x+2<=w and y+1<=h:\n d[(y+1,x+2)]=1\n if x+1<=w and y+2<=h and (y+2,x+1) in d:\n d[(y+2,x+1)]+=1\n elif x+1<=w and y+2<=h:\n d[(y+2,x+1)]=1\n if x+2<=w and y+2<=h and (y+2,x+2) in d:\n d[(y+2,x+2)]+=1\n elif x+2<=w and y+2<=h:\n d[(y+2,x+2)]=1\n ans=[0]*10\n for i in d:\n if i[0]>2 and i[1]>2:\n ans[d[i]]+=1\n \n ans[0]=h*w-sum(ans)-w*2-h*2+4\n for i in ans:\n print(i)\n ", "def sol():\n import sys\n input=sys.stdin.readline\n h,w,n=map(int,input().split())\n d={}\n for i in range(n):\n y,x=map(int,input().split())\n if (y,x) in d:\n d[(y,x)]+=1\n else:\n d[(y,x)]=1\n if y+1<=h and (y+1,x) in d:\n d[(y+1,x)]+=1\n elif y+1<=h:\n d[(y+1,x)]=1\n if y+2<=h and (y+2,x) in d:\n d[(y+2,x)]+=1\n elif y+2<=h:\n d[(y+2,x)]=1\n \n if x+1<=w and (y,x+1) in d:\n d[(y,x+1)]+=1\n elif x+1<=w:\n d[(y,x+1)]=1\n if x+2<=w and (y,x+2) in d:\n d[(y,x+2)]+=1\n elif x+2<=w:\n d[(y,x+2)]=1\n if x+1<=w and y+1<=h and (y+1,x+1) in d:\n d[(y+1,x+1)]+=1\n elif x+1<=w and y+1<=h:\n d[(y+1,x+1)]=1\n if x+2<=w and y+1<=h and (y+1,x+2) in d:\n d[(y+1,x+2)]+=1\n elif x+2<=w and y+1<=h:\n d[(y+1,x+2)]=1\n if x+1<=w and y+2<=h and (y+2,x+1) in d:\n d[(y+2,x+1)]+=1\n elif x+1<=w and y+2<=h:\n d[(y+2,x+1)]=1\n if x+2<=w and y+2<=h and (y+2,x+2) in d:\n d[(y+2,x+2)]+=1\n elif x+2<=w and y+2<=h:\n d[(y+2,x+2)]=1\n ans=[0]*10\n for i in d:\n if i[0]>2 and i[1]>2:\n ans[d[i]]+=1\n \n ans[0]=h*w-sum(ans)-w*2-h*2+4\n for i in ans:\n print(i)\n ", "sol" ]
def sol(): import sys input=sys.stdin.readline h,w,n=map(int,input().split()) d={} for i in range(n): y,x=map(int,input().split()) if (y,x) in d: d[(y,x)]+=1 else: d[(y,x)]=1 if y+1<=h and (y+1,x) in d: d[(y+1,x)]+=1 elif y+1<=h: d[(y+1,x)]=1 if y+2<=h and (y+2,x) in d: d[(y+2,x)]+=1 elif y+2<=h: d[(y+2,x)]=1 if x+1<=w and (y,x+1) in d: d[(y,x+1)]+=1 elif x+1<=w: d[(y,x+1)]=1 if x+2<=w and (y,x+2) in d: d[(y,x+2)]+=1 elif x+2<=w: d[(y,x+2)]=1 if x+1<=w and y+1<=h and (y+1,x+1) in d: d[(y+1,x+1)]+=1 elif x+1<=w and y+1<=h: d[(y+1,x+1)]=1 if x+2<=w and y+1<=h and (y+1,x+2) in d: d[(y+1,x+2)]+=1 elif x+2<=w and y+1<=h: d[(y+1,x+2)]=1 if x+1<=w and y+2<=h and (y+2,x+1) in d: d[(y+2,x+1)]+=1 elif x+1<=w and y+2<=h: d[(y+2,x+1)]=1 if x+2<=w and y+2<=h and (y+2,x+2) in d: d[(y+2,x+2)]+=1 elif x+2<=w and y+2<=h: d[(y+2,x+2)]=1 ans=[0]*10 for i in d: if i[0]>2 and i[1]>2: ans[d[i]]+=1 ans[0]=h*w-sum(ans)-w*2-h*2+4 for i in ans: print(i) if __name__=="__main__": sol()
[ 7, 0, 13, 4, 13, 4, 13, 13, 4, 18, 4, 13, 13, 13, 13, 41, 28, 13, 4, 13, 13, 4, 4, 13, 4, 13, 13, 4, 18, 4, 13, 13, 0, 13, 13, 15, 41, 28, 13, 4, 13, 17, 4, 4, 13, 0, 13, 13, 28, 13, 13, 13, 28, 13, 13, 4, 13, 39, 17, 17, 17, 0, 13, 17, 0, 13, 2, 2, 13, 13, 17, 0, 13, 2, 2, 13, 13, 17, 14, 2, 2, 2, 40, 13, 17, 40, 2, 13, 17, 13, 40, 13, 17, 40, 2, 13, 17, 13, 9, 28, 13, 4, 13, 17, 14, 2, 39, 13, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 39, 13, 13, 4, 18, 18, 13, 2, 13, 17, 13, 39, 13, 13, 3, 4, 18, 18, 13, 17, 13, 39, 13, 13, 41, 28, 13, 18, 13, 39, 17, 4, 4, 13, 13, 0, 13, 13, 4, 13, 2, 2, 2, 13, 17, 2, 13, 17, 4, 13, 13, 28, 13, 13, 4, 13, 13, 10, 2, 13, 10, 4, 13, 10, 13, 13, 10, 13, 13, 10, 2, 13, 10, 4, 13, 10, 13, 13, 10, 4, 13 ]
[ [ 197, 2 ], [ 197, 13 ], [ 197, 14 ], [ 18, 17 ], [ 180, 20 ], [ 194, 33 ], [ 39, 38 ], [ 185, 46 ], [ 63, 62 ], [ 176, 65 ], [ 188, 72 ], [ 177, 83 ], [ 192, 87 ], [ 177, 89 ], [ 189, 91 ], [ 198, 95 ], [ 189, 97 ], [ 101, 100 ], [ 186, 110 ], [ 100, 111 ], [ 186, 115 ], [ 100, 116 ], [ 186, 124 ], [ 100, 126 ], [ 186, 136 ], [ 145, 144 ], [ 186, 146 ], [ 144, 152 ], [ 182, 154 ], [ 192, 161 ], [ 198, 164 ], [ 183, 168 ], [ 171, 170 ], [ 183, 170 ], [ 170, 174 ], [ 176, 177 ], [ 197, 180 ], [ 182, 183 ], [ 185, 186 ], [ 188, 189 ], [ 197, 192 ], [ 194, 195 ], [ 197, 198 ] ]
[ "H, W, N = list(map(int, input().split()))\nAB = [list(map(int, input().split())) for _ in range(N)]\n\nfrom itertools import product\n\nS = [set() for _ in range(10)]\n# S[i]: set(黒いマスをi個こ含む3*3マスの中心セル)\n\nfor a,b in AB:\n for x,y in product([-1,0,1], repeat=2):\n X = a+x-1\n Y = b+y-1\n if X<=0 or H-1<=X or Y<=0 or W-1<=Y:\n continue\n for i in range(10):\n if (X, Y) in S[i]:\n S[i].remove((X, Y))\n S[i+1].add((X, Y))\n break\n else:\n S[1].add((X, Y))\n\nL = [len(s) for s in S[1:]]\nprint((H-2)*(W-2) - sum(L))\n\nfor l in L:\n print(l)", "H, W, N = list(map(int, input().split()))", "H", "list(map(int, input().split()))", "list", "map(int, input().split())", "map", "int", "input().split()", "().split", "()", "input", "split", "W", "N", "list(map(int, input().split())) for _ in range(N)", "for _ in range(N)", "_", "range(N)", "range", "N", "for _ in range(N)", "list(map(int, input().split()))", "list", "map(int, input().split())", "map", "int", "input().split()", "().split", "()", "input", "split", "AB = [list(map(int, input().split())) for _ in range(N)]", "AB", "[list(map(int, input().split())) for _ in range(N)]", "from itertools import product", "set() for _ in range(10)", "for _ in range(10)", "_", "range(10)", "range", "10", "for _ in range(10)", "set()", "set", "S = [set() for _ in range(10)]", "S", "[set() for _ in range(10)]", "for a,b in AB:\n for x,y in product([-1,0,1], repeat=2):\n X = a+x-1\n Y = b+y-1\n if X<=0 or H-1<=X or Y<=0 or W-1<=Y:\n continue\n for i in range(10):\n if (X, Y) in S[i]:\n S[i].remove((X, Y))\n S[i+1].add((X, Y))\n break\n else:\n S[1].add((X, Y))", "a", "b", "AB", "for x,y in product([-1,0,1], repeat=2):\n X = a+x-1\n Y = b+y-1\n if X<=0 or H-1<=X or Y<=0 or W-1<=Y:\n continue\n for i in range(10):\n if (X, Y) in S[i]:\n S[i].remove((X, Y))\n S[i+1].add((X, Y))\n break\n else:\n S[1].add((X, Y))", "x", "y", "product([-1,0,1], repeat=2)", "product", "[-1,0,1]", "-1", "0", "1", "repeat=2", "repeat", "2", "X = a+x-1", "X", "a+x-1", "a+x", "a", "x", "1", "Y = b+y-1", "Y", "b+y-1", "b+y", "b", "y", "1", "if X<=0 or H-1<=X or Y<=0 or W-1<=Y:\n continue\n ", "X<=0 or H-1<=X or Y<=0 or W-1<=Y", "X<=0 or H-1<=X or Y<=0", "X<=0 or H-1<=X", "X<=0", "X", "0", "H-1<=X", "H-1", "H", "1", "X", "Y<=0", "Y", "0", "W-1<=Y", "W-1", "W", "1", "Y", "continue", "for i in range(10):\n if (X, Y) in S[i]:\n S[i].remove((X, Y))\n S[i+1].add((X, Y))\n break\n else:\n S[1].add((X, Y))", "i", "range(10)", "range", "10", "if (X, Y) in S[i]:\n S[i].remove((X, Y))\n S[i+1].add((X, Y))\n break\n ", "(X, Y) in S[i]", "(X, Y)", "X", "Y", "S[i]", "S", "i", "S[i].remove((X, Y))", "[i].remove", "[i]", "S", "i", "remove", "(X, Y)", "X", "Y", "S[i+1].add((X, Y))", "[i+1].add", "[i+1]", "S", "i+1", "i", "1", "add", "(X, Y)", "X", "Y", "break", "S[1].add((X, Y))", "[1].add", "[1]", "S", "1", "add", "(X, Y)", "X", "Y", "len(s) for s in S[1:]", "for s in S[1:]", "s", "S[1:]", "S", "1:", "1", "for s in S[1:]", "len(s)", "len", "s", "L = [len(s) for s in S[1:]]", "L", "[len(s) for s in S[1:]]", "print((H-2)*(W-2) - sum(L))", "print", "(H-2)*(W-2) - sum(L)", "(H-2)*(W-2)", "H-2", "H", "2", "W-2", "W", "2", "sum(L)", "sum", "L", "for l in L:\n print(l)", "l", "L", "print(l)", "print", "l", "X = a+x-1", "a+x-1", "X", "N = list(map(int, input().split()))", "list(map(int, input().split()))", "N", "L = [len(s) for s in S[1:]]", "[len(s) for s in S[1:]]", "L", "S = [set() for _ in range(10)]", "[set() for _ in range(10)]", "S", "Y = b+y-1", "b+y-1", "Y", "H, W, N = list(map(int, input().split()))", "list(map(int, input().split()))", "H", "AB = [list(map(int, input().split())) for _ in range(N)]", "[list(map(int, input().split())) for _ in range(N)]", "AB", "W, N = list(map(int, input().split()))", "list(map(int, input().split()))", "W" ]
H, W, N = list(map(int, input().split())) AB = [list(map(int, input().split())) for _ in range(N)] from itertools import product S = [set() for _ in range(10)] # S[i]: set(黒いマスをi個こ含む3*3マスの中心セル) for a,b in AB: for x,y in product([-1,0,1], repeat=2): X = a+x-1 Y = b+y-1 if X<=0 or H-1<=X or Y<=0 or W-1<=Y: continue for i in range(10): if (X, Y) in S[i]: S[i].remove((X, Y)) S[i+1].add((X, Y)) break else: S[1].add((X, Y)) L = [len(s) for s in S[1:]] print((H-2)*(W-2) - sum(L)) for l in L: print(l)
[ 7, 15, 13, 15, 0, 13, 4, 13, 17, 0, 13, 39, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 13, 39, 17, 17, 17, 17, 17, 17, 17, 17, 17, 12, 13, 0, 13, 4, 13, 28, 13, 13, 4, 13, 13, 13, 28, 13, 13, 4, 13, 13, 13, 14, 2, 2, 13, 13, 17, 9, 14, 2, 2, 2, 13, 13, 17, 13, 9, 14, 2, 2, 13, 13, 17, 9, 14, 2, 2, 2, 13, 13, 17, 13, 9, 0, 18, 13, 39, 2, 13, 13, 2, 13, 13, 17, 0, 13, 2, 39, 17, 17, 28, 13, 13, 4, 18, 13, 13, 0, 18, 13, 13, 17, 0, 18, 13, 17, 2, 2, 2, 13, 17, 2, 13, 17, 4, 13, 13, 4, 13, 31, 13, 0, 13, 17, 29, 23, 13, 23, 13, 23, 13, 23, 13, 23, 13, 12, 13, 12, 13, 28, 13, 18, 13, 13, 28, 13, 4, 18, 13, 13, 27, 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, 2, 39, 4, 13, 13, 0, 13, 2, 39, 4, 13, 13, 28, 13, 4, 13, 13, 0, 18, 13, 13, 4, 13, 4, 13, 13, 0, 18, 13, 13, 4, 13, 4, 13, 13, 4, 13, 13, 13, 13, 13, 13, 14, 2, 13, 17, 4, 13, 10, 12, 13, 10, 12, 13, 10, 4, 13, 10, 39, 13, 10, 39, 13 ]
[ [ 246, 5 ], [ 249, 10 ], [ 252, 22 ], [ 37, 36 ], [ 144, 44 ], [ 146, 45 ], [ 250, 51 ], [ 253, 52 ], [ 138, 67 ], [ 140, 83 ], [ 95, 86 ], [ 36, 87 ], [ 98, 97 ], [ 36, 107 ], [ 113, 110 ], [ 97, 111 ], [ 118, 115 ], [ 97, 116 ], [ 138, 121 ], [ 140, 124 ], [ 97, 128 ], [ 97, 132 ], [ 135, 134 ], [ 138, 138 ], [ 140, 140 ], [ 142, 142 ], [ 144, 144 ], [ 146, 146 ], [ 153, 152 ], [ 158, 157 ], [ 152, 160 ], [ 157, 163 ], [ 166, 165 ], [ 150, 167 ], [ 170, 169 ], [ 165, 174 ], [ 177, 176 ], [ 165, 181 ], [ 184, 183 ], [ 165, 188 ], [ 191, 190 ], [ 183, 195 ], [ 198, 197 ], [ 183, 202 ], [ 205, 204 ], [ 183, 207 ], [ 212, 209 ], [ 190, 210 ], [ 204, 211 ], [ 165, 216 ], [ 221, 218 ], [ 197, 219 ], [ 204, 220 ], [ 165, 225 ], [ 241, 227 ], [ 169, 228 ], [ 176, 229 ], [ 183, 230 ], [ 190, 231 ], [ 197, 232 ], [ 244, 238 ], [ 246, 247 ], [ 249, 250 ], [ 252, 253 ] ]
[ "#!/usr/bin/env python3\nimport sys\nfrom collections import Counter\nINF = float(\"inf\")\n\nXX = (-2, -2, -2, -1, -1, -1, 0, 0, 0)\nYY = (-2, -1, 0, -2, -1, 0, -2, -1, 0)\n\n\ndef solve(H: int, W: int, N: int, a: \"List[int]\", b: \"List[int]\"):\n counter = Counter()\n for aa, bb in zip(a, b):\n for x, y in zip(XX, YY):\n if aa+x < 1:\n continue\n elif aa+x+2 > H:\n continue\n elif bb+y < 1:\n continue\n elif bb+y+2 > W:\n continue\n counter[(aa+x, bb+y)] += 1\n ans = [0]*10\n for key, val in counter.items():\n ans[val] += 1\n\n ans[0] = (H-2)*(W-2) - sum(ans)\n print(*ans, sep=\"\\n\")\n return\n\n\ndef main():\n\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n tokens = iterate_tokens()\n H = int(next(tokens)) # type: int\n W = int(next(tokens)) # type: int\n N = int(next(tokens)) # type: int\n a = [int()] * (N) # type: \"List[int]\"\n b = [int()] * (N) # type: \"List[int]\"\n for i in range(N):\n a[i] = int(next(tokens))\n b[i] = int(next(tokens))\n solve(H, W, N, a, b)\n\n\nif __name__ == '__main__':\n main()", "import sys", "sys", "from collections import Counter", "INF = float(\"inf\")", "INF", "float(\"inf\")", "float", "\"inf\"", "XX = (-2, -2, -2, -1, -1, -1, 0, 0, 0)", "XX", "(-2, -2, -2, -1, -1, -1, 0, 0, 0)", "-2", "-2", "-2", "-1", "-1", "-1", "0", "0", "0", "YY = (-2, -1, 0, -2, -1, 0, -2, -1, 0)", "YY", "(-2, -1, 0, -2, -1, 0, -2, -1, 0)", "-2", "-1", "0", "-2", "-1", "0", "-2", "-1", "0", "def solve(H: int, W: int, N: int, a: \"List[int]\", b: \"List[int]\"):\n counter = Counter()\n for aa, bb in zip(a, b):\n for x, y in zip(XX, YY):\n if aa+x < 1:\n continue\n elif aa+x+2 > H:\n continue\n elif bb+y < 1:\n continue\n elif bb+y+2 > W:\n continue\n counter[(aa+x, bb+y)] += 1\n ans = [0]*10\n for key, val in counter.items():\n ans[val] += 1\n\n ans[0] = (H-2)*(W-2) - sum(ans)\n print(*ans, sep=\"\\n\")\n return", "solve", "counter = Counter()", "counter", "Counter()", "Counter", "for aa, bb in zip(a, b):\n for x, y in zip(XX, YY):\n if aa+x < 1:\n continue\n elif aa+x+2 > H:\n continue\n elif bb+y < 1:\n continue\n elif bb+y+2 > W:\n continue\n counter[(aa+x, bb+y)] += 1\n ", "aa", "bb", "zip(a, b)", "zip", "a", "b", "for x, y in zip(XX, YY):\n if aa+x < 1:\n continue\n elif aa+x+2 > H:\n continue\n elif bb+y < 1:\n continue\n elif bb+y+2 > W:\n continue\n counter[(aa+x, bb+y)] += 1\n ", "x", "y", "zip(XX, YY)", "zip", "XX", "YY", "if aa+x < 1:\n continue\n elif aa+x+2 > H:\n continue\n elif bb+y < 1:\n continue\n elif bb+y+2 > W:\n continue\n ", "aa+x < 1", "aa+x", "aa", "x", "1", "continue", "elif aa+x+2 > H:\n continue\n ", "aa+x+2 > H", "aa+x+2", "aa+x", "aa", "x", "2", "H", "continue", "elif bb+y < 1:\n continue\n ", "bb+y < 1", "bb+y", "bb", "y", "1", "continue", "elif bb+y+2 > W:\n continue\n ", "bb+y+2 > W", "bb+y+2", "bb+y", "bb", "y", "2", "W", "continue", "counter[(aa+x, bb+y)] += 1", "counter[(aa+x, bb+y)]", "counter", "(aa+x, bb+y)", "aa+x", "aa", "x", "bb+y", "bb", "y", "1", "ans = [0]*10", "ans", "[0]*10", "[0]", "0", "10", "for key, val in counter.items():\n ans[val] += 1\n\n ", "key", "val", "counter.items()", "counter.items", "counter", "items", "ans[val] += 1", "ans[val]", "ans", "val", "1", "ans[0] = (H-2)*(W-2) - sum(ans)", "ans[0]", "ans", "0", "(H-2)*(W-2) - sum(ans)", "(H-2)*(W-2)", "H-2", "H", "2", "W-2", "W", "2", "sum(ans)", "sum", "ans", "print(*ans, sep=\"\\n\")", "print", "*ans", "ans", "sep=\"\\n\"", "sep", "\"\\n\"", "return", "H: int", "H", "W: int", "W", "N: int", "N", "a: \"List[int]\"", "a", "b: \"List[int]\"", "b", "def main():\n\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n tokens = iterate_tokens()\n H = int(next(tokens)) # type: int\n W = int(next(tokens)) # type: int\n N = int(next(tokens)) # type: int\n a = [int()] * (N) # type: \"List[int]\"\n b = [int()] * (N) # type: \"List[int]\"\n for i in range(N):\n a[i] = int(next(tokens))\n b[i] = int(next(tokens))\n solve(H, W, N, a, b)", "main", "def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n ", "iterate_tokens", "for line in sys.stdin:\n for word in line.split():\n yield word\n ", "line", "sys.stdin", "sys", "stdin", "for word in line.split():\n yield word\n ", "word", "line.split()", "line.split", "line", "split", "yield word", "word", "tokens = iterate_tokens()", "tokens", "iterate_tokens()", "iterate_tokens", "H = int(next(tokens))", "H", "int(next(tokens))", "int", "next(tokens)", "next", "tokens", "W = int(next(tokens))", "W", "int(next(tokens))", "int", "next(tokens)", "next", "tokens", "N = int(next(tokens))", "N", "int(next(tokens))", "int", "next(tokens)", "next", "tokens", "a = [int()] * (N)", "a", "[int()] * (N)", "[int()]", "int()", "int", "N", "b = [int()] * (N)", "b", "[int()] * (N)", "[int()]", "int()", "int", "N", "for i in range(N):\n a[i] = int(next(tokens))\n b[i] = int(next(tokens))\n ", "i", "range(N)", "range", "N", "a[i] = int(next(tokens))", "a[i]", "a", "i", "int(next(tokens))", "int", "next(tokens)", "next", "tokens", "b[i] = int(next(tokens))", "b[i]", "b", "i", "int(next(tokens))", "int", "next(tokens)", "next", "tokens", "solve(H, W, N, a, b)", "solve", "H", "W", "N", "a", "b", "if __name__ == '__main__':\n main()", "__name__ == '__main__'", "__name__", "'__main__'", "main()", "main", "def solve(H: int, W: int, N: int, a: \"List[int]\", b: \"List[int]\"):\n counter = Counter()\n for aa, bb in zip(a, b):\n for x, y in zip(XX, YY):\n if aa+x < 1:\n continue\n elif aa+x+2 > H:\n continue\n elif bb+y < 1:\n continue\n elif bb+y+2 > W:\n continue\n counter[(aa+x, bb+y)] += 1\n ans = [0]*10\n for key, val in counter.items():\n ans[val] += 1\n\n ans[0] = (H-2)*(W-2) - sum(ans)\n print(*ans, sep=\"\\n\")\n return", "def solve(H: int, W: int, N: int, a: \"List[int]\", b: \"List[int]\"):\n counter = Counter()\n for aa, bb in zip(a, b):\n for x, y in zip(XX, YY):\n if aa+x < 1:\n continue\n elif aa+x+2 > H:\n continue\n elif bb+y < 1:\n continue\n elif bb+y+2 > W:\n continue\n counter[(aa+x, bb+y)] += 1\n ans = [0]*10\n for key, val in counter.items():\n ans[val] += 1\n\n ans[0] = (H-2)*(W-2) - sum(ans)\n print(*ans, sep=\"\\n\")\n return", "solve", "def main():\n\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n tokens = iterate_tokens()\n H = int(next(tokens)) # type: int\n W = int(next(tokens)) # type: int\n N = int(next(tokens)) # type: int\n a = [int()] * (N) # type: \"List[int]\"\n b = [int()] * (N) # type: \"List[int]\"\n for i in range(N):\n a[i] = int(next(tokens))\n b[i] = int(next(tokens))\n solve(H, W, N, a, b)", "def main():\n\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n tokens = iterate_tokens()\n H = int(next(tokens)) # type: int\n W = int(next(tokens)) # type: int\n N = int(next(tokens)) # type: int\n a = [int()] * (N) # type: \"List[int]\"\n b = [int()] * (N) # type: \"List[int]\"\n for i in range(N):\n a[i] = int(next(tokens))\n b[i] = int(next(tokens))\n solve(H, W, N, a, b)", "main", "INF = float(\"inf\")", "float(\"inf\")", "INF", "XX = (-2, -2, -2, -1, -1, -1, 0, 0, 0)", "(-2, -2, -2, -1, -1, -1, 0, 0, 0)", "XX", "YY = (-2, -1, 0, -2, -1, 0, -2, -1, 0)", "(-2, -1, 0, -2, -1, 0, -2, -1, 0)", "YY" ]
#!/usr/bin/env python3 import sys from collections import Counter INF = float("inf") XX = (-2, -2, -2, -1, -1, -1, 0, 0, 0) YY = (-2, -1, 0, -2, -1, 0, -2, -1, 0) def solve(H: int, W: int, N: int, a: "List[int]", b: "List[int]"): counter = Counter() for aa, bb in zip(a, b): for x, y in zip(XX, YY): if aa+x < 1: continue elif aa+x+2 > H: continue elif bb+y < 1: continue elif bb+y+2 > W: continue counter[(aa+x, bb+y)] += 1 ans = [0]*10 for key, val in counter.items(): ans[val] += 1 ans[0] = (H-2)*(W-2) - sum(ans) print(*ans, sep="\n") return def main(): def iterate_tokens(): for line in sys.stdin: for word in line.split(): yield word tokens = iterate_tokens() H = int(next(tokens)) # type: int W = int(next(tokens)) # type: int N = int(next(tokens)) # type: int a = [int()] * (N) # type: "List[int]" b = [int()] * (N) # type: "List[int]" for i in range(N): a[i] = int(next(tokens)) b[i] = int(next(tokens)) solve(H, W, N, a, b) if __name__ == '__main__': main()
[ 7, 15, 0, 13, 4, 13, 13, 0, 13, 4, 13, 13, 4, 18, 4, 13, 13, 13, 13, 0, 13, 2, 39, 17, 17, 28, 13, 4, 13, 13, 0, 13, 4, 13, 13, 4, 18, 4, 13, 13, 13, 0, 13, 2, 13, 17, 13, 2, 13, 17, 28, 13, 4, 13, 17, 17, 28, 13, 4, 13, 17, 17, 14, 2, 40, 40, 17, 2, 13, 13, 2, 13, 17, 40, 40, 17, 2, 13, 13, 2, 13, 17, 0, 18, 13, 39, 2, 13, 13, 2, 13, 13, 17, 28, 13, 13, 0, 18, 13, 18, 13, 13, 17, 0, 18, 13, 17, 2, 2, 2, 13, 17, 2, 13, 17, 4, 13, 13, 28, 13, 13, 4, 13, 13, 10, 4, 13, 10, 2, 13, 10, 4, 13, 10, 2, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 2, 13 ]
[ [ 131, 3 ], [ 146, 8 ], [ 146, 17 ], [ 146, 18 ], [ 128, 20 ], [ 27, 26 ], [ 147, 29 ], [ 143, 31 ], [ 143, 40 ], [ 134, 42 ], [ 144, 44 ], [ 135, 44 ], [ 149, 46 ], [ 141, 48 ], [ 150, 48 ], [ 52, 51 ], [ 58, 57 ], [ 135, 68 ], [ 144, 68 ], [ 57, 69 ], [ 126, 71 ], [ 150, 77 ], [ 141, 77 ], [ 51, 78 ], [ 138, 80 ], [ 92, 83 ], [ 132, 84 ], [ 135, 87 ], [ 144, 87 ], [ 57, 88 ], [ 150, 90 ], [ 141, 90 ], [ 51, 91 ], [ 95, 94 ], [ 132, 94 ], [ 102, 97 ], [ 129, 98 ], [ 132, 100 ], [ 94, 101 ], [ 107, 104 ], [ 129, 105 ], [ 126, 110 ], [ 138, 113 ], [ 129, 117 ], [ 120, 119 ], [ 129, 119 ], [ 119, 123 ], [ 146, 126 ], [ 128, 129 ], [ 131, 132 ], [ 134, 135 ], [ 146, 138 ], [ 143, 141 ], [ 143, 144 ], [ 146, 147 ], [ 149, 150 ] ]
[ "from collections import defaultdict\n\nDic = defaultdict(int)\nH, W, N = map(int, input().split())\nans = [0]*10\n\nfor i in range(N):\n a, b = map(int, input().split())\n a, b = a-1, b-1\n for dx in range(-1, 2):\n for dy in range(-1, 2):\n if 1 <= a + dy <= H-2 and 1 <= b + dx <= W-2:\n Dic[(a+dy, b+dx)] += 1\n\nfor i in Dic:\n ans[Dic[i]] += 1\nans[0] = (H-2)*(W-2) - sum(ans)\n\nfor i in ans:\n print(i)", "from collections import defaultdict", "Dic = defaultdict(int)", "Dic", "defaultdict(int)", "defaultdict", "int", "H, W, N = map(int, input().split())", "H", "map(int, input().split())", "map", "int", "input().split()", "().split", "()", "input", "split", "W", "N", "ans = [0]*10", "ans", "[0]*10", "[0]", "0", "10", "for i in range(N):\n a, b = map(int, input().split())\n a, b = a-1, b-1\n for dx in range(-1, 2):\n for dy in range(-1, 2):\n if 1 <= a + dy <= H-2 and 1 <= b + dx <= W-2:\n Dic[(a+dy, b+dx)] += 1", "i", "range(N)", "range", "N", "a, b = map(int, input().split())", "a", "map(int, input().split())", "map", "int", "input().split()", "().split", "()", "input", "split", "b", "a, b = a-1, b-1", "a", "a-1", "a", "1", "b", "b-1", "b", "1", "for dx in range(-1, 2):\n for dy in range(-1, 2):\n if 1 <= a + dy <= H-2 and 1 <= b + dx <= W-2:\n Dic[(a+dy, b+dx)] += 1", "dx", "range(-1, 2)", "range", "-1", "2", "for dy in range(-1, 2):\n if 1 <= a + dy <= H-2 and 1 <= b + dx <= W-2:\n Dic[(a+dy, b+dx)] += 1", "dy", "range(-1, 2)", "range", "-1", "2", "if 1 <= a + dy <= H-2 and 1 <= b + dx <= W-2:\n Dic[(a+dy, b+dx)] += 1", "1 <= a + dy <= H-2 and 1 <= b + dx <= W-2", "1 <= a + dy <= H-2", "1 <= a + dy", "1", "a + dy", "a", "dy", "H-2", "H", "2", "1 <= b + dx <= W-2", "1 <= b + dx", "1", "b + dx", "b", "dx", "W-2", "W", "2", "Dic[(a+dy, b+dx)] += 1", "Dic[(a+dy, b+dx)]", "Dic", "(a+dy, b+dx)", "a+dy", "a", "dy", "b+dx", "b", "dx", "1", "for i in Dic:\n ans[Dic[i]] += 1", "i", "Dic", "ans[Dic[i]] += 1", "ans[Dic[i]]", "ans", "Dic[i]", "Dic", "i", "1", "ans[0] = (H-2)*(W-2) - sum(ans)", "ans[0]", "ans", "0", "(H-2)*(W-2) - sum(ans)", "(H-2)*(W-2)", "H-2", "H", "2", "W-2", "W", "2", "sum(ans)", "sum", "ans", "for i in ans:\n print(i)", "i", "ans", "print(i)", "print", "i", "H, W, N = map(int, input().split())", "map(int, input().split())", "H", "ans = [0]*10", "[0]*10", "ans", "Dic = defaultdict(int)", "defaultdict(int)", "Dic", "a, b = a-1, b-1", "a-1", "a", "W, N = map(int, input().split())", "map(int, input().split())", "W", "b = map(int, input().split())", "map(int, input().split())", "b", "a, b = map(int, input().split())", "map(int, input().split())", "a", "N = map(int, input().split())", "map(int, input().split())", "N", "b = a-1, b-1", "b-1", "b" ]
from collections import defaultdict Dic = defaultdict(int) H, W, N = map(int, input().split()) ans = [0]*10 for i in range(N): a, b = map(int, input().split()) a, b = a-1, b-1 for dx in range(-1, 2): for dy in range(-1, 2): if 1 <= a + dy <= H-2 and 1 <= b + dx <= W-2: Dic[(a+dy, b+dx)] += 1 for i in Dic: ans[Dic[i]] += 1 ans[0] = (H-2)*(W-2) - sum(ans) for i in ans: print(i)