Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
N = int(input())

all_str = []
for i in range(N):
    str_temp = input()
    all_str.append(str_temp)

unique_str = (list(set(all_str)))
unique_str.sort()
max_cnt = 0
str_num = dict()
for i in unique_str:
    cnt = all_str.count(i)
    str_num[i] = cnt
    if max_cnt < cnt:
        max_cnt = cnt

disp_list = []
for i in str_num:
    current_cnt = str_num[i]
    if current_cnt == max_cnt:    
        disp_list.append(i)
    

for i in disp_list:
    print(i)
    

    


Fixed submission:
# -*- coding: utf-8 -*-
import collections

N = int(input())

all_str = []
for i in range(N):
    str_temp = input()
    all_str.append(str_temp)
all_str.sort()
coll_str = (collections.Counter(all_str))
count_max = 0
j = 0
max_str = coll_str.most_common()
for i in max_str:
    
    num_of_str =  i[1]
    if num_of_str == count_max or j == 0:
        print(i[0])
        j = 1
        count_max = num_of_str
        
    if num_of_str < count_max:
        break
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split())) 
a.sort
p = True
ans = 1 
for i in a : 
  ans *= i 
  if(ans == 0) : 
    print(0)
    p = False 
    break 
if p:
  if ans > 10 **18 : 
    print(-1)
  else:
    print(ans)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
a.sort()
p = True
ans = 1
for i in a :
  ans *= i
  if(ans == 0) :
    print(0)
    p = False
    break
  if(ans > 1000000000000000000):
    print(-1)
    p =False
    break
if p:
  if ans > 1000000000000000000:
    print(-1)
  else:
    print(ans)
Buggy python submission (verdict: Runtime Error):
s=input()
 
if s=='SSS':
  print(0)
elif s=='SRS' or s=='RSS' or s=='SSR':
  print(1)
elif s=='RRR':
  print(3)
else:
  print(2)
s=input()

if s=='SSS':
  print(0)
elif s=='SRR' or s=='RRS':
  print(2)
elif s=='RRR':
  print(3)
else:
  print(1)


Fixed submission:
s=input()
 
if s=='SSS':
  print(0)
elif s=='SRR' or s=='RRS':
  print(2)
elif s=='RRR':
  print(3)
else:
  print(1)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
x=1
for i in range(n):
    x=x*a[i]

if x>10**18:
    print(-1)
        
   

        
else:
    print(x)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
x=1
c=0
if a.count(0)>0:
    print(0)
else:
    for i in range(n):
        x=x*a[i]

        if x>10**18:
            print(-1)
            c=1
            break        

        
    if c==0:
        print(x)
Buggy python submission (verdict: Runtime Error):
a,b,c,x=map(int,input().split())
 
if:
  print(x)
elif x<a+b:
  print(int(a))
else:
  print(int(2*a+b-x))

Fixed submission:
a,b,c,x=map(int,input().split())
 
if x<a:
  print(x)
elif x<a+b:
  print(a)
else:
  print(2*a+b-x)
Buggy python submission (verdict: Runtime Error):
s=100
x=int(input())
i=0
While True:
  if s>=x:
    break
  s=s*1.01
  i=i+1
  
print(i+1)

Fixed submission:
s=100
i=0
x=int(input())
 
while True:
  if s>=x:
    break
  else:
    i=i+1
    s=int(s*1.01)
    
print(i)
Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())

if a/d>c/b:
    print('Yes')
elif a/d==c/b:
	if c/b>0 and a/d==0
		print('No')
	else:
    	print('Yes')
elif a/d+1==c/b:
    if c%b==0 and a%d!=0:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Fixed submission:
a,b,c,d=map(int,input().split())
x=a//d
y=c//b
if y<x:
    print('Yes')
elif y==x:
    if c%b==0:
        print('Yes')
    else:
        if a%d==0:
            print('No')
        else:
            print('Yes')
            
