Buggy python submission (verdict: Runtime Error):
A = input()
B = input()
C = input()

next_turn = A[0]
Acnt = 1
Bcnt = 0
Ccnt = 0
while True:
    if next_turn == 'a':
        if Acnt == len(A)-1:
            print('A')
            break
        next_turn = A[Acnt]
        Acnt += 1

    elif next_turn == 'b':
        if Bcnt == len(B)-1:
            print('B')
            break
        next_turn = B[Bcnt]
        Bcnt += 1

    elif next_turn == 'c':
        if Ccnt == len(C)-1:
            print('C')
            break
        next_turn = C[Ccnt]
        Ccnt += 1

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

next_turn = A[0]
Acnt = 1
Bcnt = 0
Ccnt = 0
while True:
    if next_turn == 'a':
        if Acnt == len(A):
            print('A')
            break
        next_turn = A[Acnt]
        Acnt += 1

    elif next_turn == 'b':
        if Bcnt == len(B):
            print('B')
            break
        next_turn = B[Bcnt]
        Bcnt += 1

    elif next_turn == 'c':
        if Ccnt == len(C):
            print('C')
            break
        next_turn = C[Ccnt]
        Ccnt += 1

Buggy python submission (verdict: Runtime Error):
A = input()
B = input()
C = input()

next_turn = A[0]
Acnt = 1
Bcnt = 0
Ccnt = 0
while True:
    if next_turn == 'a':
        next_turn = A[Acnt]
        Acnt += 1
        if Acnt == len(A)-1:
            print('A')
            break
    elif next_turn == 'b':
        next_turn = B[Bcnt]
        Bcnt += 1
        if Bcnt == len(B)-1:
            print('B')
            break
    elif next_turn == 'c':
        next_turn = C[Ccnt]
        Ccnt += 1
        if Ccnt == len(C)-1:
            print('C')
            break

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

next_turn = A[0]
Acnt = 1
Bcnt = 0
Ccnt = 0
while True:
    if next_turn == 'a':
        if Acnt == len(A):
            print('A')
            break
        next_turn = A[Acnt]
        Acnt += 1

    elif next_turn == 'b':
        if Bcnt == len(B):
            print('B')
            break
        next_turn = B[Bcnt]
        Bcnt += 1

    elif next_turn == 'c':
        if Ccnt == len(C):
            print('C')
            break
        next_turn = C[Ccnt]
        Ccnt += 1

Buggy python submission (verdict: Runtime Error):
A = input()
B = input()
C = input()

next_turn = A[0]
Acnt = 0
Bcnt = 0
Ccnt = 0
while True:
    if next_turn == 'a':
        next_turn = A[Acnt]
        Acnt += 1
        if Acnt == len(A)-1:
            print('A')
            break
    elif next_turn == 'b':
        next_turn = B[Bcnt]
        Bcnt += 1
        if Bcnt == len(B)-1:
            print('B')
            break
    elif next_turn == 'c':
        next_turn = C[Ccnt]
        Ccnt += 1
        if Ccnt == len(C)-1:
            print('C')
            break

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

next_turn = A[0]
Acnt = 1
Bcnt = 0
Ccnt = 0
while True:
    if next_turn == 'a':
        if Acnt == len(A):
            print('A')
            break
        next_turn = A[Acnt]
        Acnt += 1

    elif next_turn == 'b':
        if Bcnt == len(B):
            print('B')
            break
        next_turn = B[Bcnt]
        Bcnt += 1

    elif next_turn == 'c':
        if Ccnt == len(C):
            print('C')
            break
        next_turn = C[Ccnt]
        Ccnt += 1