ZhenlongDai/ACPR huggingface dataset:
Problem: p02553
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import sys
import math
def get_array(): return list(map(int, sys.stdin.readline().strip().split()))
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def input(): return sys.stdin.readline().strip()
a,b,c,d=get_ints()
x=max(a,b)
y=max(c,d)
print(x*y)

Failing test case input:
-50222641 1 -1078917638 2

Expected output:
54186093201841958


Actual output:
2


Fixed submission (verdict: Accepted):
import sys
import math
def get_array(): return list(map(int, sys.stdin.readline().strip().split()))
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def input(): return sys.stdin.readline().strip()
a,b,c,d=get_ints()
ans=[]
x=a*c
y=a*d
z=b*c
w=b*d
ans.extend(list([x,y,z,w]))
print(max(ans))

Problem: p02553
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a,b,c,d=map(int,input().split( ))
print(max(a*d,b*c,c*d,b*d))

Failing test case input:
-452063450 0 -1164863873 0

Expected output:
526592381208741850


Actual output:
0


Fixed submission (verdict: Accepted):
a,b,c,d=map(int,input().split( ))
print(max(a*d,b*c,a*c,b*d))

Problem: p02553
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a, b, c, d = map(int, input().split())
print(max([a*c, a*d, b*d, b*d]))

Failing test case input:
10 3 -1 -8

Expected output:
-3


Actual output:
-10


Fixed submission (verdict: Accepted):
a, b, c, d = map(int, input().split())
print(max([a*c, a*d, b*c, b*d]))

Problem: p02553
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a,b,c,d=list(map(int, input("Enter a multiple value: ").split())) 
prod=[]

prod.append(a*c)
prod.append(a*d)
prod.append(b*c)
prod.append(b*d)

print(max(prod))

Failing test case input:
6 26 -4 1

Expected output:
26


Actual output:
Enter a multiple value: 26


Fixed submission (verdict: Accepted):
a,b,c,d=list(map(int, input().split())) 
prod=[]

prod.append(a*c)
prod.append(a*d)
prod.append(b*c)
prod.append(b*d)

print(max(prod))

Problem: p02553
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a, b, c, d = map(int, input().split())
print(max(a*c, b*d, a*d, b*d))


Failing test case input:
10 3 -1 -8

Expected output:
-3


Actual output:
-10


Fixed submission (verdict: Accepted):
def main():
    a, b, c, d = map(int, input().split())
    print(max(a*c, b*d, a*d, b*c))

main()

Problem: p02553
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a, b, c, d = map(int, input().split())

ans = -2e20
for x in [a, b, 0]:
    for y in [c,d, 0]:
        if x * y > ans:
            ans = x * y
print(ans)

Failing test case input:
3 5 -4 -2

Expected output:
-6

Actual output:
0


Fixed submission (verdict: Accepted):
a, b, c, d = map(int, input().split())

ans = a * c
for x in [a, b]:
    for y in [c,d]:
        if x * y > ans:
            ans = x * y
print(ans)
Problem: p02553
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a,b,c,d = map(int,input().split(' '))
ans1 = a*c
ans2 = a*c
ans3 = b*c
ans4 = b*d

print(max(ans1,ans2,ans3,ans4))

Failing test case input:
-1 2 0 -15

Expected output:
15


Actual output:
0


Fixed submission (verdict: Accepted):
a,b,c,d = map(int,input().split(' '))
ans1 = a*c
ans2 = a*d
ans3 = b*c
ans4 = b*d

print(max(ans1,ans2,ans3,ans4))

Problem: p02553
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a, b, c, d = [int(x) for x in input().split()]
print(max(a*c,b*d,a*b,b*c)) 


Failing test case input:
-1 4 1 -7

Expected output:
7


Actual output:
4


Fixed submission (verdict: Accepted):
a, b, c, d = [int(x) for x in input().split()]
print(max(a*c,b*d,a*d,b*c))

Problem: p02553
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
inp = list(map(int,input().split()))
ans = []
for i in range(4):
  for j in range(i+1,4):
    ans.append(inp[i] * inp[j])
    
print(max(ans))

Failing test case input:
6 13 -3 1

Expected output:
13


Actual output:
78


Fixed submission (verdict: Accepted):
inp = list(map(int,input().split()))
ans = []
for i in range(2):
  for j in range(2,4):
    ans.append(inp[i] * inp[j])
    
print(max(ans))

Problem: p02553
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a,b,c,d=map(int,input().split(" "))
p=max(a*c,b*c,a*c,a*d)
print(p)


Failing test case input:
1 -1 -2 -25

Expected output:
25


Actual output:
2


Fixed submission (verdict: Accepted):
a,b,c,d=map(int,input().split(" "))
print(max(a*c,b*c,a*d,b*d))
Problem: p00023
Buggy submission (Python3, verdict: Wrong Answer):


import math


num = int(input())

for i in range(num):
    ax,ay,ar,bx,by,br = map(float,input().split(' '))
    d = (ax - bx)*(ax - bx) + (ay * by)
    if d < (ar - br):
            print(2)
    if d < (br - ar):
            print(-2)
    elif d <= (ar + br):
        print(1)
    else:
        print(0)

Failing test case input:
2
1.7782119048814655 2.229054102605444 8.34592424739532 2.1321559253491804 4.08138413393845 6.1263826782839566
3.374194988713775 1.1383521104600747 3.8255604638057257 5.273208013897418 3.552118764754478 5.216151553201928

Expected output:
2
1


Actual output:
1
1


Fixed submission (verdict: Accepted):


import math 

num = int(input())
for i in range(num):
    ax,ay,ar,bx,by,br=map(float,input().split())
    d = ((ax-bx)* (ax - bx))+((ay-by)*(ay-by))
    r1 = (ar+br)*(ar+br)
    r2 = (ar-br)*(ar-br)
    if d <= r1 and d >= r2:
        print(1);
    elif d<r2 and ar>=br:
        print(2)
    elif d < r2 and ar <= br:
        print(-2)
    else:
        print(0)

Problem: p00023
Buggy submission (Python3, verdict: Wrong Answer):
for i in range(int(input())):
    points = input().split()
    p = list(map(float,points))
    if (p[3]-p[0])**2 + (p[4]-p[1])**2 <= p[2]**2:
        print(2)
    elif (p[0]-p[3])**2 + (p[1]-p[4])**2 <= p[5]**2:
        print(-2)
    elif (p[3]-p[0])**2 + (p[4]-p[1])**2 <= (p[2]+p[5])**2:
        print(1)
    else:
        print(0)

