Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
i=1
while 1
    x,y = map(int,input().split())
    n=[x,y]
    n.sort()
    print n
    i=i+1

Fixed submission:
while 1:
  x,y = map(int,raw_input().split())
  if x==0 and y==0:
    break
  else:
    n=[x,y]
    n.sort()
    print n[0],n[1]

Buggy python submission (verdict: Runtime Error):
i=0
while 1
    x,y = map(int,input().split())
    if x==0 or y==0;
        break

    n=[x,y]
    n.sort()
    print n
    i+=1

Fixed submission:
while 1:
  x,y = map(int,raw_input().split())
  if x==0 and y==0:
    break
  else:
    n=[x,y]
    n.sort()
    print n[0],n[1]

Buggy python submission (verdict: Runtime Error):
i = 0
while 1:
    x,y = map(int,input().split())
    i += 1
    if x == 0 or y==0:
        break
    n=[x,y]
    n.sort()
    print n

Fixed submission:
while 1:
  x,y = map(int,raw_input().split())
  if x==0 and y==0:
    break
  else:
    n=[x,y]
    n.sort()
    print n[0],n[1]

Buggy python submission (verdict: Runtime Error):
while 1:
  x,y = map(int,input().split())
  n=[x,y]
  if a[0]==0 and a[1]==0:
    break
  else:
    n.sort()
    print n
 

Fixed submission:
while 1:
  x,y = map(int,raw_input().split())
  if x==0 and y==0:
    break
  else:
    n=[x,y]
    n.sort()
    print n[0],n[1]

Buggy python submission (verdict: Runtime Error):
while 1:
  x,y = map(int,input().split())
  if x==0 and y==0:
    break
  else:
    n=[x,y]
    n.sort()
    print n
 

Fixed submission:
while 1:
  x,y = map(int,raw_input().split())
  if x==0 and y==0:
    break
  else:
    n=[x,y]
    n.sort()
    print n[0],n[1]

Buggy python submission (verdict: Runtime Error):
while 1:
  x,y = map(int,input().split())
  if x==0 and y==0:
    break
  else:
    n=[x,y]
    n.sort()
    print n[0],n[1]
 

Fixed submission:
while 1:
  x,y = map(int,raw_input().split())
  if x==0 and y==0:
    break
  else:
    n=[x,y]
    n.sort()
    print n[0],n[1]

Buggy python submission (verdict: Runtime Error):
while 1:
  x,y = map(int,row_input().split())
  if x==0 and y==0:
    break
  else:
    n=[x,y]
    n.sort()
    print n[0],n[1]
 

Fixed submission:
while 1:
  x,y = map(int,raw_input().split())
  if x==0 and y==0:
    break
  else:
    n=[x,y]
    n.sort()
    print n[0],n[1]
Buggy python submission (verdict: Runtime Error):
a,b= map(int,raw_input().split())
d=a/b
r=a%b
f=float(a/b)
print %d,%d,%d,%(d,r,f)

Fixed submission:
a,b= map(int,raw_input().split())
d=a/b
r=a%b
f=float(a)/float(b)
print "%d %d %f" % (d,r,f)

Buggy python submission (verdict: Runtime Error):
a,b= map(int,raw_input().split())
d=a/b
r=a%b
f=float(a/b)
print %d,%d,%f,%(d,r,f)

Fixed submission:
a,b= map(int,raw_input().split())
d=a/b
r=a%b
f=float(a)/float(b)
print "%d %d %f" % (d,r,f)
Buggy python submission (verdict: Runtime Error):
r= map(int,raw_input().split())
s=float(r)*r*pi
l=float(r)*2*pi

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

Fixed submission:
import math

r= input()
s=math.pi*float(r)**2
l=2*math.pi*float(r)

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

Buggy python submission (verdict: Runtime Error):
r= map(int,raw_input().split())
pi=3.14
s=float(r)*r*pi
l=float(r)*2*pi

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

Fixed submission:
import math

r= input()
s=math.pi*float(r)**2
l=2*math.pi*float(r)

print "%f %f" %(s,l)
Buggy python submission (verdict: Runtime Error):

while 1:
	a,"op",b= map(int,raw_input().split())
	if op==+:
		x=a+b
	elif op==-:
		x=a-b
	elif op==*:
		x=a*b
	elif op==/:
		x=a/b
	elif op=="?":
		break
	
	print "%d" %(x)

