ZhenlongDai/ACPR huggingface dataset:
Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=input()
K=int(input())
co=0
for j in S:
	if j!='1':
		print(j)
		co=1
		break
	if int(j)>K:
		break
if co==0:
	print('1')

Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
S=input()
K=int(input())
co=0	
a=0
for j in S:
	a=a+1
	if j!='1':
		print(j)
		co=1
		break
	if a==K:
		break
if co==0:
	print('1')

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
K = int(input())

for i in range(len(S)):
    if S[i] != '1': break

nth = i + 1
if nth < K:
    print(1)

answer = S[i]
print(answer)


Failing test case input:
299792458
67730444046952

Expected output:
2


Actual output:
1
2


Fixed submission (verdict: Accepted):
S = input()
K = int(input())

are_all_one = True
for i in range(len(S)):
    if S[i] != '1':
        are_all_one = False
        break

nth = i + 1
if are_all_one or K < nth:
    print(1)
    exit()

answer = S[i]
print(answer)

Problem: p03282
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s=input()
k=int(input())
cnt = 0
for i in s:
    if i =='1':
        cnt +=1
if cnt >=k:
    print(1)
    exit()
for i in s:
    if i !='1':
        print(i)
        exit()

Failing test case input:
1214
2

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
s=input()
k = int(input())
cnt = 0
for i in s:
    if i == '1':
        cnt +=1
    else:
        x = i
        break
if cnt >= k:
    print(1)
else:
    print(x)

Problem: p03282
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
S = input()
K = int(input())

for i, s in enumerate(S, 1):
  if s == 1:
    if i == K:
      print(s)
      break
    else:
      continue
  else:
    print(s)
    break

Failing test case input:
1214
3

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
S = input()
K = int(input())
 
for i, s in enumerate(S, 1):
  if s == '1':
    if i == K:
      print(s)
      break
    else:
      continue
  else:
    print(s)
    break

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
K = int(input())
if S[min(len(S)-1,K - 1)] == '1':
    print(1)
else:
    print(S.replace('1','')[0])


Failing test case input:
1214
3

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
S = input()
K = int(input())
if K < 110 and S[:K] == '1'*K:
    print(1)
else:
    print(S.replace('1', '')[0])

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):



s = input()
k = int(input())



s_k = s[:k]
sk1_count = s.count('1') 

if sk1_count == k:
  print(1)
else:
  for i in s:
    i = int(i)
    if i != 1:
      print(i)
      break

Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):



s = input()
k = int(input())



s_k = s[:k]
sk1_count = s_k.count('1') 

if sk1_count == k:
  print(1)
else:
  for i in s:
    i = int(i)
    if i != 1:
      print(i)
      break
Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = list(map(int,list(input())))
li = [2,3,4,5,6,7,8,9]
ans = 1
for i in range(len(s)):
    if s[i] in li:
        ans = s[i]
        break
print(ans)

Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
s = list(map(int,list(input())))
k = int(input())

li = [2,3,4,5,6,7,8,9]
ans = 1
for i in range(len(s)):
    if k == i+1:
        ans = s[i]
        break
    if s[i] in li:
        ans = s[i]
        break
print(ans)

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
K = int(input())
judge = True
for i in range(len(S)):
    if S[i] !="1":
        judge = False
        print(S[i])
        exit()
if judge:
    print(1)

Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
S = input()
K = int(input())
judge = True
for i in range(len(S)):
    if S[i] !="1":
        
        if (i+1) <= K: 
            print(S[i])
            exit()
print(1)

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
k=int(input())
sl=list(s)
for i in range(len(sl)):
    if s[i]!='1':
        print(s[i])
        exit()
    if k<len(sl):print(s[k-1])

Failing test case input:
1214
1

Expected output:
1


Actual output:
1
2


Fixed submission (verdict: Accepted):
s=input()
k=int(input())
sl=list(s)
for i in range(k):
    if s[i]!='1':
        print(s[i])
        exit()
print(1)

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
k=int(input())
on=[int(j) for j in range(2,10)]
i=0
if int(s[0]) in on:
    print(s[0])

while int(s[i]) not in on:
    if s[i] in on:
        print(s[i])
        break
    elif i==k-1:
        print(s[k-1])
        break
    i+=1

Failing test case input:
1214
3

Expected output:
2


Actual output:

Fixed submission (verdict: Accepted):
s=input()
k=int(input())
on=[int(j) for j in range(2,10)]
for i in range(k):
    if int(s[i]) in on:
        print(s[i])
        break
    elif i==k-1:
        print('1')
    else:
        i+=1

Problem: p03282
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
def main():
    S = input()
    k = int(input())

    for s in S:
        s = int(s)
        if s != 1:
            print(s)
            return
    print(1)


if __name__ == '__main__':
    main()


Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
def main():
    S = input()
    k = int(input())

    for i,s in enumerate(S):
        s = int(s)
        if s != 1:
            print(s)
            return
        if i+1 == k:
            print(1)
            return
    print(1)


