Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import sys

N = int(input())
A = list(map(int, input().split()))
A.sort()

for i in range(0, N, 1):
	if A[i] == A[i + 1]:
		print("NO")
		sys.exit(0)

print("YES")

Fixed submission:
import sys

N = int(input())
A = list(map(int, input().split()))
A.sort()

for i in range(0, N - 1, 1):
	if A[i] == A[i + 1]:
		print("NO")
		sys.exit(0)

print("YES")

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

N = int(input())
A = list(map(int, input().split()))

for i in range(0, N, 1):
	for j in range(i + 1, N, 1):
		if A[i] == A[j]:
			print("NO")
			sys.exit(0)

print("YES")

Fixed submission:
import sys

N = int(input())
A = list(map(int, input().split()))
A.sort()

for i in range(0, N - 1, 1):
	if A[i] == A[i + 1]:
		print("NO")
		sys.exit(0)

print("YES")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(int, input().split()))

count = 0
for i in range(1, N + 1):
	for j in range(1, i + 1):
		if not P[i - 1] <= P[j - 1]:
			break
		elif i == j:
			count += 1

print(count)

Fixed submission:
N = int(input())
P = list(map(int, input().split()))

max = P[0]
count = 1
for i in range(1, N):
	if max >= P[i]:
		max = P[i]
		count += 1

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

N, M = map(int, input().split())

WA = [0] * N
isAC = [False] * N

for _ in range(M):
	p, S = input().split()
	if S == "AC":
		isAC[int(p) - 1] = True
	elif not isAC[int(p) - 1]:
		WA += 1

ACsum, WAsum = 0, 0
for i in range(N):
	if isAC[i]:
		ACsum += 1
		WAsum += WA[i]

print(ACsum, WAsum)

Fixed submission:
import sys

N, M = map(int, input().split())

WA = [0] * N
isAC = [False] * N

for _ in range(M):
	p, S = input().split()
	if S == "AC":
		isAC[int(p) - 1] = True
	elif not isAC[int(p) - 1]:
		WA[int(p) - 1] += 1

ACsum, WAsum = 0, 0
for i in range(N):
	if isAC[i]:
		ACsum += 1
		WAsum += WA[i]

print(ACsum, WAsum)
Buggy python submission (verdict: Runtime Error):
import sys
import math

N, M = map(int, input().split())
a = list(map(lambda x: int(x) >> 1, input().split()))

alcm = 1
for i in range(N):
	alcm = alcm * a[i] // math.gcd(alcm, a[i])