Fixed submission:
while 1:
	x=raw_input().split()
	op= x[1]
	a = int(x[0])
	b = int(x[2])

	if op=="+":
		x=a+b
	elif op=="-":
		x=a-b
	elif op=="*":
		x=a*b
	elif op=="/":
		x=a/b
	elif op=="?":
		break
	
	print "%d" %(x)

Buggy python submission (verdict: Runtime Error):

while 1:
	a,"op",b= map(int,raw_input().split())
	if op=="+":
		x=a+b
	elif op=="-":
		x=a-b
	elif op=="*":
		x=a*b
	elif op=="/":
		x=a/b
	elif op=="?":
		break
	
	print "%d" %(x)

Fixed submission:
while 1:
	x=raw_input().split()
	op= x[1]
	a = int(x[0])
	b = int(x[2])

	if op=="+":
		x=a+b
	elif op=="-":
		x=a-b
	elif op=="*":
		x=a*b
	elif op=="/":
		x=a/b
	elif op=="?":
		break
	
	print "%d" %(x)

Buggy python submission (verdict: Runtime Error):
while 1:
	x=raw_input().split()
    op= x[1]
    a = int(x[0])
    b = int(x[2])

	if op=="+":
		x=a+b
	elif op=="-":
		x=a-b
	elif op=="*":
		x=a*b
	elif op=="/":
		x=a/b
	elif op=="?":
		break
	
	print "%d" %(x)

Fixed submission:
while 1:
	x=raw_input().split()
	op= x[1]
	a = int(x[0])
	b = int(x[2])

	if op=="+":
		x=a+b
	elif op=="-":
		x=a-b
	elif op=="*":
		x=a*b
	elif op=="/":
		x=a/b
	elif op=="?":
		break
	
	print "%d" %(x)

Buggy python submission (verdict: Runtime Error):

while 1:
	a,op,b= map(str,raw_input().split())
    a = int(a)
    b = int(b)

	if op=="+":
		x=a+b
	elif op=="-":
		x=a-b
	elif op=="*":
		x=a*b
	elif op=="/":
		x=a/b
	elif op=="?":
		break
	
	print "%d" %(x)

Fixed submission:
while 1:
	x=raw_input().split()
	op= x[1]
	a = int(x[0])
	b = int(x[2])

	if op=="+":
		x=a+b
	elif op=="-":
		x=a-b
	elif op=="*":
		x=a*b
	elif op=="/":
		x=a/b
	elif op=="?":
		break
	
	print "%d" %(x)
Buggy python submission (verdict: Runtime Error):
H,W=map(int,raw_input().split())

while 1:
	if H==0 and W==0:
		break
	for i in H
		print "#"*W 
		print "/n"

Fixed submission:
while 1:
	H,W=map(int,raw_input().split())

	if H==0 and W==0:
		break

	for i in range(H):
		print "#"*W 
	print ""

Buggy python submission (verdict: Runtime Error):
while 1:
	H,W=map(int,raw_input().split())
	if H==0 and W==0:
		break
	for i in H:
		print "#"*W 
		print "/n"

Fixed submission:
while 1:
	H,W=map(int,raw_input().split())

	if H==0 and W==0:
		break

	for i in range(H):
		print "#"*W 
	print ""

Buggy python submission (verdict: Runtime Error):
while 1:
	H,W=map(int,raw_input().split())
	if H==0 and W==0:
		break
	for i in H:
		print "#"*W 
	print "/n"

Fixed submission:
while 1:
	H,W=map(int,raw_input().split())

	if H==0 and W==0:
		break

	for i in range(H):
		print "#"*W 
	print ""
Buggy python submission (verdict: Runtime Error):
 n=input()
 a=map(int,raw_input().split())
 a=reverse
 print a

Fixed submission:
n=input()
a=map(int,raw_input().split())
a.reverse()

for i in a:
    print i,

Buggy python submission (verdict: Runtime Error):
 n=input()
 a=map(int,raw_input().split())
 a=reverse()

for i in range(n)
     print a[i]

Fixed submission:
n=input()
a=map(int,raw_input().split())
a.reverse()

for i in a:
    print i,

Buggy python submission (verdict: Runtime Error):
 n=input()
 a=map(int,raw_input().split())
 a=reverse()

 print a

Fixed submission:
n=input()
a=map(int,raw_input().split())
a.reverse()

for i in a:
    print i,

Buggy python submission (verdict: Runtime Error):
n=input()
a=map(int,raw_input().split())
a=reverse

for i in n:
	print a