Failing test case input:
2
3.1147350602004042 3.104014127818376 8.346090594022616 3.394681734559696 4.777899923453189 6.328774266228958
3.6249592462761786 1.4833368850878772 3.8255604638057257 5.666886669242947 3.552118764754478 5.216151553201928

Expected output:
2
1


Actual output:
2
2


Fixed submission (verdict: Accepted):
n=int(input())
for i in range(n):
    points = input().split()
    p = list(map(float,points))
    if (p[3]-p[0])**2 + (p[4]-p[1])**2 < (p[2]-p[5])**2:
        if p[5]>p[2]:
            print(-2)
        else:
            print(2)
    elif (p[0]-p[3])**2 + (p[1]-p[4])**2 >= (p[2]-p[5])**2 and (p[0]-p[3])**2 + (p[1]-p[4])**2 <= (p[2]+p[5])**2:
        print(1)
    else:
        print(0)

Problem: p00023
Buggy submission (Python3, verdict: Wrong Answer):


import math


num = int(input())

for i in range(num):
    ax,ay,ar,bx,by,br = map(float,input().split(' '))
    d = (ax - bx)*(ax - bx) + (ay * by)
    if d < (br - ar):
            print(2)
    if d < (ar - br):
            print(-2)
    elif d <= (ar + br):
        print(1)
    else:
        print(0)

Failing test case input:
2
0.0 0.24407396280008453 5.0 0.8233993605029404 1.5542884595470625 4.0
0.0 0.0 2.0 4.1 0.0 2.4515674947137622

Expected output:
1
1


Actual output:
1
0


Fixed submission (verdict: Accepted):


import math 

num = int(input())
for i in range(num):
    ax,ay,ar,bx,by,br=map(float,input().split())
    d = ((ax-bx)* (ax - bx))+((ay-by)*(ay-by))
    r1 = (ar+br)*(ar+br)
    r2 = (ar-br)*(ar-br)
    if d <= r1 and d >= r2:
        print(1);
    elif d<r2 and ar>=br:
        print(2)
    elif d < r2 and ar <= br:
        print(-2)
    else:
        print(0)
Problem: p00023
Buggy submission (Python3, verdict: Wrong Answer):
import math
for i in range(int(input())):
    xa, ya, ra, xb, yb, rb = list(map(float, input().split()))

    d1 = (xa - xb) ** 2 + (ya - yb) ** 2
    d2 = ra ** 2 + rb ** 2
    dr = (ra-rb) ** 2

    if d1 <= d2:
        if dr >= d1:
            print(2 if ra > rb else -2)
        else:
            print(1)
    else:
        print(0)

Failing test case input:
2
0.0 0.24407396280008453 5.0 0.8233993605029404 1.5542884595470625 4.0
0.0 0.0 2.0 4.1 0.0 3.0061092150330126

Expected output:
1
1


Actual output:
1
0


Fixed submission (verdict: Accepted):
import math
for i in range(int(input())):
    xa, ya, ra, xb, yb, rb = list(map(float, input().split()))

    d1 = (xa - xb) ** 2 + (ya - yb) ** 2
    d2 = (ra + rb) ** 2
    dr = (ra-rb) ** 2

    if d1 <= d2:
        if dr > d1:
            print(2 if ra > rb else -2)
        else:
            print(1)
    else:
        print(0)

Problem: p00023
Buggy submission (Python3, verdict: Wrong Answer):
n = int(input())

for _ in range(n):
    xa, ya, ra, xb, yb, rb = map(float, input().split())
    dist = ((xa - xb)**2 + (ya - yb)**2)**.5
    if ra + rb < dist:
        print('0')
    elif (rb < ra) and (dist < ra):
        print('2')
    elif (ra < rb) and (dist < rb):
        print('-2')
    else:
        print('1')

Failing test case input:
2
3.1147350602004042 5.306164423252864 8.532934285306728 3.394681734559696 5.199724891496771 6.328774266228958
4.906409876074726 2.426875419198473 4.579264541699624 6.577993493319819 3.902262698935009 5.284452322696371

Expected output:
2
1


Actual output:
2
-2


Fixed submission (verdict: Accepted):
n = int(input())

for _ in range(n):
    xa, ya, ra, xb, yb, rb = map(float, input().split())
    dist = ((xa - xb)**2 + (ya - yb)**2)**.5
    if ra + rb < dist:
        print('0')
    elif abs(ra - rb) <= dist:
        print('1')
    elif (rb < ra):
        print('2')
    elif (ra < rb):
        print('-2')

Problem: p00023
Buggy submission (Python3, verdict: Wrong Answer):
for i in range(int(input())):
    points = input().split()
    p = list(map(float,points))
    if (p[3]-p[0])**2 + (p[4]-p[1])**2 <= p[2]**2:
        print(2)
    elif (p[0]-p[3])**2 + (p[1]-p[4])**2 < p[5]**2:
        print(-2)
    elif (p[3]-p[0])**2 + (p[4]-p[1])**2 < (p[2]+p[5])**2:
        print(1)
    else:
        print(0)

Failing test case input:
2
0.0 0.24407396280008453 5.0 1.4717826557130267 1.5542884595470625 4.0
0.9769597723465082 0.0 2.0 4.1 0.0 3.0061092150330126

Expected output:
1
1


Actual output:
2
1


Fixed submission (verdict: Accepted):
n=int(input())
for i in range(n):
    points = input().split()
    p = list(map(float,points))
    if (p[3]-p[0])**2 + (p[4]-p[1])**2 < (p[2]-p[5])**2:
        if p[5]>p[2]:
            print(-2)
        else:
            print(2)
    elif (p[0]-p[3])**2 + (p[1]-p[4])**2 >= (p[2]-p[5])**2 and (p[0]-p[3])**2 + (p[1]-p[4])**2 <= (p[2]+p[5])**2:
        print(1)
    else:
        print(0)
Problem: p00023
Buggy submission (Python3, verdict: Wrong Answer):
import math
for i in range(int(input())):
    xa, ya, ra, xb, yb, rb = list(map(float, input().split()))

    d1 = (xa - xb) ** 2 + (ya - yb) ** 2
    d2 = ra ** 2 + rb ** 2
    dr = (ra-rb) ** 2

    if d1 <= d2:
        if d2 > d1 > dr:
            print(1)
        elif dr > d1:
            print(2 if ra > rb else -2)
        else:
            print(1)
    else:
        print(0)

Failing test case input:
2
0.0 0.24407396280008453 5.0 0.8233993605029404 1.5542884595470625 4.0
0.0 0.0 2.0 4.1 0.0 3.0061092150330126