elif y==x+1:
    if c%b==0:
        print('Yes')
    else:
        print('No')
            
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
,b,c,d=map(int,input().split())
if a/d>c/b:
    print('Yes')
elif a/d==c/b:
	if c/b>0 and a/d==0
		print('No')
	else:
    	print('Yes')
elif a/d+1==c/b:
    if c%b==0 and a%d!=0:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Fixed submission:
a,b,c,d=map(int,input().split())
x=a//d
y=c//b
if y<x:
    print('Yes')
elif y==x:
    if c%b==0:
        print('Yes')
    else:
        if a%d==0:
            print('No')
        else:
            print('Yes')
            
elif y==x+1:
    if c%b==0:
        print('Yes')
    else:
        print('No')
            
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
if a/d>c/b:
    print('Yes')
elif a/d==c/b:
  if c/b>0 and a/d==0
  print('No')
  else:
    print('Yes')
elif a/d+1==c/b:
    if c%b==0 and a%d!=0:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Fixed submission:
a,b,c,d=map(int,input().split())
x=a//d
y=c//b
if y<x:
    print('Yes')
elif y==x:
    if c%b==0:
        print('Yes')
    else:
        if a%d==0:
            print('No')
        else:
            print('Yes')
            
elif y==x+1:
    if c%b==0:
        print('Yes')
    else:
        print('No')
            
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
if a/d>c/b:
    print('Yes')
elif a/d+1=c/b:
    if c%d==0:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Fixed submission:
a,b,c,d=map(int,input().split())
x=a//d
y=c//b
if y<x:
    print('Yes')
elif y==x:
    if c%b==0:
        print('Yes')
    else:
        if a%d==0:
            print('No')
        else:
            print('Yes')
            
elif y==x+1:
    if c%b==0:
        print('Yes')
    else:
        print('No')
            
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
n=input()

if s[0]=='7' or s[1]=='7' or s[2]=='7':
  print('Yes')
else:
  print('No')

Fixed submission:
n=input()
 
if n[0]=='7' or n[1]=='7' or n[2]=='7':
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
s=input()
c=0
for i in range(len(s)):
	if s[i]==7:
    	c=c+1
    
if c>0:
  print('Yes')
else:
  print('No')
  

Fixed submission:
n=input()
 
if n[0]=='7' or n[1]=='7' or n[2]=='7':
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
a,b,c=int(input())

print(c,a,b)

Fixed submission:
a,b,c=map(int,input().split())
 
print(c,a,b)
Buggy python submission (verdict: Runtime Error):
n,r=int(input())
 
if n<10:
  print(int(r+100*(10-n)))
else:
  print(r)

Fixed submission:
n,r=map(int,input().split())
 
if n<10:
  print(r+100*(10-n))
else:
  print(r)

Buggy python submission (verdict: Runtime Error):
n,r=int(input())

if n<10:
  print(r+100*(10-n))
else:
  print(r)

Fixed submission:
n,r=map(int,input().split())
 
if n<10:
  print(r+100*(10-n))
else:
  print(r)
Buggy python submission (verdict: Runtime Error):
h,n=map(int,inuput().split())
a=list(map(int,input().split()))

if h>sum(a):
    print('No')
else:
    print('Yes')

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

if h>sum(a):
    print('No')
else:
    print('Yes')
Buggy python submission (verdict: Runtime Error):
a,p=map(int,input().split())
print(int((a*3+b)/2))

Fixed submission:
a,p=map(int,input().split())
print(int((a*3+p)/2))
Buggy python submission (verdict: Runtime Error):
n,k=input().split()
k=int(k)
x=n.replace(n[k-1],n[k-1].upper())
print(x)

Fixed submission:
n,k=map(int,input().split())
s=input()
s=s[:k-1]+s[k-1].lower()+s[k:]
print(s)
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())

