Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n = input()
R = []
for i in range(n):
    R.append(input())

profit = R[1] - R[0]
for i in range(n):
    for j in range(i+1, n):
        if R[j] - R[i] > profit:
            profit = R[j] - R[i]
print "%d" % profit

Fixed submission:
n = input()
R = []
for i in range(n):
    R.append(input())

maxv = R[1] - R[0]
minv = R[0]
for j in range(1, n):
    maxv = max(maxv, R[j] - minv)
    minv = min(minv, R[j])

print "%d" % maxv

Buggy python submission (verdict: Time Limit Exceeded):
n = input()
R = []
for i in range(n):
    R.append(input())

profit = R[n-1] - R[0]
after = R[n-1]
for i in range(n):
    if R[n-1-i] < after and i != 0:
        continue
    for j in range(n-i-1):
        if R[n-1-i] - R[j] > profit:
            profit = R[n-1-i] - R[j]
            after = R[n-1-i]
print "%d" % profit

Fixed submission:
n = input()
R = []
for i in range(n):
    R.append(input())

maxv = R[1] - R[0]
minv = R[0]
for j in range(1, n):
    maxv = max(maxv, R[j] - minv)
    minv = min(minv, R[j])

print "%d" % maxv
Buggy python submission (verdict: Runtime Error):
a = input()
b = input()
s = a * b
l = 2 * (a+b)

print "%d %d" % (s, l)

Fixed submission:
tmp = raw_input().split()
a = int(tmp[0])
b = int(tmp[1])
s = a * b
l = 2 * (a+b)

print "%d %d" % (s, l)
Buggy python submission (verdict: Runtime Error):
import math

s = map(int, raw_input().split())
print "%d" % (math.pow(s[0], s[1]) % 1000000007)

Fixed submission:
NUM = 1000000007

def power(m, n):
    if n == 0:
        return 1
    if n == 1:
        return m
    if n % 2 == 0:
        tmp = power(m, n/2) % NUM
        return tmp ** 2 % NUM
    if n % 2 == 1:
        tmp = power(m, n/2) % NUM
        return m * (tmp**2) % NUM

s = map(int, raw_input().split())
print "%d" % (power(s[0], s[1]) % NUM)

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

s = map(int, raw_input().split())
print "%d" % (math.pow(s[0], s[1]) % 1000000007)

Fixed submission:
NUM = 1000000007

def power(m, n):
    if n == 0:
        return 1
    if n == 1:
        return m
    if n % 2 == 0:
        tmp = power(m, n/2) % NUM
        return tmp ** 2 % NUM
    if n % 2 == 1:
        tmp = power(m, n/2) % NUM
        return m * (tmp**2) % NUM

s = map(int, raw_input().split())
print "%d" % (power(s[0], s[1]) % NUM)
Buggy python submission (verdict: Runtime Error):
import sys

print sys.argv[1]*3

Fixed submission:
n = input()
print n**3

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/python
import sys
fp = open(sys.argv[1],'rb')
for i in fp.readline:
    print i*3

Fixed submission:
n = input()
print n**3
Buggy python submission (verdict: Runtime Error):
import sys
s=[0]*51
for a in range(10):
	for b in range(10):
		for c in range(10):
			for d in range(10):
				s[a+b+c+d]+=1
for l in sys.stdin:print x[int(l)]

Fixed submission:
def count(n):
    cnt = 0
    for a in range(10):
        for b in range(10):
            for c in range(10):
                for d in range(10):
                    if a + b + c + d == n:
                        cnt += 1
    print(cnt)

while True:
    try:
        n = int(input())
        count(n)
    except EOFError:
        break
Buggy python submission (verdict: Runtime Error):
l=xrange(1,input()+1)
for a,b in[map(int,raw_input().split(","))for i in xrange(input())]:l[a-1],l[b-1]=l[b-1],l[a-1]
for i in l:print i

Fixed submission:
w = int(input())
n = int(input())

