Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N,M = list(map(int,input().split()))
S = []
C = []
ans = [0 for i in range(N)]
fr = 0
for i in range(M):
    s = 0
    c = 0
    s,c = list(map(int,input().split()))
    S.append(s)
    C.append(c)

for i in range(M):
    if C[i] != ans[S[i]-1] and ans[S[i]-1] != 0:
        fr = 1
    else:
        ans[S[i]-1] = C[i]

if ans[0] == 0:
    ans += 1

if fr != 0:
    print(-1)
else:
    if N == 3:
        print(ans[0]*100 + ans[1]*10 + ans[2])
    elif N == 2:
        print(ans[0]*10 + ans[1])
    else:
        print(ans[0])

Fixed submission:
N,M = list(map(int,input().split()))
S = []
C = []
ans = [11 for i in range(N)]
fr = 0
for i in range(M):
    s = 0
    c = 0
    s,c = list(map(int,input().split()))
    S.append(s)
    C.append(c)

for i in range(M):
    if C[i] != ans[S[i]-1] and ans[S[i]-1] != 11:
        fr = 1
    elif C[i] == 0 and S[i] == 1 and N > 1:
        fr = 1
    else:
        ans[S[i]-1] = C[i]

for i in range(N):
    if ans[i] == 11:
        ans[i] = 0

if ans[0] == 0 and N > 1:
    ans[0] = 1

if fr != 0:
    print(-1)
else:
    if N == 3:
        print(ans[0]*100 + ans[1]*10 + ans[2])
    elif N == 2:
        print(ans[0]*10 + ans[1])
    else:
        print(ans[0])

Buggy python submission (verdict: Runtime Error):
N,M = list(map(int,input().split()))
S = []
C = []
ans = [0 for i in range(N)]
fr = 0
for i in range(M):
    s = 0
    c = 0
    s,c = list(map(int,input().split()))
    S.append(s)
    C.append(c)

for i in range(M):
    if C[i] != ans[S[i]-1] and ans[S[i]-1] != 0:
        fr = 1
    else:
        ans[S[i]-1] = C[i]

if fr != 0:
    print(-1)
elif (ans[0]*100 + ans[1]*10 + ans[2]) > 10**(N-1):
    print(ans[0]*100 + ans[1]*10 + ans[2])
else:
    print(-1)

Fixed submission:
N,M = list(map(int,input().split()))
S = []
C = []
ans = [11 for i in range(N)]
fr = 0
for i in range(M):
    s = 0
    c = 0
    s,c = list(map(int,input().split()))
    S.append(s)
    C.append(c)

for i in range(M):
    if C[i] != ans[S[i]-1] and ans[S[i]-1] != 11:
        fr = 1
    elif C[i] == 0 and S[i] == 1 and N > 1:
        fr = 1
    else:
        ans[S[i]-1] = C[i]

for i in range(N):
    if ans[i] == 11:
        ans[i] = 0

if ans[0] == 0 and N > 1:
    ans[0] = 1

if fr != 0:
    print(-1)
else:
    if N == 3:
        print(ans[0]*100 + ans[1]*10 + ans[2])
    elif N == 2:
        print(ans[0]*10 + ans[1])
    else:
        print(ans[0])
Buggy python submission (verdict: Runtime Error):
S = str(input())
ans = []
for i  in range(len(S)):
    ans.append(x)
ans = ''.join(ans)
print(ans)

Fixed submission:
S = str(input())
ans = []
for i  in range(len(S)):
    ans.append('x')
ans = ''.join(ans)
print(ans)
Buggy python submission (verdict: Runtime Error):
import itertools
N,K = list(map(int,input().split()))
p = list(map(int,input().split()))
k = [(1+i)/2 for i in p]
a = list(itertools.accumulate(k))
max = a[2]
for i in range(3,N):
    if max < a[i] - a[i-3]:
        max = a[i] - a[i-3]
print(max)

Fixed submission:
import itertools
N,K = list(map(int,input().split()))
p = list(map(int,input().split()))
k = [(1+i)/2 for i in p]
a = list(itertools.accumulate(k))
max = a[K-1]
for i in range(K,N):
    if max < a[i] - a[i-K]:
        max = a[i] - a[i-K]
print(max)
Buggy python submission (verdict: Runtime Error):
N,K = list(map(int,input().split()))
H = list(map(int, input().split()))