if __name__ == '__main__':
    main()
Problem: p03282
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s = input()
k = int(input())
ans = 1
for v in range(len(s)):
    if  s[v] != "1":
        ans = s[v]
        break
print(ans)

Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
s = input()
k = int(input())
ans = 1
for v in range(k):
    if  s[v] != "1":
        ans = s[v]
        break
print(ans)

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = list(input())
K = int(input())

for ss in s:
	if ss != "1":
		print(ss)
		break

if set(s) == {"1"}:
	print("1")


Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
s = list(input())
K = int(input())

if set(s[:K]) == {"1"}:
	print("1")
else:
	for ss in s:
		if ss != "1":
			print(ss)
			break

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
k=int(input())

for i in range(len(s)):
    if s[i]!='1':
        if k>=i:
            print('1')
            exit()
        else:
            print(s[i])
            exit()
print('1')

Failing test case input:
299792458
346186

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
s=input()
k=int(input())

for i in range(len(s)):
    if s[i]!='1':
        if k<=i:
            print('1')
            exit()
        else:
            print(s[i])
            exit()
print('1')

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    s=input()
    k=int(input())
    for i in range(min(100,k-1)):
        if s[i]!='1':
            print(s[i])
            break

if __name__=='__main__':
    main()

Failing test case input:
1214
2

Expected output:
2


Actual output:

Fixed submission (verdict: Accepted):
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    s=input()
    k=int(input())
    for i in range(min(100,k)):
        if s[i]!='1':
            print(s[i])
            break
    else:print(1)

if __name__=='__main__':
    main()

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=input()
K=int(input())
N=len(S)

i=0
while i<N:
  if S[i]=='1':
    i+=1
  else:
    print(S[i])
    exit()
    
print(1)

Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
S=input()
K=int(input())
N=len(S)

i=0
while i<K:
  if S[i]=='1':
    i+=1
  else:
    print(S[i])
    exit()

print(1)

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
k = int(input())




ch_cnt = 1
first_num = 1

for ch in s:
    if ch != "1":
        first_num = int(ch)
        break
    ch_cnt += 1



if k <= ch_cnt:
    print(1)
else:
    print(first_num)


Failing test case input:
299792458
1

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
s = input()
k = int(input())




ch_cnt = 0
first_num = 1

for ch in s:
    if ch != "1":
        first_num = int(ch)
        break
    ch_cnt += 1



if k <= ch_cnt:
    print(1)
else:
    print(first_num)
Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
s=input()
k=int(input())
for i in range(len(s)):
  if s[i]!="1":
    print(s[i])
    sys.exit()
print(1)


Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
import sys
s=input()
k=int(input())
for i in range(k):
  if s[i]!="1":
    print(s[i])
    sys.exit()
print(1)

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
k=int(input())
for x in s:
  if x==1:
    k-=1
    if k==0:
      print(1)
  else:
    print(x)
    exit()

Failing test case input:
1214
9

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
s=input()
k=int(input())
for x in s:
  if x=='1':
    k-=1
    if k==0:
      print(1)
      exit()
  else:
    print(x)
    exit()

Problem: p03282
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
S = input()
K = int(input())

ans = 1
for i in S:
	print(i,K)
	if i != '1':
		ans = i
		break
	if K==1:
		ans = i
		break
	K-=1
print(ans)

Failing test case input:
299792458
1794665

Expected output:
2


Actual output:
2 1794665
2


Fixed submission (verdict: Accepted):
S = input()
K = int(input())

ans = 1
for i in S:
	if i != '1':
		ans = i
		break
	if K==1:
		ans = i
		break
	K-=1
print(ans)

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
k = int(input())

sz = len(s)

for i in range(0, sz):
    if s[i] == '1':
        if i == k:
            print(1)
            break
    else:
        print(s[i])
        break

Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
s = input()
k = int(input())

sz = len(s)

for i in range(0, sz):
    if s[i] == '1':
        if i+1 == k:
            print(1)
            break
    else:
        print(s[i])
        break

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=input()
K=int(input())
for i in range(K):
    if S[i]=="1":
        continue
    else:
        print(S[i])
        break

Failing test case input:
1214
1

Expected output:
1


Actual output:

Fixed submission (verdict: Accepted):
S=input()
K=int(input())
for i in range(K):
    if S[i]=="1":
        continue
    else:
        print(S[i])
        exit()
print("1")

Problem: p03282
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
s = input()
k = int(input())

for i, v in enumerate(s):
  if i == k-1:
      print(1)
      exit()
  elif v != "1": 
      print(v)
      exit()

Failing test case input:
1214
2

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
s = input()
k = int(input())

for i, v in enumerate(s):
  if i == k-1:
      print(v)
      exit()
  elif v != "1": 
      print(v)
      exit()
Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = str(input())
k = int(input())
for i in s:
    if i != "1":
        print(str(i))
        break
    else:
        print("1")
        break