if b-a>k or c-b>k or d-c>k or e-d>k or f-e>k:
    print(':(')
else:
    print('Yay!')
    



Fixed submission:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())

x=max(a,b,c,d,e)
y=min(a,b,c,d,e)


if x-y>k:
    print(':(')
else:
    print('Yay!')

Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
f=int(input())
k=int(input())

if b-a>k or c-b>k or d-c>k or e-d>k or f-e>k:
    print(':(')
else:
    print('Yay!')
    



Fixed submission:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())

x=max(a,b,c,d,e)
y=min(a,b,c,d,e)


if x-y>k:
    print(':(')
else:
    print('Yay!')
Buggy python submission (verdict: Runtime Error):
b=input()
if b='A':
    print('T')
elif b='T':
    print('A')
elif b='G':
    print('C')
else:
    print('G')

Fixed submission:
b=input()
if b=='A':
    print('T')
elif b=='T':
    print('A')
elif b=='G':
    print('C')
else:
    print('G')
Buggy python submission (verdict: Runtime Error):
H,W=map(int,input().split())
h,w=map(int,input().split())
prin(int((H-h)*(W-w)))

Fixed submission:
H,W=map(int,input().split())
h,w=map(int,input().split())
print(int((H-h)*(W-w)))
Buggy python submission (verdict: Runtime Error):
s=int(input())

if s==4 or s==2 or s==1:
    print(4)
    
l=[]
else:
    for i in range(10**6+1):
        l.append(s)
        if l.count(4)>2:
            break
        elif s%2==0:
            s=s//2
        else:
            s=3*s+1
    x=l.index(4)

    l=l[x+1:]
    y=l.index(4)

    print(y+x+2)

Fixed submission:
s=int(input())

if s==4 or s==2 or s==1:
    print(4)
    

else:
    l=[]
    for i in range(10**6+1):
        l.append(s)
        if l.count(4)>2:
            break
        elif s%2==0:
            s=s//2
        else:
            s=3*s+1
    x=l.index(4)

    l=l[x+1:]
    y=l.index(4)

    print(y+x+2)
Buggy python submission (verdict: Runtime Error):
k=int(input())
if n%2==0:
    print(int(n*n/4))
else:
    print(int((n-1)*(n+1)/4))

Fixed submission:
n=int(input())
if n%2==0:
    print(int((n*n)/4))
else:
    print(int(((n-1)*(n+1))/4))

Buggy python submission (verdict: Runtime Error):
k=int(input())
if n%2==0:
    print(n*n/4)
else:
    print((n-1)*(n+1)/4)

Fixed submission:
n=int(input())
if n%2==0:
    print(int((n*n)/4))
else:
    print(int(((n-1)*(n+1))/4))
Buggy python submission (verdict: Runtime Error):
x=int(input())
l=[]

if x==1:
    print(1)

else:

    for i in range(2,x+1):
        for j in range(1,x+1):
            y=j**i
            if y<=x:
                l.append(y)
            elif y>x:
                break
print(max(l))

Fixed submission:
x=int(input())
l=[]

if x==1:
    print(1)

else:

    for i in range(2,x+1):
        for j in range(1,x+1):
            y=j**i
            if y<=x:
                l.append(y)
            elif y>x:
                break
    print(max(l))

Buggy python submission (verdict: Runtime Error):
x=int(input())
l=[]

if x==1:
    print(1)

else:

    for i in range(2,x+1):
        for j in range(1,x+1):
            y=j**i
            if 1<=y and y<=x:
                l.append(y)
            elif y>x:
                break
print(max(l))

Fixed submission:
x=int(input())
l=[]

if x==1:
    print(1)

else:

    for i in range(2,x+1):
        for j in range(1,x+1):
            y=j**i
            if y<=x:
                l.append(y)
            elif y>x:
                break
    print(max(l))
Buggy python submission (verdict: Runtime Error):
n=input()
if len(set(n))=3:
    print('Yes')