Fixed submission:
n=input()
a=map(int,raw_input().split())
a.reverse()

for i in a:
    print i,

Buggy python submission (verdict: Runtime Error):
n=input()
a=map(int,raw_input().split())
a=reverse

for i in n:
    print a

Fixed submission:
n=input()
a=map(int,raw_input().split())
a.reverse()

for i in a:
    print i,

Buggy python submission (verdict: Runtime Error):
n=input()
a=map(int,raw_input().split())
a.reverse()

for i in n:
    print a

Fixed submission:
n=input()
a=map(int,raw_input().split())
a.reverse()

for i in a:
    print i,

Buggy python submission (verdict: Runtime Error):
n=input()
a=map(int,raw_input().split())
a.reverse()

for i in n:
    print i

Fixed submission:
n=input()
a=map(int,raw_input().split())
a.reverse()

for i in a:
    print i,
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

count = 0

for i in range(n):
  check = True
  
  key = int(input())

  for i in range(2,key):
    if key % i == 0:
      check = False
    
  if check:
    count += 1

print(count)


Fixed submission:
def isPrime(n):
    for i in range(2, n):
        if i * i > n:
            return 1
        if n % i == 0:
            return 0
    return 1
 
ans = 0
n = int(input())
for i in range(n):
    x = int(input())
    ans = ans + isPrime(x)
 