Failing test case input:
1214
17

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
s = str(input())
k = int(input())
for i in range(k):
    if s[i] != "1":
        print(s[i])
        exit()
print("1")

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = str(input())
K = int(input())

gosencho = 5 * (10**15)

for i in range(len(S)):
        if K <= 0:
                print(S[i-1])
                exit(0)
        elif S[i] != '1':
                K -= int(S[i]) * gosencho
        else:
                K -= 1

print(S[-1])

Failing test case input:
299792458
21272681179121983

Expected output:
2


Actual output:
9


Fixed submission (verdict: Accepted):
S = str(input())
K = int(input())

if len(S) == 1:
        print(S[0])
        exit(0)

i = 0
while S[i] == '1' and i <= len(S)-2:
        if K <= i + 1:
                print(S[i])
                exit(0)
        i += 1
print(S[i])

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
k = int(input())

for i, s in enumerate(S):
    if s == "1" and i < k:
        continue
    print(s)
    break
else:
    print(S[-1])

Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
S = input()
k = int(input())

for i, s in enumerate(S):
    if s == "1" and i + 1 < k:
        continue
    print(s)
    break
else:
    print(S[-1])

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
k=int(input())
for i in range(len(s)):
    if s[i]!=1:
        if (i+1)>=k:
            print("1")
        else:
            print(s[i])
        break

Failing test case input:
1214
4

Expected output:
2

Actual output:
1


Fixed submission (verdict: Accepted):
s=input()
k=int(input())
for i in range(k):
    if s[i]!="1":
        print(s[i])
        exit()
print("1")

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = str(input())
k = int(input())

if k == 1:
    print(s[0])
else:
    for i in s:
        if i != '1':
            print(i)
            quit()

print('1')

Failing test case input:
299792458
1

Expected output:
2


Actual output:
2
1


Fixed submission (verdict: Accepted):
s = str(input())
k = int(input())

for i in range(min(len(s),k)):
    if s[i] != '1':
        print(s[i])
        quit()

print('1')

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = list(input())
k = int(input())

if set(s[:k+1]) == set([1]):
    print(1)
else:
    for x in s[:k+1]:
        if x != '1':
            print(x)
            break


Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
s = list(input())
k = int(input())

if set(s[:k]) == set(['1']):
    print(1)
else:
    for x in s[:k+1]:
        if x != '1':
            print(x)
            break
Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = list(input())
k = input()

if k == '1':
    print(s[0])
else:
    n = min(int(k)-1, len(s))
    f = True
    for i in range(n):
        if s[i] != '1':
            print(s[i])
            f = False
    if f:
        print(s[n])

Failing test case input:
299792458
16007747457388278

Expected output:
2


Actual output:
2
9
9
7
9
2
4
5
8


Fixed submission (verdict: Accepted):
s = list(input())
k = input()

if k == '1':
    print(s[0])
else:
    n = min(int(k), len(s))
    f = True
    for i in range(n):
        if s[i] != '1':
            print(s[i])
            f = False
            break
    if f:
        print(1)

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = str(input())
k = int(input())
for i in s:
    if i != "1":
        print(str(i))
        break
    else:
        print("1")


Failing test case input:
1214
5

Expected output:
2


Actual output:
1
2


Fixed submission (verdict: Accepted):
s = str(input())
k = int(input())
for i in range(k):
    if s[i] != "1":
        print(s[i])
        exit()
print("1")

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=str(input())
k=int(input())
a=0
for i in range(len(s)):
    if s[i]=='1':
        pass
    else:
        a=1
        if i+1<=k:
            print(s[i])
        break
if a==0:
    print(1)
    

Failing test case input:
1214
1

Expected output:
1


Actual output:

Fixed submission (verdict: Accepted):
s=str(input())
k=int(input())
a=0
for i in range(len(s)):
    if s[i]=='1':
        pass
    else:
        if i+1<=k:
            print(s[i])
            a=1
        break
if a==0:
    print(1)

Problem: p03282
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
S=input()
K=int(input())
count=0
for i in range(len(S)):
  if S[i]==1:
    count+=1
  else:
    break
if count>=K:
  print(1)
else:
  print(S[count])

Failing test case input:
1214
4

Expected output:
2

Actual output:
1


Fixed submission (verdict: Accepted):
S=input()
K=int(input())
count=0
for i in range(len(S)):
  if int(S[i])==1:
    count+=1
  else:
    break

if count>=K:
  print(1)
else:
  print(S[count])

Problem: p03282
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s = input()
k = int(input())

f = 1

for c in s:
    if int(c) != 1:
        f = int(c)
        break

print(f)

Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
s = input()
k = int(input())

f = 1
d = 0

for c in s:
    if int(c) != 1:
        f = int(c)
        break
    else:
        d += 1