Expected output:
1
1


Actual output:
1
0


Fixed submission (verdict: Accepted):
import math
for i in range(int(input())):
    xa, ya, ra, xb, yb, rb = list(map(float, input().split()))

    d1 = (xa - xb) ** 2 + (ya - yb) ** 2
    d2 = (ra + rb) ** 2
    dr = (ra-rb) ** 2

    if d1 <= d2:
        if dr > d1:
            print(2 if ra > rb else -2)
        else:
            print(1)
    else:
        print(0)

Problem: p00023
Buggy submission (Python3, verdict: Wrong Answer):
import math
for i in range(int(input())):
    xa, ya, ra, xb, yb, rb = list(map(float, input().split()))

    d1 = math.sqrt((xa - xb) ** 2 + (ya - yb) ** 2)
    d2 = math.fabs(ra + rb)

    if d1 <= d2:
        if d1 <= ra or d1 <= rb:
            print(2 if ra > rb else -2)
        else:
            print(1)
    else:
        print(0)

Failing test case input:
2
0.0 1.1804991696233216 5.97720052787132 2.014536612537453 1.81180019862589 4.634115446683061
0.9769597723465082 0.39921226227011497 2.0 4.456171562511242 0.7358711718147521 3.0061092150330126

Expected output:
1
1


Actual output:
2
1


Fixed submission (verdict: Accepted):
import math
for i in range(int(input())):
    xa, ya, ra, xb, yb, rb = list(map(float, input().split()))

    d1 = (xa - xb) ** 2 + (ya - yb) ** 2
    d2 = (ra + rb) ** 2
    dr = (ra-rb) ** 2

    if d1 <= d2:
        if dr > d1:
            print(2 if ra > rb else -2)
        else:
            print(1)
    else:
        print(0)

Problem: p00023
Buggy submission (Python3, verdict: Wrong Answer):


import math


num = int(input())

for i in range(num):
    ax,ay,ar,bx,by,br = map(float,input().split(' '))
    d = (ax - bx)*(ax - bx) + (ay * by)
    if d < abs(br - ar):
        if ar > br:
            print(2)
        else:
            print(-2)
    elif d <= ar + br:
        print(1)
    else:
        print(0)

Failing test case input:
2
3.1147350602004042 4.968769205602394 8.532934285306728 3.394681734559696 4.777899923453189 6.328774266228958
4.208439027280414 2.426875419198473 4.579264541699624 6.525780948382415 3.552118764754478 5.284452322696371

Expected output:
2
1


Actual output:
0
0


Fixed submission (verdict: Accepted):


import math 

num = int(input())
for i in range(num):
    ax,ay,ar,bx,by,br=map(float,input().split())
    d = ((ax-bx)* (ax - bx))+((ay-by)*(ay-by))
    r1 = (ar+br)*(ar+br)
    r2 = (ar-br)*(ar-br)
    if d <= r1 and d >= r2:
        print(1);
    elif d<r2 and ar>=br:
        print(2)
    elif d < r2 and ar <= br:
        print(-2)
    else:
        print(0)
Problem: p00023
Buggy submission (Python3, verdict: Wrong Answer):
import math
for i in range(int(input())):
    xa, ya, ra, xb, yb, rb = list(map(float, input().split()))

    d1 = math.sqrt((xa - xb) ** 2 + (ya - yb) ** 2)
    d2 = math.fabs(ra + rb)

    if d1 <= d2:
        if d1 < ra or d1 < rb:
            print(2 if ra > rb else -2)
        else:
            print(1)
    else:
        print(0)

Failing test case input:
2
1.3018830993798196 1.1804991696233216 5.97720052787132 2.1321559253491804 2.072303142011048 4.898405435743801
1.6154186783950772 0.39921226227011497 2.512872370263131 5.273208013897418 2.169775861927481 3.924014997809771

Expected output:
1
1


Actual output:
2
1


Fixed submission (verdict: Accepted):
import math
for i in range(int(input())):
    xa, ya, ra, xb, yb, rb = list(map(float, input().split()))

    d1 = (xa - xb) ** 2 + (ya - yb) ** 2
    d2 = (ra + rb) ** 2
    dr = (ra-rb) ** 2

    if d1 <= d2:
        if dr > d1:
            print(2 if ra > rb else -2)
        else:
            print(1)
    else:
        print(0)

Problem: p00023
Buggy submission (Python3, verdict: Wrong Answer):
import math
for i in range(int(input())):
    xa, ya, ra, xb, yb, rb = list(map(float, input().split()))

    d1 = (xa - xb) ** 2 + (ya - yb) ** 2
    d2 = ra ** 2 + rb ** 2
    dr = ra ** 2 - rb ** 2

    if d1 <= d2:
        if math.fabs(dr) > math.fabs(d1):
            print(2 if ra > rb else -2)
        else:
            print(1)
    else:
        print(0)

Failing test case input:
2
0.811277241404971 1.1804991696233216 5.97720052787132 2.1321559253491804 1.81180019862589 4.898405435743801
1.5169042667075785 0.39921226227011497 2.512872370263131 4.456171562511242 2.169775861927481 3.924014997809771

Expected output:
1
1


Actual output:
2
1


Fixed submission (verdict: Accepted):
import math
for i in range(int(input())):
    xa, ya, ra, xb, yb, rb = list(map(float, input().split()))

    d1 = (xa - xb) ** 2 + (ya - yb) ** 2
    d2 = (ra + rb) ** 2
    dr = (ra-rb) ** 2

    if d1 <= d2:
        if dr > d1:
            print(2 if ra > rb else -2)
        else:
            print(1)
    else:
        print(0)

Problem: p00023
Buggy submission (Python3, verdict: Wrong Answer):
n = input()
for i in range(int(n)):
    xa, ya, ra, xb, rb, yb = list(map(float, input().split(" ")))
    d = abs(complex(xb-xa, yb-ya))
    if ra + rb < d:
        print("0")
    elif abs(rb-ra) <= d <= ra+rb:
        print("1")
    elif d < abs(ra-rb):
        print("2" if ra > rb else "-2")

Failing test case input:
2
0.1862002303347462 1.1804991696233216 5.97720052787132 2.014536612537453 1.81180019862589 4.634115446683061
1.2609752971649137 0.39921226227011497 2.0 4.456171562511242 0.7358711718147521 3.0061092150330126

Expected output:
1
1


Actual output:
2
0


