Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
s1 = input()
s2 = input()
s3 = input()

s1.upper()
s2.upper()
s3.upper()

print(s1[0] + s2[0] + s3[0])

Fixed submission:
s1, s2, s3 = input().split()
print((s1[0]+s2[0]+s3[0]).upper())

Buggy python submission (verdict: Runtime Error):
s1 = input()
s2 = input()
s3 = input()

print(s1.upper()[0] + s2.upper()[0] + s3.upper()[0])

Fixed submission:
s1, s2, s3 = input().split()
print((s1[0]+s2[0]+s3[0]).upper())
Buggy python submission (verdict: Runtime Error):
O = input()
E = input()

for i in range(E.length()):
  print(O[i], end='')
  print(E[i], end='')
  
if not(E.length() == O.length()):
  print(O[O.length() - 1])

Fixed submission:
O = input()
E = input()

for i in range(len(E)):
  print(O[i], end='')
  print(E[i], end='')
  
if not(len(E) == len(O)):
  print(O[len(O) - 1])
Buggy python submission (verdict: Runtime Error):
A = int(input())
op = input()
B = int(input())

if op == '+':
  print(A + B)
else:
  print(A - B)


Fixed submission:
a = input().split()
if a[1] == '+':
    print(int(a[0])+int(a[2]))
else:
    print(int(a[0])-int(a[-1]))

Buggy python submission (verdict: Runtime Error):
A = int(input())
op = input()
B = input()

if op == '+':
  print(A + B)
else:
  print(A - B)

Fixed submission:
a = input().split()
if a[1] == '+':
    print(int(a[0])+int(a[2]))
else:
    print(int(a[0])-int(a[-1]))
Buggy python submission (verdict: Runtime Error):
a, b, h = map(int, input().split())

print((a + b) * h / 2)