if d >= k:
    print(1)
else:
    print(f)

Problem: p03282
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
a = list(input())
k = int(input())

count = 0
for i in a:
    if i != 1:
        print(i)
        break


Failing test case input:
1214
5

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
a = list(input())
k = int(input())

for i in a:
    if i != '1':
        print(i)
        break
    k -= 1
    if k == 0:
        print('1')
        break
Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
K = int(input())

mark = 0
cnt = 0
for i in range(len(S)):
    if S[i] != '1':
        print(S[i])
        exit()
    else:
        cnt += 1
        if K == cnt:
            print('1')


Failing test case input:
1214
1

Expected output:
1


Actual output:
1
2


Fixed submission (verdict: Accepted):
S = input()
K = int(input())

mark = 0
cnt = 0
for i in range(len(S)):
    if S[i] != '1':
        print(S[i])
        exit()
    else:
        cnt += 1
        if K == cnt:
            print('1')
            exit()

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = list(map(int, input().split()))
k = int(input())

answer = 1
for i in range(min(k, len(s))):
    if s[i] != '1':
        answer = s[i]
        break

print(answer)

Failing test case input:
299792458
82342728260945

Expected output:
2


Actual output:
299792458


Fixed submission (verdict: Accepted):
s = input()
k = int(input())

answer = 1
for i in range(min(k, len(s))):
    if s[i] != '1':
        answer = s[i]
        break

print(answer)

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
K = int(input())
ret = "1"
for i in S:
    if i == "1":
        continue
    ret = i
    break
print(ret)


Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
S = input()
K = int(input())
ret = "1"
for i in range(K):
    if len(S) < i-1:
        break
    if S[i] != "1":
        ret = S[i]
        break
print(ret)

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
k = int(input())

flag  = 0

for i in s:
    if i == "1":
        continue
    else:
        print(i)
        flag = 1
        break

if flag == 0:
    print("1")

Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
s = input()
k = int(input())

flag  = 0

for i in range(k):
    if s[i] == "1":
        continue
    else:
        print(s[i])
        flag = 1
        break

if flag == 0:
    print("1")

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = [int(c) for c in input()]
K = int(input())

if sum(S) == len(S):
    print(1)
    exit()

for i in range(len(S)):
    if S[i] != 1:
        print(S[i])
        exit()


Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
S = [int(c) for c in input()]
K = int(input())

if sum(S) == len(S):
    print(1)
    exit()

for i in range(K):
    if S[i] != 1:
        print(S[i])
        exit()
print(1)
Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = input()
b = int(input())
c = 0
for i in range(len(a)):
    if a[i] == "1":
        c = i
    else:
        break
if b > c:
    print(a[i])
else:
    print("1")


Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
a = input()
b = int(input())
c = 0
d = ""
for i in range(len(a)):
    if a[i] == "1":
        c += 1
    else:
        d = a[i]
        break
if b <= c:
    print(1)
else:
    print(d)

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
k=int(input())
for i in range(len(s)):
    if s[i]!="1":
        print(s[i])
        break

Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
s=input()
k=int(input())
for i in range(k):
    if s[i]!="1":
        print(s[i])
        break
    if i==k-1:
        print(1)

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
k = int(input())
ans = 1
for i in s:
    if i!= '1':
        ans = i
        break
print(ans)

Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
s = input()
k = int(input())
ans = '1'
for i in range(k):
    if s[i]!= '1':
        ans = s[i]
        break
print(ans)

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
k=int(input())

isOne=True
for i in range(max(k, len(s))):
  if s[i]!="1":
    isOne=False
    ans=s[i]
    break
if isOne:
  print(1)
else:
  print(ans)

Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
s=input()
k=int(input())

isOne=True
for i in range(min(k, len(s))):
  if s[i]!="1":
    isOne=False
    ans=s[i]
    break
if isOne:
  print(1)
else:
  print(ans)

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
K = int(input())
ans = "1"
for i in range(len(S)):
  if S[i] != "1":
    ans = S[i]
    break
  if i > K:
    break
print(ans)

Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
S = input()
K = int(input())
ans = "1"
for i in range(len(S)):
  if i >= K:
    break
  if S[i] != "1":
    ans = S[i]
    break

print(ans)

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
k = int(input())

for c in s:
  if c != '1':
    print(c)
    exit()
  else:
    continue
print(1)

Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
s = input()
k = int(input())

for c in s:
  if c != '1':
    print(c)
    exit()
  else:
    k -= 1
    if k == 0:
      print(1)
      exit()
print(1)
Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
k = int(input()) - 1
 
cnt1 = 0
for i in range(len(s)):
  if s[i] == '1':
    cnt1 += 1
  else:
    break
 
print(cnt1, k)
if cnt1 > k:
  print(1)
else:
  print(s[cnt1])

Failing test case input:
299792458
415291

Expected output:
2


