Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
raise Exception((eval("'a'")))

Fixed submission:
import re

p = 0
class N(int):
    def __add__(self,n):
        return N((int(self) + int(n)) % p)
    def __sub__(self,n):
        return N((int(self) - int(n)) % p)
    def __mul__(self,n):
        return N((int(self) * int(n)) % p)
    def __floordiv__(self,n):
        if not n:
            raise ZeroDivisionError
        return self*pow(int(n),p-2,p)

while True:
    s = input()
    p,s = s.split(':')
    p = int(p)
    if not p:
        break
    s = s.replace(' ','')
    try:
        n = eval(re.sub(r'(\d+)',r'N(\1)',s).replace('/','//'))
        print('%s = %s (mod %s)'%(s,n,p))
    except ZeroDivisionError:
        print('NG')

Buggy python submission (verdict: Runtime Error):
if eval('1') == 1:
 raise Exception("a")
print("b")

Fixed submission:
import re

p = 0
class N(int):
    def __add__(self,n):
        return N((int(self) + int(n)) % p)
    def __sub__(self,n):
        return N((int(self) - int(n)) % p)
    def __mul__(self,n):
        return N((int(self) * int(n)) % p)
    def __floordiv__(self,n):
        if not n:
            raise ZeroDivisionError
        return self*pow(int(n),p-2,p)

while True:
    s = input()
    p,s = s.split(':')
    p = int(p)
    if not p:
        break
    s = s.replace(' ','')
    try:
        n = eval(re.sub(r'(\d+)',r'N(\1)',s).replace('/','//'))
        print('%s = %s (mod %s)'%(s,n,p))
    except ZeroDivisionError:
        print('NG')

Buggy python submission (verdict: Time Limit Exceeded):
import re

p = 0
class N(int):
    def __add__(self,n):
        return N((int(self) + int(n)) % p)
    def __sub__(self,n):
        return N((int(self) - int(n)) % p)
    def __mul__(self,n):
        return N((int(self) * int(n)) % p)
    def __floordiv__(self,n):
        if not n:
            raise ZeroDivisionError
        return N((int(self)*int(n**(p-2))) % p)

while True:
    s = input()
    p,s = s.split(':')
    p = int(p)
    if not p:
        break
    s = s.replace(' ','')
    try:
        n = eval(re.sub(r'(\d+)',r'N(\1)',s).replace('/','//'))
        print('%s = %s (mod %s)'%(s,n,p))
    except ZeroDivisionError:
        print('NG')

Fixed submission:
import re

p = 0
class N(int):
    def __add__(self,n):
        return N((int(self) + int(n)) % p)
    def __sub__(self,n):
        return N((int(self) - int(n)) % p)
    def __mul__(self,n):
        return N((int(self) * int(n)) % p)
    def __floordiv__(self,n):
        if not n:
            raise ZeroDivisionError
        return self*pow(int(n),p-2,p)

while True:
    s = input()
    p,s = s.split(':')
    p = int(p)
    if not p:
        break
    s = s.replace(' ','')
    try:
        n = eval(re.sub(r'(\d+)',r'N(\1)',s).replace('/','//'))
        print('%s = %s (mod %s)'%(s,n,p))
    except ZeroDivisionError:
        print('NG')
Buggy python submission (verdict: Runtime Error):
def calculate(num,i):
		num.sort(reverse=True)
		if num[0] == num[3]:
			return "NA"
		L = num[0] * 1000 + num[1] * 100 + num[2] * 10 + num[3]
		S = num[3] * 1000 + num[2] * 100 + num[1] * 10 + num[0]
		new_N = L - S
		if new_N == 6174:
			return i + 1
		return calculate(map(int,str(new_N)),i+1)
ans = []
while(1):
	input_str = raw_input()
	if input_str == '0000':
		break
	elif input_str == '6174':
		ans.append(0)
	else:
		num = map(int,input_str)
		ans.append(calculate(num,0))
for value in ans:
	print value