print(ans)
Buggy python submission (verdict: Runtime Error):
print(" ".join([str(i) for i in sorted([int(w) for w in input().split()])])

Fixed submission:
print(" ".join([str(i) for i in sorted([int(w) for w in input().split()])]))
Buggy python submission (verdict: Runtime Error):
for i in range(10000)
  x = int(input())
  if x == 0: break
  print("Case %d: %d" % (i+1, x))

Fixed submission:
for i in range(10000):
    x = int(input())
    if x == 0: break
    print("Case %d: %d" % (i+1, x))
Buggy python submission (verdict: Runtime Error):
x = input()
y = input()

a = x*y
b = 2*x+2*y

print a 
print b

Fixed submission:
x,y = map(int,raw_input().split())

a = x*y
b = 2*x+2*y

print a,b
Buggy python submission (verdict: Runtime Error):
r,c=map(int,raw_input().split())
m=[]
ans=[]

for i in range(r):
	a=map(int,raw_input().split())
	m.append(a)
	sum=0
	for j in range(c)
		print(a[j]),
		sum+=a[j]
	print(sum)
total=0
for i in range(c):
	sum=0
	for j in range(r):
		sum+=m[j][i]
	print(sum),
	total+=sum
print(total)

Fixed submission:
r,c=map(int,raw_input().split())
m=[]
ans=[]

for i in range(r):
	a=map(int,raw_input().split())
	m.append(a)
	sum=0
	for j in range(c):
		print(a[j]),
		sum+=a[j]
	print(sum)
total=0
for i in range(c):
	sum=0
	for j in range(r):
		sum+=m[j][i]
	print(sum),
	total+=sum
print(total)
Buggy python submission (verdict: Runtime Error):
while 1:
	x=input()
	if x=='0':
		break
	print sum(map(int,x))

Fixed submission:
while 1:
	x=raw_input()
	if x=='0':
		break
	print sum(map(int,x))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(raw_input())
a = map(int, raw_input().split())
sm = 0

for i in range(0, len(a)):
	for j in range(i+1, len(a)):
		if a[i] > a[j]:
			temp = a[i]
			a[i] = a[j]
			a[j] = temp

for i in range(0, len(a)):
	sm = sm + a[i]


print a[0], a[len(a)-1], sm

Fixed submission:
n = int(raw_input())
a = map(int, raw_input().split())

a_ = sorted(a)
sum = 0

for e in a_:
	sum += e

print "%d %d %d" %(a_[0], a_[-1], sum)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(raw_input())
a = map(int, raw_input().split())
sm = 0

for i in range(0, len(a)):
	for j in range(i+1, len(a)):
		if a[i] > a[j]:
			temp = a[i]
			a[i] = a[j]
			a[j] = temp
	sm = sm + a[i]


print a[0], a[len(a)-1], sm

Fixed submission:
n = int(raw_input())
a = map(int, raw_input().split())

a_ = sorted(a)
sum = 0

for e in a_:
	sum += e

print "%d %d %d" %(a_[0], a_[-1], sum)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(raw_input())
a = map(int, raw_input().split())
sm = 0

for i in xrange(0, len(a)):
	for j in xrange(i+1, len(a)):
		if a[i] > a[j]:
			temp = a[i]
			a[i] = a[j]
			a[j] = temp
	sm = sm + a[i]


print a[0], a[len(a)-1], sm

Fixed submission:
n = int(raw_input())
a = map(int, raw_input().split())

a_ = sorted(a)
sum = 0

for e in a_:
	sum += e

print "%d %d %d" %(a_[0], a_[-1], sum)
Buggy python submission (verdict: Runtime Error):

(n, m, l) = map(int, raw_input().split())

A = []
for i in xrange(0,n):
	line_A = map(int, raw_input().split())
	A.append(line_A)

B = []
for j in xrange(0,m):
	line_B = map(int, raw_input().split())
	B.append(line_B)

C = []
for x in xrange(0,n):
	temp_list = []
	for y in xrange(0,l):
		temp = 0
		for z in xrange(0,m):
			temp = temp + A[x][z] * B[z][y]

		temp_list.append(temp)
		
	C.append(temp_list)
	temp_list = []
			

for k in xrange(0,n):
	if k > 0:
		print
	for h in xrange(0,l):

Fixed submission:
(n, m, l) = map(int, raw_input().split())

A = []
for i in xrange(0,n):
	line_A = map(int, raw_input().split())
	A.append(line_A)

B = []
for j in xrange(0,m):
	line_B = map(int, raw_input().split())
	B.append(line_B)

C = []
for x in xrange(0,n):
	temp_list = []
	for y in xrange(0,l):
		temp = 0
		for z in xrange(0,m):
			temp = temp + A[x][z] * B[z][y]

		temp_list.append(temp)
		
	C.append(temp_list)
	temp_list = []
			

for k in xrange(0,n):
	if k > 0:
		print
	for h in xrange(0,l):
		print C[k][h],
print
Buggy python submission (verdict: Runtime Error):
l = [int(x) for x in input().split()]
a = l[0]
b = l[1]
if a < b :
    print("a < b")
elif a > b :
    print("a > b")
else:
    print("a == b")
l = [int(x) for x in input().split()]
a = l[0]
b = l[1]
c = l[2]
if a < b < c:
    print("Yes")
else:
    print("No")

Fixed submission:
l = [int(x) for x in input().split()]
a = l[0]
b = l[1]
c = l[2]
if a < b < c:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
while True:
    l = sorted([int(x) for x in input().split()])
    if l[0] == 0 and l[1] == 0:
        break
    l.sort()
    print(" ".join(map(str,l)))

Fixed submission:
cnt = 1
while True:
    i = input()
    if i == '0':
        break
    print("Case {}: {}".format(cnt,i))
    cnt = cnt+1
Buggy python submission (verdict: Runtime Error):
import sys


class Stack:
    def __init__(self, lst):
        self.lst = lst

    def push(x):
        lst.append(x)
    def pop():
        lst.pop(-1)

def cul(exp):

    S = Stack(exp)

    for val in exp:
        if val in ["+", "-", "*"]:
            if val == "+":
                x = reduce(lambda a,b:int(a)+int(b), S[-2:])
            elif val == "-":
                x = reduce(lambda a,b:int(a)-int(b), S[-2:])
            elif val == "*":
                x = reduce(lambda a,b:int(a)*int(b), S[-2:])
            for i in range(2):
                S.pop()
            S.push(x)
        else:
            S.push(val)

    return S[0]


if __name__ == "__main__":
    exp = sys.stdin.read().strip().split(" ")
    ans = cul(exp)
    print ans

Fixed submission:
import sys


Stack = []

def push(x):
    Stack.append(x)

def pop():
    Stack.pop(-1)


def cul(exp):
    for val in exp:
        if val in ["+", "-", "*"]:
            a = int(Stack[-2])
            b = int(Stack[-1])
            if val == "+":
                x = a + b
            elif val == "-":
                x = a - b
            elif val == "*":
                x = a * b
            for i in range(2):
                pop()
            push(x)
        else:
            push(val)

    return Stack[0]


if __name__ == "__main__":
    exp = sys.stdin.read().strip().split(" ")
    ans = cul(exp)
    print ans
Buggy python submission (verdict: Runtime Error):
x = sys.stdin
print x**3

Fixed submission:
import sys

x = sys.stdin.read()

print int(x)**3

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

x = sys.stdin
print x**3

Fixed submission:
import sys

x = sys.stdin.read()

print int(x)**3
Buggy python submission (verdict: Runtime Error):
import sys

input = sys.stdin.read()
(a, b) = map(lambda x:int(x) , input.split(" "))


x = a*b
y = 2*(a+b)

print str(x) + "?\t" + str(y)

Fixed submission:
import sys

lst = sys.stdin.read().split(" ")

a = int(lst[0])
b = int(lst[1])

print str(a*b) + " " + str(2*(a+b))

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

input = sys.stdin.read()
(a,b) = [int(x) for x in input.split(" ")]

x = a*b
y = 2*(a+b)

print x + "?\t" + y

Fixed submission:
import sys

lst = sys.stdin.read().split(" ")

a = int(lst[0])
b = int(lst[1])

print str(a*b) + " " + str(2*(a+b))
Buggy python submission (verdict: Runtime Error):
n = int(input())
A = input().split(' ')

for i in range(1, n-1):
    v = A[i]
    j = i - 1
    while j >= 0 && A[j] > v:
        A[j+1] = A[j]
        j--
        A[j+1] = v
    print(" ".join(A))

Fixed submission:
n = int(input())
A = input().split(' ')

#for i in range(n):
#    A[i] = int(A[i])
print(" ".join(A))

for i in range(1, n):
    v = A[i]
    j = i - 1

    while j >= 0 and int(A[j]) > int(v):
        A[j+1] = A[j]
        A[j] = v
        j -= 1
    print(" ".join(A))
Buggy python submission (verdict: Time Limit Exceeded):
x, y = map(int, input().split(' '))
n = min(x, y)

for d in reversed(range(1, n + 1)):
    if (x % d == 0) and (y % d == 0):
        print(d)
        break

Fixed submission:
def gcd(x, y):
    if x < y:
        x, y = y, x
    while y > 0:
        r = x % y
        x = y
        y = r

    return x

x, y = map(int, input().split(' '))
n = min(x, y)

print(gcd(x, y))
Buggy python submission (verdict: Time Limit Exceeded):
def insertionSort(A, n, g):
    global cnt
    for i in range(g, n):
        v = A[i]
        j = i - g
        while j >= 0 and int(A[j]) > int(v):
            A[j + g] = A[j]
            j = j - g
            cnt += 1
            A[j + g] = v

def shellSort(A, n):
    global m, G
    for i in range(0, m): 
        insertionSort(A, n, G[i])

n = int(input())
A = []
for i in range(0, n):
    A.append(int(input()))

G = []
h = 1
for i in range(1, 999999):
    if h > n:
        break
    G.append(h)
    h = 3 * h + 1

G.reverse()

cnt = 0
m = len(G)
shellSort(A, n)
'''
m = 2
G = (4,1)
shellSort(A, n)
'''

print(m)
print(" ".join(map(str, G)))
print(cnt)
for i in range(0, n):
    print(A[i])

Fixed submission:
def insertionSort(A, n, g):
    global cnt
    for i in range(g, n):
        v = A[i]
        j = i - g
        while j >= 0 and A[j] > v:
            A[j + g] = A[j]
            j = j - g
            cnt += 1
        A[j + g] = v

def shellSort(A, n):
    global m, G
    for i in range(0, m): 
        insertionSort(A, n, G[i])

n = int(input())
A = []
for i in range(0, n):
    A.append(int(input()))

G = []
h = 1
for i in range(1, 999999):
    if h > n:
        break
    G.append(h)
    h = 3 * h + 1

G.reverse()

cnt = 0
m = len(G)
shellSort(A, n)
'''
m = 2
G = (4,1)
shellSort(A, n)
'''

print(m)
print(" ".join(map(str, G)))
print(cnt)
for i in range(0, n):
    print(A[i])
Buggy python submission (verdict: Runtime Error):
X = int(input())
Print(x * x * x)

Fixed submission:
x = int(input())
print(x * x * x)

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

x = int(sys.argv[1])                                                                                             
 print(x * x * x)

Fixed submission:
x = int(input())
print(x * x * x)

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

x = int(sys.argv[1])
print(x * x * x)

Fixed submission:
x = int(input())
print(x * x * x)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split(' '))
print( a * b, 2a + 2b)