Fixed submission (verdict: Accepted):
n = int(input())
for i in range(n):
    k = input()
    xa, ya, ra, xb, yb, rb = list(map(float, k.split(" ")))
    d = abs(complex(xb-xa, yb-ya))
    if ra + rb < d:
        print("0")
    elif abs(rb-ra) <= d <= ra+rb:
        print("1")
    else:
        print("2" if ra > rb else "-2")
Problem: p00023
Buggy submission (Python3, verdict: Wrong Answer):
import sys
import math

n = int(input())

for _ in range(n):
    xa, ya, ra, xb, yb, rb = map(float, input().split())

    distance = math.sqrt(abs(xa-xb)**2 + abs(ya-yb)**2)
    if distance < ra + rb:
        if (ra < rb and distance < ra) or (ra > rb and distance < rb):
            print("2")
        else:
            print("1")
    else:
        print("0")

Failing test case input:
2
2.768549403858919 3.104014127818376 8.346090594022616 3.394681734559696 4.777899923453189 6.328774266228958
3.6249592462761786 1.4833368850878772 3.8255604638057257 5.666886669242947 3.552118764754478 5.216151553201928

Expected output:
2
1


Actual output:
2
2


Fixed submission (verdict: Accepted):
import sys
import math

n = int(input())

for _ in range(n):
    xa, ya, ra, xb, yb, rb = map(float, input().split())

    distance = math.sqrt((xa-xb)**2 + (ya-yb)**2)
    if ra + rb >= distance:
        if (distance + ra < rb):
            print(-2)
        elif (distance + rb < ra):
            print(2)
        else:
            print(1)
    else:
        print(0)

Problem: p00023
Buggy submission (Python3, verdict: Wrong Answer):
import sys
import math

n = int(input())

for _ in range(n):
    xa, ya, ra, xb, yb, rb = map(float, input().split())

    distance = math.sqrt((xa-xb)**2 + (ya-yb)**2)
    if ra + rb < distance:
        if (ra < rb and distance + ra < rb):
            print(-2)
        elif (rb < ra and distance + rb < ra):
            print(2)
        else:
            print(1)
    else:
        print(0)

Failing test case input:
2
3.1147350602004042 3.104014127818376 8.346090594022616 3.394681734559696 4.777899923453189 6.328774266228958
3.6249592462761786 1.4833368850878772 3.8255604638057257 5.666886669242947 3.552118764754478 5.216151553201928

Expected output:
2
1


Actual output:
0
0


Fixed submission (verdict: Accepted):
import sys
import math

n = int(input())

for _ in range(n):
    xa, ya, ra, xb, yb, rb = map(float, input().split())

    distance = math.sqrt((xa-xb)**2 + (ya-yb)**2)
    if ra + rb >= distance:
        if (distance + ra < rb):
            print(-2)
        elif (distance + rb < ra):
            print(2)
        else:
            print(1)
    else:
        print(0)
Problem: p00023
Buggy submission (Python3, verdict: Wrong Answer):


import math


num = int(input())

for i in range(num):
    ax,ay,ar,bx,by,br = map(float,input().split(' '))
    d = (ax - bx)**2 + (ay * by)**2
    if d < abs(br - ar):
        if ar > br:
            print(2)
        else:
            print(-2)
    elif d <= ar + br:
        print(1)
    else:
        print(0)

Failing test case input:
2
0.0 0.24407396280008453 5.0 0.8233993605029404 1.5542884595470625 4.0
0.0 0.0 2.0 4.1 0.0 3.0061092150330126

Expected output:
1
1


Actual output:
2
0


Fixed submission (verdict: Accepted):


import math 

num = int(input())
for i in range(num):
    ax,ay,ar,bx,by,br=map(float,input().split())
    d = ((ax-bx)* (ax - bx))+((ay-by)*(ay-by))
    r1 = (ar+br)*(ar+br)
    r2 = (ar-br)*(ar-br)
    if d <= r1 and d >= r2:
        print(1);
    elif d<r2 and ar>=br:
        print(2)
    elif d < r2 and ar <= br:
        print(-2)
    else:
        print(0)
Problem: p03036
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int,input().split())
def fib(n):
  if n == 0:
    return c
  else:
    return 2 * fib(n-1) -10
  
for i in range(10):
  print(fib(i+1))

Failing test case input:
2 -2 1

Expected output:
4
10
22
46
94
190
382
766
1534
3070


Actual output:
-8
-26
-62
-134
-278
-566
-1142
-2294
-4598
-9206


Fixed submission (verdict: Accepted):
a,b,c = map(int,input().split())
def fib(n):
  if n == 0:
    return c
  else:
    return a * fib(n-1) -b
  
for i in range(10):
  print(fib(i+1))

Problem: p03036
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
r,d,x=map(int, input().split())
ans=x
for i in range(1,10):
    ans=r*ans-d
    print(ans)

Failing test case input:
4 0 -7

Expected output:
-28
-112
-448
-1792
-7168
-28672
-114688
-458752
-1835008
-7340032


Actual output:
-28
-112
-448
-1792
-7168
-28672
-114688
-458752
-1835008


Fixed submission (verdict: Accepted):
r,d,x=map(int, input().split())
ans=x
for i in range(1,11):
    ans=r*ans-d
    print(ans)

Problem: p03036
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
r, d, x = map(int, input().split())

for i in range(x):
  x = r * x - d
  if i >= 10:
    break  
  print(x)

Failing test case input:
8 10 -1

Expected output:
-18
-154
-1242
-9946
-79578
-636634
-5093082
-40744666
-325957338
-2607658714


Actual output:
no output


Fixed submission (verdict: Accepted):
r, d, x = map(int, input().split())

for i in range(10):
  x = r * x - d
  print(x)

Problem: p03036
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
INPUT = input().split()
r = int(INPUT[0])
D = int(INPUT[1])
X = int(INPUT[2])

XX = []

ans = ""
XX.append(X)

i = 0
while i <= 10:
    v = r * XX[i] - D
    XX.append(v)
    ans = ans + str(XX[i + 1]) + '\n'
    i += 1

print(ans)

Failing test case input:
1 1 36

Expected output:
35
34
33
32
31
30
29
28
27
26


Actual output:
35
34
33
32
31
30
29
28
27
26
25



Fixed submission (verdict: Accepted):
INPUT = input().split()
r = int(INPUT[0])
D = int(INPUT[1])
X = int(INPUT[2])

XX = []

ans = ""
XX.append(X)

i = 0
while i < 10:
    v = r * XX[i] - D
    XX.append(v)
    ans = ans + str(XX[i + 1]) + '\n'
    i += 1

print(ans)