amida = [i for i in range(1, w + 1)]
for _ in range(n):
    a, b = [int(i) - 1 for i in input().split(",")]
    amida[a], amida[b] = amida[b], amida[a]

for x in amida:
    print(x)
Buggy python submission (verdict: Runtime Error):
seconds = int(input())
print(":".join(seconds/60/24,seconds/60%24, seconds%60))


Fixed submission:
seconds = int(input())
print(":".join([str(n) for n in [seconds//60//60,seconds//60%60, seconds%60]]))

Buggy python submission (verdict: Runtime Error):
seconds = int(input())
print(":".join([seconds/60/24,seconds/60%24, seconds%60]))


Fixed submission:
seconds = int(input())
print(":".join([str(n) for n in [seconds//60//60,seconds//60%60, seconds%60]]))
Buggy python submission (verdict: Runtime Error):
from math import pi
r = int(input())
print("{:f} {:f}".format(r * r * pi, 2 * r * pi))



Fixed submission:
from math import pi
r = float(input())
print("{:f} {:f}".format(r * r * pi, 2 * r * pi))
Buggy python submission (verdict: Runtime Error):
andb=(raw_input()).split(" ")
a=int(aandb[0])
b=int(aandb[1])
print a,
if a == b:
    print "==",
elif a > b:
    print ">",
else:
    print "<",
print b

Fixed submission:
aandb=(raw_input()).split(" ")
a=int(aandb[0])
b=int(aandb[1])

print "a",

if a > b:
    print ">",
elif a < b:
    print "<",
else:
    print "==",

print "b"
Buggy python submission (verdict: Runtime Error):
while true:
    n=input()
    if n==0: break
    print sum(input() for i in xrange(n/4))

Fixed submission:
while True:
    n = input()
    if n == 0: break
    print sum(input() for i in range(n/4))

Buggy python submission (verdict: Runtime Error):
while true:
    n =input()
    if n == 0: break
    print sum(input() for i in xrange(n/4))

Fixed submission:
while True:
    n = input()
    if n == 0: break
    print sum(input() for i in range(n/4))

Buggy python submission (verdict: Runtime Error):
while True:
    n=input()
    if n==0: break
    print ans(input() for i in range(n/4))

Fixed submission:
while True:
    n = input()
    if n == 0: break
    print sum(input() for i in range(n/4))

Buggy python submission (verdict: Runtime Error):
while True:
    n = input()
    if n == 0: break
    print ans(input() for i in range(n/4))

Fixed submission:
while True:
    n = input()
    if n == 0: break
    print sum(input() for i in range(n/4))
Buggy python submission (verdict: Runtime Error):
n = input()
lis = []
ans = 0
for i in xrange(n):
    com = raw_input()
    if   com[0] == 'i':
        lis.append(com[7:])
    elif com[6] == ' ':
        try:
            lis.pop(~lis[::-1].index(com[7:]))
        except:
            pass
    elif com[6] == 'F':
        lis.pop()
    else:
        bot += 1
 
print ' '.join( map(str, reversed(lis[ans:])) )

Fixed submission:
n = input()
lis = []
ans = 0
for i in xrange(n):
    com = raw_input()
    if   com[0] == 'i':
        lis.append(com[7:])
    elif com[6] == ' ':
        try:
            lis.pop(~lis[::-1].index(com[7:]))
        except:
            pass
    elif com[6] == 'F':
        lis.pop()
    else:ans += 1
 
print ' '.join( map(str, reversed(lis[ans:])) )
Buggy python submission (verdict: Runtime Error):
import math
from math import radians
from cmath import sqrt
a,b,c = map(int, raw_input().split)
s = (a * b  *  math.sin(radians(c))) /2
c = sqrt(pow(a,2) + pow(b,2) - 2*a*b*math.cos(radians(c)))
print s
print a + b +c
print s*2 /a

Fixed submission:
import math
a, b, C = map(int, raw_input().split())
S = (a * b * math.sin(math.radians(C))) / 2
c = math.sqrt(a*a + b*b - 2*a*b*math.cos(math.radians(C)))
print("%f" % (S))
print("%f" % ( a + b + c))
print("%f" % ((S * 2) / a))
Buggy python submission (verdict: Runtime Error):
while True:
    n = str(raw_input())
    if n == 0:break
    sum = 0
    for i in n:
        sum += int(i)
    print sum

Fixed submission:
while True:
    n = str(raw_input())
    if n == "0":break
    sum = 0
    for i in n:
        sum += int(i)
    print sum

Buggy python submission (verdict: Runtime Error):
while True:
    n = raw_input()
    if n == 0:break
    sum = 0
    for i in n:
        sum += int(i)
    print sum

Fixed submission:
while True:
    n = str(raw_input())
    if n == "0":break
    sum = 0
    for i in n:
        sum += int(i)
    print sum

Buggy python submission (verdict: Runtime Error):
while True:
    n = str(raw_input())
    if n == 0:break
    sum = 0
    for i in n:
        sum += int(i)
    print sum

Fixed submission:
while True:
    n = str(raw_input())
    if n == "0":break
    sum = 0
    for i in n:
        sum += int(i)
    print sum
Buggy python submission (verdict: Runtime Error):
while True:
    n,x = map(int,raw_input().split())
    count = 0;
    for i in range(1,n + 1):
        for j in range(1,n + 1):
            if i == j:break
            for k in range(1,n + 1):
                if j == k:break
                if i + j + k == x:
                    count+=1
                    print i,j,k,"=",i+j+k
                    break
    print count

Fixed submission:
while True:
    n,x = map(int,raw_input().split())
    count = 0;
    if n == 0 and x == 0:break
    for i in range(1,n + 1):
        for j in range(1,n + 1):
            if i == j:break
            for k in range(1,n + 1):
                if j == k:break
                if i + j + k == x:
                    count+=1
                    break
    print count
Buggy python submission (verdict: Runtime Error):
n=int(raw_input())
a=map(int, raw_input().split())

print ' '.join(map(str, a.reverse()))

Fixed submission:
n = int(raw_input())




a = map(int, raw_input().split())
a.reverse()
print ' '.join(map(str, a))
Buggy python submission (verdict: Runtime Error):
while 1:
    try : line = raw_input()
    except : break
    for i in range(26):
        char = chr(i + 97)
          print '%s : %d' % (char , line.lower().count(c))

Fixed submission:
line = ""
while True:
    try: line += raw_input()
    except:break
for i in range(26):
    c = chr(i + 97)
    print '%s : %d' % (c, line.lower().count(c))
Buggy python submission (verdict: Runtime Error):
input()
S = raw_input().split()
input()
T = raw_input().split()
print len(S & T)

Fixed submission:
input()
S = set(raw_input().split())
input()
T = set(raw_input().split())
print len(S & T)
Buggy python submission (verdict: Runtime Error):
x = int(raw_input())
print (x * x * x)

Fixed submission:
import sys

x = int(input())
print (x * x * x)

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

x = int(raw_input())
print (x * x * x)

Fixed submission:
import sys

x = int(input())
print (x * x * x)
Buggy python submission (verdict: Runtime Error):
a = input()
b = input()

print a * b, 2 * (a + b)

Fixed submission:
import sys

(a, b) = map(int, input().split())

print (a * b, (a + b) * 2)

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())

print a * b, 2 * (a + b)

Fixed submission:
import sys

(a, b) = map(int, input().split())

print (a * b, (a + b) * 2)

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())

print (a * b, 2 * a + 2 * b)

Fixed submission:
import sys

(a, b) = map(int, input().split())

print (a * b, (a + b) * 2)

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

a = int(raw_input())
b = int(raw_input())

print a * b, 2 * a + 2 * b

Fixed submission:
import sys

(a, b) = map(int, input().split())

print (a * b, (a + b) * 2)

Buggy python submission (verdict: Runtime Error):
a = int(raw_input())
b = int(raw_input())

s = a * b
s2 = 2 * (a + b)
print (s, s2)

Fixed submission:
import sys

(a, b) = map(int, input().split())

print (a * b, (a + b) * 2)

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

a = eval(raw_input())
b = eval(raw_input())

s1 = a * b
s2 = 2 * (a + b)
print s1, s2

Fixed submission:
import sys

(a, b) = map(int, input().split())

print (a * b, (a + b) * 2)

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

(a, b) = map(int, raw_input().split())

s1 = a * b
s2 = 2 * (a + b)
print s1, s2

Fixed submission:
import sys

(a, b) = map(int, input().split())

print (a * b, (a + b) * 2)
Buggy python submission (verdict: Runtime Error):
import string

w = input()
w.upper()

cnt = 0

while True:
    S = input().split()
    for s in S:
        s.upper()

        i = 0
        while i < len(s):
            if s not in string.digits:
                s.erase(i)
                i -= 1
            i += 1

        if (s == w):
            cnt += 1
    if S[-1] == 'END_OF_TEXT':
        break

print(cnt)

Fixed submission:
W = input().lower()

cnt = 0
while True:
    T = input().split()
    
    if T[0] == "END_OF_TEXT":
        break
        
    for string in T:
        string = string.rstrip(".").lower()
        #print(string)
        if W == string:
           cnt = cnt + 1
        
print(cnt)

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

w = input()
w.upper()

cnt = 0

while True:
    S = input().split()
    if len(S) == 0:
        break

    for s in S:
        s.upper()

        if w in s:
            cnt += 1

print(cnt)

Fixed submission:
W = input().lower()

cnt = 0
while True:
    T = input().split()
    
    if T[0] == "END_OF_TEXT":
        break
        
    for string in T:
        string = string.rstrip(".").lower()
        #print(string)
        if W == string:
           cnt = cnt + 1
        
print(cnt)
Buggy python submission (verdict: Runtime Error):
n = int(raw_input())
for i in xrange(n):
	x1,y1,x2,y2,x3,y3,x4,y4 = map(float,raw_input().split())
	z1 = (y1 - y2) / (x1 - x2)
	z2 = (y3 - y4) / (x3 - x4)
	if z1 == z2:
		print "YES"
	else:
		print "NO"

Fixed submission:
n = int(raw_input())
for i in range(0, n):
	x1,y1,x2,y2,x3,y3,x4,y4 = map(float,raw_input().split())
 
	z1 = (x1 - x2) * (y3 - y4)
	z2 = (x3 - x4) * (y1 - y2)
 
	if abs(z1 - z2) < 1e-10:
		print "YES"
	else:
		print "NO"

Buggy python submission (verdict: Runtime Error):
n = int(raw_input())
for i in range(0, n):
	x1,y1,x2,y2,x3,y3,x4,y4 = map(float,raw_input().split())
	z1 = (y1 - y2) / (x1 - x2)
	z2 = (y3 - y4) / (x3 - x4)
	if z1 == z2:
		print "YES"
	else:
		print "NO"

Fixed submission:
n = int(raw_input())
for i in range(0, n):
	x1,y1,x2,y2,x3,y3,x4,y4 = map(float,raw_input().split())
 
	z1 = (x1 - x2) * (y3 - y4)
	z2 = (x3 - x4) * (y1 - y2)
 
	if abs(z1 - z2) < 1e-10:
		print "YES"
	else:
		print "NO"

Buggy python submission (verdict: Runtime Error):
n = int(raw_input())
for i in range(0, n):
	x1,y1,x2,y2,x3,y3,x4,y4 = map(float,raw_input().split())
	z1 = (y1 - y2) / (x1 - x2)
	z2 = (y3 - y4) / (x3 - x4)
	if z1 == z2:
		print "YES"
	else:
		print "NO"

Fixed submission:
n = int(raw_input())
for i in range(0, n):
	x1,y1,x2,y2,x3,y3,x4,y4 = map(float,raw_input().split())
 
	z1 = (x1 - x2) * (y3 - y4)
	z2 = (x3 - x4) * (y1 - y2)
 
	if abs(z1 - z2) < 1e-10:
		print "YES"
	else:
		print "NO"
Buggy python submission (verdict: Runtime Error):
while True:
	try:
		code = [raw_input() for _ in range(8)]
	except EOFError:
		break
	
	code = "".join(code)
	
	check = 0
	for var in range(0, len(code)):
		if int(code[var:var+1]) == 1:
			check = var
			break
	
	if int(code[check+1:check+2]) == 1 and int(code[check+8:check+9]) == 1:
			if int(code[check+9:check+10]) == 1:
				print "A"
			if int(code[check+7:check+8]) == 1:
				print "G"
	elif int(code[check+1:check+2]) == 1:
		if int(code[check+2:check+3]) == 1 and int(code[check+3:check+4]) == 1:
			print "C"
		if int(code[check+9:check+10]) == 1 and int(code[check+10:check+11]) == 1:
			print "E"
	elif int(code[check+8:check+9]) == 1:
		if int(code[check+16:check+17]) == 1 and int(code[check+24:check+25]) == 1:
			print "B"
		if int(code[check+7:check+8]) == 1 and int(code[check+15:check+16]) == 1:
			print "D"
		if int(code[check+9:check+10]) == 1 and int(code[check+17:check+18]) == 1:
			print "F"

Fixed submission:
while True:
	surface = [list(raw_input()) for _ in range(0, 8)]

	surf = []
	for i in range(0, 8):
		if "1" in surface[i]:
			surf.append(surface[i])
	
	if len(surf) == 1 : print "C"
	else:
		if len(surf) == 2:
			x = surf[0].index("1")
			y = surf[1].index("1")
			if x - y == 0    : print "A"
			elif x - y == -1 : print "E"
			elif x - y ==  1 : print "G"
		elif len(surf) == 3:
			x = surf[0].index("1")
			y = surf[1].index("1")
			if x - y ==   1 : print "D"
			elif x - y == 0 : print "F"
		elif len(surf) == 4 : print "B"
		
	try:
		raw_input()
	except EOFError:
		break

Buggy python submission (verdict: Runtime Error):
while True:
	try:
		code = [raw_input() for _ in range(8)]
	except EOFError:
		break
	
	code = "".join(code)
	
	str(code)
	check = 0
	for var in range(0, len(code)):
		if int(code[var:var+1]) == 1:
			check = var
			break
	
	if int(code[check+1:check+2]) == 1 and int(code[check+8:check+9]) == 1:
			if int(code[check+9:check+10]) == 1:
				print "A"
			if int(code[check+7:check+8]) == 1:
				print "G"
	elif int(code[check+1:check+2]) == 1:
		if int(code[check+2:check+3]) == 1 and int(code[check+3:check+4]) == 1:
			print "C"
		if int(code[check+9:check+10]) == 1 and int(code[check+10:check+11]) == 1:
			print "E"
	elif int(code[check+8:check+9]) == 1:
		if int(code[check+16:check+17]) == 1 and int(code[check+24:check+25]) == 1:
			print "B"
		if int(code[check+7:check+8]) == 1 and int(code[check+15:check+16]) == 1:
			print "D"
		if int(code[check+9:check+10]) == 1 and int(code[check+17:check+18]) == 1:
			print "F"

Fixed submission:
while True:
	surface = [list(raw_input()) for _ in range(0, 8)]

	surf = []
	for i in range(0, 8):
		if "1" in surface[i]:
			surf.append(surface[i])
	
	if len(surf) == 1 : print "C"
	else:
		if len(surf) == 2:
			x = surf[0].index("1")
			y = surf[1].index("1")
			if x - y == 0    : print "A"
			elif x - y == -1 : print "E"
			elif x - y ==  1 : print "G"
		elif len(surf) == 3:
			x = surf[0].index("1")
			y = surf[1].index("1")
			if x - y ==   1 : print "D"
			elif x - y == 0 : print "F"
		elif len(surf) == 4 : print "B"
		
	try:
		raw_input()
	except EOFError:
		break
Buggy python submission (verdict: Runtime Error):
while True:
	try:
		num = raw_input().split(" ")
		sum = 0
		x = float(num[0]) / float(num[1])
		if x < 1:
			x = x + 1.0
		for var in range(1, int(num[2]) + 1):
			sum += int(str(x * 10**var)[var:var+1])
			
		print sum
	except EOFError:
		break

Fixed submission:
while True:
	try:
		a,b,n = map(int,raw_input().split())
	except EOFError:
		break
	s = 0
	for var in range(0, n):
		a = a % b * 10
		s += a / b
	print s

Buggy python submission (verdict: Runtime Error):
while True:
		num = raw_input().split(" ")
		sum = 0
		x = float(num[0]) / float(num[1])
		if x < 1:
			x = x + 1.0
		for var in range(1, int(num[2]) + 1):
			sum += int(str(x * 10**var)[var:var+1])
			
		print sum

Fixed submission:
while True:
	try:
		a,b,n = map(int,raw_input().split())
	except EOFError:
		break
	s = 0
	for var in range(0, n):
		a = a % b * 10
		s += a / b
	print s
Buggy python submission (verdict: Runtime Error):
def doc_string():
    """
    I can fly.
    """
while True:
    h = int(raw_input) * 3600
    m = int(raw_input) * 60
    s = int(raw_input)
    time = 120 * 60 - (h + m + s)
    if h == -1 and m == -1 and s == -1:
        print "kill"

    h = str(time / 3600)
    m = str(time % 3600 / 60)
    s = str(time % 3600 % 60)
    if len(h) == 1:
        h = "0" + h
    if len(m) == 1:
        m = "0" + m
    if len(s) == 1:
        s = "0" + s
    print h + ":" + m + ":" + s

    h = str(time * 3 / 3600)
    m = str(time * 3 % 3600 / 60)
    s = str(time * 3 % 3600 % 60)
    if len(h) == 1:
        h = "0" + h
    if len(m) == 1:
        m = "0" + m
    if len(s) == 1:
        s = "0" + s
    print h + ":" + m + ":" + s

Fixed submission:
def doc_string():
    """
    I can fly.
    """
while True:
    h,m,s = map(int,raw_input().split())
    if h == -1 and m == -1 and s == -1:
        break
    
    h = h * 3600
    m = m * 60
    time = 120 * 60 - (h + m + s)
    h = str(time / 3600)
    m = str(time % 3600 / 60)
    s = str(time % 3600 % 60)
    if len(h) == 1:
        h = "0" + h
    if len(m) == 1:
        m = "0" + m
    if len(s) == 1:
        s = "0" + s
    print h + ":" + m + ":" + s

    h = str(time * 3 / 3600)
    m = str(time * 3 % 3600 / 60)
    s = str(time * 3 % 3600 % 60)
    if len(h) == 1:
        h = "0" + h
    if len(m) == 1:
        m = "0" + m
    if len(s) == 1:
        s = "0" + s
    print h + ":" + m + ":" + s
Buggy python submission (verdict: Runtime Error):
while True:
		code = raw_input()
	
	code = code.replace(",","")
	code = code.replace(".","")
	code = code.split()
	
	list = []
	
	for var in code:
		if len(var) >= 3 and len(var) <= 6:
			list.append(var)
			
	for var in list:
		print var,
		
	print ""

Fixed submission:
code = raw_input()
code = code.replace(",","")
code = code.replace(".","")
code = code.split()
	
list = []
	
for var in code:
	if len(var) >= 3 and len(var) <= 6:
		list.append(var)
			
for var in list:
	print var,
Buggy python submission (verdict: Runtime Error):
l = [[], [], []]
ans = []
for i in range(3):
  for j in range(8):
    s = raw_input().split()
    l[i].append(float(s[1]), int(s[0]))
for i in range(3):
  l[i].sort()
  l[i].reverse()
  ans.append(l[i].pop(0))
  ans.append(l[i].pop(0))
l = l[0] + l[1] + [2]
l.sort()
l.reverse()
ans.append(l.pop(0))
ans.append(l.pop(0))
for n in ans:
  print str(n[1]) + " " + str(n[0])

Fixed submission:
l = [[], [], []]
ans = []
for i in range(3):
  for j in range(8):
    s = raw_input().split()
    l[i].append([float(s[1]), int(s[0])])
for i in range(3):
  l[i].sort()
  ans.append(l[i].pop(0))
  ans.append(l[i].pop(0))
l = l[0] + l[1] + l[2]
l.sort()
ans.append(l.pop(0))
ans.append(l.pop(0))
for n in ans:
  print str(n[1]) + " " + str(n[0])
Buggy python submission (verdict: Runtime Error):
n = int)input())
xs = []
for i in range(n): xs.append(input())
m = int(input())
flag = 1
for i in range(m):
    s = input()
    if s in l:
        print("Opened" if flag == 1 else "Closed", "by", s)
        flag ^= 1
    else:
        print("Unknown", s)

Fixed submission:
n = int(input())
xs = []
for i in range(n): xs.append(input())
m = int(input())
flag = 1
for i in range(m):
    s = input()
    if s in xs:
        print("Opened" if flag == 1 else "Closed", "by", s)
        flag ^= 1
    else:
        print("Unknown", s)

Buggy python submission (verdict: Runtime Error):
n = int)input())
xs = []
for i in range(n): xs.append(input())
m = int(input())
flag = 1
for i in range(m):
    s = input()
    if s in xs:
        print("Opened" if flag == 1 else "Closed", "by", s)
        flag ^= 1
    else:
        print("Unknown", s)

Fixed submission:
n = int(input())
xs = []
for i in range(n): xs.append(input())
m = int(input())
flag = 1
for i in range(m):
    s = input()
    if s in xs:
        print("Opened" if flag == 1 else "Closed", "by", s)
        flag ^= 1
    else:
        print("Unknown", s)
Buggy python submission (verdict: Runtime Error):

list = []
for i in range(10):
    hill = int(input())
    list.append(hill)

sorted(list)
h1 = a[9]
h2 = a[8]
h3 = a[7]

print(h1)
print(h2)
print(h3)

Fixed submission:

array = []
for i in range(10):
    num = int(input())
    array.append(num)

list = sorted(array)
print(list[9])
print(list[8])
print(list[7])

Buggy python submission (verdict: Runtime Error):
def main():
    number = []
    for i in range(10):
        num = int(input())
        number.append(num)


    numbers = number.sorted(number)
    print(numbers[9])
    print(numbers[8])
    print(numbers[7])




if __name__=='__main__':
    main()

Fixed submission:

array = []
for i in range(10):
    num = int(input())
    array.append(num)

list = sorted(array)
print(list[9])
print(list[8])
print(list[7])
Buggy python submission (verdict: Runtime Error):
import math
while True:
    try:
        num = input().split(" ")
        num1 = int(num[0])
        num2 = int(num[1])
        sum_number =　num1 + num2
        ans = int(math.log10(sum_number) + 1)
        print(ans)

    except:
        break
    

Fixed submission:
import math
while True:
    try:

        num1, num2 = map(int, input().split())
        sum_number = num1 + num2

        ans = int(math.log10(sum_number) + 1)
        print(ans)

    except:
        break