Problem:


﻿Score: 300 points

Problem Statement

Mr. Infinity has a string S consisting of digits from 1 to 9. Each time the date changes, this string changes as follows:

Each occurrence of 2 in S is replaced with 22. Similarly, each 3 becomes 333, 4 becomes 4444, 5 becomes 55555, 6 becomes 666666, 7 becomes 7777777, 8 becomes 88888888 and 9 becomes 999999999. 1 remains as 1.

For example, if S is 1324, it becomes 1333224444 the next day, and it becomes 133333333322224444444444444444 the day after next.
You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

Constraints

S is a string of length between 1 and 100 (inclusive).

K is an integer between 1 and 10^{18} (inclusive).

The length of the string after 5 \times 10^{15} days is at least K.

Input

Input is given from Standard Input in the following format:

S
K

Output

Print the K-th character from the left in Mr. Infinity's string after 5 \times 10^{15} days.

Sample Input 1

1214
4

Sample Output 1

2

The string S changes as follows:  

Now: 1214

After one day: 12214444

After two days: 1222214444444444444444

After three days: 12222222214444444444444444444444444444444444444444444444444444444444444444

The first five characters in the string after 5 \times 10^{15} days is 12222. As K=4, we should print the fourth character, 2.

Sample Input 2

3
157

Sample Output 2

3

The initial string is 3. The string after 5 \times 10^{15} days consists only of 3.

Sample Input 3

299792458
9460730472580800

Sample Output 3

2



Sample input:
1214
4


Sample output:
2

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

s = input()
n = len(s)
k = I()
for i in range(n):
    if s[i] != '1':
        break
else:
    print(1)
    quit()
if k <= i+1:
    print(1)
else:
    print(s[i])

Submission status: Wrong Answer

Solution code:
S = input()
print(S) if len(S) == 1 else print([S[0],S[1]][S[0] == '1'])

Submission status: Wrong Answer

Solution code:
a = input()
k = int(input())
b = list(a)
if k == 1:
    print(b[0])
elif int(b[0]) == 1:
    print(b[1])
else:
    print(b[0])

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = list(input())
k = int(input())
if len(s) == 1:
    print(s)
elif k == 1:
    print(s[0])
else:
    for i in range(k):
        if s[i] != "1":
            print(s[i])
            exit()
    print(s[k-1])

Submission status: Wrong Answer

Solution code:
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

Submission status: Wrong Answer

Solution code:
s = list(input())
k = int(input())
if s[0] == "1":
    print(1)
elif len(s) == 1:
    print(s)
else:
    print(s[0])

Submission status: Wrong Answer

Solution code:
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

Submission status: Wrong Answer

Solution code:
5*10**15
S=input()
K=int(input())

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys


def solve(S: int, K: int):
    s = str(S)
    for i in s:
        if i != '1':
            print(i)
            break
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    solve(S, K)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
s=list(input())
k=int(input())
cnt=0
ans=0
for i in s:
    if i =="1":
        cnt+=1
        continue
    else:
        if cnt<k:
            print(i)
        else:
            print("1")
        break

Submission status: Wrong Answer

Solution code:
s=list(input())
k=int(input())
for i in s:
    if i =="1":
        continue
    else:
        print(i)
        break

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())

if k == 1:
    print(s[0])
elif s[0] != '1':
    print(s[0])
else:
    print(s[1])

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
if k == 1:
  print(s[0])
else:
  if s[0] == '1':
    for i in range(len(s)):
      if s[i] != '1':
        print(s[i])
        exit()
    print(s[1])
  else:
    print(s[0])

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
if k == 1:
  print(s[0])
else:
  if s[0] == '1':
    print(s[1])
  else:
    print(s[0])

Submission status: Wrong Answer

Solution code:
c = 5*pow(10, 14)
list_N = list(input())
k = int(input())
cnt = 0
ans = 0

for i in list_N:
    i = int(i)
    if i != 1:
        ans = i
        break

print(ans)

Submission status: Wrong Answer

Solution code:
c = 5*pow(10, 14)
list_N = list(input())
k = int(input())
cnt = 0
ans = 0