else:
    print('No')

Fixed submission:
n=input()
if len(set(n))==3:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
n=input()
if n<2:
    print(1)
elif n<4:
    print(2)
elif n<8:
    print(4)
elif n<16:
    print(8)
elif n<32:
    print(16)
elif n<64:
    print(32)
else:
    print(64)

Fixed submission:
n=int(input())
if n<2:
    print(1)
elif n<4:
    print(2)
elif n<8:
    print(4)
elif n<16:
    print(8)
elif n<32:
    print(16)
elif n<64:
    print(32)
else:
    print(64)
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
x=0
for i in range(1,b+1):
    if i*a%==c:
        x+=1
if x==0:
    print('NO')
else:
    print('YES')

Fixed submission:
a,b,c=map(int,input().split())
x=0
for i in range(1,b+1):
    if i*a%b==c:
        x+=1
if x==0:
    print('NO')
else:
    print('YES')
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=[]
b=[]
c=[]
d=[]
x=[]
y=[]
l=[]
p=[]

for i in range(n):
    ai,bi=map(int,input().split())
    a.append(ai)
    b.append(bi)
    
for j in range(m):
    ci,di=map(int,input().split())
    c.append(ci)
    d.append(di)
    
for i in range(n):
    for j in range(m):
        x.append(abs(a[i]-c[j]))
        y.append(abs(b[i]-d[j]))
        l.append(x[i]+y[i])
    
    p.append(l.index(min(l))+1)   
    l=[]
    x=[]
    y=[]
    
for i in range(n):
    print(p[i])

Fixed submission:
n,m=map(int,input().split())
a=[]
b=[]
c=[]
d=[]
x=[]
y=[]
l=[]
p=[]

for i in range(n):
    ai,bi=map(int,input().split())
    a.append(ai)
    b.append(bi)
    
for j in range(m):
    ci,di=map(int,input().split())
    c.append(ci)
    d.append(di)
    
for i in range(n):
    for j in range(m):
        x.append(abs(a[i]-c[j]))
        y.append(abs(b[i]-d[j]))
        l.append(x[j+i*m]+y[j+i*m])
    
    p.append(l.index(min(l))+1)   
    l=[]
    #x=[]
    #y=[]
    
for i in range(n):
    print(p[i])
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
x=1
for i in range(1,n+1):
    x=x*(i%(10**9+7))
print(x%(10**9+7))

Fixed submission:
n=int(input())
x=1
for i in range(1,n+1):
    x=x*(i%(10**9+7))
    x=x%(10**9+7)
print(x)
Buggy python submission (verdict: Time Limit Exceeded):
k,s=map(int,input().split())
c=0

for l in range(k+1):
    for m in range(k+1):
        for n in range(k+1):
            if l+m+n==s:
                c+=1
            elif l+m+n>s:
                break
print(c)

Fixed submission:
k,s=map(int,input().split())
c=0

for l in range(k+1):
    for m in range(k+1):
        if 0<=s-l-m and s-l-m<=k:
            c+=1
print(c)

Buggy python submission (verdict: Time Limit Exceeded):
k,s=map(int,input().split())
c=0

for l in range(k+1):
    for m in range(k+1):
        for n in range(k+1):
            if l+m+n==s:
                c+=1
                
print(c)

Fixed submission:
k,s=map(int,input().split())
c=0

for l in range(k+1):
    for m in range(k+1):
        if 0<=s-l-m and s-l-m<=k:
            c+=1
print(c)
Buggy python submission (verdict: Runtime Error):
a=input()
b=input()
c=input()

l=a+b+c

n=a[0]
a=a.lstrip(n)

for i in range(len(l)-1):
    if n=='a':
        if len(a)==0:
            print('A')
            break
        n=a[0]
        a=a.lstrip(n)
    elif x=='b':
        if len(b)==0:
            print('B')
            break
        n=b[0]
        b=b.lstrip(n)
    else:
        if len(c)==0:
            print('C')
            break
        n=c[0]
        c=c.lstrip(n)