Problem: p03036
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
r, D, x_2000= map(int, input().split(' '))
xs = [x_2000]
for x in range(10):
	xs.append(r*xs[len(xs)-1]-D)
print('\n'.join(map(str, xs)))

Failing test case input:
3 1 -8

Expected output:
-25
-76
-229
-688
-2065
-6196
-18589
-55768
-167305
-501916


Actual output:
-8
-25
-76
-229
-688
-2065
-6196
-18589
-55768
-167305
-501916


Fixed submission (verdict: Accepted):
r, D, x_2000= map(int, input().split(' '))
xs = [x_2000]
for x in range(10):
	xs.append(r*xs[len(xs)-1]-D)
xs.pop(0)
print('\n'.join(map(str, xs)))
Problem: p03036
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x=input()
xx=x.split()
r=int(xx[0])
x2=int(xx[1])
D=int(xx[2])
y=[0]*10
for i in range(10):
  y[i]+=r*x2-D
  print(y[i])
  x2=y[i]

Failing test case input:
6 -4 -1

Expected output:
-2
-8
-44
-260
-1556
-9332
-55988
-335924
-2015540
-12093236


Actual output:
-23
-137
-821
-4925
-29549
-177293
-1063757
-6382541
-38295245
-229771469


Fixed submission (verdict: Accepted):
x=input()
xx=x.split()
r=int(xx[0])
D=int(xx[1])
x2=int(xx[2])
y=[0]*10
for i in range(10):
  y[i]+=r*x2-D
  print(y[i])
  x2=y[i]

Problem: p03036
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
r, d, x = map(int, input().split())
for i in range(10):
  r = r*x-d
  print(r)

Failing test case input:
-2 0 9

Expected output:
-18
36
-72
144
-288
576
-1152
2304
-4608
9216


Actual output:
-18
-162
-1458
-13122
-118098
-1062882
-9565938
-86093442
-774840978
-6973568802


Fixed submission (verdict: Accepted):
r, d, x = map(int, input().split())
for i in range(10):
  x = r*x-d
  print(x)

Problem: p03036
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
r,d,x = map(int,input().split())
for i in range(10):
    x = r*x-d
print(x)


Failing test case input:
-2 -1 1

Expected output:
-1
3
-5
11
-21
43
-85
171
-341
683


Actual output:
683


Fixed submission (verdict: Accepted):
r,d,x = map(int,input().split())
for i in range(10):
    x = r*x-d
    print(x)

Problem: p03036
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
r,D,x_2000 = map(int,input().split())


X=[x_2000]
for i in range(10):
    X.append(r*X[i] - D)


print(*X,sep="\n")
    

Failing test case input:
8 3 -1

Expected output:
-11
-91
-731
-5851
-46811
-374491
-2995931
-23967451
-191739611
-1533916891


Actual output:
-1
-11
-91
-731
-5851
-46811
-374491
-2995931
-23967451
-191739611
-1533916891


Fixed submission (verdict: Accepted):
r,D,x_2000 = map(int,input().split())


X=[x_2000]
for i in range(10):
    X.append(r*X[i] - D)


print(*X[1:],sep="\n")

Problem: p03036
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
r,D,x = [int(i) for i in input().split()]

print(r)


def calu(r,D,x):
    X =x
    for j in range(10):
       X = r*X-D
       print(X)

calu(r,D,x)

Failing test case input:
2 -2 1

Expected output:
4
10
22
46
94
190
382
766
1534
3070


Actual output:
2
4
10
22
46
94
190
382
766
1534
3070


Fixed submission (verdict: Accepted):
r,D,x = [int(i) for i in input().split()]
def calu(r,D,x):
    X =x
    for j in range(10):
       X = r*X-D
       print(X)

calu(r,D,x)

Problem: p03036
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
r,d,x = map(int, input().split())
for i in range(10):
  x =r*x-d
print(x)

Failing test case input:
13 1 -1

Expected output:
-14
-183
-2380
-30941
-402234
-5229043
-67977560
-883708281
-11488207654
-149346699503


Actual output:
-149346699503


Fixed submission (verdict: Accepted):
r,d,x = map(int, input().split())
for i in range(10):
  x =r*x-d
  print(x)
Problem: p03036
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
r,d,x=map(int,input().split())

for i in range(11):
  x= x*r-d
  print(x)



Failing test case input:
4 0 -5

Expected output:
-20
-80
-320
-1280
-5120
-20480
-81920
-327680
-1310720
-5242880


Actual output:
-20
-80
-320
-1280
-5120
-20480
-81920
-327680
-1310720
-5242880
-20971520


Fixed submission (verdict: Accepted):
r,d,x=map(int,input().split())

for i in range(10):
  x= x*r-d
  print(x)

Problem: p03036
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
r, D, x = map(int, input().split())
def mo(r, D, x, i):
  out = rx - D
  print(int(out))
  if i<9:
  	return mo(r, D, out, i+1)
  else:
    return 0
  
  mo(r, D, x, 0)

Failing test case input:
2 -4 0

Expected output:
4
12
28
60
124
252
508
1020
2044
4092


Actual output:
no output


Fixed submission (verdict: Accepted):
r, D, x = map(int, input().split())
def mo(r, D, x, i):
  out = r*x - D
  print(int(out))
  if i<9:
  	return mo(r, D, out, i+1)
  else:
    return 0
  
mo(r, D, x, 0)

Problem: p03036
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,d,x=map(int,input().split())
for i in range(10):
    x= n*x-d
print(x)

Failing test case input:
3 1 -8

Expected output:
-25
-76
-229
-688
-2065
-6196
-18589
-55768
-167305
-501916


Actual output:
-501916


Fixed submission (verdict: Accepted):
n,d,x=map(int,input().split())
for i in range(10):
    x= n*x-d
    print(x)

Problem: p03036
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
r, D, x2000 = map(int, input().split())
for i in range(10):
  x2000 = r*x2000+D
  print(x2000)

Failing test case input:
3 1 -10

Expected output:
-31
-94
-283
-850
-2551
-7654
-22963
-68890
-206671
-620014


Actual output:
-29
-86
-257
-770
-2309
-6926
-20777
-62330
-186989
-560966


Fixed submission (verdict: Accepted):
r, D, x2000 = map(int, input().split())
for i in range(10):
  x2000 = r*x2000-D
  print(x2000)

Problem: p03036
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
r, d, x = map(int, input().split())
for _ in range(10):
  x = r * x -d
print(x)


Failing test case input:
-2 0 3

Expected output:
-6
12
-24
48
-96
192
-384
768
-1536
3072


Actual output:
3072