Fixed submission:
a, b = map(int, input().split(' '))
print( a * b, 2 * a + 2 * b)
Buggy python submission (verdict: Time Limit Exceeded):
def devisor_list(x):
    result = []
    for n in range(1, x + 1):
        if x % n == 0:
            result.append(n)
    return result

def common_max_element(array1, array2):
    result = []
    for n in array1:
        if n in array2:
            result.append(n)
    return max(result)

x, y = [int(n) for n in input().split()]
print(common_max_element(devisor_list(x), devisor_list(y)))



Fixed submission:
def gcd(x, y):
    if x < y:
        x, y = [y, x]

    while y > 0:
        r = x % y
        x = y
        y = r
    return x

x, y = [int(n) for n in input().split()]
print(gcd(x, y))
Buggy python submission (verdict: Time Limit Exceeded):
row_num = int(input())
nums = []
for row in range(row_num):
    nums.append(int(input()))

max_diff = nums[1] - nums[0]
for i in range(len(nums)):
    for j in range(i+1, len(nums)):
        diff = nums[j] - nums[i]
        if max_diff >= diff:
            continue
        else:
            max_diff = diff

print(max_diff)



Fixed submission:
row_num = int(input())
nums = []
for row in range(row_num):
    nums.append(int(input()))

min_diff = nums[0]
max_diff = nums[1] - nums[0]
for i in range(1, len(nums)):
    if max_diff < nums[i] - min_diff:
        max_diff = nums[i] - min_diff
    if min_diff > nums[i]:
        min_diff = nums[i]