for i in list_N:
    i = int(i)
    cnt += pow(i, c)
    if cnt > k:
        ans = i
        break

print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
l = len(s)

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

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
l = len(s)

for i in range(l):
  if s[i] != "1":
    print(s[i])
    exit()

Submission status: Wrong Answer

Solution code:
def main(s, k):
    for i, si in enumerate(s):
        if i == k - 1:
            print(1)
            return

        if si != "1":
            print(si)
            return
    
    print(1)

if __name__ == "__main__":
    s = input()
    k = int(input())

    main(s, k)

Submission status: Wrong Answer

Solution code:
def main(s, k):
    for i, si in enumerate(s):
        if i == k - 1:
            print(1)
            return

        if si != "1":
            print(si)
            return


if __name__ == "__main__":
    s = input()
    k = int(input())

    main(s, k)

Submission status: Wrong Answer

Solution code:
def main(s, k):
    for i in s:
        if i != "1":
            print(i)
            return
    
    print(1)

if __name__ == "__main__":
    s = input()
    k = int(input())

    main(s, k)

Submission status: Wrong Answer

Solution code:
def main(s, k):
    for i in s:
        if i != "1":
            print(i)
            return


if __name__ == "__main__":
    s = input()
    k = int(input())

    main(s, k)

Submission status: Wrong Answer

Solution code:
s=input()
k=int(input())
ans=-1
for i in s:
    if i!='1':
        ans=int(i)
        break
print(ans) if ans!=-1 else print('1')

Submission status: Wrong Answer

Solution code:
s=input()
k=int(input())
ans=-1
for i in s:
    if i!='0' and i!='1':
        ans=int(i)
        break
print(ans) if ans!=-1 else print(s[k-1])

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())
if K == 1:
  print(S[0])
  quit()

if S[0] == '1':
  print(S[1])
else:
  print(S[0])

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())
if list(set(S)) == ["1"]:
    print(1)
elif S[0] == "1" and K > 1:
    ind = 1
    while S[ind] == "1":
        ind += 1
    if ind > K:
        print(S[ind])
    else:
        print(1)
else:
    print(S[0])

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())
if list(set(S)) == ["1"]:
    print(1)
elif S[0] == "1" and K > 1:
    ind = 1
    while S[ind] == "1":
        ind += 1
    print(S[ind])
else:
    print(S[0])

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())

if s[0] != '1':
    print(s[0])
else:
    if k == 1:
        print(s[0])
    else:
        print(s[1])

Submission status: Wrong Answer

Solution code:

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

for i in range(min(k,len(s))):
    if s[i] != "1":
        print(int(s[i]))
        break
print(1)

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())

import sys

if S[0] == "1":
    for i in range(1,len(S)):
        if S[i] != "1":
            print(S[i])
            sys.exit()
    print(S[0])
else:
    print(S[0])

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())

ans = S[0]

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

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())

ans = "1"

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
s = input()
k = int(input())

for i in range(k):
    if s[i] != '1':
        print(s[i])
        break
print(1)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
s = input()
k = int(input())

for i in range(k):
    if s[i] != '1':
        print(s[i])
        break

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
for i in s:
    if i != "1":
        print(i)
        exit()
print(1)

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
if k <= len(s) :
         for i in range(k):
                  if s[i] != "1":
                           print(s[i])
                           exit()
         print("1")
for i in range(len(s)):
         if s[i] != "1":
                  print(s[i])
                  exit()

Submission status: Wrong Answer

Solution code:
def resolve():
    S = input()
    s = [int(c) for c in S]
    K = int(input())
    
    if len(s) == 1:
        print(s[0])
    else:
        if K == 1:
            print(s[0])
        else:
            for i in range(len(s)):
                if s[i] != 1:
                    print(s[i])
                    break


resolve()

Submission status: Wrong Answer

Solution code:
# import bisect
# from collections import Counter, deque
# import copy
# from fractions import gcd
# from functools import reduce
# from itertools import accumulate, permutations, combinations, combinations_with_replacement, groupby, product
# import math
# import numpy as np
import sys

sys.setrecursionlimit(10 ** 5 + 10)


# input = sys.stdin.readline