Actual output:
0 415290
2


Fixed submission (verdict: Accepted):
s = input()
k = int(input()) - 1
 
cnt1 = 0
for i in range(len(s)):
  if s[i] == '1':
    cnt1 += 1
  else:
    break
 

if cnt1 > k:
  print(1)
else:
  print(s[cnt1])

Problem: p03282
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
S = input()
K = int(input())

if len(S) >= K and S[K-1] == 1:
    print(1)
    exit()
else:
    for s in S:
        if s == "1":
            continue
        else:
            print(s)
            break

Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
S = input()
K = int(input())

flag = 0
for idx, s in enumerate(S):
    if idx == K-1 and s == "1":
        break
    if s == "1":
        continue
    else:
        flag = 1
        print(s)
        break
if flag == 0:
    print(1)

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
k = int(input())
for i in range(k):
    if s[i] !=1:
        print(int(s[i]))
        exit()
print(1)

Failing test case input:
1214
8

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
S = input()
K = int(input())

for i in range(K):
    if int(S[i]) != 1:
        print(int(S[i]))
        exit()
print(1)

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

s = input()
k = int(input())
flg = False
for i in s:
    if i != "1":
        print(i)
        flg = True
        break
if not flg:
    print(s[0])

Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):

s = input()
k = int(input())
flg = False
for i in s[:k]:
    if i != "1":
        print(i)
        flg = True
        break
if not flg:
    print(1)

Problem: p03282
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s = input()
k = int(input())

if len(s) == 1:
  print(s)
else :
  for i in range(len(s)):
    if s[i] != "1":
      print(s[i])
      break

Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
s = input()
k = int(input())

answer = 1
if len(s) == 1:
  answer = s
else :
  for i in range(k):
    if s[i] != "1":
      answer = s[i]
      break
print(answer)

Problem: p03282
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
S,K=list(input()),int(input())
for i in S:
    if i!='1':
        print(i)
        exit()

Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
S,K=list(input()),int(input())
for i in S:
    K-=1
    if i!='1'or K==0:
        print(i)
        exit()
Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
n = int(input())

for i in s:
    if i != "1":
        print(i)
        break
else:
    print(1)

Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
s = input()
n = int(input())
 
count = 0
for i in s:
    count+=1
    if i != "1" or count == n:
        print(i)
        break
else:
    print(1)

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
for i in list(input()):
  if i != "1":
    print(i)
    exit()
else:
  print(1)

Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
n=input()
k=int(input())
for i in range(k):
  if n[i] != "1":
    print(n[i])
    exit()
else:
  print(1)

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import os, sys, re, math

lines = sys.stdin.readlines()

S = lines[0]
K = lines[1]

for i in range(len(S)):
    c = S[i]
    if i == K:
        print (c)
        break
    else:
        if c != '1':
            print (c)
            break


Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
import os, sys, re, math

lines = sys.stdin.readlines()

S = lines[0]
K = lines[1]

for i in range(len(S)):
    c = S[i]
    if i + 1 == int(K):
        print (c)
        break
    else:
        if c != '1':
            print (c)
            break

Problem: p03282
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
S=input()
K=input()
num=-1
K=1
for i in range(len(S)):
    if S[i]!="1":
        num=i
        K=int(S[i])
        break
if K-1<num:
    print(1)
else:
    print(K)


Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
S=input()
K=int(input())
num=100000
for i in range(len(S)):
    if S[i]!="1":
        num=i
        T=int(S[i])
        break
if K-1<num:
    print(1)
else:
    print(T)

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = list(input())
k = int(input())
if len(s) == 1:
    print(s)
elif k == 1:
    print(s[0])
else:
    for i in range(len(s)):
        if s[i] != "1":
            print(s[i])
            break

Failing test case input:
3
74

Expected output:
3


Actual output:
3

Fixed submission (verdict: Accepted):
import sys
s = list(input())
k = int(input())
if len(s) == 1:
    print(s[0])
elif k == 1:
    print(s[0])
else:
    for i in range(k):
        if s[i] != "1":
            print(s[i])
            sys.exit()
    print(1)

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
k = int(input())
answer = 0


if s[0]!= '1' and len(s)>1:
    answer = s[0]
else:
    if k ==0 or len(s)==1:
        answer =s[0]
    else:
        answer =s[1]

print(answer)

Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
s = input()
k = int(input())
answer = 0
sub = 0
count = len(s)

for i in range(len(s)):
    if s[i]!='1':
        count = min(i,count)

if k <= count:
    answer = '1'
else:
    answer = s[count]
print(answer)
Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
k = int(input())
ans = 0
count = 0
for i in range(len(s)):
    if k == "1":
        count += 1
        if count == k:
            ans = 1
            break
    else:
        ans = s[i]
        break
print(ans)

Failing test case input:
1214
2

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
s = input()
k = int(input())
count = 0
ans = 0
for i in range(len(s)):
    if s[i] == "1":
        count += 1
        if count == k:
            ans = 1
            break
    else:
        ans = s[i]
        break