print(max_diff)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
d = []
for i in range(n):
    cmd, string = input().split()
    if cmd == "insert":
        d.append(string)
    else:
        if string in d:
            print("yes")
        else:
            print("no")


Fixed submission:
n = int(input())
d = {}
for i in range(n):
    cmd, string = input().split()
    if cmd == "insert":
        d[string] = True
    else:
        try:
            if d[string]:
                print("yes")
        except:
            print("no")

Buggy python submission (verdict: Time Limit Exceeded):
def binarySearch(array, key):
    left = 0
    right = len(array)
    while left < right:
        mid = int((left + right) / 2)
        if key == array[mid]:
            return True
        elif key > array[mid]:
            left = mid + 1
        elif key < array[mid]:
            right = mid
        else:
            print("ERROR")
    return False


n = int(input())
d = []
for i in range(n):
    cmd, string = input().split()
    if cmd == "insert":
        d.append(string)
    else:
        if binarySearch(sorted(d), string):
            print("yes")
        else:
            print("no")


Fixed submission:
n = int(input())
d = {}
for i in range(n):
    cmd, string = input().split()
    if cmd == "insert":
        d[string] = True
    else:
        try:
            if d[string]:
                print("yes")
        except:
            print("no")

Buggy python submission (verdict: Time Limit Exceeded):
def binarySearch(array, key):
    left = 0
    right = len(array)
    while left < right:
        mid = int((left + right) / 2)
        if key == array[mid]:
            return True
        elif key > array[mid]:
            left = mid + 1
        elif key < array[mid]:
            right = mid
        else:
            print("ERROR")
    return False


def convertor(string):
    result = ""
    for s in string:
        if s == 'A':
            result += "1"
        elif s == 'C':
            result += "2"
        elif s == 'G':
            result += "3"
        elif s == 'T':
            result += "4"
        else:
            print("ERROR")
    return eval(result)


n = int(input())
d = []
for i in range(n):
    cmd, string = input().split()
    string = convertor(string)
    if cmd == "insert":
        d.append(string)
    else:
        if binarySearch(sorted(d), string):
            print("yes")
        else:
            print("no")


Fixed submission:
n = int(input())
d = {}
for i in range(n):
    cmd, string = input().split()
    if cmd == "insert":
        d[string] = True
    else:
        try:
            if d[string]:
                print("yes")
        except:
            print("no")
Buggy python submission (verdict: Runtime Error):
global n
n = int(input())
a_array = [int(x) for x in input().split()]
q = int(input())
m_array = [int(x) for x in input().split()]

def solve(a, m):
    if m == 0:
        return True
    if a >= n:
        return False
    res = solve(a + 1, m) or solve(a + 1, m - a_array[a])
    return res

for m in m_array:
    if solve(0, m):
        print("yes")
    else:
        print("no")



Fixed submission:
from itertools import combinations

n = int(input())
a_array = [int(x) for x in input().split()]
q = int(input())
m_array = [int(x) for x in input().split()]

array = []
for j in range(n + 1):
    x = combinations(a_array, j)
    for y in x:
        array.append(sum(y))

for m in m_array:
    print("yes" if m in array else "no")