Buggy python submission (verdict: Runtime Error):
import sys

d = {'A': 1, 'B': 0, 'C': 0}

for line in sys.stdin:
    a, t = line.split(',')
    d[a], d[t] = d[t], d[a]

for k, v in d.items():
    if v:
        print(k)

Fixed submission:
d = {'A': True, 'B': False, 'C': False}

while True:
    try:
        a, t = input().split(',')
        d[a], d[t] = d[t], d[a]
    except:
        for k, v in d.items():
            if v:
                print(k)
        break

Buggy python submission (verdict: Runtime Error):
import sys

d = {'A': 1, 'B': 0, 'C': 0}

for line in sys.stdin:
    a, t = line.split(',')
    d[a], d[t] = d[t], d[a]

for k, v in d.items():
    if v:
        print(k)

Fixed submission:
d = {'A': True, 'B': False, 'C': False}

while True:
    try:
        a, t = input().split(',')
        d[a], d[t] = d[t], d[a]
    except:
        for k, v in d.items():
            if v:
                print(k)
        break

Buggy python submission (verdict: Runtime Error):
import sys

d = {'A': 1, 'B': 0, 'C': 0}

_input = sys.stdin
for line in _input:
    a, t = line.split(',')
    d[a], d[t] = d[t], d[a]

for k, v in d.items():
    if v:
        print(k)

Fixed submission:
d = {'A': True, 'B': False, 'C': False}

while True:
    try:
        a, t = input().split(',')
        d[a], d[t] = d[t], d[a]
    except:
        for k, v in d.items():
            if v:
                print(k)
        break

Buggy python submission (verdict: Runtime Error):
import sys

d = {'A': 1, 'B': 0, 'C': 0}

for line in sys.stdin:
    a, t = line.split().split(',')
    d[a], d[t] = d[t], d[a]

for k, v in d.items():
    if v:
        print(k)

Fixed submission:
d = {'A': True, 'B': False, 'C': False}

while True:
    try:
        a, t = input().split(',')
        d[a], d[t] = d[t], d[a]
    except:
        for k, v in d.items():
            if v:
                print(k)
        break

Buggy python submission (verdict: Runtime Error):
import sys

d = {'A': True, 'B': False, 'C': False}

for line in sys.stdin:
    a, t = line.split().split(',')
    d[a], d[t] = d[t], d[a]

for k, v in d.items():
    if v:
        print(k)

Fixed submission:
d = {'A': True, 'B': False, 'C': False}

while True:
    try:
        a, t = input().split(',')
        d[a], d[t] = d[t], d[a]
    except:
        for k, v in d.items():
            if v:
                print(k)
        break

Buggy python submission (verdict: Runtime Error):
d = {'A': True, 'B': False, 'C': False}

while True:
    try:
        line = input()
    except:
        break
    a, t = line.split().split(',')
    d[a], d[t] = d[t], d[a]

for k, v in d.items():
    if v:
        print(k)

Fixed submission:
d = {'A': True, 'B': False, 'C': False}

while True:
    try:
        a, t = input().split(',')
        d[a], d[t] = d[t], d[a]
    except:
        for k, v in d.items():
            if v:
                print(k)
        break

Buggy python submission (verdict: Runtime Error):
import sys

d = {'A': True, 'B': False, 'C': False}

for line in sys.stdin:
    a, t = line.split(',')
    d[a], d[t] = d[t], d[a]

for k, v in d.items():
    if v:
        print(k)

Fixed submission:
d = {'A': True, 'B': False, 'C': False}

while True:
    try:
        a, t = input().split(',')
        d[a], d[t] = d[t], d[a]
    except:
        for k, v in d.items():
            if v:
                print(k)
        break

Buggy python submission (verdict: Time Limit Exceeded):
d = {'A': True, 'B': False, 'C': False}

while True:
    try:
        a, t = input().split(',')
        d[a], d[t] = d[t], d[a]
    except:
        for k, v in d.items():
            if v:
                print(k)

Fixed submission:
d = {'A': True, 'B': False, 'C': False}

while True:
    try:
        a, t = input().split(',')
        d[a], d[t] = d[t], d[a]
    except:
        for k, v in d.items():
            if v:
                print(k)
        break