print(ans)

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=int(input())
k=int(input())

for i in range(len(str(s))):
    if str(s)[i]!='1':
        print(str(s)[i])
        exit()
print(1)
   

Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
s=int(input())
k=int(input())

for i in range(min(len(str(s)),k)):
    if str(s)[i]!='1':
        print(str(s)[i])
        exit()
print(1)

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
k = int(input())


def ans():
    if len(S) == 1:
        return S
    else:
        for i in range(len(S)):
            if i + 1 == k:
                return 1
            if S[i] != '1':
                return S[i]
    
    return 1


print(ans())


Failing test case input:
299792458
1

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
S = input()
k = int(input())


def ans():
    if len(S) == 1:
        return S
    else:
        for i in range(len(S)):
            if i + 1 == k:
                return S[i]
            if S[i] != '1':
                return S[i]

    return 1


print(ans())

Problem: p03282
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
s = input()
k = int(input())
flag = False
for i in range(len(s)):
    if s[i] != '1':
        id = s[i]
        flag = True
        break
if flag:
    print(id)
else:
    print(1)


Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
s = input()
k = int(input())
flag = False
for i in range(k):
    if s[i] != '1':
        id = s[i]
        flag = True
        break
if flag:
    print(id)
else:
    print(1)

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
import math

s=input()
k = int(input())
cnt = False
ans=0
for i in range(0,k):
    if s[i] != '1':
        ans = s[i]
        cnt = True
        break
    cnt+=1
if (not cnt):
    print(1)
else:
    print(ans)


Failing test case input:
1214
1

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
import sys
import math

s=input()
k = int(input())
cnt = False
ans=0
for i in range(0,k):
    if s[i] != '1':
        ans = s[i]
        cnt = True
        break
if (not cnt):
    print(1)
else:
    print(ans)
Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
K = input()
f = True
for s in S:
  if s != "1":
    print(s)
    f = False
    break
if f:
  print("1")

Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
S = input()
K = int(input())
f = True
for i in range(K):
  if S[i] != "1":
    print(S[i])
    f = False
    break
if f:
  print(1)

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from sys import stdin
S = (stdin.readline().rstrip())
K = int(stdin.readline().rstrip())
cnt = 0
for i in S:
    if i == "1":
        cnt += 1
    else:
        ans = int(i)
if cnt >= K:
    ans = 1
print(ans)

Failing test case input:
299792458
6594324861078428

Expected output:
2


Actual output:
8


Fixed submission (verdict: Accepted):
from sys import stdin
S = (stdin.readline().rstrip())
K = int(stdin.readline().rstrip())
cnt = 0
for i in S:
    if i == "1":
        cnt += 1
    else:
        ans = int(i)
        break
if cnt >= K:
    ans = 1
print(ans)

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = str(input())
K = int(input())

gosencho = 5 * (10**15)

for i in S:
        if i != '1':
                K -= int(i) * gosencho
        else:
                K -= 1
        if K <= 0:
                print(i)
                exit(0)

Failing test case input:
299792458
27784678339588086

Expected output:
2


Actual output:
9


Fixed submission (verdict: Accepted):
S = str(input())
K = int(input())

if len(S) == 1:
        print(S[0])
        exit(0)

i = 0
while S[i] == '1' and i <= len(S)-2:
        if K <= i + 1:
                print(S[i])
                exit(0)
        i += 1
print(S[i])

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=list(input())
k=int(input())
if len(n)==1:
  print('1')
else:
  one_list=[]
  while len(n)!=0:
    if n[0]=='1':
      one_list.append(n.pop(0))
    else:
      break
  print(one_list)
  if k<=len(one_list):
    print('1')
  else:
    print(n[0])

Failing test case input:
299792458
642

Expected output:
2


Actual output:
[]
2


Fixed submission (verdict: Accepted):
n=list(input())
k=int(input())
if len(n)==1 and n[0]=='1':
  print('1')
else:
  one_list=[]
  while len(n)!=0:
    if n[0]=='1':
      one_list.append(n.pop(0))
    else:
      break
  if k<=len(one_list):
    print('1')
  else:
    print(n[0])

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
k = int(input())
for i in range(len(s)):
    if s[i] != "1":
        if k < i:
            print(1)
        else:
            print(s[i])
        break
else:
    print(1)

Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
s = input()
k = int(input())
for i in range(len(s)):
    if s[i] != "1":
        if k < i+1:
            print(1)
        else:
            print(s[i])
        break
else:
    print(1)
Problem: p03282
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
5*10**15
S=input()
K=int(input())

if set(S[:K])=={1}:
    print('1')
else:
    for i in range(len(S)):
        if S[i]!='1':
            print(S[i])
            break

Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
5*10**15
S=input()
K=int(input())
if set(list(S[:K]))=={'1'}:
    print('1')