def resolve():
    S = input()
    s = [int(c) for c in S]
    K = int(input())
    
    if len(s) == 1:
        print(s[0])
    else:
        if K == 1:
            print(s[0])
        else:
            for i in range(len(s)):
                if s[i] != 1:
                    print(s[i])
                    break


resolve()

Submission status: Wrong Answer

Solution code:
# import bisect
# from collections import Counter, deque
# import copy
# from fractions import gcd
# from functools import reduce
# from itertools import accumulate, permutations, combinations, combinations_with_replacement, groupby, product
# import math
# import numpy as np
import sys

sys.setrecursionlimit(10 ** 5 + 10)


# input = sys.stdin.readline

def resolve():
    S = input()
    s = [int(c) for c in S]

    K = int(input())
    if len(s) == 1:
        print(s[0])
    elif K == 1:
        print(s[0])
    else:
        for i in range(len(s)):
            if s[i] != 1:
                print(s[i])
                break


resolve()

Submission status: Wrong Answer

Solution code:
# import bisect
# from collections import Counter, deque
# import copy
# from fractions import gcd
# from functools import reduce
# from itertools import accumulate, permutations, combinations, combinations_with_replacement, groupby, product
# import math
# import numpy as np
import sys
sys.setrecursionlimit(10 ** 5 + 10)
# input = sys.stdin.readline

def resolve():

    S = input()
    s = [int(c) for c in S]

    K=int(input())
    if len(s)==1:
        print(s[0])
    elif K==1:
        print(s[0])
    else:
        for i in s:
            if i!=1:
                print(i)
                break



resolve()

Submission status: Wrong Answer

Solution code:
# import bisect
# from collections import Counter, deque
# import copy
# from fractions import gcd
# from functools import reduce
# from itertools import accumulate, permutations, combinations, combinations_with_replacement, groupby, product
# import math
# import numpy as np
import sys
sys.setrecursionlimit(10 ** 5 + 10)
# input = sys.stdin.readline

def resolve():

    S = input()
    s = [int(c) for c in S]

    K=int(input())
    if K==1:
        print(s[0])
    else:
        for i in s:
            if i!=1:
                print(i)
                break



resolve()

Submission status: Wrong Answer

Solution code:
s=str(input())
k=int(input())

if k==1 or s=="1":
    print(s[0])
    exit()

if s[0]=="1":
    print(s[1])
else:
    print(s[0])

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
flag = True

if len(s)==1:
    print(int(s))
    exit()

new = ''
for i in s:
    if i!='1':
        flag = False
        new += i

if flag:
    print(1)
else:
    print(new[0])

Submission status: Wrong Answer

Solution code:
from sys import stdin
def main():
    #入力
    readline=stdin.readline
    S=readline().strip()
    K=int(readline())

    if len(S)==1:
        print(S[0])
    elif K==1:
        print(S[0])
    else:
        if S[0]!="1":
            print(S[0])
        else:
            print(S[1])

if __name__=="__main__":
    main()

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())
f1 = min([i for i in range(len(S)) if S[i] == '1'] + [len(S)])
if f1 == len(S):
    print(S[0])
else:
    print("1" if f1 + 1 >= K else S[f1 + 1])

Submission status: Wrong Answer

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()

def main():
    S = input()
    for i in list(S):
        if i != '1':
            print(i)
            exit()
    print('1')

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())

if s.count('1') == len(s):
    print(1)
else:
    for c in s:
        if c != '1':
            print(c)
            exit()

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())

for i in range(len(S)):
    if(S[i] == "1"):
        if(i == len(S)-1 and S[i] == "1"):
            print(1)
        else:    
            continue
    else:
        print(S[i])
        break

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())

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

Submission status: Wrong Answer

Solution code:
S=input()
K=float(input())
lis=list(S)
ss=set(lis)

if len(ss)==1:
  print(S[0])
else:
  for num in lis:
    if int(num)!=1:
      print(num)
      break

Submission status: Wrong Answer

Solution code:
S = list(input())
K = int(input())

if S.count('1') == len(S):
    print(1)
    exit(0)
for s in S:
    if s != '1':
        print(s)
        exit(0)

Submission status: Wrong Answer

Solution code:
S = list(input())
K = int(input())