Fixed submission:
def calculate(num,i):
		num.sort(reverse=True)
		if num[0] == num[3]:
			return "NA"
		L = num[0] * 1000 + num[1] * 100 + num[2] * 10 + num[3]
		S = num[3] * 1000 + num[2] * 100 + num[1] * 10 + num[0]
		new_N = L - S
		if new_N == 6174:
			return i + 1
		input_str = "%04d" % new_N
		return calculate(map(int,input_str),i+1)
ans = []
while(1):
	input_str = raw_input()
	if input_str == '0000':
		break
	elif input_str == '6174':
		ans.append(0)
	else:
		num = map(int,input_str)
		ans.append(calculate(num,0))
for value in ans:
	print value
Buggy python submission (verdict: Runtime Error):
x=0
while True:
	sousa=input().sprit() #?????????
	sousa=[int(sousa[0]),int(sousa[1])]
	if sousa==[0,0]:break
	yama=[]
	for k in range(sousa[1]):yama.append(k+1)
	yama=yama[::-1]
	for r in range(sousa[1]):
		[p,c]=input().sprit()
		[p,c]=[int(p),int(c)]
		yama[:p+c-1]=yama[p-1:p+c-1]+yama[:p-2]
	print(yama[0])

Fixed submission:
while True:
	sousa=input().split()
	sousa=[int(sousa[0]),int(sousa[1])]
	if sousa==[0,0]:break
	yama=[]
	for k in range(sousa[0]):yama.append(k+1)
	yama=yama[::-1]
	for r in range(sousa[1]):
		[p,c]=input().split()
		[p,c]=[int(p),int(c)]
		yama[:p+c-1]=yama[p-1:p+c-1]+yama[:p-1]
	print(yama[0])

Buggy python submission (verdict: Runtime Error):
while True:
	sousa=input().sprit() #?????????
	sousa=[int(sousa[0]),int(sousa[1])]
	if sousa==[0,0]:break
	yama=[]
	for k in range(sousa[0]):yama.append(k+1)
	yama=yama[::-1]
	for r in range(sousa[1]):
		[p,c]=input().sprit()
		[p,c]=[int(p),int(c)]
		yama[:p+c-1]=yama[p-1:p+c-1]+yama[:p-2]
	print(yama[0])

Fixed submission:
while True:
	sousa=input().split()
	sousa=[int(sousa[0]),int(sousa[1])]
	if sousa==[0,0]:break
	yama=[]
	for k in range(sousa[0]):yama.append(k+1)
	yama=yama[::-1]
	for r in range(sousa[1]):
		[p,c]=input().split()
		[p,c]=[int(p),int(c)]
		yama[:p+c-1]=yama[p-1:p+c-1]+yama[:p-1]
	print(yama[0])
Buggy python submission (verdict: Runtime Error):
while True:
    N=int(input())
    if N==0:break
    t=[0]
    y=[0]
    lst=list(range(N))
    for k in lst[1:]:
        [x,d]=input().slice()
        [x,d]=[int(x),int(d)]
        if d==0:
            t=t+[t[x]]
            y=y+[y[x]-1]
        if d==1:
            t=t+[t[x]-1]
            y=y+[y[x]]
        if d==2:
            t=t+[t[x]]
            y=y+[y[x]+1]
        if d==3:
            t=t+[t[x]+1]
            y=y+[y[x]]
    ht=0
    lt=0
    hy=0
    ly=0
    for f in range(N):
        if ht<t[f]:
            ht+=1
        if lt>t[f]:
            lt-=1
        if hy<y[f]:
            hy+=1
        if ly>y[f]:
            ly-=1
    print(ht-lt+1,hy-ly+1)

Fixed submission:
while True:
    N=int(input())
    if N==0:break
    t=[0]
    y=[0]
    lst=list(range(N))
    for k in lst[1:]:
        [x,d]=input().split()
        [x,d]=[int(x),int(d)]
        if d==0:
            t=t+[t[x]]
            y=y+[y[x]-1]
        if d==1:
            t=t+[t[x]-1]
            y=y+[y[x]]
        if d==2:
            t=t+[t[x]]
            y=y+[y[x]+1]
        if d==3:
            t=t+[t[x]+1]
            y=y+[y[x]]
    ht=0
    lt=0
    hy=0
    ly=0
    for f in range(N):
        if ht<t[f]:
            ht+=1
        if lt>t[f]:
            lt-=1
        if hy<y[f]:
            hy+=1
        if ly>y[f]:
            ly-=1
    print(hy-ly+1,ht-lt+1)