print(math.ceil((M // alcm) / 2))

Fixed submission:
import sys
import math
import fractions

N, M = map(int, input().split())
a = list(map(lambda x: int(x) >> 1, input().split()))
set(a)

fdigit = 0
while True:
	c = 1 << fdigit
	if a[0] & c != 0:
		break
	fdigit += 1

alcm = 1
for i in range(N):
	digit = 0
	while True:
		c = 1 << digit
		if a[i] & c != 0:
			break
		digit += 1
	if digit != fdigit:
		print(0)
		sys.exit(0)

	alcm = (alcm * a[i]) // fractions.gcd(alcm, a[i])

print(math.ceil((M // alcm) / 2))
Buggy python submission (verdict: Runtime Error):
import math

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

if x > (a ** 2) * b / 2:
	arg = (2 * b / a) - (2 * x / (a ** 3))
elif x == (a ** 2) * b / 2:
	arg = atan2(b, a)
else:
	arg = (a * (b ** 2)) / (2 * x)

print(math.atan(arg) / math.pi * 180)

Fixed submission:
import math

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

if x > (a ** 2) * b / 2:
	arg = (2 * b / a) - (2 * x / (a ** 3))
else:
	arg = (a * (b ** 2)) / (2 * x)

print(math.atan(arg) / math.pi * 180)
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
A = sorted(list(map(int, input().split())), reverse = True)

for _ in range(0, M, 1):
	A[0] >>= 1
	for i in range(1, len(A), 1):
		if A[i - 1] < A[i]:
			A[i], A[i - 1] = A[i - 1], A[i]
		else:
			break

print(sum(A))

Fixed submission:
import heapq

N, M = map(int, input().split())
A = list(map(lambda o: -int(o), input().split()))
heapq.heapify(A)

for i in range(0, M, 1):
	heapq.heappush(A, -(-heapq.heappop(A) >> 1))

print(-sum(A))

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
A = list(map(int, input().split()))

for _ in range(0, M, 1):
	A.sort(reverse = True)
	A[0] >>= 1

print(sum(A))

Fixed submission:
import heapq

N, M = map(int, input().split())
A = list(map(lambda o: -int(o), input().split()))
heapq.heapify(A)

for i in range(0, M, 1):
	heapq.heappush(A, -(-heapq.heappop(A) >> 1))

print(-sum(A))

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
A = list(map(int, input().split()))

for _ in range(0, M, 1):
	A[A.index(max(A))] >>= 1

print(sum(A))

Fixed submission:
import heapq

N, M = map(int, input().split())
A = list(map(lambda o: -int(o), input().split()))
heapq.heapify(A)

for i in range(0, M, 1):
	heapq.heappush(A, -(-heapq.heappop(A) >> 1))

print(-sum(A))
Buggy python submission (verdict: Runtime Error):
import math

N = int(input())
s = [""] * N
for i in range(N):
	s[i] = list(input())
	s[i].sort()
s.sort()

st, count = 1, 0
for i in range(1, N):
	if s[i - 1] == s[i]:
		st += 1
	elif st > 2:
		count += math.factorial(st) / (2 * (st - 2))
		st = 1
	elif st == 2:
		count += 1
		st = 1
if st > 2:
	count += math.factorial(st) / (2 * (st - 2))
elif st == 2:
	count += 1

print(int(count))

Fixed submission:
import math

N = int(input())
s = [""] * N
for i in range(N):
	s[i] = list(input())
	s[i].sort()
s.sort()

st, count = 1, 0
for i in range(1, N):
	if s[i - 1] == s[i]:
		st += 1
	elif st > 1:
		count += math.factorial(st) // (2 * math.factorial(st - 2))
		st = 1
if st > 1:
	count += math.factorial(st) // (2 * math.factorial(st - 2))

print(count)
Buggy python submission (verdict: Time Limit Exceeded):
X,K,D=map(int,input().split())
now=X
for i in range(K):
    X_plus=now+D
    X_mi=now-D
    if abs(X_plus)<abs(X_mi):
        now=X_plus
    else :
        now=X_mi

print(abs(now))
    

Fixed submission:
X,K,D=map(int,input().split())
X=abs(X)
y=X//D
if K<y:
    y=K
X=X-(D*y)
K=K-y

if K%2==1:
    X=abs(X-D)
    
print(X)
Buggy python submission (verdict: Runtime Error):
tem = input()
if tem >= 30:
  print('Yes')
else:
  print('No')

Fixed submission:
tem = int(input())
if tem >= 30:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
a = list(map(int, input().split()))
2
if a[0]<=100 and a[1]<=100 and a[2]<=100 and a[0]<=a[1]:
3
  b = a[1]-a[0]
4
  if b%a[2] > 0:
5
    print(int(b/a[2]))
6
    
7
  else:
8
    print(int(b/a[2])+1)

Fixed submission:
a = a, b, c, = map(int, input().split())
bc = int(b/c)
ac = int((a-1)/c)
ans = bc-ac
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))

length = len(a)
ans = 0
for i in range(0,length-1):
  for j in range(i+1,length):
    ans += (a[i] * a[j])

print(ans % (10**9 + 7))

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

length = len(a)
total = sum(a)

ans = 0
for i in range(0,length):
    total -= a[i]
    ans += (a[i] * total)


print(ans % (10**9 + 7))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
str = input().split()
num_list = []
for i in str:
  num_list.append(int(i))

ans = num_list[0]
LIMIT_NUM = 10**18
for i in range(1,N):
  ans *= num_list[i]

if ans > LIMIT_NUM:
               print(-1)
else:
               print(ans)


Fixed submission:
def main(): 
  N = int(input())
  str_num = input().split()

  num_list = []
  for i in str_num:
    num_list.append(int(i))

  num_list.sort(reverse=True)

  ans = num_list[0]

  LIMIT_NUM = 10**18

  if 0 in num_list:
    print(0)
    return

  for i in range(1,N):
    ans *= num_list[i]
    if ans > LIMIT_NUM:
      print(-1)
      return

  print(ans)


main()

Buggy python submission (verdict: Runtime Error):
str = input().split()
num_list = []
for i in str:
  num_list.append(int(i))

ans = num_list[0]
LIMIT_NUM = 10**18
for i in range(1,len(num_list):
  ans *= num_list[i]

if ans > LIMIT_NUM:
               print(-1)
else:
               print(ans)

Fixed submission:
def main(): 
  N = int(input())
  str_num = input().split()

  num_list = []
  for i in str_num:
    num_list.append(int(i))

  num_list.sort(reverse=True)

  ans = num_list[0]

  LIMIT_NUM = 10**18

  if 0 in num_list:
    print(0)
    return

  for i in range(1,N):
    ans *= num_list[i]
    if ans > LIMIT_NUM:
      print(-1)
      return

  print(ans)


main()

Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce
N = int(input())
A = map(int, input().split())
B = reduce((lambda x, y : x*y), A)
if B > 10**18:
  print(-1)
else:
  print(B)


Fixed submission:
from functools import reduce
N = int(input())
A = list(map(int, input().split()))
A.sort()
if A[0] == 0:
    print(0)
else:
    p = 1;
    for i in range(N):
        p *= A[i];
        if p > 10**18:
            p = -1;
            break;
    print(p)
Buggy python submission (verdict: Runtime Error):
#abc176b
N=input()
s=0
for i in range(len(N)):
 s+=int(N[i])
if s%9==0:
 print('Yes')
else:
 print('No')


Fixed submission:
#abc176a
import math
n,x,t=map(int,input().split())
print(math.ceil(float(n)/x)*t)
Buggy python submission (verdict: Runtime Error):
#abc175b
n=int(input())
l=list(map(int,input().split()))
l.sort()
cnt=0
for i in range(n):
 for j in range(i):
  for k in range(j):
   if l[k]!=l[j] and l[i]!=l[j] and l[k]+l[j]>l[i]:
    cnt+=1
print(cnt)


Fixed submission:
#abc17a
s=input()
if 'RRR' in s:
 print(3)
elif 'RR' in s:
 print(2)
elif 'R' in s:
 print(1)
else:
 print(0)
Buggy python submission (verdict: Runtime Error):
abc171c
n=int(input())
s=''
while n:
 n-=1
 s+=chr(n%26+97)
 n//=26
print(s[::-1])


Fixed submission:
#abc171c
n=int(input())
s=''
while n:
 n-=1
 s+=chr(n%26+97)
 n//=26
print(s[::-1])
Buggy python submission (verdict: Runtime Error):
abc166b
k=int(input())
s=input()
if len(s)<=k:
 print(s)
else:
 ss=s[:k]
 print(ss+'...')


Fixed submission:
#abc168b
k=int(input())
s=input()
if len(s)<=k:
 print(s)
else:
 ss=s[:k]
 print(ss+'...')
Buggy python submission (verdict: Runtime Error):
#abc164a

a,b,c,d=map(int,input().split())
x=(a+d-1)//d
y=(c+b-1)//b
if x>=y:
 print('Yes')
else:
 print('No')


Fixed submission:
#abc164a

s,w=map(int,input().split())
if s<=w:
 print('unsafe')
else:
 print('safe')

Buggy python submission (verdict: Runtime Error):
#abc164a

a,b,c,d=map(int,input().split())
x=(a+d-1)/d
y=(c+b-1)/b
if x>=y:
 print('Yes')
else:
 print('No')


Fixed submission:
#abc164a

s,w=map(int,input().split())
if s<=w:
 print('unsafe')
else:
 print('safe')
Buggy python submission (verdict: Runtime Error):
#abc163c
n=int(input())
a=list(map(int,input().split()))
res=[0]*n
for x in a:
 res[x-1]+=1
print(*res,sep='\n')


Fixed submission:
#abc163a
from math import pi
r=int(input())
print(r*pi*2)

Buggy python submission (verdict: Runtime Error):
#abc163c
n=int(input())
a=list(map(int,input().split()))
for i in range(n):
 print(a.count(i+1))


Fixed submission:
#abc163a
from math import pi
r=int(input())
print(r*pi*2)
Buggy python submission (verdict: Time Limit Exceeded):
#abc163c
n=int(input())
a=list(map(int,input().split()))
for i in range(n):
 print(a.count(i+1))


Fixed submission:
#abc163c
n=int(input())
a=list(map(int,input().split()))
res=[0]*n
for x in a:
 res[x-1]+=1
for i in res:
 print(i)
Buggy python submission (verdict: Runtime Error):
#abc161b
n,m=map(int,raw_input().split())
a=map(int,raw_input().split())
x=sum(a)/(4.0*m)
l=[i for i in a if i>=x]
if len(l)>=m:
 print 'Yes'
else:
 print 'No'


Fixed submission:
#abc161a
x,y,z=map(int,raw_input().split())
x,y=y,x
x,z=z,x
print x,y,z

Buggy python submission (verdict: Runtime Error):
abc161b
n,m=map(int,raw_input().split())
a=map(int,raw_input().split())
x=sum(a)/(4*m)
l=[i for i in a if i>x]
if len(l)>=m:
 print 'Yes'
else:
 print 'No'


Fixed submission:
#abc161a
x,y,z=map(int,raw_input().split())
x,y=y,x
x,z=z,x
print x,y,z

Buggy python submission (verdict: Runtime Error):
#abc161b
n,m=map(int,raw_input().split())
a=map(int,raw_input().split())
x=sum(a)/(4*m)
l=[i for i in a if i>=x]
if len(l)>m:
 print 'Yes'
else:
 print 'No'


Fixed submission:
#abc161a
x,y,z=map(int,raw_input().split())
x,y=y,x
x,z=z,x
print x,y,z
Buggy python submission (verdict: Runtime Error):
#abc148c
import math

a,b=map(int,input().split())
print((a*b)//math.gcd(a,b))


Fixed submission:
#abc148c
from fractions import gcd

a,b=map(int,input().split())
print((a*b)//gcd(a,b))
Buggy python submission (verdict: Runtime Error):
#abc15047d
n=int(raw_input())
a=map(int,raw_input().split())
mod=10**9+7
res=0
for i in range(60):
 cnt=sum([1 for x in a if (x>>i & 1)])
 res+=cnt*(n-cnt)*(1<<i)
 res=res%mod
print res


Fixed submission:
#abc147a

a1,a2,a3=map(int,raw_input().split())
if a1+a2+a3>=22:
 print 'bust'
else:
 print 'win'
Buggy python submission (verdict: Time Limit Exceeded):
#abc15047d
n=int(raw_input())
a=map(int,raw_input().split())
mod=10**9+7
res=0
for i in range(60):
 cnt=sum([1 for x in a if (x>>i & 1)])
 res+=cnt*(n-cnt)*(1<<i)
 res=res%mod
print res


Fixed submission:
#abc15047d
n=int(raw_input())
a=map(int,raw_input().split())
mod=10**9+7
res=0
for i in range(60):
 cnt=sum([1 for x in a if (x>>i & 1)])
 res+=cnt*(n-cnt)*(1<<i)
 res=res%mod
print res
Buggy python submission (verdict: Runtime Error):
#abc142d

def gcd(x,y):
 while y:
  x,y=y,x%y
 return x

def factorize(n):
 fct=[]
 b,e=2,0
 while b*b<=n:
  while n%b==0:
   n=n//b
   e =e+1
   if e>0:
    fct.append((b,e))
    b,e=b+1,0
 if n>1:
  fct.append((n,1))
 return fct

a,b=map(int,raw_input().split())
z=gcd(a,b)
print len(factorize(z))+1


Fixed submission:
#abc142a
n=int(raw_input())
if n%2==0:
 print 0.5
else:
 print (1.0+n/2)/n
Buggy python submission (verdict: Runtime Error):
#abc133c

l,r=map(int,raw_input().split())
if r-l>3000:
 print 0
 sys.exit()
res=-1
for i in xrange(l,r):
 for j in xrange(i+1,r+1):
  res=min(res,(i*j)%2019)
print res


Fixed submission:
#abc133c

l,r=map(int,raw_input().split())
r=min(r,l+673)
res=2018
for i in  xrange(l,r+1):
 for j in xrange(i+1,r+1):
  res=min(res,i*j%2019)
print res

Buggy python submission (verdict: Runtime Error):
#abc133c

l,r=map(int,raw_input().split())
if r-l>3000:
 print 0
 sys.exit()
res=2018
for i in xrange(l,r):
 for j in xrange(i+1,r+1):
  res=min(res,(i*j)%2019)
print res


Fixed submission:
#abc133c

l,r=map(int,raw_input().split())
r=min(r,l+673)
res=2018
for i in  xrange(l,r+1):
 for j in xrange(i+1,r+1):
  res=min(res,i*j%2019)
print res
Buggy python submission (verdict: Runtime Error):
#abc125b

n=int(raw_input())
v=map(int,raw_input().split())
c=map(int,raw_input().split())
res=0
for i in xrange(n):
 if v[i]-c[i]>0:
  res+=v[i]-c[i]
print res


Fixed submission:
#abc125a

a,b,t=map(int,raw_input().split())
res=t/a*b
print res
Buggy python submission (verdict: Runtime Error):
abc125b

n=int(raw_input())
v=map(int,raw_input().split())
c=map(int,raw_input().split())
res=0
for i in xrange(n):
 if v[i]-c[i]>0:
  res+=v[i]-c[i]
print res


Fixed submission:
#abc125b

n=int(raw_input())
v=map(int,raw_input().split())
c=map(int,raw_input().split())
res=0
for i in xrange(n):
 if v[i]-c[i]>0:
  res+=v[i]-c[i]
print res
Buggy python submission (verdict: Runtime Error):
#abc122a

b=raw_input()
if b=='A':
 print 'T'
elif b=='C':
 print 'G'
elif b=='G':
 print 'C'
elif:
 print 'A'


Fixed submission:
#abc122a

b=raw_input()
if b=='A':
 print 'T'
elif b=='C':
 print 'G'
elif b=='G':
 print 'C'
else:
 print 'A'
Buggy python submission (verdict: Runtime Error):
abc119d
import bisect

a,b,q=map(int,raw_input().split())
inf=2<<60
s=[-inf]+[int(raw_input()) for i in xrange(a)]+[inf]
t=[-inf]+[int(raw_input()) for i in xrange(b)]+[inf]
for i in xrange(q):
 x=int(raw_input())
 b=bisect.bisect_right(s,x)
 d=bisect.bisect_right(t,x)
 res=inf
 for ss in [s[b-1],s[b]]:
  for tt in [t[d-1],t[d]]:
   d1=abs(ss-x)+abs(tt-ss)
   d2=abs(tt-x)+abs(ss-tt)
   res=min(res,d1,d2)
 print res


Fixed submission:
#abc119d
import bisect

a,b,q=map(int,raw_input().split())
inf=2<<60
s=[-inf]+[int(raw_input()) for i in xrange(a)]+[inf]
t=[-inf]+[int(raw_input()) for i in xrange(b)]+[inf]
s.sort()
t.sort()
for i in xrange(q):
 x=int(raw_input())
 b=bisect.bisect(s,x)
 d=bisect.bisect(t,x)
 res=inf
 for ss in [s[b-1],s[b]]:
  for tt in [t[d-1],t[d]]:
   d1=abs(ss-x)+abs(tt-ss)
   d2=abs(tt-x)+abs(ss-tt)
   res=min(res,d1,d2)
 print res
Buggy python submission (verdict: Runtime Error):
#abc118c

import functools
import math

n=int(input())
l=list(map(int,input().split()))
print(functools.reduce(math.gcd,l))


Fixed submission:
#abc118c
import functools

def gcd(a,b):
 while b:
  a,b=b,a%b
 return a

n=int(raw_input())
l=map(int,raw_input().split())
print functools.reduce(gcd,l)
Buggy python submission (verdict: Runtime Error):
#abc117b

n=int(raw_input())
l=map(int,raw_input().split())
if max(l)>=sum(l)-max(l):
 print 'No'
else:
 print 'Yes'


Fixed submission:
#abc117a
t,x=map(int,raw_input().split())
print 1.0*t/x
Buggy python submission (verdict: Runtime Error):
#abc106c
import sys

s=raw_input()
k=int(raw_input())
if s.count('1')==len(s):
 print '1'
 sys.exit()
for i in xrange(k):
 if s[i]!='!':
  print s[i]
  sys.exit()


Fixed submission:
#abc106a

a,b=map(int,raw_input().split())
print a*b-a-b+1
Buggy python submission (verdict: Runtime Error):
#abc106c
import sys

s=raw_input()
k=int(raw_input())
while True:
 if s:
  if s[0]=='1':
   s=s[1:]
  print s[0]
  sys.exit()
 else:
  print '1'
  sys.exit()


Fixed submission:
#abc106c
import sys

s=raw_input()
k=int(raw_input())
if s.count('1')==len(s):
 print '1'
 sys.exit()
for i in xrange(k):
 if s[i]!='1':
  print s[i]
  sys.exit()
print '1'
Buggy python submission (verdict: Time Limit Exceeded):
#abc098c

n=int(raw_input())
s=raw_input()
res=float('inf')
for i in xrange(len(s)):
 s1=s[:i]
 s2=s[i+1:]
 res=min(s1.count('W')+s2.count('E'),res)
print res


Fixed submission:
#abc098c

n=int(raw_input())
s=raw_input()
cnt=s[1:].count('E')
res=cnt
for i in xrange(1,n):
 if s[i-1]=='W':
  cnt+=1
 if s[i]=='E':
  cnt-=1
 res=min(cnt,res)
print res
Buggy python submission (verdict: Time Limit Exceeded):
#abc094c
from statistics import median

n=int(input())
x=list(map(int,input().split()))
res=[]
for i in range(n):
 y=x.copy()
 y.pop(i)
 res.append(median(y))
for i in range(n):
 print(res[i])


Fixed submission:
#abc094c

n=int(raw_input())
x=map(int,raw_input().split())
y=sorted(x)
l=y[n/2]
r=y[n/2-1]
for i in x:
 print l if i<l else r
Buggy python submission (verdict: Runtime Error):
#abc093b
import sys

a,b,k=map(int,raw_input().split())
if a==b:
 print a
 sys.exit()
l1=[i for i in xrange(a,a+k)]
l2=[i for i in xrange( b-k+1,b+1)]
s1=set(l1)
s2=set(l2)
if b-k>=k-a:
 res=list(s1 | s2)
else:
 res=list(s1 & s2)
res.sort()
for i in xrange(len(res)):
 print res[i]


Fixed submission:
#abc093a

s=raw_input()
if s.count('a')==1 and s.count('b')==1 and s.count('c')==1:
 print 'Yes'
else:
 print 'No'

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

a,b,k=map(int,raw_input().split())
if a==b:
 print a
 sys.exit()
l1=[i for i in xrange(a,a+k)]
l2=[i for i in xrange( b-k+1,b+1)]
s1=set(l1);print s1
s2=set(l2);print s2
if b-k>=k-a:
 res=list(s1 | s2)
else:
 res=list(s1 & s2)
res.sort()
for i in xrange(len(res)):
 print res[i]


Fixed submission:
#abc093a

s=raw_input()
if s.count('a')==1 and s.count('b')==1 and s.count('c')==1:
 print 'Yes'
else:
 print 'No'
Buggy python submission (verdict: Runtime Error):
#abc090b

a,b=map(int,raw_input().split())
cnt=0
for i in xrange(a,b+1):
 s=i%10
 t=i/10000%10
 u=i/10%10
 v=i/1000%10
 if s==t and u==v:
  cnt+=1
print cnt


Fixed submission:
#abc090a

c=[]
for i in xrange(3):
 c.append(raw_input())
print c[0][0]+c[1][1]+c[2][2]
Buggy python submission (verdict: Runtime Error):
#abc089b

n=int(raw_input())
s=map(str,raw_input().split())
ss=set(s)
cnt=len(ss)
1f cnt=3:
 print 'Three'
else:
 print 'Four'


Fixed submission:
#abc089b

n=int(raw_input())
s=map(str,raw_input().split())
ss=set(s)
cnt=len(ss)
if cnt==3:
 print 'Three'
else:
 print 'Four'
Buggy python submission (verdict: Runtime Error):
#ABC088C
import sys

c=[map(int,raw_input().split()) for i in xrange(3)]
a=[0,0,0]
b=[0,0,0]
b[0],b[1],b[2]=c[0][0],c[0][1],c[0][2]
a[1],a[2]=c[1][0]-b[0],c[2][0]-b[0]
for i in xrange(3):
 for j in xrange(3):
  if c[i][j]!=a[i]+b[j]:
   print 'No'
   sys.exit()
print 'Yes'


Fixed submission:
#ABC088A

n=int(raw_input())
a=int(raw_input())
if n%500>a:
 print 'No'
else:
 print 'Yes'
Buggy python submission (verdict: Runtime Error):
#abc081c
import collections
import sys

n,k=map(int,raw_input().split())
a=map(int,raw_input().split())
if n==k:
 print 0
 sys.exit()
cnt=collections.Counter(a)
l=[]
for k1,v in cnt.items():
 l.append(v)
l2=sorted(l,reverse=True)
temp=0
for i in xrange(k):
 temp+=l2[i]
print n-temp


Fixed submission:
#abc081c
import collections

n,k=map(int,raw_input().split())
a=map(int,raw_input().split())
cnt=collections.Counter(a)
l=[]
for k1,v in cnt.items():
 l.append(v)
l2=sorted(l,reverse=True)
temp=0
for i in xrange(min(k,len(l2))):
 temp+=l2[i]
print n-temp
Buggy python submission (verdict: Runtime Error):
#ABC079C

n=raw_input()
s=[]
for i in xrange(4):
 s.append(n[i])
if s[0]==s[1]==s[2] or s[1]==s[2]==s[3] or s[2]==s[3]==s[4]:
 print 'Yes'
else:
 print 'No'


Fixed submission:
#ABC079C

n=raw_input()
s=[]
for i in xrange(4):
 s.append(n[i])
if s[0]==s[1]==s[2] or s[1]==s[2]==s[3]:
 print 'Yes'
else:
 print 'No'
Buggy python submission (verdict: Runtime Error):
#ABC076A

r=int(raw_input())
d=int(raw_input())
print g*2-r


Fixed submission:
#ABC076A

r=int(raw_input())
g=int(raw_input())
print g*2-r

Buggy python submission (verdict: Runtime Error):
#ABC076A

r=int(raw_input())
d=int(raw_input())
print g*2-r


Fixed submission:
#ABC076A

r=int(raw_input())
g=int(raw_input())
print g*2-r
Buggy python submission (verdict: Runtime Error):
#ABC075B

h,w=map(int,raw_input().split())
l=[]
for i in xrange(h):
 l.append(list(raw_input()))
for y in xrange(h):
 for x in xrange(w):
  if l[y][x]=='#':
   continue
  cnt=0
  for dy in [-1,0,1]:
   for dx in [-1,0,1]:
    ny=y+dy
    nx=x+dx
    if 0<=ny<h and 0<=nx<w:
     if l[ny][nx]=='#':
      cnt+=1
  l[y][x]=str(cnt)
for i in xrange(h):
 print ''.join(l[i])


Fixed submission:
#ABC075A

a,b,c=map(int,raw_input().split())
if a==b:
 print c
elif a==c:
 print b
else:
 print a
Buggy python submission (verdict: Time Limit Exceeded):
#ABC073C

n=int(raw_input())
l=[]
for i in xrange(n):
 l.append(int(raw_input()))
s=set(l)
ls=list(set(s))
cnt=0
for i in xrange(len(ls)):
 if l.count(ls[i])%2:
  cnt+=1
print cnt


Fixed submission:
#ABC073C
import sys

n=int(raw_input())
dic={}
for i in xrange(n):
 a=int(raw_input())
 if a in dic:
  dic[a]^=1
 else:
  dic[a]=1

res=0
for i in dic:
 if dic[i]==1:
  res+=1
print res

Buggy python submission (verdict: Time Limit Exceeded):
#ABC073C

n=int(raw_input())
l=[]
for i in xrange(n):
 l.append(int(raw_input()))
s=set(l)
ls=list(set(s))
cnt=0
for i in xrange(len(ls)):
 if l.count(ls[i])%2:
  cnt+=1
print cnt


Fixed submission:
#ABC073C
import sys

n=int(raw_input())
dic={}
for i in xrange(n):
 a=int(raw_input())
 if a in dic:
  dic[a]^=1
 else:
  dic[a]=1

res=0
for i in dic:
 if dic[i]==1:
  res+=1
print res
Buggy python submission (verdict: Runtime Error):
#ARc080C

n=int(raw_input())
l=map(int,raw_input().split())
cnt1=cnt2=cnt4=0
for i in xrange(n):
 if (l[i]%2)%2==0:
  cnt4+=1
 elif l[i]%2==0:
  cnt2+1=1
 elif l[i]%2:
  cnt1+=1
if cnt2==0:
 if cnt1<=cnt4+1:
  print 'Yes'
 else:
  print 'No'
else:
 if cnt1<=cnt4:
  print 'Yes'
 else:
  print 'No'


Fixed submission:
#ARc080C

n=int(raw_input())
l=map(int,raw_input().split())
cnt1=cnt2=cnt4=0
for i in xrange(n):
 if l[i]%4==0:
  cnt4+=1
 elif l[i]%2==0:
  cnt2+=1
 else:
  cnt1+=1
if cnt4>=cnt1:
 print 'Yes'
elif cnt4==cnt1-1 and cnt2==0:
 print 'Yes'
else:
 print 'No'
Buggy python submission (verdict: Runtime Error):
#abc066d
mod=10**9+7

def com(n,r,m):
 f=[1,1]
 for i in range(2,n+1):
  f.append(f[i-1]*i%m)
 return f[n]*pow(f[r]*f[n-r]%m,m-2,m)%m


N=int(raw_input())
A=map(int,raw_input().split())
c=[-1]*N
for i in range(N+1):
 if c[A[i]-1]!=-1:
  break
 c[A[i]-1]=i
j=c[A[i]-1]
i=N-i
for k in range(1,N+2):
 res=com(N+1,k,mod)
 if k-1<=i+j:
  res-=com(i+j,k-1,mod)
 print res%mod


Fixed submission:
#ABC066A

l=map(int,raw_input().split())
ls=sorted(l)
print ls[0]+ls[1]