if S.count('1') == len(S):
    print(1)
for s in S:
    if s != '1':
        print(s)
        exit(0)

Submission status: Wrong Answer

Solution code:
S = list(input())
K = int(input())

for s in S:
    if s != '1':
        print(s)
        exit(0)

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())

for elem in s:
  if int(elem) == 1:
    if k == 1:
      print(elem)
      break
    else:
      pass
  else:
    print(elem)
    break

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())

if len(s) == 1:
    print(s)
    exit()

if s[0] == '1':
    print(s[1])
else:
    print(s[0])

Submission status: Wrong Answer

Solution code:
s = str(input())
k = int(input())

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

print('1')

Submission status: Wrong Answer

Solution code:
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')

Submission status: Wrong Answer

Solution code:
s = str(input())
k = int(input())

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

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())

if S[0] == "1" and len(S) > 1:
    print(S[1])
else:
    print(S[0])

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())
ans = "1"
for i in range(K):
  if S[i] != "1":
    ans = i
    break
print(ans)

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())
ans = "1"
for i in S:
  if i != "1":
    ans = i
    break
print(ans)

Submission status: Wrong Answer

Solution code:
s = list(str(input()))
s = list(map(int, s))
k = int(input())

flag = True
for i in range(len(s)):
    if s[i] != 1:
        flag = False
    else:
        pass

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

Submission status: Wrong Answer

Solution code:
s = list(str(input()))
s = list(map(int, s))
k = int(input())

if k == 1:
    print(s[0])
else:
    flag = True
    for i in range(len(s)):
        if s[i] == 1:
            pass
        else:
            print(s[i])
            flag = False
            break

    if flag:
        print(1)

Submission status: Wrong Answer

Solution code:
s = list(str(input()))
s = list(map(int, s))
k = int(input())

flag = True
for i in range(len(s)):
    if s[i] == 1:
        pass
    else:
        print(s[i])
        flag = False
        break

if flag:
    print(1)

Submission status: Wrong Answer

Solution code:
import sys

S = input()
K = int(input())

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

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())

for i, c in enumerate(s):
  if c != "1":
    print(c)
    break
  if i >= k:
    print(1)
    break
else:
  print(1)

Submission status: Wrong Answer

Solution code:
import sys
S = input()
K = int(input())
if len(S) == 1:
  print(S)
  sys.exit(0)
if K == 1:
  print(S[0])
i = 0
while i<len(S):
  if S[i] == '1':
  	i += 1
  else:
    break
if i < len(S):
  keep = S[i]
else:
  keep = S[i-1]
if K <= i:
  print(1)
  sys.exit(0)
else:
  if S[0] != '1':
    print(S[0])
  else:
	  print(keep)

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())

if s.count('1') == len(s) or k == 1 and s[k-1] == '1':
    print(1)
else:
    for i in range(len(s)):
        if s[i] != '1':
            print(s[i])
            break

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())

S = []

for i in s:
    S.append(i)





if k == 1:
    print(S[0])
elif S[0] != "1":
    print(S[0])
else:
    print(S[1])

Submission status: Wrong Answer

Solution code:
#abc106 c
s=input()
k=int(input())
ans="1"
if len(s)!=s.count("1"):
    for c in s:
        if c!="1":
            ans=c
            break
print(ans)

Submission status: Wrong Answer

Solution code:
S = list(input())
for i in range(len(S)):
    S[i] = int(S[i])

K = int(input())

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

if K > 100:
    print(start)
elif K-1 >= loc:
    print(start)
else:
    print(1)

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())

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

Submission status: Wrong Answer

Solution code:
s=input()
k=int(input())
for i in range(k):
  if s[i]!=1:
    print(s[i])
    exit()
print(1)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
def input(): return sys.stdin.readline().rstrip()

def main():
    S=list(map(int,list(input())))
    K=int(input())
    for n in S:
        if n==1:
            K-=1
            if K==0:
                print(0)
                exit()
        else:
            print(n)
            exit()

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
def input(): return sys.stdin.readline().rstrip()

def main():
    S=list(map(int,list(input())))
    K=int(input())
    for n in S:
        if n!=1:
            print(n)
            exit()

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())
if K != 1 and S[0] == '1':
    print(S[1])