Fixed submission:
a=input()
b=input()
c=input()

#l=a+b+c

#n=a[0]
#a=a.lstrip(n)
n='a'
while True: 
    if n=='a':
        if len(a)==0:
            print('A')
            exit()
            
        n=a[0]
        #a=a.lstrip(n)
        a=a[1:]
        
    elif n=='b':
        if len(b)==0:
            print('B')
            exit()
            
        n=b[0]
        #b=b.lstrip(n)
        b=b[1:]
        
    else:
        if len(c)==0:
            print('C')
            exit()
            
        n=c[0]
        #c=c.lstrip(n)
        c=c[1:]
Buggy python submission (verdict: Runtime Error):
s = input()
a = 's'
if s[-1] == 's':
    a = 'es'
s.append(a)

Fixed submission:
s = input()
a = 's'
if s[-1] == 's':
    a = 'es'
s = s + a
print(s)
Buggy python submission (verdict: Time Limit Exceeded):
N,X,M = map(int,input().split())
R = [X]
m = min(N,M)
for i in range(m):
    r = R[-1]
    r = r**2%M
    if r in R:
        break
    R.append(r)
for i in range(len(R)):
    if r == R[i]:
        break
a = 0
b = sum(R)
for j in range(i):
    a += R[j]
    b -= R[j]
n = len(R) - i
t = N - i
p = t // n
q = t % n
c = 0
for j in range(q):
    c += R[i+j]
ans = a + b*p + c
print(ans)

Fixed submission:
N,X,M = map(int,input().split())
R = [X]
dr = {}
for i in range(M):
    dr[i] = 0
m = min(N,M)
for i in range(m):
    r = R[-1]
    r = r**2%M
    if dr[r] == 1:
        break
    R.append(r)
    dr[r] = 1
for i in range(len(R)):
    if r == R[i]:
        break
a = 0
b = sum(R)
for j in range(i):
    a += R[j]
    b -= R[j]
n = len(R) - i
t = N - i
p = t // n
q = t % n
c = 0
for j in range(q):
    c += R[i+j]
ans = a + b*p + c
print(ans)

Buggy python submission (verdict: Runtime Error):
N,X,M = map(int,input().split())
R = [X]
m = min(X,M)
for i in range(m):
    r = R[-1]
    r = r**2%M
    if r in R:
        break
    R.append(r)
for i in range(len(R)):
    if r == R[i]:
        break
a = 0
b = sum(R)
for j in range(i):
    a += R[j]
    b -= R[j]
n = len(R) - i
t = N - i
p = t // n
q = t % n
c = 0
for j in range(q):
    c += R[i+j]
ans = a + b*p + c
print(ans)

Fixed submission:
N,X,M = map(int,input().split())
R = [X]
dr = {}
for i in range(M):
    dr[i] = 0
m = min(N,M)
for i in range(m):
    r = R[-1]
    r = r**2%M
    if dr[r] == 1:
        break
    R.append(r)
    dr[r] = 1
for i in range(len(R)):
    if r == R[i]:
        break
a = 0
b = sum(R)
for j in range(i):
    a += R[j]
    b -= R[j]
n = len(R) - i
t = N - i
p = t // n
q = t % n
c = 0
for j in range(q):
    c += R[i+j]
ans = a + b*p + c
print(ans)

Buggy python submission (verdict: Runtime Error):
N,X,M = map(int,input().split())
R = [X]
m = min(X,M)
for i in range(m):
    r = R[-1]
    r = r**2%M
    if r in R:
        break
    R.append(r)
for i in range(len(R)):
    if r == R[i]:
        break
a = 0
b = sum(R)
for j in range(i):
    a += R[j]
    b -= R[j]