Buggy python submission (verdict: Runtime Error):
while True:
    N=int(input())
    if N==0:break
    t=[0]
    y=[0]
    lst=list(range(N))
    for k in lst[1:]:
        [x,d]=input().slice()
        [x,d]=[int(x),int(d)]
        if d==0:
            t=t+[t[x]]
            y=y+[y[x]-1]
        if d==1:
            t=t+[t[x]-1]
            y=y+[y[x]]
        if d==2:
            t=t+[t[x]]
            y=y+[y[x]+1]
        if d==3:
            t=t+[t[x]+1]
            y=y+[y[x]]
    ht=0
    lt=0
    hy=0
    ly=0
    for f in range(N):
        if ht<t[f]:
            ht+=1
        if lt>t[f]:
            lt-=1
        if hy<y[f]:
            hy+=1
        if ly>y[f]:
            ly-=1
    print(ht-lt+1,hy-ly+1)

Fixed submission:
while True:
    N=int(input())
    if N==0:break
    t=[0]
    y=[0]
    lst=list(range(N))
    for k in lst[1:]:
        [x,d]=input().split()
        [x,d]=[int(x),int(d)]
        if d==0:
            t=t+[t[x]]
            y=y+[y[x]-1]
        if d==1:
            t=t+[t[x]-1]
            y=y+[y[x]]
        if d==2:
            t=t+[t[x]]
            y=y+[y[x]+1]
        if d==3:
            t=t+[t[x]+1]
            y=y+[y[x]]
    ht=0
    lt=0
    hy=0
    ly=0
    for f in range(N):
        if ht<t[f]:
            ht+=1
        if lt>t[f]:
            lt-=1
        if hy<y[f]:
            hy+=1
        if ly>y[f]:
            ly-=1
    print(hy-ly+1,ht-lt+1)
Buggy python submission (verdict: Runtime Error):
while True:
    [n,m,a]=input().split()
    if [n,m,a]==["0","0","0"]: break
    [n,m,a]=[int(n),int(m),int(a)]
    yokobo={}
    for k in range(m):
        [h,p,q]=input().sprit()
        yokobo[h,p]=[int(q)]
        yokobo[h,q]=[int(p)]
    move=1000
    while move>0:
        a=yokobo[move,a]
        move=move-1

Fixed submission:
while True:
    [n,m,a]=input().split()
    if [n,m,a]==["0","0","0"]: break
    [n,m]=[int(n),int(m)]
    yokobo={}
    for k in range(m):
        [h,p,q]=input().split()
        yokobo[h,p]=q
        yokobo[h,q]=p
    high=1000
    while high>0:
        if (str(high),a) in yokobo:
            a=yokobo[str(high),a]
        high-=1
    print(a)
Buggy python submission (verdict: Runtime Error):
now=False
N=int(input())
for k in range(N):
    lst=lst.append(input())
M=int(input())
for t in range(M):
    ID=input()
    if ID in lst:
        now=not(now)
        if now:
            print("Opened by",ID)
        else:
            print("Closed by",ID)
    else:
        print("Unknown",ID)

Fixed submission:
now=False
lst=[]
N=int(input())
for k in range(N):lst.append(input())
M=int(input())
for t in range(M):
    ID=input()
    if ID in lst:
        now=not(now)
        if now:
            print("Opened by",ID)
        else:
            print("Closed by",ID)
    else:
        print("Unknown",ID)

Buggy python submission (verdict: Runtime Error):
now=False
lst=[]
N=int(input())
for k in range(N):
    lst=lst.append(input())
M=int(input())
for t in range(M):
    ID=input()
    if ID in lst:
        now=not(now)
        if now:
            print("Opened by",ID)
        else:
            print("Closed by",ID)
    else:
        print("Unknown",ID)