else:
    print(S[0])

Submission status: Wrong Answer

Solution code:
x=input()
x=list(x)
m=len(x)
t=1
for i in range(m):
	if x[i]!='1' and t==1:
		t=x[i]
t=int(t)
print(t)

Submission status: Wrong Answer

Solution code:
x=input()
x=list(x)
m=len(x)
t=1
for i in range(m):
	if x[i]!="1" and t==1:
		t=x[i]

print(t)

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())
ans = ""

for i in range(len(S)):
  if int(S[i]) == 1:
    continue
  else:
    if i+1 <= K:
      ans = S[i]
      break
    else:
      ans = 1
      break
print(ans)

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())
ans = ""

if int(S[0]) > 1:
  ans = S[0]
elif K>=100:
  for i in range(len(S)):
    if int(S[i]) > 1:
      ans = S[i]
      break
else:
  for i in range(len(S)):
    if int(S[i]) > 1:
      if i+1 <= K:
        ans = S[i]
        break
      else:
        ans = 1
print(ans)

Submission status: Wrong Answer

Solution code:
s = list(input())
k = int(input())
for i in range(len(s)):
  if s[i] != "1":
    break
print(s[i])

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
if list(s)[0] == 1:
  print(list(s)[1])
else:
  print(list(s)[0])

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())

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

print(ans)

Submission status: Wrong Answer

Solution code:

def submit():
    s = str(input())
    k = int(input())

    for i, c in enumerate(s):
        if c != "1":
            if i + 1 > k:
                print("1")
                return
            else:
                print(c)
                return
            

if __name__ == "__main__":
    submit()

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())

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

Submission status: Wrong Answer

Solution code:
S = input()
n = int(input())
ans = 1
for s in S:
    if s != "1":
        ans = s
        break
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
lengh = 0
ans = '1'
for i in list(s):
    if i != '1':
        ans = i
        break
if k <= len(s) and ['1']*k == s[:k]: ans = s[k-1]
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
lengh = 0
ans = '1'
for i in list(s):
    if i != '1':
        ans = i
        break
if k <= len(s) and s[k-1] == '1': ans = s[k-1]
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
lengh = 0
ans = '1'
for i in list(s):
    if i != '1':
        ans = i
        break
if k <= len(s) and s[k-1] == '1': ans = '1'
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
lengh = 0
ans = '1'
for i in list(s):
    if i != '1':
        ans = i
        break
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
f = True
c = 0
for i in s:
    if i=='1' and f: c+=1
    else: 
        f=False
        break
if c==0:
    print(s[0])
else:
    if c>=k: print(s[0])
    else: print(s[1])

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
f = True
c = 0
for i in s:
    if i=='1' and f: c+=1
    else: f=False
if c==0:
    print(s[0])
else:
    if c>=k: print(s[0])
    else: print(s[1])

Submission status: Wrong Answer

Solution code:
s = input()
k = input()
for _ in s:
    if _ != '1':
        print(_)
        exit()

Submission status: Wrong Answer

Solution code:
s=str(input())
n=int(input())
if(n==1 and s[0]=='1'):
    print(1)
elif(s[0]!='1'):
    print(s[0])
else:
    print(s[1])

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
if k == 1: print(s[0])
elif s[0] == "1": print(s[1])
else: print(s[0])

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())

if len(s)>k and all(s[i]=="1" for i in range(k)):
    print(1)
else:
    print(s[0])

Submission status: Wrong Answer

Solution code:
s=input()
k=int(input())
t=""
if k==1:
  print(s[0])
else:
  for i in s:
    if int(i)==1:
      t+=i
    else:
      t+=i
      break
  if k>=len(t):
    print(t[-1])
  else:
    print(t[k])

Submission status: Wrong Answer