Fixed submission (verdict: Accepted):
r, d, x = map(int, input().split())
for _ in range(10):
  x = r * x -d
  print(x)

Problem: p03036
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
r, D, x = map(int,input().split())
for i in range(0,D):
    x = r*x-D
    print(x)

Failing test case input:
3 1 -8

Expected output:
-25
-76
-229
-688
-2065
-6196
-18589
-55768
-167305
-501916


Actual output:
-25


Fixed submission (verdict: Accepted):
r, D, x = map(int,input().split())
for i in range(10):
    x = r*x-D
    print(x)
Problem: p03036
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int, input().split())
x0=c
x1=a*c-b
x2=2*(x1-x0)+x1
x3=2*(x2-x1)+x2
x4=2*(x3-x2)+x3
x5=2*(x4-x3)+x4
x6=2*(x5-x4)+x5
x7=2*(x6-x5)+x6
x8=2*(x7-x6)+x7
x9=2*(x8-x7)+x8
x10=2*(x9-x8)+x9

print(x1)
print(x2)
print(x3)
print(x4)
print(x5)
print(x6)
print(x7)
print(x8)
print(x9)
print(x10)


Failing test case input:
6 -4 -1

Expected output:
-2
-8
-44
-260
-1556
-9332
-55988
-335924
-2015540
-12093236


Actual output:
-2
-4
-8
-16
-32
-64
-128
-256
-512
-1024


Fixed submission (verdict: Accepted):
a,b,c = map(int, input().split())
x0=c
x1=a*c-b
x2=a*(x1-x0)+x1
x3=a*(x2-x1)+x2
x4=a*(x3-x2)+x3
x5=a*(x4-x3)+x4
x6=a*(x5-x4)+x5
x7=a*(x6-x5)+x6
x8=a*(x7-x6)+x7
x9=a*(x8-x7)+x8
x10=a*(x9-x8)+x9

print(x1)
print(x2)
print(x3)
print(x4)
print(x5)
print(x6)
print(x7)
print(x8)
print(x9)
print(x10)

Problem: p03036
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c=map(int,input().split())
for i in range(10):
  s1=(a*c) -b
  print(s1)
  a=s1

Failing test case input:
-1 1 38

Expected output:
-39
38
-39
38
-39
38
-39
38
-39
38


Actual output:
-39
-1483
-56355
-2141491
-81376659
-3092313043
-117507895635
-4465300034131
-169681401296979
-6447893249285203


Fixed submission (verdict: Accepted):
a,b,c=map(int,input().split())
for i in range(10):
  s1=(a*c) -b
  print(s1)
  c=s1
Problem: p03998
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=input()
b=input()
c=input()





n='a'
while True:
    
    if n=='a':
        if len(a)==0:
            print('A')
            break
        else:
            n=a[0]
            a=a.lstrip(a[0])
    elif n=='b':
        if len(b)==0:
            print('B')
            break
        else:
            n=b[0]
            b=b.lstrip(b[0])
    else:
        if len(c)==0:
            print('C')
            break
        else:
            n=c[0]
            c=c.lstrip(c[0])



Failing test case input:
abcb
baaa
bccc

Expected output:
A


Actual output:
B


Fixed submission (verdict: Accepted):
a=input()
b=input()
c=input()





n='a'
while True: 
    if n=='a':
        if len(a)==0:
            print('A')
            exit()
            
        n=a[0]
        
        a=a[1:]
        
    elif n=='b':
        if len(b)==0:
            print('B')
            exit()
            
        n=b[0]
        
        b=b[1:]
        
    else:
        if len(c)==0:
            print('C')
            exit()
            
        n=c[0]
        
        c=c[1:]

Problem: p03998
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = input()
b = input()
c = input()

cards = {'a': a, 'b': b, 'c': c}
turn = 'a'

while True:
    if len(cards[turn]) == 0:
        print(turn)
        break
    draw = cards[turn][0]
    cards[turn] = cards[turn][1:]
    turn = draw


Failing test case input:
bcba
aaab
cccc

Expected output:
C


Actual output:
c


Fixed submission (verdict: Accepted):
a = input()
b = input()
c = input()

cards = {'a': a, 'b': b, 'c': c}
turn = 'a'

while True:
    if len(cards[turn]) == 0:
        print(turn.upper())
        break
    draw = cards[turn][0]
    cards[turn] = cards[turn][1:]
    turn = draw
Problem: p03998
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = input()
b = input()
c = input()
countlist = [1, 0, 0]
list = ["a", "b", "c"]
turn = 0
value = ""
for x in range(len(a) + len(b) + len(c)):
    
    if countlist[0] > len(a) or countlist[1] > len(b) or countlist[2] > len(c): break
    if turn == 0: value = a[countlist[turn] - 1]
    elif turn == 1: value = b[countlist[turn] - 1]
    elif turn == 2: value = c[countlist[turn] - 1]
        
    turn = list.index(value)
    countlist[turn] += 1
    print(countlist)

if countlist[0] > len(a): print("A")
elif countlist[1] > len(b): print("B")
elif countlist[2] > len(c): print("C")


Failing test case input:
abcb
baaa
bccc

Expected output:
A


Actual output:
[2, 0, 0]
[2, 1, 0]
[2, 2, 0]
[3, 2, 0]
[3, 2, 1]
[3, 3, 1]
[4, 3, 1]
[4, 4, 1]
[5, 4, 1]
A


Fixed submission (verdict: Accepted):
a = input()
b = input()
c = input()
countlist = [1, 0, 0]
list = ["a", "b", "c"]
turn = 0
value = ""
for x in range(len(a) + len(b) + len(c)):
    
    if countlist[0] > len(a) or countlist[1] > len(b) or countlist[2] > len(c): break
    if turn == 0: value = a[countlist[turn] - 1]
    elif turn == 1: value = b[countlist[turn] - 1]
    elif turn == 2: value = c[countlist[turn] - 1]
        
    turn = list.index(value)
    countlist[turn] += 1

if countlist[0] > len(a): print("A")
elif countlist[1] > len(b): print("B")
elif countlist[2] > len(c): print("C")

Problem: p03998
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
turn = "a"
S = {}
S["a"] = list(input())
S["b"] = list(input())
S["c"] = list(input())

while True:
    nextturn = S[turn].pop(0)
    if len(S[turn]) == 0:
        print(turn.upper())
        break
    else:
        turn = nextturn
        

Failing test case input:
aaca
baab
cccb

Expected output:
A


Actual output:
C


Fixed submission (verdict: Accepted):
turn = "a"
S = {}
S["a"] = list(input())
S["b"] = list(input())
S["c"] = list(input())