Fixed submission:
now=False
lst=[]
N=int(input())
for k in range(N):lst.append(input())
M=int(input())
for t in range(M):
    ID=input()
    if ID in lst:
        now=not(now)
        if now:
            print("Opened by",ID)
        else:
            print("Closed by",ID)
    else:
        print("Unknown",ID)
Buggy python submission (verdict: Runtime Error):
# coding:utf-8
# ??\??????????????´??°????°???????????????????

i = 1
x = 1
while x != 0 and y != 0:
    xy = raw_input().split()
    x = int(xy[0])
    y = int(xy[1])
    if x == 0 and y ==0:
        break
    if x < y :
        print x,y
    else:
        print y,x

Fixed submission:
# coding:utf-8
# ??\??????????????´??°????°???????????????????

i = 1
x = 1
y = 1
while x != 0 or y != 0:
    xy = raw_input().split()
    x = int(xy[0])
    y = int(xy[1])
    if x == 0 and y ==0:
        break
    if x < y :
        print x,y
    else:
        print y,x
Buggy python submission (verdict: Runtime Error):
#??°???????????¢

n = input()

l = raw_input().split()

for i in range(n):
    l.append(i)

l.reverse()

print l

Fixed submission:
#??°???????????¢

n = input()
n = int(n)

l = input().split()
l = list(map(int, l))

# ?????¢
l.reverse()

# ????§????????????§??????
for i in range(n-1):
    print(l[i], end=" ")
print(l[n-1])
Buggy python submission (verdict: Runtime Error):
while(1):
    try:
        a, b = map(str, raw_input().split())
        print int(a)+int(b)
    except ValueError:
        exit

Fixed submission:
while True:
    try:
        print sum(map(int, raw_input().split()))
    except EOFError:
        break

Buggy python submission (verdict: Time Limit Exceeded):
while(1):
    try:
        print sum(map(int, raw_input().split()))
    except EOFError:
        exit

Fixed submission:
while True:
    try:
        print sum(map(int, raw_input().split()))
    except EOFError:
        break
Buggy python submission (verdict: Time Limit Exceeded):
iterator = [["NS", "S"], ["NT", "T"]]
var = {}
for i, j in iterator:
    var[i] = int(input())
    var[j] = [int(k) for k in input().split()]
res = 0
for T in var["T"]:
    if T in var["S"]:
        res += 1
print(res)

Fixed submission:
iterator = (("NS", "S"), ("NT", "T"))
var = {}

for i, j in iterator:
    var[i] = int(input())
    var[j] = [int(k) for k in input().split()]

count = 0
for T in var["T"]:
    left = 0
    right = len(var["S"])
    while(left < right):
        mid = (left + right)//2
        if var["S"][mid] == T:
            count += 1
            break
        elif var["S"][mid] <= T:
            left = mid+1
        else:
            right = mid
print(count)

Buggy python submission (verdict: Runtime Error):
from collections import deque

iterator = [["NS", "S"], ["NT", "T"]]
var = {}

for i, j in iterator:
    var[i] = int(input())
    var[j] = [int(k) for k in input().split()]
var["S"] = sorted(var["S"])
var["T"] = sorted(var["T"])

dq = deque(var["S"])
res = 0

for T in var["T"]:
    if T in dq:
        res += 1
        while(dq[0] <= T):
            dq.popleft()
print(res)

Fixed submission:
iterator = (("NS", "S"), ("NT", "T"))
var = {}

for i, j in iterator:
    var[i] = int(input())
    var[j] = [int(k) for k in input().split()]

count = 0
for T in var["T"]:
    left = 0
    right = len(var["S"])
    while(left < right):
        mid = (left + right)//2
        if var["S"][mid] == T:
            count += 1
            break
        elif var["S"][mid] <= T:
            left = mid+1
        else:
            right = mid