n = len(R) - i
t = N - i
p = t // n
q = t % n
c = 0
for j in range(q):
    c += R[i+j]
ans = a + b*p + c
print(ans)

Fixed submission:
N,X,M = map(int,input().split())
R = [X]
dr = {}
for i in range(M):
    dr[i] = 0
m = min(N,M)
for i in range(m):
    r = R[-1]
    r = r**2%M
    if dr[r] == 1:
        break
    R.append(r)
    dr[r] = 1
for i in range(len(R)):
    if r == R[i]:
        break
a = 0
b = sum(R)
for j in range(i):
    a += R[j]
    b -= R[j]
n = len(R) - i
t = N - i
p = t // n
q = t % n
c = 0
for j in range(q):
    c += R[i+j]
ans = a + b*p + c
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
A.sort()
B = []
for i in range(N):
    a = A.pop(0)
    B.append(a)
    B.append(a)
ans = 0
B.pop()
for i in range(N-1):
    a = B.pop()
    ans += a
print(ans)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
A.sort()
k = N - 2
a = A.pop()
ans = a
n = k // 2
for i in range(n):
    a = A.pop()
    ans += 2*a
if k - 2*n == 1:
    ans += A[-1]

print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
A.sort()
B = []
for i in range(N):
    a = A.pop(0)
    B.append(0)
    B.append(0)
ans = 0
B.pop()
for i in range(N-1):
    a = B.pop()
    ans += b
print(ans)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
A.sort()
k = N - 2
a = A.pop()
ans = a
n = k // 2
for i in range(n):
    a = A.pop()
    ans += 2*a
if k - 2*n == 1:
    ans += A[-1]

print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
A.sort()
B = []
for i in range(N):
    a = A.pop(0)
    B.append(0)
    B.append(0)
ans = 0
B.sort()
for i in range(N-1):
    a = B.pop(0)
    ans += b
print(ans)


Fixed submission:
N = int(input())
A = list(map(int,input().split()))
A.sort()
k = N - 2
a = A.pop()
ans = a
n = k // 2
for i in range(n):
    a = A.pop()
    ans += 2*a
if k - 2*n == 1:
    ans += A[-1]

print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
A.sort()
B = []
for i in range(N):
    a = A.pop(0)
    B.append(0)
    B.append(0)
ans = 0
for i in range(N-1):
    a = B.pop(0)
    ans += b
print(ans)


Fixed submission:
N = int(input())
A = list(map(int,input().split()))
A.sort()
k = N - 2
a = A.pop()
ans = a
n = k // 2
for i in range(n):
    a = A.pop()
    ans += 2*a
if k - 2*n == 1:
    ans += A[-1]

print(ans)
Buggy python submission (verdict: Runtime Error):
X,N = map(int,input().split())
if N > 0:
    A = list(map(int,input().split()))
    d = {}
    for i in range(101):
        d[i] = 0
    for a in A:
        d[a] = 1
    for i in range(0,100):
        x = X - i
        y = X + i
        if d[x] == 0:
            print(x)
            quit()
        if d[y] == 0:
            print(y)
            quit()
else:
    print(X)

Fixed submission:
X,N = map(int,input().split())
if N > 0:
    A = list(map(int,input().split()))
    d = {}
    for i in range(102):
        d[i] = 0
    for a in A:
        d[a] = 1
    for i in range(0,100):
        x = X - i
        y = X + i
        if d[x] == 0:
            print(x)
            quit()
        if d[y] == 0:
            print(y)
            quit()
else:
    print(X)

Buggy python submission (verdict: Runtime Error):
X,N = map(int,input().split())
if N > 0:
    A = list(map(int,input()))
    for i in range(100):
        x = X - i
        y = X - i
    if x not in A:
        print(x)
        quit()
    if y not in A:
        print(y)
        quit()
else:
    print(N)