while True:
    turn = S[turn].pop(0)
    if len(S[turn]) == 0:
        print(turn.upper())
        break
Problem: p03998
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

import sys, math, fractions, itertools


def solve(S_A: str, S_B: str, S_C: str):
    t = 'a'
    A = list(S_A)
    B = list(S_B)
    C = list(S_C)
    while(True):
        if t == 'a':
            if len(A) == 0:
                w = 'A'
                break
            t = A.pop()
        elif t == 'b':
            if len(B) == 0:
                w = 'B'
                break
            t = B.pop()
        else:
            if len(C) == 0:
                w = 'C'
                break
            t = C.pop()
    print(w)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S_A = next(tokens)  
    S_B = next(tokens)  
    S_C = next(tokens)  
    solve(S_A, S_B, S_C)

if __name__ == '__main__':
    main()


Failing test case input:
aacb
abbb
bdba

Expected output:
B


Actual output:
A


Fixed submission (verdict: Accepted):

import sys, math, fractions, itertools


def solve(S_A: str, S_B: str, S_C: str):
    t = 'a'
    A = list(S_A)
    B = list(S_B)
    C = list(S_C)
    a, b ,c = 0, 0, 0
    while(True):
        if t == 'a':
            if len(A) == a:
                w = 'A'
                break
            t = A[a]
            a += 1
        elif t == 'b':
            if len(B) == b:
                w = 'B'
                break
            t = B[b]
            b += 1
        else:
            if len(C) == c:
                w = 'C'
                break
            t = C[c]
            c += 1
    print(w)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S_A = next(tokens)  
    S_B = next(tokens)  
    S_C = next(tokens)  
    solve(S_A, S_B, S_C)

if __name__ == '__main__':
    main()
Problem: p03998
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = list(input())
b = list(input())
c = list(input())
select = "a"
lengtha = len(a)
lengthb = len(b)
lengthc = len(c)
while True:
  if select == "a":
    del a[0]
    lengtha -= 1
    if lengtha == 0:
      print("A")
      break;
    else:
      select = a[0]
  elif select == "b":
    del b[0]
    lengthb -= 1
    if lengthb == 0:
      print("B")
      break;
    else:
      select = b[0]
  else:
    del c[0]
    lengthc -= 1
    if lengthc==0:
      print("C")
      break;
    else:
      select = c[0]

Failing test case input:
abcb
aabb
bccc

Expected output:
B


Actual output:
C


Fixed submission (verdict: Accepted):
a = list(input())
b = list(input())
c = list(input())
moji = a[0]
select = "a"
lengtha = len(a)
lengthb = len(b)
lengthc = len(c)
while True:
  if select == "a":
    if lengtha == 0:
      print("A")
      break;
    else:
      select = a[0]
      del a[0]
      lengtha -= 1
  elif select == "b":
    if lengthb == 0:
      print("B")
      break;
    else:
      select = b[0]
      del b[0]
      lengthb -= 1
  else:
    if lengthc==0:
      print("C")
      break;
    else:
      select = c[0]
      del c[0]
      lengthc -= 1

Problem: p03998
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
sa = list(str(input()))
sb = list(str(input()))
sc = list(str(input()))
pa, pb, pc = 0, 0, 0

read = sa[0]
while True:
  if read == 'a':
    pa += 1
    if pa == len(sa):
      print('A')
      break
    read = sa[pa]
  elif read == 'b':
    pb += 1
    if pb == len(sb):
      print('B')
      break
    read = sb[pb]
  else:
    pc += 1
    if pc == len(sc):
      print('C')
      break
    read = sc[pc]


Failing test case input:
abcb
baaa
bccc

Expected output:
A


Actual output:
C


Fixed submission (verdict: Accepted):
sa = list(str(input()))
sb = list(str(input()))
sc = list(str(input()))
pa, pb, pc = 0, -1, -1

read = sa[0]
while True:
  if read == 'a':
    pa += 1
    if pa == len(sa):
      print('A')
      break
    read = sa[pa]
  elif read == 'b':
    pb += 1
    if pb == len(sb):
      print('B')
      break
    read = sb[pb]
  else:
    pc += 1
    if pc == len(sc):
      print('C')
      break
    read = sc[pc]

Problem: p03998
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A=input()
B=input()
C=input()
s="a"
while len(A)!=0 and len(B)!=0 and len(C)!=0:
  if s=="a":
    s=A[0]
    A=A[1:]
    continue
  if s=="b":
    s=B[0]
    B=B[1:]
    continue
  if s=="c":
    s=C[0]
    C=C[1:]
    continue
if len(A)==0:
  print("A")
elif len(B)==0:
  print("B")
else:
  print("C")


Failing test case input:
abcb
aacc
bccc

Expected output:
C


Actual output:
A


Fixed submission (verdict: Accepted):
A=input()
B=input()
C=input()
s="a"
while (len(A)!=0 or s!="a") and (len(B)!=0 or s!="b") and (len(C)!=0 or s!="c"):
  if s=="a":
    s=A[0]
    A=A[1:]
  elif s=="b":
    s=B[0]
    B=B[1:]
  else:
    s=C[0]
    C=C[1:]
if len(A)==0 and s=="a":
    print("A")
elif len(B)==0 and s=="b":
    print("B")
else:
    print("C")
Problem: p03998
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A=input()
B=input()
C=input()

i=0
j=0
k=0
c=0
while(True):
    if(c==0):
        if(A[i]=="a"):
            i+=1
            c=0
        elif(A[i]=="b"):
            j+=1
            c=1
        else:
            k+=1
            c=2

    elif(c==1):
        if(B[j]=="a"):
            i+=1
            c=0
        elif(B[j]=="b"):
            j+=1
            c=1
        else:
            k+=1
            c=2
    else:
        if(C[k]=="a"):
            i+=1
            c=0
        elif(C[k]=="b"):
            j+=1
            c=1
        else:
            k+=1
            c=2
    if(i==(len(A))):
        print("A")
        exit()
    if(j==(len(B))):
        print("B")
        exit()
    if(k==(len(C))):
        print("C")
        exit()

Failing test case input:
aacb
abab
bcba

Expected output:
A


Actual output:
B


Fixed submission (verdict: Accepted):
A=input() 
B=input() 
C=input() 

i=0
j=-1
k=-1
c=0