print(count)
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
N = int(f.readline())
A = [int(i) for i in input().split()]
q = int(f.readline())
m = [int(i) for i in input().split()]
MAX_LENGTH = len(A)
#i番目以降の値を使ってmを作ればTrueを返す
def fullSearch(i, m):
    #終了条件
    if m == 0:
        return True
    elif i >= MAX_LENGTH:
        return False
    else:
        #全探索かっこわるい
        return fullSearch(i + 1, m) or fullSearch(i + 1, m - A[i])

for i in m:
    print("yes" if fullSearch(0, i) else "no")

Fixed submission:
# coding: utf-8
N = int(input())
A = [int(i) for i in input().split()]
q = int(input())
m = [int(i) for i in input().split()]
MAX_LENGTH = len(A)
dp = [[-1 for i in range(max(m) + 1)] for j in range(MAX_LENGTH + 1)]
# i番目以降の値を使ってmを作ればTrueを返す
def fullSearch(i, m):
    # 終了条件
    if m < 0:
        return False
    elif dp[i][m] != -1:
        return dp[i][m]
    elif m == 0:
        return True
    elif i >= MAX_LENGTH:
        return False
    else:
        # 全探索かっこわるい
        res = fullSearch(i + 1, m) or fullSearch(i + 1, m - A[i])
    # のでメモ化
    dp[i][m] = res
    return res
for mi in m:
    print("yes" if fullSearch(0, mi) else "no")

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
N = int(input())
A = [int(i) for i in input().split()]
q = int(input())
m = [int(i) for i in input().split()]
MAX_LENGTH = len(A)
#i番目以降の値を使ってmを作ればTrueを返す
def fullSearch(i, m):
    #終了条件
    if m == 0:
        return True
    elif i >= MAX_LENGTH:
        return False
    else:
        #全探索かっこわるい
        return fullSearch(i + 1, m) or fullSearch(i + 1, m - A[i])
 
for i in m:
    print("yes" if fullSearch(0, i) else "no")

Fixed submission:
# coding: utf-8
N = int(input())
A = [int(i) for i in input().split()]
q = int(input())
m = [int(i) for i in input().split()]
MAX_LENGTH = len(A)
dp = [[-1 for i in range(max(m) + 1)] for j in range(MAX_LENGTH + 1)]
# i番目以降の値を使ってmを作ればTrueを返す
def fullSearch(i, m):
    # 終了条件
    if m < 0:
        return False
    elif dp[i][m] != -1:
        return dp[i][m]
    elif m == 0:
        return True
    elif i >= MAX_LENGTH:
        return False
    else:
        # 全探索かっこわるい
        res = fullSearch(i + 1, m) or fullSearch(i + 1, m - A[i])
    # のでメモ化
    dp[i][m] = res
    return res
for mi in m:
    print("yes" if fullSearch(0, mi) else "no")
Buggy python submission (verdict: Runtime Error):
#f = open("input.txt")
#N, K = [int(x) for x in f.readline().split(' ')]
#lines = f.readlines()

import sys
N, K = [int(x) for x in sys.stdin.readline().split(' ')]
lines = sys.stdin.readlines()
f.close()

schedule = [0]*N
for line in lines:
    strs = line.split(' ')
    schedule[int(strs[0])-1] = int(strs[1])

number = [0]*9
for i in range(9):
    l1 = i // 3
    l2 = i % 3
    if(schedule[0]!=l1+1 and schedule[0]!=0):
        number[i] = 0
    elif(schedule[1]!=l2+1 and schedule[1]!=0):
        number[i] = 0
    else:
        number[i] = 1


for s in schedule[2:]:
    new_number = [0]*9
    for i in range(9):
        l1 = i // 3
        l2 = i % 3
        for j in range(3):
            new_number[i] += number[l2*3 + j] if((s==0 or s==l1+1) and  not (l2==j and l1==j)) else 0
    for i in range(9):
        number[i] = new_number[i] % 10000
      
sum = 0
for n in number:
    sum += n
print(sum % 10000)

Fixed submission:
#f = open("input.txt")
#N, K = [int(x) for x in f.readline().split(' ')]
#lines = f.readlines()
#f.close()
from sys import stdin
N, K = [int(x) for x in stdin.readline().split(' ')]
lines = stdin.readlines()