H.sort()

if K < N:
    for x in range(K):
        H.pop(-x-1)
    print(sum(H))

else:
    print('0')

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

if K < N:
    H.sort()
    H = H[0:N-K]
    print(sum(H))
    
else:
    print('0')
Buggy python submission (verdict: Runtime Error):
H = int(input())
ans = 0
if H != 1 and H % 2 == 1:
    H = H+1
elif H == 1:
    print(1)
 
 
print((pow(2,(H//2)-1)

Fixed submission:
def atk(H):
    if H == 1:
        return(H)
    else:
        global count
        count += 1
        return(atk(H//2))
count = 0
atk(int(input()))
print(-1*(1-(2**(count+1))))

Buggy python submission (verdict: Runtime Error):
H = int(input())
ans = 0
if H != 1 and H % 2 == 1:
    H = H+1
elif H == 1:
    print(1)


print((pow(2,H//2)-1))

Fixed submission:
def atk(H):
    if H == 1:
        return(H)
    else:
        global count
        count += 1
        return(atk(H//2))
count = 0
atk(int(input()))
print(-1*(1-(2**(count+1))))
Buggy python submission (verdict: Runtime Error):
N,M = list(map(int,input().split()))
p = []
for i in range(M):
    x,y = list(map(str, input().split()))
    p.append([int(x),y])
count = [[0,0]for i in range(M)]
ansac = 0
answa = 0
for i in range(M):
    if count[p[i][0]-1][1] != 0:
        pass
    else:
        if p[i][1] == 'AC':
            count[p[i][0]-1][1] += 1
        else:
            count[p[i][0]-1][0] += 1
for i in range(N):
    answa += count[i][0]
    ansac += count[i][1]
print(str(ansac) + ' ' + str(answa))

Fixed submission:
N,M = list(map(int,input().split()))
p = []
for i in range(M):
    x,y = list(map(str, input().split()))
    p.append([int(x),y])
count = [[0,0]for i in range(N)]
ansac = 0
answa = 0
for i in range(M):
    if count[p[i][0]-1][1] != 0:
        pass
    else:
        if p[i][1] == 'AC':
            count[p[i][0]-1][1] += 1
        else:
            count[p[i][0]-1][0] += 1
for i in range(N):
    if count[i][1] > 0:
        answa += count[i][0]
    ansac += count[i][1]
print(str(ansac) + ' ' + str(answa))
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = str(input())
count = 0
for i in range(N-2):
    if S[i] == A and S[i+1] == B and S[i+2] == C:
        count += 1
print(count)

Fixed submission:
N = int(input())
S = str(input())
count = 0
for i in range(N-2):
    if S[i] == "A" and S[i+1] == "B" and S[i+2] == "C":
        count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = str(input())
count = 0
for i in range(N-2):
    if S[i] == A and S[i+1] == B ans S[i+2] == C:
        count += 1
print(count)

Fixed submission:
N = int(input())
S = str(input())
count = 0
for i in range(N-2):
    if S[i] == "A" and S[i+1] == "B" and S[i+2] == "C":
        count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
S,T = list(map(str,input().split()))
ans = []
for i in range(len(S)):
    ans.append(S[i])
    ans.append(T[i])
print(''.join(ans))

Fixed submission:
N = int(input())
S,T = list(map(str,input().split()))
ans = []
for i in range(len(S)):
    ans.append(S[i])
    ans.append(T[i])
print(''.join(ans))
Buggy python submission (verdict: Runtime Error):
import math
A,B = list(map(int,input().split()))
print(int(A*B/math.gcd(A,B)))

Fixed submission:
import fractions
A,B = list(map(int,input().split()))
print(int(A*B/fractions.gcd(A,B)))

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

Fixed submission:
import fractions
A,B = list(map(int,input().split()))
print(int(A*B/fractions.gcd(A,B)))

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

Fixed submission:
import fractions
A,B = list(map(int,input().split()))
print(int(A*B/fractions.gcd(A,B)))

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

Fixed submission:
import fractions
A,B = list(map(int,input().split()))
print(int(A*B/fractions.gcd(A,B)))

Buggy python submission (verdict: Time Limit Exceeded):
A,B = list(map(int,input().split()))
for i in range(min(A,B),A*B+1):
    if i % A == 0 and i % B == 0:
        print(i)
        break


Fixed submission:
import fractions
A,B = list(map(int,input().split()))
print(int(A*B/fractions.gcd(A,B)))

Buggy python submission (verdict: Time Limit Exceeded):
A,B = list(map(int,input().split()))
for i in range(2,A*B+1):
    if i % A == 0 and i % B == 0:
        print(i)
        break


Fixed submission:
import fractions
A,B = list(map(int,input().split()))
print(int(A*B/fractions.gcd(A,B)))
Buggy python submission (verdict: Runtime Error):
import math
N = int(input())
ran = math.floor(math.sqrt(N))
max = 0
for i in range(１、ran):
    if N%i == 0:
        if i > max:
            max = i
print(i + N/i -2)

Fixed submission:
n = int(input())
s = int(n ** 0.5)
i = 0
while True:
    if n%(s + i) == 0:
        k = 1
        break
    if n%(s - i) == 0:
        k = -1
        break
    i += 1
s = s + i * k 
print((s + n // s) - 2)

Buggy python submission (verdict: Runtime Error):
import math
N = int(input())
a = 1
b = 1
ran = math.floor(math.sqrt(N))
max = 0
for i in range(ran):
    if N%i == 0:
        if i > max:
            max = i
print(i + N/i -2)

Fixed submission:
n = int(input())
s = int(n ** 0.5)
i = 0
while True:
    if n%(s + i) == 0:
        k = 1
        break
    if n%(s - i) == 0:
        k = -1
        break
    i += 1
s = s + i * k 
print((s + n // s) - 2)
Buggy python submission (verdict: Runtime Error):
N = int(input())
if N % 2 == 0:
    print((N/2)/N)
else:
    print((N//2)+1/(N)

Fixed submission:
N = int(input())
if N % 2 == 0:
    print((N/2)/N)
else:
    print((N//2+1)/N)
Buggy python submission (verdict: Runtime Error):
S = str(input())
if S == Sunny:
    print('Cloudy')
elif S == Cloudy:
    print('Rainy')
else:
    print('Sunny')

Fixed submission:
S = str(input())
if S == 'Sunny':
    print('Cloudy')
elif S == 'Cloudy':
    print('Rainy')
else:
    print('Sunny')
Buggy python submission (verdict: Runtime Error):
print(int(input())**3))

Fixed submission:
print(int(input())**3)

Buggy python submission (verdict: Runtime Error):
print(int(input()**3))

Fixed submission:
print(int(input())**3)
Buggy python submission (verdict: Runtime Error):
A = list(map(int,input().split()))
print(max(A+B,A-B,A*B))

Fixed submission:
A,B = list(map(int,input().split()))
print(max(A+B,A-B, A*B))

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

Fixed submission:
A,B = list(map(int,input().split()))
print(max(A+B,A-B, A*B))

Buggy python submission (verdict: Runtime Error):
A=int(input())
B=int(input())
Sum = A + B
Minus = A - B
Multi = A * B
if Sum > Minus and Sum > Multi:
    print(Sum)
elif Multi > Minus and Sum < Multi:
    print(Multi)
else:
    print(Minus)
    


Fixed submission:
A,B = list(map(int,input().split()))
print(max(A+B,A-B, A*B))
Buggy python submission (verdict: Runtime Error):
K,X=list(map(int,input().split()))
min = max(X - (K -1),-1000000)
max = min (X + (K-1),1000000)
for i in range(min,max+1):
    ans.append(i)
print(' '.join(ans))

Fixed submission:
K,X=list(map(int,input().split()))
Min = max(X - (K -1),-1000000)
Max = min(X + (K-1),1000000)
ans = []
for i in range(Min,Max+1):
    ans.append(i)
ans = map(str,ans)
ans = ' '.join(ans)
print(ans)

Buggy python submission (verdict: Runtime Error):
K,X=list(map(int,input().split()))
min = max(X - (K -1),−1000000)
max = min (X + (K-1),1000000)
for i in range(min,max+1):
    ans.append(i)
print(' '.join(ans))

Fixed submission:
K,X=list(map(int,input().split()))
Min = max(X - (K -1),-1000000)
Max = min(X + (K-1),1000000)
ans = []
for i in range(Min,Max+1):
    ans.append(i)
ans = map(str,ans)
ans = ' '.join(ans)
print(ans)
Buggy python submission (verdict: Runtime Error):
A = list(map(int,input().split()))
print(A[2] - (A[1]-A[2])

Fixed submission:
A = list(map(int,input().split()))
if A[2] > A[0]-A[1]:
    print(A[2] - (A[0]-A[1]))
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
A ,B = int(input())
if (A+B)%2==0:
    print((A+B)/2)
else:
    print('IMPOSSIBLE')

Fixed submission:
A= list(map(int,input().split()))
if (A[0]+A[1])%2 == 0:
    print(int((A[0]+A[1])/2))
else:
    print('IMPOSSIBLE')
Buggy python submission (verdict: Runtime Error):
n = input()
p = list(map(int, input().split()))
ans = 0
for i in p[2:]:
    if p[i] < p[i-1] < p[i-2] or p[i] > p[i-1] > p[i-2]:
        ans +=1
    else:
        continue
print(ans)


Fixed submission:
n = int(input())
p = list(map(int, input().split()))
ans = 0
for i in range(1,n-1):
    if p[i+1] < p[i] < p[i-1] or p[i+1] > p[i] > p[i-1]:
        ans +=1
print(ans)

Buggy python submission (verdict: Runtime Error):
n = input()
p = list(map(int, input().split()))
ans = 0
for i in p[3:]:
    if p[i] < p[i-1] < p[i-2] or p[i] > p[i-1] > p[i-2]:
        ans +=1
    else:
        continue
print(ans)


Fixed submission:
n = int(input())
p = list(map(int, input().split()))
ans = 0
for i in range(1,n-1):
    if p[i+1] < p[i] < p[i-1] or p[i+1] > p[i] > p[i-1]:
        ans +=1
print(ans)
Buggy python submission (verdict: Runtime Error):
X,A = int(input().split())
if X < A:
    print('0')
else:
    print('10')


Fixed submission:
X,A = (input().split())
if X < A:
    print('0')
else:
    print('10')

Buggy python submission (verdict: Runtime Error):
X,A = int(input().split())
if X < A:
    print('0')
else:
    print('10')


Fixed submission:
X,A = (input().split())
if X < A:
    print('0')
else:
    print('10')
Buggy python submission (verdict: Runtime Error):
P= list(map(int(input().split()))
P.sort()
print(P[0]+P[1])

Fixed submission:
P= list(map(int, input().split()))
P.sort()
print(P[0]+P[1])
Buggy python submission (verdict: Runtime Error):
N,K = list(map(int, input().split()))
S = str(input())
s = [S[i] for i in range(len(S))]
s[K-1] = chr(ord(s[k-1])+32)
print(join(s))

Fixed submission:
N,K = list(map(int, input().split()))
S = str(input())
s = [S[i] for i in range(len(S))]
s[K-1] = chr(ord(s[K-1])+32)
print(''.join(s))

Buggy python submission (verdict: Runtime Error):
N,K = list(map(int, input().split()))
S = str(input())
s = [S[i] for i in range(len(S))]
ans = (s[K-1].lower)
print(''.join(ans))

Fixed submission:
N,K = list(map(int, input().split()))
S = str(input())
s = [S[i] for i in range(len(S))]
s[K-1] = chr(ord(s[K-1])+32)
print(''.join(s))

Buggy python submission (verdict: Runtime Error):
N,K = list(map(int, input().split()))
S = str(input())
s = [S[i] for i in range(len(S))]
ans = (s[K-1].lower)
print(join(ans))

Fixed submission:
N,K = list(map(int, input().split()))
S = str(input())
s = [S[i] for i in range(len(S))]
s[K-1] = chr(ord(s[K-1])+32)
print(''.join(s))
Buggy python submission (verdict: Runtime Error):
s = str(input())
ans = 0
for i in range(len(s)):
    count = 0
    if S[i] == "A" or "T" or "C" or "G":
        count += 1
        for j in range(len(s)-i):
            if S[j] == "A" or "T" or "C" or "G":       
                count += 1
            else:
                break:
    if ans < count:
        ans = count
print(ans)

Fixed submission:
S = str(input())
ans = []
for i in range(len(S)):
    preans = []
    if S[i] == "A" or S[i] == "C" or S[i]  == "G" or S[i] =="T":
        preans.append(S[i])
        for j in range(1,len(S)-i):
            if S[i+j] == "A" or S[i+j] == "C" or S[i+j]  == "G" or S[i+j] =="T":
                preans.append(S[i+j])
            else:
                break
    if len(preans) > len(ans):
        ans = preans
if len(ans) == 2 and ans[0] == "A" and ans[1] == "C":
    print(0)
else:
    print(len(ans))

Buggy python submission (verdict: Runtime Error):
s = str(input())
ans = 0
for i in range(len(s)):
    count = 0
    if S[i] == "A" or "T" or "C" or "G":
        count += 1
        for j in range(len(s)-i):
            if S[j] == "A" or "T" or "C" or "G":       
                count += 1:
            else:
                break:
    if ans < count:
        ans = count
print(ans)

Fixed submission:
S = str(input())
ans = []
for i in range(len(S)):
    preans = []
    if S[i] == "A" or S[i] == "C" or S[i]  == "G" or S[i] =="T":
        preans.append(S[i])
        for j in range(1,len(S)-i):
            if S[i+j] == "A" or S[i+j] == "C" or S[i+j]  == "G" or S[i+j] =="T":
                preans.append(S[i+j])
            else:
                break
    if len(preans) > len(ans):
        ans = preans
if len(ans) == 2 and ans[0] == "A" and ans[1] == "C":
    print(0)
else:
    print(len(ans))

Buggy python submission (verdict: Runtime Error):
s = str(input())
ans = 0
for i in range(len(s)):
count = 0
    if S[i] == "A" or "T" or "C" or "G":
        count += 1
        for j in range(len(s)-i):
            if S[j] == "A" or "T" or "C" or "G":       
                count += 1:
            else:
                break:
    if ans < count:
        ans = count
print(ans)

Fixed submission:
S = str(input())
ans = []
for i in range(len(S)):
    preans = []
    if S[i] == "A" or S[i] == "C" or S[i]  == "G" or S[i] =="T":
        preans.append(S[i])
        for j in range(1,len(S)-i):
            if S[i+j] == "A" or S[i+j] == "C" or S[i+j]  == "G" or S[i+j] =="T":
                preans.append(S[i+j])
            else:
                break
    if len(preans) > len(ans):
        ans = preans
if len(ans) == 2 and ans[0] == "A" and ans[1] == "C":
    print(0)
else:
    print(len(ans))
Buggy python submission (verdict: Runtime Error):
N,M,C = list(map(int,input().split()))
B = list(map(int,input().split()))
A = []
for i in range(N):
    A.append(list(map(int,input().split())))
S = []
count = 0
for i in range(N):
    for j in range(M):
        S.append(A[j]*B[j])
    if sum(S) > -1 * C:
        count += 1
    S = []
print(count)

Fixed submission:
N,M,C = list(map(int,input().split()))
B = list(map(int,input().split()))
A = []
for i in range(N):
    A.append(list(map(int,input().split())))
S = []
count = 0
for i in range(N):
    for j in range(M):
        S.append(A[i][j]*B[j])
    if sum(S) > -1 * C:
        count += 1
    S = []
print(count)

Buggy python submission (verdict: Runtime Error):
N,M,C = list(map(int,input().split()))
B = list(map(int,input().split()))
A = []
for i in range(N):
    A.append(list(map(int,input(),split())))
S = []
count = 0
for i in range(N):
    for j in range(M):
        S.append(A[j]*B[j])
    if sum(S) > -1 * C:
        count += 1
    S = []
print(count)

Fixed submission:
N,M,C = list(map(int,input().split()))
B = list(map(int,input().split()))
A = []
for i in range(N):
    A.append(list(map(int,input().split())))
S = []
count = 0
for i in range(N):
    for j in range(M):
        S.append(A[i][j]*B[j])
    if sum(S) > -1 * C:
        count += 1
    S = []
print(count)
Buggy python submission (verdict: Runtime Error):
A,B = int(input())
if B%A==0:
    print(A+B)
else:
    print(B-A)

Fixed submission:
A,B = list(map(int,input().split()))
if B%A==0:
    print(A+B)
else:
    print(B-A)

Buggy python submission (verdict: Runtime Error):
A,B = int(input())
if B%A=0:
    print(A+B)
else:
    print(B-A)

Fixed submission:
A,B = list(map(int,input().split()))
if B%A==0:
    print(A+B)
else:
    print(B-A)
Buggy python submission (verdict: Runtime Error):
N = int(input())
if N == 3 or N==5 or N==7:
    print('Yes')
else:
print('No')

Fixed submission:
N = int(input())
if N == 3 or N==5 or N==7:
    print('YES')
else:
    print('NO')

Buggy python submission (verdict: Runtime Error):
N = int(input())
if N == 3 or 5 or 7:
    print('Yes')
else:
print('No')

Fixed submission:
N = int(input())
if N == 3 or N==5 or N==7:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Runtime Error):
N = int(input())
if N == 1:
    print('Hello World)
if N == 2:
    A =int(input())
    B =int(input())
    print(A+B)

Fixed submission:
N = int(input())
if N == 1:
    print('Hello World')
else:
    A =int(input())
    B =int(input())
    print(A+B)

Buggy python submission (verdict: Runtime Error):
N = int(input())
if N == 1:
    print('Hello World)
if N == 2:
    A == int(input())
    B == int(input())
    print(A+B)

Fixed submission:
N = int(input())
if N == 1:
    print('Hello World')
else:
    A =int(input())
    B =int(input())
    print(A+B)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = []
A.append(N//100)
A.append(N//10-A)
A.append(N-A-B)
for i in range(3):
    if A[i]==1:
        A[i]=9
    if A[i]==9:
        A[i]=1
print(A[0]*100+A[1]*10+A[2])

Fixed submission:
N = int(input())
A = []
a = N//100
b = N//10-a*10
c = N - a*100 - b*10
A.append(a)
A.append(b)
A.append(c)
for i in range(3):
    if A[i]==1:
        A[i]=9
    elif A[i]==9:
        A[i]=1
print(A[0]*100+A[1]*10+A[2])
Buggy python submission (verdict: Runtime Error):
A,B=list(map(int,input.split()))
print((A-1)*(B-1) + 1)

Fixed submission:
A,B=list(map(int,input().split()))
print((A-1)*(B-1))

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

Fixed submission:
A,B=list(map(int,input().split()))
print((A-1)*(B-1))
Buggy python submission (verdict: Runtime Error):
s = str(input())
S = [int(s[i]) for i in range(len(s))]
K = int(input())
ans = 1
count = 0
for i in range(K):
    if S[i] != 1 and count == 0:
        ans = S[i]
        count += 1
print(ans)

Fixed submission:
s = str(input())
S = [int(s[i]) for i in range(len(s))]
K = int(input())
ans = 1
count = 0
for i in range(min(len(S),K)):
    if S[i] != 1 and count == 0:
        ans = S[i]
        count += 1
        break
print(ans)

Buggy python submission (verdict: Runtime Error):
s = str(input())
S = [int(s[i]) for i in range(len(s))]
K = int(input())
ans = 1
for i in S:
    if S[i] != 1:
        ans = S[i]
        break
print(ans)

Fixed submission:
s = str(input())
S = [int(s[i]) for i in range(len(s))]
K = int(input())
ans = 1
count = 0
for i in range(min(len(S),K)):
    if S[i] != 1 and count == 0:
        ans = S[i]
        count += 1
        break
print(ans)

Buggy python submission (verdict: Runtime Error):
s = str(input())
S = [int(s[i]) for i in range(len(s))]
K = int(input())
ans = 1
for i in S:
    if S[i] != 1:
        print(S[i])
        break



Fixed submission:
s = str(input())
S = [int(s[i]) for i in range(len(s))]
K = int(input())
ans = 1
count = 0
for i in range(min(len(S),K)):
    if S[i] != 1 and count == 0:
        ans = S[i]
        count += 1
        break
print(ans)
Buggy python submission (verdict: Runtime Error):
N = input()
if N % 2 == 0:
    print(N)
else:
    print(N * 2)

Fixed submission:
N = int(input())
if N % 2 == 0:
    print(N)
else:
    print(N * 2)
Buggy python submission (verdict: Runtime Error):
N,K = list(map(int, input().split()))
a = list(map(int, input().split()))
print( (n-1 + k-1 - 1)// (k-1) )

Fixed submission:
n,k = list(map(int, input().split()))
a = list(map(int, input().split()))
print( (n-1 + k-1 - 1)// (k-1) )