while(True):
    if(c==0):
        if(i>=(len(A))):
            print("A")
            exit()
        if(A[i]=="a"):
            i+=1
            c=0
        elif(A[i]=="b"):
            j+=1
            c=1
        else:
            k+=1
            c=2

    elif(c==1):
        if(j>=(len(B))):
            print("B")
            exit()
        if(B[j]=="a"):
            i+=1
            c=0
        elif(B[j]=="b"):
            j+=1
            c=1
        else:
            k+=1
            c=2
    else:
        if(k>=(len(C))):
            print("C")
            exit()
        if(C[k]=="a"):
            i+=1
            c=0
        elif(C[k]=="b"):
            j+=1
            c=1
        else:
            k+=1
            c=2

Problem: p03998
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=input()
b=input()
c=input()
dic={'a':[_ for _ in a],'b':[_ for _ in b],'c':[_ for _ in c]}
char='a'
print(dic)
for i in range(len(a)+len(b)+len(c)):
    if len(dic[char]) == 0:
        break
    char = dic[char].pop(0)
print(char.upper())

Failing test case input:
aaca
abba
bdcc

Expected output:
A


Actual output:
{'a': ['a', 'a', 'c', 'a'], 'b': ['a', 'b', 'b', 'a'], 'c': ['b', 'd', 'c', 'c']}
A


Fixed submission (verdict: Accepted):
a=input()
b=input()
c=input()
dic={'a':[_ for _ in a],'b':[_ for _ in b],'c':[_ for _ in c]}
char='a'
for i in range(len(a)+len(b)+len(c)):
    if len(dic[char]) == 0:
        break
    char = dic[char].pop(0)
print(char.upper())
Problem: p03998
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
SA = list(str(input())) 
SB = list(str(input())) 
SC = list(str(input())) 
card = 'a'

for i in range(301):
    if len(SA)==1 and card =='a':
        print('A')
        break
    elif len(SB)==1 and card=='b':
        print('B')
        break
    elif len(SC)==1 and card=='c':
        print('C')
        break
        
    if card == 'a':
        SA = SA[1:]
        card = SA[0]
    elif card == 'b':
        SB = SB[1:]
        card = SB[0]
    elif card == 'c':
        SC =SC[1:]
        card = SC[0]

Failing test case input:
acaa
bbaa
bccc

Expected output:
A


Actual output:
C


Fixed submission (verdict: Accepted):
SA, SB, SC = [input() for i in range(3)]
SA = SA + '0'
SB = SB + '0'
SC = SC + '0'

card = SA[0]
SA = SA[1:]

for i in range(303):
    if SA == '0' and card == 'a':
        print('A')
        break
    elif SB == '0' and card == 'b':
        print('B')
        break
    elif SC == '0' and card == 'c':
        print('C')
        break
    
    if card == 'a':
        card = SA[0]
        SA = SA[1:]
    elif card == 'b':
        card = SB[0]
        SB = SB[1:]
    elif card == 'c':
        card = SC[0]
        SC = SC[1:]

Problem: p03998
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
SA, SB, SC = [input() for i in range(3)]
SA = SA + '0'
SB = SB + '0'
SC = SC + '0'

card = SA[0]
SA = SA[1:]

for i in range(1):
    if SA == '0' and card == 'a':
        print('A')
        break
    elif SB == '0' and card == 'b':
        print('B')
        break
    elif SC == '0' and card == 'c':
        print('C')
        break
    
    if card == 'a':
        card = SA[0]
        SA = SA[1:]
    elif card == 'b':
        card = SB[0]
        SB = SB[1:]
    elif card == 'c':
        card = SC[0]
        SC = SC[1:]

Failing test case input:
caa
acbc
ba

Expected output:
A


Actual output:
no output


Fixed submission (verdict: Accepted):
SA, SB, SC = [input() for i in range(3)]
SA = SA + '0'
SB = SB + '0'
SC = SC + '0'

card = SA[0]
SA = SA[1:]

for i in range(303):
    if SA == '0' and card == 'a':
        print('A')
        break
    elif SB == '0' and card == 'b':
        print('B')
        break
    elif SC == '0' and card == 'c':
        print('C')
        break
    
    if card == 'a':
        card = SA[0]
        SA = SA[1:]
    elif card == 'b':
        card = SB[0]
        SB = SB[1:]
    elif card == 'c':
        card = SC[0]
        SC = SC[1:]

Problem: p03998
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
Sa = list(input())
Sb = list(input())
Sc = list(input())
l = [len(Sa), len(Sb), len(Sc)]
s = [Sa, Sb, Sc]
p = 0
while True:
    l[p] -= 1
    if l[p] <= 0:
        print("ABC"[p])
        break
    else:
        p = "abc".find(s[p][l[p] - len(s[p]) + 1])

Failing test case input:
aac
accb
ca

Expected output:
A


Actual output:
C


Fixed submission (verdict: Accepted):
Sa = input()
Sb = input()
Sc = input()
l = [len(Sa), len(Sb), len(Sc)]
s = [Sa, Sb, Sc]
p = 0
while True:
    if l[p] <= 0:
        print("ABC"[p])
        break
    else:
        l[p] -= 1
        p = "abc".find(s[p][len(s[p])-l[p]-1])
Problem: p03998
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c=input(),input(),input()
string=[a,b,c]
s=[0,0,0]
ban=0
print(string)
while s[0]!=len(a) and s[1]!=len(b) and s[2]!=len(c):
    temp=s[ban]
    s[ban]+=1
    if string[ban][temp]=="a": ban=0
    elif string[ban][temp]=="b": ban=1
    else: ban=2

if s[0]==len(a): print("A")
if s[1]==len(b): print("B")
if s[2]==len(c): print("C")

Failing test case input:
aacb
bbaa
bccc

Expected output:
A


Actual output:
['aacb', 'bbaa', 'bccc']
A


Fixed submission (verdict: Accepted):
a,b,c=input(),input(),input()
string=[a,b,c]
ans=["A","B","C"]
s=[0,0,0]
ban=0
while s[ban]!=len(string[ban]):
    temp=s[ban]
    s[ban]+=1
    if string[ban][temp]=="a": ban=0
    elif string[ban][temp]=="b": ban=1
    else: ban=2
print(ans[ban])

Problem: p03998
Buggy submission (Python (3.8.2), verdict: Wrong Answer):

from collections import deque
S_A = deque(input())
S_B = deque(input())
S_C = deque(input())


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.pop()
        elif next_turn == 'b':
            next_turn = S_B.pop()
        else:
            next_turn = S_C.pop()


Failing test case input:
aacb
abbb
bdba

Expected output:
B


Actual output:
A


Fixed submission (verdict: Accepted):

from collections import deque
S_A = deque(input())
S_B = deque(input())
S_C = deque(input())


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()