Fixed submission:
a = int(input())
b = int(input())
h = int(input())
print((a + b) * h // 2)

Buggy python submission (verdict: Runtime Error):
a, b, h = map(int, imput().split())

print((a + b) * h / 2)

Fixed submission:
a = int(input())
b = int(input())
h = int(input())
print((a + b) * h // 2)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
N = int(input())
A = [int(n) for n in input().split()]
MAX = 10**18
ans = 1
for a in A:
    ans *= a
else:
    if ans > MAX:
        print("-1")
    else:
        print(ans)

Fixed submission:
import sys
N = int(input())
A = [int(n) for n in input().split()]
MAX = 10**18
ans = 1
if 0 in A:
    print("0")
    sys.exit()
for a in A:
    if ans > MAX:
        print("-1")
        sys.exit()
    ans *= a
else:
    if ans > MAX:
        print("-1")
    else:
        print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
N = int(input())
A = [int(n) for n in input().split()]
MAX = 10**18
ans = 1
for a in A:
    ans *= a
else:
    if ans > MAX:
        print("-1")
    else:
        print(ans)

Fixed submission:
import sys
N = int(input())
A = [int(n) for n in input().split()]
MAX = 10**18
ans = 1
if 0 in A:
    print("0")
    sys.exit()
for a in A:
    if ans > MAX:
        print("-1")
        sys.exit()
    ans *= a
else:
    if ans > MAX:
        print("-1")
    else:
        print(ans)
Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
A=[int(n) for n in input().split()]
A.sort()
        
for _ in range(M):
    a = A[-1]//2
    del A[-1]
    for i in range(N):
        if A[i] >a:
            A.insert(i, a)
            break
print(sum(A))

Fixed submission:
import heapq
N,M = map(int,input().split())
H=[]
for i in input().split():
    heapq.heappush(H,-int(i))
for i in range(M):
    a = heapq.heappop(H)
    heapq.heappush(H,-(-a//2))
print(-sum(H))

Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
A=[int(n) for n in input().split()]
A.sort()
        
for _ in range(M):
    a = A[-1]//2
    del A[-1]
    for i in range(N):
        if A[i] >a:
            A.insert(i, a)
            break
    print(A)
print(sum(A))

Fixed submission:
import heapq
N,M = map(int,input().split())
H=[]
for i in input().split():
    heapq.heappush(H,-int(i))
for i in range(M):
    a = heapq.heappop(H)
    heapq.heappush(H,-(-a//2))
print(-sum(H))

Buggy python submission (verdict: Time Limit Exceeded):
N,M = map(int,input().split())
A=[int(n) for n in input().split()]
A.sort()
def insert_sort(arr):
    for i in range(1, len(arr)):
        j = i - 1
        ele = arr[i]
        while arr[j] > ele and j >= 0:
            arr[j + 1] = arr[j]
            j -= 1
        arr[j + 1] = ele
    return arr
        
for _ in range(M):
    A[-1] = A[-1]//2
    A = insert_sort(A)
print(sum(A))

Fixed submission:
import heapq
N,M = map(int,input().split())
H=[]
for i in input().split():
    heapq.heappush(H,-int(i))
for i in range(M):
    a = heapq.heappop(H)
    heapq.heappush(H,-(-a//2))
print(-sum(H))

Buggy python submission (verdict: Time Limit Exceeded):
N,M = map(int,input().split())
A=[int(n) for n in input().split()]
A.sort()
def insert_sort(arr):
    for i in range(1, len(arr)):
        j = i - 1
        ele = arr[i]
        while arr[j] > ele and j >= 0:
            arr[j + 1] = arr[j]
            j -= 1
        arr[j + 1] = ele
    return arr
        
for _ in range(M):
    A[-1] = A[-1]//2
    A = insert_sort(A)
print(sum(A))

Fixed submission:
import heapq
N,M = map(int,input().split())
H=[]
for i in input().split():
    heapq.heappush(H,-int(i))
for i in range(M):
    a = heapq.heappop(H)
    heapq.heappush(H,-(-a//2))
print(-sum(H))
Buggy python submission (verdict: Runtime Error):
N = int(input())
H = [int(n) for n in input().split()]
Hd = []
for i in range(N-1):
    Hd.append(H[i]-H[i+1])
ans_list = [0]*N
J =0
for i in range(N-1):
    if i < J:
        continue
    if Hd[i] >= 0:
        candidate = 1
        for j in range(i+1,N-1):
            if Hd[j] >= 0:
                candidate += 1
            else:
                J = j
                break
        ans_list[i] = candidate
print(max((ans_list)))

Fixed submission:
S = input()
T = input()
ans = 0
for i in range(3):
    if S[i] == T[i]:
        ans +=1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int,input().split())
A = [1]*N
for i in range(M):
    L, R = map(int,input().split())
    for j in range(0,L-1):
        A[j] = 0
    for j in range(R,N):
        A[j] =0
print(sum(A))

Fixed submission:
N, M = map(int,input().split())
L =[]
R =[]
for i in range(M):
    L1, R1 = map(int,input().split())
    L.append(L1-1)
    R.append(R1+1)
if min(R) - max(L) -1<0:
    print("0")
else:
    print(min(R)-max(L)-1)
Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd
from functools import reduce
from copy import copy
def gcd_list(numbers):
    return reduce(gcd, numbers)
ans = 0
N = int(input())
A = [int(n) for n in input().split()]

for i in range(N):
    B = copy(A)
    B.pop(i)
    tmp = gcd_list(B)
    if ans < tmp:
        ans = tmp
print(ans)

Fixed submission:
N = int(input())
A = [int(n) for n in input().split()]

from fractions import gcd
L = [0]*(N+1)
R = [0]*(N+1)
ans = 0
for i in range(N):
    L[i] = gcd(L[i-1],A[i])
for i in reversed(range(N)):
    R[i] = gcd(R[i+1],A[i])

for i in range(N):
    if gcd(L[i-1],R[i+1]) > ans:
        ans = gcd(L[i-1],R[i+1])
print(ans)
Buggy python submission (verdict: Runtime Error):
S = input()
import re
regex = re.compile(r"[ATGC]+")
mo = regex.findall(S)
l=[]
for item in mo:
    l.append(len(item))
print(max(l))

Fixed submission:
S = input()
import re
regex = re.compile(r"[ATGC]+")
mo = regex.findall(S)
l=[]
for item in mo:
    l.append(len(item))
if l ==[]:
    print("0")
else:
    print(max(l))
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N, Q = map(int, input().split())
S = input()
po =[]
while True:
    if S.find("AC") == -1:
        break
    else:
        po.append(S.find("AC"))
        S =S.replace("AC","XX",1)
po_numpy = np.array(po)    
for i in range(Q):
    l1 ,r1 = map(int, input().split())
    print(np.sum(np.logical_and(l1-1<= po_numpy, po_numpy <= r1-2)))

Fixed submission:
N, Q = map(int, input().split())
S = input()
L = [0]*(N+1)
for i in range(N):
    if S[i:i+2] == "AC":
        L[i+1] = L[i] +1
    else:
        L[i+1] = L[i]
for i in range(Q):
    l,r = map(int, input().split())
    print(L[r-1]-L[l-1])

Buggy python submission (verdict: Time Limit Exceeded):
N, Q = map(int, input().split())
S = input()
for i in range(Q):
    l1 ,r1 = map(int, input().split())
    s = S[l1-1:r1]
    print(int((r1-l1+1-len(s.replace("AC","")))/2))

Fixed submission:
N, Q = map(int, input().split())
S = input()
L = [0]*(N+1)
for i in range(N):
    if S[i:i+2] == "AC":
        L[i+1] = L[i] +1
    else:
        L[i+1] = L[i]
for i in range(Q):
    l,r = map(int, input().split())
    print(L[r-1]-L[l-1])

Buggy python submission (verdict: Time Limit Exceeded):
N, Q = map(int, input().split())
S = input()
l=[]; r=[]
for _ in range(Q):
    l1, r1 = map(int, input().split())
    l.append(l1); r.append(r1)
for i in range(Q):
    s = S[l[i]-1:r[i]]
    print(int((r[i]-l[i]+1-len(s.replace("AC","")))/2))

Fixed submission:
N, Q = map(int, input().split())
S = input()
L = [0]*(N+1)
for i in range(N):
    if S[i:i+2] == "AC":
        L[i+1] = L[i] +1
    else:
        L[i+1] = L[i]
for i in range(Q):
    l,r = map(int, input().split())
    print(L[r-1]-L[l-1])

Buggy python submission (verdict: Time Limit Exceeded):
N, Q = map(int, input().split())
S = input()
l=[]; r=[]
for _ in range(Q):
    l1, r1 = map(int, input().split())
    l.append(l1); r.append(r1)
import re
regex = re.compile(r"AC")
for i in range(Q):
    mo = regex.findall(S[l[i]-1:r[i]])
    print(len(mo))

Fixed submission:
N, Q = map(int, input().split())
S = input()
L = [0]*(N+1)
for i in range(N):
    if S[i:i+2] == "AC":
        L[i+1] = L[i] +1
    else:
        L[i+1] = L[i]
for i in range(Q):
    l,r = map(int, input().split())
    print(L[r-1]-L[l-1])
Buggy python submission (verdict: Runtime Error):
A,B,K = map(int, input().split())
List =[]
if A==1 or B==1:
  print("1")
for num in range(1,A):
  if A%num == 0 and B%num == 0:
    List.append(num)
print(List[-K])

Fixed submission:
A,B,K = map(int, input().split())
List =[]
for num in range(1,A+1):
  if A%num == 0 and B%num == 0:
    List.append(num)
print(List[-K])
Buggy python submission (verdict: Time Limit Exceeded):
S = input()
S_len = len(S)
while True:
    if "01"in S:
        S =S.replace("01","")
    elif "10" in S:
        S =S.replace("10","")
    else:
        break
print(S_len - len(S))

Fixed submission:
S = list(input())
zero_num = S.count("0")
one_num = S.count("1")
print(len(S)-abs(zero_num - one_num))

Buggy python submission (verdict: Time Limit Exceeded):
S = input()
S_len = len(S)
while True:
    if "01"in S:
        S =S.replace("01","",1)
    elif "10" in S:
        S =S.replace("10","",1)
    else:
        break
print(S_len - len(S))

Fixed submission:
S = list(input())
zero_num = S.count("0")
one_num = S.count("1")
print(len(S)-abs(zero_num - one_num))
Buggy python submission (verdict: Runtime Error):
N = int(input())
x = []
u = []
for i in range(N):
  x1,u1 = input().split()
  x.append(float(x1))
  u.append(str(u1))
otoshidama = 0.0
for i in range(N):
  if u[i] = "JPY":
    otoshidama += x[i]
  else:
    otoshidama += x[i]*380000.0
print(otoshidama)

Fixed submission:
N = int(input())
x = []
u = []
for i in range(N):
  x1,u1 = input().split()
  x.append(float(x1))
  u.append(str(u1))
otoshidama = 0.0
for i in range(N):
  if u[i] == "JPY":
    otoshidama += x[i]
  else:
    otoshidama += x[i]*380000.0
print(otoshidama)

Buggy python submission (verdict: Runtime Error):
N = int(input())
x = []
u = []
for i in range(N):
  x1,u1 = input().split()
  x.append(float(x1))
  u.append(str(u1))
otoshidama = 0.0
for i in range(N):
  if u[i] = "JPY":
    otoshidama += x[i]
  else:
    otoshidama += x[i]*380000.0
print(otoshidama)

Fixed submission:
N = int(input())
x = []
u = []
for i in range(N):
  x1,u1 = input().split()
  x.append(float(x1))
  u.append(str(u1))
otoshidama = 0.0
for i in range(N):
  if u[i] == "JPY":
    otoshidama += x[i]
  else:
    otoshidama += x[i]*380000.0
print(otoshidama)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [int(n) for n in input().split()]

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

temp_gcm = gcm(A[0],A[1])
for i in range(2,N):
  temp_gcm = gcm(A[i],temp_gcm)
print(temp_gcm)


Fixed submission:
N = int(input())
A = [int(n) for n in input().split()]

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

temp_gcd = gcd(A[0],A[1])
for i in range(2,N):
     temp_gcd = gcd(A[i],temp_gcd)
print(temp_gcd)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [int(n) for n in input().split()]

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

temp_gcm = gcm(A[0],A[1])
 for i in range(2,N):
     temp_gcm = gcm(A[i],temp_gcm)
print(temp_gcm)


Fixed submission:
N = int(input())
A = [int(n) for n in input().split()]

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

temp_gcd = gcd(A[0],A[1])
for i in range(2,N):
     temp_gcd = gcd(A[i],temp_gcd)
print(temp_gcd)
Buggy python submission (verdict: Runtime Error):
A = [int(n) for n in input().split())
print(A[0]*A[1]/2)

Fixed submission:
A = [int(n) for n in input().split()]
print(int(A[0]*A[1]/2))

Buggy python submission (verdict: Runtime Error):
A = input().split()
print(A[0]*A[1]/2)

Fixed submission:
A = [int(n) for n in input().split()]
print(int(A[0]*A[1]/2))
Buggy python submission (verdict: Runtime Error):
s = input()
def f(n):
  if n%2 == 0:
    return n/2
  else:
    return 3*n+1
a = []
a.append(s)
for i in range(1,1000001):
  if f(a[i-1]) in a:
    print(i)
    break
  else:
    a.append(f(a[i-1]))
  

Fixed submission:
s = int(input())
def f(n):
  if n%2 == 0:
    return n/2
  else:
    return 3*n+1
a = []
a.append(s)
for i in range(1,1000001):
  if f(a[i-1]) in a:
    print(i+1)
    break
  else:
    a.append(f(a[i-1]))
Buggy python submission (verdict: Runtime Error):
N = int(input())
a = [int(n) for n in input().split()].sort(Reverse = True)
Alice = 0
Bob = 0
for i in range(N):
  if i%2==0:
    Alice += a[i]
  else:
    Bob += a[i]
print(Alice - Bob)


Fixed submission:
N = int(input())
a = [int(n) for n in input().split()]
a.sort(reverse = True)
Alice = 0
Bob = 0
for i in range(N):
  if i%2==0:
    Alice += a[i]
  else:
    Bob += a[i]
print(Alice - Bob)
Buggy python submission (verdict: Runtime Error):
N = int(input())
d = []
for _ in range(N):
  d.append(int(input())
print(len(set(d)))


Fixed submission:
N = int(input())
d = []
for i in range(N):
  d.append(int(input()))
print(len(set(d)))
Buggy python submission (verdict: Runtime Error):
N, Y = map(int,input().split())
for i in range(N+1):
  for j in range(N+1):
    if Y == 10000*i + 5000*j + 1000*(N-i-j):
      print(i," ",j," ",k)
      break
  else:
    continue
  break
else:
  print("-1 -1 -1")

Fixed submission:
N, Y = map(int,input().split())
for i in range(N+1):
  for j in range(N+1):
    if Y == 10000*i + 5000*j + 1000*(N-i-j) and N-i-j >= 0:
      print(i," ",j," ",N-i-j)
      break
  else:
    continue
  break
else:
  print("-1 -1 -1")

Buggy python submission (verdict: Time Limit Exceeded):
N, Y = map(int,input().split())
for i in range(N+1):
  for j in range(N+1):
    for k in range(N+1):
      if Y == 10000*i + 5000*j + 1000*k and N == i + j + k:
        print(i," ",j," ",k)
        break
    else:
      continue
    break
  else:
    continue
  break
else:
  print("-1 -1 -1")

Fixed submission:
N, Y = map(int,input().split())
for i in range(N+1):
  for j in range(N+1):
    if Y == 10000*i + 5000*j + 1000*(N-i-j) and N-i-j >= 0:
      print(i," ",j," ",N-i-j)
      break
  else:
    continue
  break
else:
  print("-1 -1 -1")
Buggy python submission (verdict: Runtime Error):
alphabet = {1:"a",2:"b"}
backet = [0]*26
S = input()
for char in S:
    backet[ord(char)-97] = 1
print(chr(backet.index(0)+97))


Fixed submission:
alphabet = {1:"a",2:"b"}
backet = [0]*26
S = input()
for char in S:
    backet[ord(char)-97] = 1
if backet == [1]*26:
    print("None")
else:
    print(chr(backet.index(0)+97))
Buggy python submission (verdict: Runtime Error):
N = int(input())
power = [64,32,16,8,4,2,1]
for i in power:
  if N <= power:
    print(power)
    break

Fixed submission:
N = int(input())
power = [64,32,16,8,4,2,1]
for i in power:
  if N >= i:
    print(i)
    break
Buggy python submission (verdict: Runtime Error):
W, H, N = map(int,input().split())
Map = np.ones((H, W),dtype = int)
for i in range(N):
    x,y,a = map(int,input().split())
    if a == 1:
        Map[:,:x] = 0
    elif a == 2:
        Map[:,x:] = 0
    elif a == 3:
        Map[:y,:] = 0
    else:
        Map[y:,:] = 0
print(Map.sum())    

Fixed submission:
import numpy as np
W, H, N = map(int,input().split())
Map = np.ones((H, W),dtype = int)
for i in range(N):
    x,y,a = map(int,input().split())
    if a == 1:
        Map[:,:x] = 0
    elif a == 2:
        Map[:,x:] = 0
    elif a == 3:
        Map[:y,:] = 0
    else:
        Map[y:,:] = 0
print(Map.sum())

Buggy python submission (verdict: Runtime Error):
W, H, N = map(int,input().split())
Map = np.ones((H, W),dtype = int)
for i in range(N):
    x,y,a = map(int,input().split())
    if a == 1:
        Map[:,:x] = 0
    elif a == 2:
        Map[:,x:] = 0
    elif a == 3:
        Map[:y,:] = 0
    else:
        Map[y:,:] = 0
print(Map.sum())

Fixed submission:
import numpy as np
W, H, N = map(int,input().split())
Map = np.ones((H, W),dtype = int)
for i in range(N):
    x,y,a = map(int,input().split())
    if a == 1:
        Map[:,:x] = 0
    elif a == 2:
        Map[:,x:] = 0
    elif a == 3:
        Map[:y,:] = 0
    else:
        Map[y:,:] = 0
print(Map.sum())
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = input().split()
ans = 1
for i in a:
  ans = ans * int(i)
if ans>1000000000000000000:
  print('-1')
else:
  print(ans)

Fixed submission:
n = int(input())
a = input().split()
ans = 1
for i in a:
  if i=='0':
    ans = 0
    break
for i in a:
  ans = ans * int(i)
  if ans>1000000000000000000:
    ans = -1
    break
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
x=int(input())
A=[]
C=[]
for i in range(100000):
    A.append((i)**5)
    C.append((-(i))**5)
for i in range(len(A)):
    for j in range(len(A)):
        if x==A[i]-A[j]:
            print(i,j)
            #print(A[i],A[j])
            #print(A)
            exit()
        elif x==A[i]-C[j]:
            print(i,-(j))
            #print(A[i],C[j])
            #print(C)
            exit()

            
    


Fixed submission:
x=int(input())
A=[]
C=[]
for i in range(100000):
    A.append((i)**5)
    C.append((-(i))**5)
for i in range(len(A)):
    for j in range(len(A)):
        if x==A[i]-A[j]:
            print(i,j)
            #print(A[i],A[j])
            #print(A)
            exit()
        elif x==A[i]-C[j]:
            print(i,-(j))
            #print(A[i],C[j])
            #print(C)
            exit()
Buggy python submission (verdict: Runtime Error):
s,w=map(int, input().split())
if w>=s:
  pritn('unsafe')
else:
  print('safe')

Fixed submission:
s,w=map(int, input().split())
if w>=s:
  print('unsafe')
else:
  print('safe')
Buggy python submission (verdict: Runtime Error):
s,w=map(int, input().split())
if w>=s:
  print('unsafe')
else:
  print('safe')


Fixed submission:
a,b,c,d=map(int, input().split())
while a>0 or c>0:
  c-=b
  a-=d
  if c<=0:
    print('Yes')
    exit()
  elif a<=0:
    print('No')
    exit()
Buggy python submission (verdict: Runtime Error):
n,m=map(int, input().split())
A=list(map(int, input(0.split())))
t=0
for i in range(m):
  t+=A[i]
if t>n:
  print(-1)
else:
  print(n-t)
  
  

Fixed submission:
n,m=map(int, input().split())
A=list(map(int, input().split()))
t=0
for i in range(m):
  t+=A[i]
if t>n:
  print(-1)
else:
  print(n-t)
Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int, input().split())
d=abs(n-k)
if n%k==0:
    print(0)
elif n>d:
    while d>abs(d-k):
        d=abs(d-k)
    print(d)
else:
    print(n)


Fixed submission:
n,k=map(int, input().split())
d=abs(n-k)
t=n//k
if n%k==0:
    print(0)
elif n>d:
    a=n-t*k
    if a>abs(a-k):
        print(abs(a-k))
    else:
        print(a)
else:
    print(n)
Buggy python submission (verdict: Runtime Error):
S=list(map(1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51))
k=int(input())
print(S[k-1])

Fixed submission:
S=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k=int(input())
print(S[k-1])

Buggy python submission (verdict: Runtime Error):
S=list(1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51)
k=int(input())
print(S[k-1])

Fixed submission:
S=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k=int(input())
print(S[k-1])
Buggy python submission (verdict: Runtime Error):
n,a,b=map(int, input().split())
t=''
while len(t)<n:
  t+='b'*a+'r'*b
t=t[::-1]
t=list(t)
g=0
for i in range(n):
  f=t.pop()
  if f=='b':
    g+=1
print(g)
  


Fixed submission:
n,a,b=map(int, input().split())
t=a+b
s=n//t
p=n%t
g=0
if p<=a:
  g=p
else:
  g=a
print(s*a+g)

Buggy python submission (verdict: Runtime Error):
n,a,b=map(int, input().split())
t=''
while len(t)<n:
  t+='b'*a+'r'*b
t=t[::-1]
t=list(t)
g=0
for i in range(n):
  f=t.pop()
  if f=='b':
    g+=1
print(g)
  


Fixed submission:
n,a,b=map(int, input().split())
t=a+b
s=n//t
p=n%t
g=0
if p<=a:
  g=p
else:
  g=a
print(s*a+g)
Buggy python submission (verdict: Runtime Error):
N=int(input())
S=N%2
if S==0:
  print(N//2)
else:
  print(N//2)+1

Fixed submission:
N=int(input())
S=N%2
if S==0:
  print(N//2)
else:
  print(N//2+1)
Buggy python submission (verdict: Runtime Error):
a,b=map(int, input().split())
if a>b:
  string(a)*b
  print(string(a)*b)
else:
  print(string(b)*a)

Fixed submission:
a,b=map(int, input().split())
if a<b:
    str(a)*b
    print(str(a)*b)
else:
    print(str(b)*a)
Buggy python submission (verdict: Runtime Error):
X=list(map(int, input()))
t=0
for i in range(len(X)):
  if X[i]==1:
    t+=300000
  elif X[i]==2:
    t+=200000
  elif X[i]==3:
    t+=100000
if X[0]==X[1] and X[0]==1:
  t+=400000
print(t)


Fixed submission:
X=list(map(int, input().split()))
t=0
for i in range(len(X)):
  if X[i]==1:
    t+=300000
  elif X[i]==2:
    t+=200000
  elif X[i]==3:
    t+=100000
if X[0]==X[1] and X[0]==1:
  t+=400000
print(t)
Buggy python submission (verdict: Runtime Error):
n,k,q=map(int,input().split())
A=[]
A=[int(input()) for i in range(q)]
B=[]
for i in range(q):
    B.append(-q)
for i in A:
    B[i-1]+=1
for i in range(q):
    if B[i]<=0:
        B[i]='No'
    else:
        B[i]='Yes'
C="\n".join(B)
print(C)

Fixed submission:
n,k,q=map(int,input().split())
A=[]
A=[int(input()) for i in range(q)]
#print(A)
B=[]
for i in range(n):
    B.append(-q+k)
#print(B)
for i in A:
    B[i-1]+=1
for i in range(n):
    if B[i]<=0:
        B[i]='No'
    else:
        B[i]='Yes'
C="\n".join(B)
print(C)
Buggy python submission (verdict: Runtime Error):
r=int(input())
print(3*a*a)

Fixed submission:
r=int(input())
print(3*r*r)
Buggy python submission (verdict: Runtime Error):
n=int(input())
p=list(map(int, input().split()))
t=0
for i in range(n):
  if i!=0 or i!=n-1:
    l=[p[i-1], p[i], p[i+1]]
    l.sort()
    if l[1]==p[i]:
      t+=1
print(t)

Fixed submission:
n=int(input())
p=list(map(int, input().split()))
t=0
for i in range(n):
    if i!=0 and i!=n-1:
      l=[p[i-1], p[i], p[i+1]]
      l.sort()
      if l[1]==p[i]:
          t+=1
print(t)

Buggy python submission (verdict: Runtime Error):
n=int(input())
p=list(map(int, input().split()))
t=0
for i in range(n):
  if i!=0 or i!=n-1:
    l=list(p[i-1], p[i], p[i+1])
    l.sort()
    if l[1]==p[i]:
      t+=1
print(t)

Fixed submission:
n=int(input())
p=list(map(int, input().split()))
t=0
for i in range(n):
    if i!=0 and i!=n-1:
      l=[p[i-1], p[i], p[i+1]]
      l.sort()
      if l[1]==p[i]:
          t+=1
print(t)