else:
    for i in range(len(S)):
        if S[i]!='1':
            print(S[i])
            break

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

S=input()
K=int(input())
flag=0
c=0
for i in (S):
    
    if int(i)!=1:
        print(i)
        flag=1
        break
    else:
        c+=1
        if c>K:
            print(1)
            flag=1
            break

if flag==0:
    print(1)


Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):

S=input()
K=int(input())
flag=0
c=0
for i in (S):
    if int(i)!=1:
        print(i)
        flag=1
        break
    else:
        c+=1
        if c>=K:
            print(1)
            flag=1
            break

if flag==0:
    print(1)

Problem: p03282
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
S = input()
K = int(input())

for s in S[:K+1]:
    if s != "1": 
      print(s)
      break
    else:
      print(1)
    

Failing test case input:
1214
3

Expected output:
2


Actual output:
1
2


Fixed submission (verdict: Accepted):
S = input()
K = int(input())

idx = min(K, len(S))
for s in S[:idx]:
    if s != "1": 
      print(s)
      break
else:
  print(1)

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
K = int(input())

for i in S:
  if i != S[0]:
    print(i)
    exit()
    
print(S[0])

Failing test case input:
299792458
337959

Expected output:
2


Actual output:
9


Fixed submission (verdict: Accepted):
S = input()
K = int(input())

c = "1"

for i in range(K):
  if S[i] != "1":
    c = S[i]
    break
print(c)

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = list(input())
K = int(input())

S = [int(e) for e in set(S)]
number = 0
days = 5 * 10**15
for e in S:
    result = 1
    if e == 1:
        number += 1
        continue
    for f in range(1,days + 1):
        number = e**f
        if number >= K:
            print(e)
            exit()

Failing test case input:
299792458
2

Expected output:
2


Actual output:
8


Fixed submission (verdict: Accepted):
S = list(input())
K = int(input())

S = [int(e) for e in S]
days = 5 * 10**15
for e in S:
    result = 1
    if e == 1:
        K -= 1
        if K <= 0:
            print(e)
            exit()
        continue
    for f in range(days):
        result *= e
        if K - result <= 0:
            print(e)
            exit()
        if f == days - 1:
            K -= result
Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = list(input())
k = int(input())
if len(s) <= 1:
    print(s[0])
else:
    if s[0] == '1':
        print(s[1])
    else:
        print(s[0])


Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
s = list(input())
k = int(input())

if k == 1:
    print(s[0])
else:
    for i in range(len(s)):
        if i+1 >= k or s[i] != '1':
            print(s[i])
            break

Problem: p03282
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
S = list(input())
K = int(input())
for i in range(min(len(S),K)):
    if S[i] != 1:
        print(S[i])
        exit()
print(1)

Failing test case input:
1214
2

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
S = list(input())
K = int(input())
for i in range(min(len(S),K)):
    if S[i] != "1":
        print(int(S[i]))
        exit()
print(1)

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
K = int(input())

if len(S)==1:
    print(S[0])
    quit()

if K == 1:
    print(S[0])
    quit()

n = 0
while n < len(S):
    if S[n] != '1':
        break
    else:
        n += 1

if K-1 <= n:
    print(1)
else:
    print(S[n])

Failing test case input:
1214
2

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
S = input()
K = int(input())

if len(S)==1:
    print(S[0])
    quit()

if K == 1:
    print(S[0])
    quit()

n = 0
while n < len(S):
    if S[n] != '1':
        break
    else:
        n += 1

if K <= n:
    print(1)
else:
    print(S[n])

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
s = list(map(int,list(input())))
k = int(input())
for item in s:
  if item == 1:
    k -= 1
  else:
    k -= math.log10(item)*5000000000000000
  if k <= 0:
    print(item)
    break

Failing test case input:
299792458
8652975297679381

Expected output:
2


Actual output:
9


Fixed submission (verdict: Accepted):
s = list(map(int,list(input())))
k = int(input())
for item in s:
  if item == 1:
    k -= 1
  else:
    k -= 1000000000000000000
  if k <= 0:
    print(item)
    break

Problem: p03282
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
s=input()
n=len(s)
k=int(input())
t=5*10**15
for i in range(n):
    a=int(s[i])
    if a==1:
        k-=1
    else:
        k-=a*t
    if k<=0:
        print(a)
        break

Failing test case input:
299792458
11289796998184320

Expected output:
2


Actual output:
9


Fixed submission (verdict: Accepted):
s=input()
n=len(s)
k=int(input())
t=5*10**15
for i in range(n):
    a=int(s[i])
    if a==1:
        k-=1
    else:
        print(a)
        break
    if k<=0:
        print(1)
        break
Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
K = int(input())

DAY = 5000000000000000

count1 = 0
for c in S:
    if c == '1':
        count1 += 1
    else:
        break
next_c = c