schedule = [0]*N
for line in lines:
    strs = line.split(' ')
    schedule[int(strs[0])-1] = int(strs[1])

number = [1]*9
for i in range(9):
    (l1,l2) = divmod(i,3)
    if   schedule[0]!=l2+1 and schedule[0]!=0:
        number[i] = 0
    elif schedule[1]!=l1+1 and schedule[1]!=0:
        number[i] = 0

for s in schedule[2:]:
    tmp = [0]*9
    for i in range(9):
        (l1,l2) = divmod(i,3)
       	tmp[i] = [number[l2*3+j] for j in range(3) \
                 if (s==0 or s==l1+1) and  not (l2==j and l1==j)]
    number = [sum(tmp_i) for tmp_i in tmp]
print(sum(number) % 10000)
Buggy python submission (verdict: Runtime Error):
x = input()
print(x**3)


Fixed submission:
x = int(input())
print(x**3)
Buggy python submission (verdict: Runtime Error):
i = 1;
while True:
    if((x = int(input())) == 0) break;
    print(f"Case {i}: {x}")


Fixed submission:
i = 1
while True:
    x = int(input())
    if(x == 0): 
        break
    print(f"Case {i}: {x}")
    i += 1

Buggy python submission (verdict: Runtime Error):
i = 1;
while True:
    x = int(input()))
    if(x == 0): 
        break;
    print(f"Case {i}: {x}")
    i += 1


Fixed submission:
i = 1
while True:
    x = int(input())
    if(x == 0): 
        break
    print(f"Case {i}: {x}")
    i += 1

Buggy python submission (verdict: Runtime Error):
i = 1
while True:
    x = int(input()))
    if(x == 0): 
        break;
    print(f"Case {i}: {x}")
    i += 1


Fixed submission:
i = 1
while True:
    x = int(input())
    if(x == 0): 
        break
    print(f"Case {i}: {x}")
    i += 1

Buggy python submission (verdict: Runtime Error):
i = 1
while True:
    x = int(input()))
    if(x == 0): 
        break
    print(f"Case {i}: {x}")
    i += 1


Fixed submission:
i = 1
while True:
    x = int(input())
    if(x == 0): 
        break
    print(f"Case {i}: {x}")
    i += 1
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split()))
cnt = 0
for i in range(a, b+1, 1):
    if(c % i == 0):
        cnt += 1
print(cnt)


Fixed submission:
a, b, c = map(int, input().split())
cnt = 0
for i in range(a, b+1, 1):
    if(c % i == 0):
        cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
a = int(input())
print("%.6f %,6f"%(a*a*3.1415926535, 2*a*3.1415946535))


Fixed submission:
import math
x = float(input())
print("%.6f %.6f"%(x*x*math.pi, x*2*math.pi))

Buggy python submission (verdict: Runtime Error):
x = float(input())
print("%.6f %.6"%(a*a*3.14159265, a*2*3.14159265))


Fixed submission:
import math
x = float(input())
print("%.6f %.6f"%(x*x*math.pi, x*2*math.pi))

Buggy python submission (verdict: Runtime Error):
x = float(input())
print("%.6f %.6"%(x*x*3.141592, x*2*3.141592))


Fixed submission:
import math
x = float(input())
print("%.6f %.6f"%(x*x*math.pi, x*2*math.pi))
Buggy python submission (verdict: Runtime Error):
while True:
    a = int(input())
    c = input()
    b = int(input())
    if(c == '+'):
        print(a + b)
    elif(c == '-'):
        print(a - b)
    elif(c == '*'):
        print(a * b)
    elif(c == '/')
        print(a / b)
    else:
        break