Fixed submission:
X,N = map(int,input().split())
if N > 0:
    A = list(map(int,input().split()))
    d = {}
    for i in range(102):
        d[i] = 0
    for a in A:
        d[a] = 1
    for i in range(0,100):
        x = X - i
        y = X + i
        if d[x] == 0:
            print(x)
            quit()
        if d[y] == 0:
            print(y)
            quit()
else:
    print(X)

Buggy python submission (verdict: Runtime Error):
X,N = map(int,input())
if N > 0:
    A = list(map(int,input()))
    for i in range(100):
        x = X - i
        y = X - i
    if x not in A:
        print(x)
        quit()
    if y not in A:
        print(y)
        quit()
else:
    print(N)

Fixed submission:
X,N = map(int,input().split())
if N > 0:
    A = list(map(int,input().split()))
    d = {}
    for i in range(102):
        d[i] = 0
    for a in A:
        d[a] = 1
    for i in range(0,100):
        x = X - i
        y = X + i
        if d[x] == 0:
            print(x)
            quit()
        if d[y] == 0:
            print(y)
            quit()
else:
    print(X)
Buggy python submission (verdict: Runtime Error):
S = input()
n = len(S)
p = (n-1)//2
q = (n+3)//2 - 1
A = S[:p]
B = S[q:]
ans = 'Yes'
for i in range(len(S)):
    if S[i] != S[-i-1]:
        ans = 'No
for i in range(len(A)):
    if A[i] != A[-i-1]:
        ans = 'No'
for i in range(len(B)):
    if B[i] != B[-i-1]:
        ans = 'No'
print(ans)


Fixed submission:
S = input()
n = len(S)
p = (n-1)//2
q = (n+3)//2 - 1
A = S[:p]
B = S[q:]
ans = 'Yes'
for i in range(len(S)):
    if S[i] != S[-i-1]:
        ans = 'No'
for i in range(len(A)):
    if A[i] != A[-i-1]:
        ans = 'No'
for i in range(len(B)):
    if B[i] != B[-i-1]:
        ans = 'No'
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())

count = 0
for i in range(n - 1):
    c = i + 1
    a_b = n - c
    for j in range(a_b):
        a = j + 1
        if a_b % a == 0:
            count += 1

print(count)



Fixed submission:
word = list(input())


if word[-1] == "s":
    word.append("es")
else:
    word.append("s")
    
word_comp = "".join(word)

print(word_comp)

Buggy python submission (verdict: Runtime Error):
 x= str(input())
a=list(x)
l=len(a)
if a[l-1]=='s':
    print(x+'es')
else:
    print(x+'s')

Fixed submission:
x= str(input())
a=list(x)
l=len(a)
if a[l-1]=='s':
    print(x+'es')
else:
    print(x+'s')
Buggy python submission (verdict: Runtime Error):
N=int(input())
if N == 1:
    print(0)
elif N==o:
    print(1)

Fixed submission:
N=int(input())
if N == 1:
    print(0)
elif N==0:
    print(1)
Buggy python submission (verdict: Runtime Error):
a,b,c,d= map(int,imput().split())
if b>=0 and d>=0:
    print(b*d)
elif b>=0 and d<0 and a>=0:
    print(a*d)
elif b>=0 and d<0 and a<0:
    print(a*c)
elif b<0 and d>=0 and c>=0:
    print(b*c)
elif b<0 and d>=0 and c<0:
    print(a*c)
else:
    print(a*c)

Fixed submission:
a,b,c,d= map(int,input().split())
A=max(a*c,a*d,b*c,b*d)
print(A)
Buggy python submission (verdict: Runtime Error):
A,B =map(int.input().split())
print(A*B)


Fixed submission:
A,B =input().split()
a=int(A)
b=int(B)
print(a*b)

Buggy python submission (verdict: Runtime Error):
A,B =map(int.input().split())
print(A*B)

Fixed submission:
A,B =input().split()
a=int(A)
b=int(B)
print(a*b)