Solution code:
def main():
    #from sys import stdin, setrecursionlimit
    #setrecursionlimit(10**9)
    #r = input()
    #n = int(input())
    #a, b = map(int, input().split())
    #s, y = input().split()
    #a = input().split()
    #a = [int(input()) for i in range(n)]
    #a = list(map(int, input().split()))
    #a = [list(map(int, input().split())) for i in range(n)]
    #a = [int(s) - 1 for s in input().split()]
    #l=[int(input()) for _ in range(int(input()))]
    #res = 0
    s = [int(i) for i in list(input())]
    k = int(input())
    if max(s[:k+1]) == 1:
        print(1)
    else:
        for i in s:
            if i > 1:
                print(i)
                return 0

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    #from sys import stdin, setrecursionlimit
    #setrecursionlimit(10**9)
    #r = input()
    #n = int(input())
    #a, b = map(int, input().split())
    #s, y = input().split()
    #a = input().split()
    #a = [int(input()) for i in range(n)]
    #a = list(map(int, input().split()))
    #a = [list(map(int, input().split())) for i in range(n)]
    #a = [int(s) - 1 for s in input().split()]
    #l=[int(input()) for _ in range(int(input()))]
    #res = 0
    s = [int(i) for i in list(input())]
    k = int(input())
    if max(s) == 1:
        print(1)
    elif k == 1 and s[0] == 1:
        print(1)
    else:
        for i in s:
            if i > 1:
                print(i)
                return 0

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    #from sys import stdin, setrecursionlimit
    #setrecursionlimit(10**9)
    #r = input()
    #n = int(input())
    #a, b = map(int, input().split())
    #s, y = input().split()
    #a = input().split()
    #a = [int(input()) for i in range(n)]
    #a = list(map(int, input().split()))
    #a = [list(map(int, input().split())) for i in range(n)]
    #a = [int(s) - 1 for s in input().split()]
    #l=[int(input()) for _ in range(int(input()))]
    #res = 0
    s = [int(i) for i in list(input())]
    k = int(input())
    for i in s:
        if i > 1:
            print(i)
            return 0

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    #from sys import stdin, setrecursionlimit
    #setrecursionlimit(10**9)
    #r = input()
    #n = int(input())
    #a, b = map(int, input().split())
    #s, y = input().split()
    #a = input().split()
    #a = [int(input()) for i in range(n)]
    #a = list(map(int, input().split()))
    #a = [list(map(int, input().split())) for i in range(n)]
    #a = [int(s) - 1 for s in input().split()]
    #l=[int(input()) for _ in range(int(input()))]
    #res = 0
    s = list(input())
    k = int(input())
    for i in s:
        if i != '1':
            print(i)
            exit()

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
s = list(str(input()))
k = int(input())
for i in range(len(s)):
    if s[i] != "1":
        print(int(s[i]))
        break
else:
    print("1")

Submission status: Wrong Answer

Solution code:
s =input()
n = len(s)
k = int(input())

for i in range(n):
    if s[i] == '1':
        continue
    else:
        print(int(s[i]))
        break
else:
    print(1)

Submission status: Wrong Answer

Solution code:
s=input()
        
n=int(input())

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

Submission status: Wrong Answer

Solution code:
s=input()
        
n=int(input())

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

Submission status: Wrong Answer

Solution code:
s = input()
s = [int(i) for i in s]
k = int(input())
if max(s) == 1:
	print(1)
	exit()
for i in s:
	if i > 1:
		print(i)
		exit()

Submission status: Wrong Answer

Solution code:
s = list(input())
k = int(input())
for i in s:
	if int(i) > 1:
		print(i)
		exit()

Submission status: Wrong Answer

Solution code:
S=input()
K=int(input())
N=len(S)
for i in range(N):
    if not(S[i]=="1"):
        print(S[i])
        break

Submission status: Wrong Answer

Solution code:
def main():
    import sys
    #input = sys.stdin.readline
    sys.setrecursionlimit(10000000)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations
    #from itertools import accumulate, product, permutations
    from math import floor, ceil

    #mod = 1000000007

    s = input()
    input()
    n = 0
    while n<len(s):
        if not s[n]=='1':
            print(s[n])
            exit()
        else:
            n += 1
    print('1')


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys

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

for i in range(min(4, len(k))):
    if k[i]!="1":
        print(k[i])
        sys.exit()
print(1)

Submission status: Wrong Answer

Solution code:
def main():
    S = input()
    k = int(input())

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
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()