Fixed submission:
while True:
    a, b, c = map(str, input().split())
    a = int(a)
    c = int(c)
    if(b == '+'):
        print(a + c)
    elif(b == '-'):
        print(a - c)
    elif(b == '*'):
        print(a * c)
    elif(b == '/'):
        print(a // c)
    else:
        break

Buggy python submission (verdict: Runtime Error):
while True:
    a = int(input())
    c = str(input())
    b = int(input())
    if(c == '+'):
        print(a + b)
    elif(c == '-'):
        print(a - b)
    elif(c == '*'):
        print(a * b)
    elif(c == '/')
        print(a / b)
    else:
        break


Fixed submission:
while True:
    a, b, c = map(str, input().split())
    a = int(a)
    c = int(c)
    if(b == '+'):
        print(a + c)
    elif(b == '-'):
        print(a - c)
    elif(b == '*'):
        print(a * c)
    elif(b == '/'):
        print(a // c)
    else:
        break

Buggy python submission (verdict: Runtime Error):
while True:
    a, b, c = map(str, input().split())
    a = int(a)
    c = int(c)
    if(c == '+'):
        print(a + b)
    elif(c == '-'):
        print(a - b)
    elif(c == '*'):
        print(a * b)
    elif(c == '/')
        print(a / b)
    else:
        break


Fixed submission:
while True:
    a, b, c = map(str, input().split())
    a = int(a)
    c = int(c)
    if(b == '+'):
        print(a + c)
    elif(b == '-'):
        print(a - c)
    elif(b == '*'):
        print(a * c)
    elif(b == '/'):
        print(a // c)
    else:
        break
Buggy python submission (verdict: Runtime Error):
max = 0
min = 100000000
ave = 0
x = int(input())
for i in range(0, x):
    a = int(input())
    if(max < a):
        max = a
    if(min > a):
        min = a
    avg += a
print("%d %d %d"%(min, max, ave//x))


Fixed submission:
x = input()
a = list(map(int, input().split()))
print("%d %d %d"%(min(a), max(a), sum(a)))

Buggy python submission (verdict: Runtime Error):
i = 0
max = 0
min = 100000000
ave = 0
x = int(input())
for i in range(0, x):
    a = int(input())
    if(max < a):
        max = a
    if(min > a):
        min = a
    avg += a
print("%d %d %d"%(min, max, ave//x))


Fixed submission:
x = input()
a = list(map(int, input().split()))
print("%d %d %d"%(min(a), max(a), sum(a)))

Buggy python submission (verdict: Runtime Error):
i = 0
max = 0
min = 100000000
ave = 0
x = int(input())
for i in range(0, x):
    a = int(input())
    if(max < a):
        max = a
    if(min > a):
        min = a
    avg += a
print("%d %d %d"%(min, max, ave//x))


Fixed submission:
x = input()
a = list(map(int, input().split()))
print("%d %d %d"%(min(a), max(a), sum(a)))

Buggy python submission (verdict: Runtime Error):
x = input())
a = ilist(map(int, input().split())
print("%d %d %d"%(min(a), max(a), sum(a)))


Fixed submission:
x = input()
a = list(map(int, input().split()))
print("%d %d %d"%(min(a), max(a), sum(a)))

Buggy python submission (verdict: Runtime Error):
x = input())
a = list(map(int, input().split())
print("%d %d %d"%(min(a), max(a), sum(a)))


Fixed submission:
x = input()
a = list(map(int, input().split()))
print("%d %d %d"%(min(a), max(a), sum(a)))

Buggy python submission (verdict: Runtime Error):
x = input())
a = list(map(int, input().split()))
print("%d %d %d"%(min(a), max(a), sum(a)))


Fixed submission:
x = input()
a = list(map(int, input().split()))
print("%d %d %d"%(min(a), max(a), sum(a)))
Buggy python submission (verdict: Runtime Error):
while True:
    a, b = map(int, input().split())
    if(a == 0 and b == 0):
        break
    for i in range(a):
        for j in range(b):
            if(1 < i < a and 1 < j < b):
                print(".", end = "")
            else print("#", end = "")
        print()


Fixed submission:
while True:
    a, b = map(int, input().split())
    if(a == 0 and b == 0):
        break
    for i in range(a):
        for j in range(b):
            if(0 < i < a-1 and 0 < j < b-1):
                print(".", end = "")
            else:
                print("#", end = "")
        print()
    print()