if K <= DAY * count1:
    print('1')
else:
    print(next_c)


Failing test case input:
1214
9

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
S = input()
K = int(input())


count1 = 0
for c in S:
    if c == '1':
        count1 += 1
    else:
        break
next_c = c

if K <= count1:
    print('1')
else:
    print(next_c)

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = str(input())
k = int(input())
ans=0
m=0
for x in s:
  if(int(x)==1):
    continue
    m+=1
  else:
    ans=int(x)
    break

if m<k:
  print(ans)
else:
  print(1)


Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
s = str(input())
k = int(input())
ans=0
m=0
for x in s:
  if(int(x)==1):
    m+=1
    continue
  else:
    ans=int(x)
    break

if m<k:
  print(ans)
else:
  print(1)

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
K = int(input())
if S[0]*len(S) == S and S[0] == "1":
    print("1")
else:
    ans = 0
    ind = 0
    for i in range(len(S)):
        if S[i] != "1":
            ans = S[i]
            ind = i+1
    if ind > K:
        print("1")
    else:
        print(ans)

Failing test case input:
299792458
5161700883731392

Expected output:
2


Actual output:
8


Fixed submission (verdict: Accepted):
S = input()
K = int(input())
if S[0]*len(S) == S and S[0] == "1":
    print("1")
else:
    ans = 0
    ind = 0
    for i in range(len(S)):
        if S[i] != "1":
            ans = S[i]
            ind = i+1
            break
    if ind > K:
        print("1")
    else:
        print(ans)

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
k = int(input())
for i in range(min(k,len(s))):
    if s[i] != 1:
        print(s[i])
        exit()
else:
    print(1)

Failing test case input:
1214
2

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
s = input()
k = int(input())
for i in range(min(k,len(s))):
    if s[i] != "1":
        print(s[i])
        exit()
else:
    print(1)

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
k = int(input())
for i in s:
    if i!='1':
        print(i)
        break

Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
s = input()
k = int(input())
for i in range(k):
    if s[i]!='1':
        break
print(s[i])

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
k=int(input())
for i in range(len(s)):
    if s[i]!=1:
        print(s[i])
        break

Failing test case input:
1214
8

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
s=input()
k=int(input())
for i in range(k):
    if s[i]!="1":
        print(s[i])
        exit()
print("1")
Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
k=int(input())
if s.count("1")==len(s):
    print(1)
else:
    for i in s:
        if i!="1":
            print(i)
            break


Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
s=input()
k=int(input())

for i in range(len(s)):
    if s[i] != "1":
        print(s[i])
        break
    else:
        k-=1
        if k==0:
            print(1)
            break

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
K = int(input())


C = '1'
for i in S:
    if i != '1':
        C = i
        break
print(C)

Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
S = input()
K = int(input())


C = '1'
for i in range(len(S)):
    if S[i] != '1' or i+1 == K:
        C = S[i]
        break
print(C)

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = list(input())
N, = list(map(int,input().split()))

ans = 1

for i in range(len(S)):
    if  not S[i] == '1':
        ans = int(S[i])
        break
        
print(ans)


Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
S = list(input())
N, = list(map(int,input().split()))

ans = 1
num_1 = 0

for i in range(len(S)):
    if  not S[i] == '1':
        ans = int(S[i])
        break
    else:
        num_1 += 1

if  len(S) == 1:
    ans = int(S[0])
if  num_1 >= N:
    ans = 1
        
print(ans)

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
K = int(input())
not_one = '1'
for s in S:
  if s != '1':
    not_one = s
    break
    
print(not_one)

Failing test case input:
1214
1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
S = input()
K = int(input())
not_one = '1'
count = 0
for s in S:
  if s != '1':
    not_one = s
    break
  count += 1

if K <= count:
  print('1')
else:
  print(not_one)

Problem: p03282
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
k = int(input())

for i in range(k):
    if s[i] == 1:
        continue
    else:
        print(s[i])
        exit()
        
print(1)

Failing test case input:
1214
7

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
s = input()
k = int(input())

for i in range(k):
    if int(s[i]) == 1:
        continue
    else:
        print(s[i])
        exit()
        
print(1)

Problem: p03282
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a=input()
b=int(input())
c=0
if a[0]!="1":
  print(a[0])
if a[0]=="1":
  for i in range(len(a)-1):
    if a[i]=="1" and a[i+1]=="1":
      c=c+1
    else:
      break
if c>=b:
  print(1)
else:
  print(a[c-1])


Failing test case input:
3
142

Expected output:
3


Actual output:
3
3


Fixed submission (verdict: Accepted):
a=input()
b=int(input())
c=1
if a[0]!="1":
  print(a[0])
if a[0]=="1":
  for i in range(len(a)-1):
    if a[i]=="1" and a[i+1]=="1":
      c=c+1
    else:
      break
  if c>=b:
    print(1)
  else:
    print(a[c])