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:
s = input().strip()
k = int(input().strip())
days = 5 * (10 ** 15)
if len(s) == 1:
    print(s)
    exit()
before = 0
for i in range(0, len(s) - 1):
    diff = 0
    if s[i] == "1":
        diff = 1
    else:
        for j in range(1, (days + 1), 1):
            if 10 ** 18 <= int(s[i]) ** j:
                diff = int(s[i]) ** j
                break
    if (k - 1) < (before + diff):
        print(s[i])
        break
    else:
        before = before + diff

Submission status: Wrong Answer

Solution code:
s = input().strip()
k = int(input().strip())
days = 5 * (10 ** 15)
if len(s) == 1:
    print(s)
    exit()
before = 0
for i in range(0, len(s) - 1):
    diff = 0
    if s[i] == "1":
        diff = 1
    else:
        for j in range(1, (days + 1), 1):
            if 10 ** 18 <= int(s[i]) ** j:
                diff = int(s[i]) ** j
                break
    if (k - 1) <= (before + diff):
        print(s[i])
        break
    else:
        before = before + diff

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

def main():
    S = input().strip()
    for s in S:
        if s != "1":
            print(s)
            exit()



if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
b = list(map(int,s))
for i in b:
    if i!=1:
        print(i)
        break
else:print(1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

count = 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]) * count
        else:
                K -= 1

print(S[-1])

Submission status: Wrong Answer

Solution code:
s=input()
len_s=len(s)
cnt=0
k=int(input())
for v in s:
    if v!='1':
        print(int(v))
        break
    else:
        cnt+=1
        if len_s==cnt:
            print(1)
            break

Submission status: Wrong Answer

Solution code:
s=input()
k=int(input())
for v in s:
    if v!='1':
        print(v)
        break

Submission status: Wrong Answer

Solution code:
s=input()
k=int(input())
t=''
for v in s:
    if int(v)*(5**12)<=k:
        break
print(v)

Submission status: Wrong Answer

Solution code:
a=input()
k=0
while a[k]=='1'and len(a)-1>k:
  k+=1
b=int(input())
if b<k or a=='1'*len(a):print(1)
else:print(a[k])

Submission status: Wrong Answer

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

if len(S) == 1:
    print(S)
else:
    for x in S:
        if x != "1":
            print(x)
            exit()

Submission status: Wrong Answer

Solution code:
a=input()
k=0
while a[k]==1 and len(a)>k:
  k+=1
b=int(input())
if b<k or a=='1'*len(a):print(1)
else:print(a[k])

Submission status: Wrong Answer

Solution code:
a=input()
b=int(input())
print(a[b>1and a[0]=='1'])

Submission status: Wrong Answer

Solution code:
s=input()
k=int(input())
ans,bns=0,0
for i in range(len(s)):
    if s[i]!="1":
        ans=s[i]
        break
    else:
        bns+=1 #0の連続
if k<bns: #k=何番目
    print(1)
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
numstr = input()
num = int(input())
def check():
    infinity = ""
    for i in range(len(numstr)):
        if numstr[i] is not "1":
            infinity = infinity + numstr[i]
            return infinity
        else:
            infinity = infinity + "1"
    return "1"
infinity = check()
print(infinity[len(infinity)-1])

Submission status: Wrong Answer

Solution code:
s=input()
k=int(input())
ans=0
for i in range(len(s)):
    if s[i]!=1:
        print(s[i])
        break
    else:
        ans+=1
        if k<ans:
            print(1)
            break

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

Submission status: Wrong Answer

Solution code:
numstr = input()
num = int(input())
def check():
    for i in range(len(numstr)):
        if numstr[i] is not "1":
            return numstr[i]
    return "1"
print(check())

Submission status: Wrong Answer

Solution code:
numstr = input()
num = int(input())
def check():
    for i in range(len(numstr)):
        if numstr[i] is not "1":
            return numstr[i]
print(check())

Submission status: Wrong Answer

Solution code:
numstr = input()
num = int(input())
def check():
    for i in range(len(numstr)):
        if numstr[i] != 1:
            return numstr[i]
print(check())

Submission status: Wrong Answer

Solution code:
S=str(input())
K=int(input())
L=[1]*len(S)
count=0
#うしたぷにきあ君笑
for i in range(len(S)):
  if S[i]!='1' or K==1:
    print(int(S[i]))
    exit()

Submission status: Wrong Answer

Solution code:
S=str(input())
K=int(input())
L=[1]*len(S)
count=0
#うしたぷにきあ君笑
for i in range(len(S)):
  if S[i]!='1':
    print(int(S[i]))
    exit()

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())
ans = 0
onecount = 0
for i in S:
    if i == "1":
        onecount += 1
        continue
    else:
        if onecount >= K:
            ans = 1
        else:
            ans = i
        break
print(ans)

Submission status: Wrong Answer

Solution code:
S = input()
ans = 0
for i in S:
    if i == "1":
        continue
    else:
        ans = i
        break
print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

s = [int(i) for i in s]

for i,a in enumerate(s):

    if i == k and i == 1:
        print(1)
        exit(0)
        
    elif a == 1:
        continue
    else:
        print(a)
        exit(0)

Submission status: Wrong Answer

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

s = [int(i) for i in s]

for i,a in enumerate(s):
    if a == 1:
        continue
    elif i == k and i == 1:
        print(1)
        exit(0)

    else:
        print(a)
        exit(0)

Submission status: Wrong Answer

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

s = [int(i) for i in s]

for i,a in enumerate(s):
    if a == 1:
        continue
    elif i == k and i == 1:
        print(1)
        
    else:
        print(a)
        exit(0)

Submission status: Wrong Answer

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

s = [int(i) for i in s]

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

Submission status: Wrong Answer

Solution code:
s = input()

k = int(input())

if k == 1 or len(list(s)) == 1 or int(s[0]) != 1:
    print(int(s[0]))
else:
    print(int(s[1]))

Submission status: Wrong Answer

Solution code:
s = input()

k = int(input())

if k == 1 or len(list(s)) == 1 or (int(s[0]) != 1 and k>1):
    print(int(s[0]))
else:
    print(int(s[1]))

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(i)

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())
not_one = '1'
for s in S:
  if s != '1':
    not_one = s
    break
    
print(not_one)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
S = input()
K = int(input())
for i,s in enumerate(S):
    if s == '1':
        pass
    else:
        if K <= i+1:
            print(1)
        else:
            print(s)
        break

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if (len(S) == 1):
    print(S)
else:
    if(S[0] == '1'):
        if(K==1):
            print(S[0])
        else:
            for s in S:
                if (s != '1'):
                    print(s)
                    break
    else:
        print(S[0])

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:

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

s = str(S)
l = len(s)

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

print(1)

Submission status: Wrong Answer

Solution code:

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

if S <= 9:
 print(S)
else:
 s = str(S)
 index = 0
 l = len(s)
 while True:
  if index >= l:
   print('1')
   break
  if s[index] != '1':
   print(s[index])
   break
  else:
   index += 1

Submission status: Wrong Answer

Solution code:

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

if S <= 9:
 print(S)
else:
 i = str(S)[0]
 if i != '1':
  print(i)
 else:
  print(str(S)[1])

Submission status: Wrong Answer

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


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

    main(s, k)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=input()
k=int(input())
for i in range(len(s)):
    if s[i]!=1:
        num=i
        ans=s[i]
        break
if k<=num-1:
    print(1)
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
s=input()
k=int(input())
for i in range(len(s)):
    if s[i]!=1:
        num=i
        ans=s[i]
        break
if k<=num:
    print(1)
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
s=input()
k=int(input())
for i in range(len(s)):
    if s[i]!=1:
        num=i
        ans=s[i]
        break
if k<=num+1:
    print(1)
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
d = 5 *  10**15

current = 0

for c in s:
    cint = int(c)
    if cint == 1:
        current += 1
    else:
        current += cint * d
    if current >= k:
        print (c)
        exit()

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
# 5千兆＝ 5 * 10**15
ans = '1'
for i in range(len(s)):
    if s[i] != '1' and i <= k:
        ans = s[i]
        break
print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

i = 0
while S[i] == "1":
    i += 1
    if i == len(S):
        break

if i == 0:
    print(S[0])
elif K <= i:
    print("1")
else:
    print(S[1])

Submission status: Wrong Answer

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

if k == 1:
	print(s[0])
	quit()

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

Submission status: Wrong Answer

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

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


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

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = S[0]

for s in S:
    if s != "1":
        ans = s
        break

print(ans)

Submission status: Wrong Answer

Solution code:
s=input()
k=int(input())
ok=True
for i in range(len(s)):
  if i<k:
    if s[i]!='1':
      ok=False
      a=s[i]
  else:
    break
if ok:
  print('1')
else:
  print(a)

Submission status: Wrong Answer

Solution code:
import sys
import numpy as np
S = list(input())
K = int(input())
cnt = 0
for i in S:
    if i != "1":
        print(i)
        sys.exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
for i in input():
  if i != '1':
    print(i)
    quit()

Submission status: Wrong Answer

Solution code:
lim=5000000000000000
s=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())


count = 0
for i in range(len(s)):
  if s[i] == "1":
    count = i
  else:
    st = s[i]
    break

if k <= count+1:
  print(1)
else:
  print(st)

Submission status: Wrong Answer

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

lst = []
for i in s:
  if i == "1":
    lst.append(1)
  else:
    lst.append("INF")

for i in range(len(s)):
  if lst[i] == "INF":
    print(s[i])
    break
  elif k <= lst[i]:
    print(s[i])
    break

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
lst = []
for i in s:
  if i == "1":
    lst.append(1)
  else:
    lst.append("INF")

for i in range(len(s)):
  if lst[i] == "INF":
    print(s[i])
    break
  elif k <= lst[i]:
    print(s[i])
    break

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
lst = []
for i in s:
  if i == "1":
    lst.append(1)
  else:
    lst.append(int(i)*5*10**16)

lst2 = [0]*len(s)
for i in range(len(lst)):
    if i == 0:
        lst2[i] = lst[i]
        continue
    lst2[i] = (lst2[i-1]+lst[i])

for i in range(len(s)):
  if k <= lst2[i]:
    print(s[i])
    exit()

Submission status: Wrong Answer

Solution code:
s=input()
k=int(input())
for i,c in enumerate(s):
  if c!='1' or i>=k:
    break
print(c)

Submission status: Wrong Answer

Solution code:
S = list(input())
K = int(input())
s1 = 1
sl = len(S)
for i in range(len(S)):
    if S[i] != '1':
        s1 = S[i]
        sl = i+1
        break
if sl >= K:
    print(1)
else:
    print(s1)

Submission status: Wrong Answer

Solution code:
import sys
S=int(input())
K=int(input())
if K == 1:
    print(str(S)[0])
else:
    for s in str(S):
        if s != "1":
            print(s)
            sys.exit()
    else:
        print(1)

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())
if K == 1:
    print(S[0])
else:
    for i in range(len(S)):
        if S[i] != "1":
            print(S[i])
            exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())
if K == 1:
    print(S[0])
    exit()
for i in range(len(S)):
    if S[i] != 1:
        print(S[i])
        exit()
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])
        exit()
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])
        exit()

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())
for s in S:
  if s!="1":
    print(s);exit()
print("1")

Submission status: Wrong Answer

Solution code:
S = list(map( int,input() ))
K = int(input())
for s in S:
  if s!=1:
    print(s);exit()
print(1)

Submission status: Wrong Answer

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

key = 0
ans = '1'

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

Submission status: Wrong Answer

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

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

if turn_on:
    print('1')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import sys
import numpy as np

n = int(sys.stdin.readline())
A = list(map(int, sys.stdin.readline().split()))

print(sum(A)-n)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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

Submission status: Wrong Answer

Solution code:
s=list(map(int,list(input())))
k=int(input())
for i in range(len(s)):
    if s[i]!=1:
        if i>k:
            print(1)
        else:
            print(s[i])
        break
else:
    print(1)
'''
N=5000000000000

def groupby(a):
    a2=[[a[0],1]]
    for i in range(1,len(a)):
        if a2[-1][0]==a[i]:
            a2[-1][1]+=1
        else:
            a2.append([a[i],1])
    return a2

x=groupby(s)

for i in x:
    i[1]=i[1]*(i[0]**N)
計算量的に間に合わないのは明らか
print(x)
'''

Submission status: Wrong Answer

Solution code:
s=list(map(int,list(input())))
k=int(input())
for i in range(len(s)):
    if s[i]!=1:
        if i*(5000000000000+1)>k:
            print(1)
        else:
            print(s[i])
        break
else:
    print(1)
'''
N=5000000000000

def groupby(a):
    a2=[[a[0],1]]
    for i in range(1,len(a)):
        if a2[-1][0]==a[i]:
            a2[-1][1]+=1
        else:
            a2.append([a[i],1])
    return a2

x=groupby(s)

for i in x:
    i[1]=i[1]*(i[0]**N)
計算量的に間に合わないのは明らか
print(x)
'''

Submission status: Wrong Answer

Solution code:
s=list(map(int,list(input())))
k=int(input())
for i in s:
    if i!=1:
        print(i)
        break
else:
    print(1)
'''
N=5000000000000

def groupby(a):
    a2=[[a[0],1]]
    for i in range(1,len(a)):
        if a2[-1][0]==a[i]:
            a2[-1][1]+=1
        else:
            a2.append([a[i],1])
    return a2

x=groupby(s)

for i in x:
    i[1]=i[1]*(i[0]**N)
計算量的に間に合わないのは明らか
print(x)
'''

Submission status: Wrong Answer

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

ANS = 1
for i in range(K-1):
  if s[i] != '1':
    ANS = int(s[i])
    break
print(ANS)

Submission status: Wrong Answer

Solution code:
S = [int(s) for s in list(input())]
K = int(input())

first_char = S[0]
if len(S) == 1:
    print(first_char)
elif first_char == 1 and K == 1:
    print(first_char)
elif first_char == 1 and K > 1:
    print(S[1])
else:
    print(first_char)

Submission status: Wrong Answer

Solution code:
s=input()
k=int(input())
for x in s:
  if x=='1':
    k-=1
    if k==0:
      print(1,k)
      exit()
  else:
    print(x)
    exit()

Submission status: Wrong Answer

Solution code:
s=input()
k=int(input())
for x in s:
  if x==1:
    k-=1
    if k==0:
      print(1)
  else:
    print(x)
    exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
k = int(input())
for i, s in enumerate(S):
  if s == "1" and i+1==k:
    print(s)
    break
  else:
    print(s)
    break

Submission status: Wrong Answer

Solution code:
S = input()
k = int(input())
d = {}
cnt = 0
for i, s in enumerate(S):
  if s == "1":
    cnt += 1
    if i == k:
      print(s)
      exit()
  else:
    print(s)
    exit()
if cnt == len(S):
  print("1")

Submission status: Wrong Answer

Solution code:
S = input()
k = int(input())
d = {}
cnt = 0
cnt1 = 0
for i, s in enumerate(S):
  if s == "1" and k <= 5000000000000000:
    print(1)
    break
  elif s != "1":
    print(s)
    break
  else:
    print(S[i+1])

Submission status: Wrong Answer

Solution code:
S = input()
k = int(input())
for s in S:
  if s == "1" and k <= 5000000000000000:
    print(1)
    break
  else:
    print(s)
    break

Submission status: Wrong Answer

Solution code:
s=input()
k=int(input())
i=0
while True:
  if i<len(s) and s[i]=='1':
    i+=1
  else:
    break
if i==0:
  print(s[0])
  exit()
if i<k:
  print(s[1])
else:
  print(s[0])

Submission status: Wrong Answer

Solution code:
s=input()
k=int(input())
i=0
while True:
  if i<len(s) and s[i]=='1':
    i+=1
  else:
    break
if i==0:
  print(s[0])
  exit()
if i<=k and len(s)>=2:
  print(s[1])
else:
  print(s[0])

Submission status: Wrong Answer

Solution code:
s=input()
k=int(input())
i=0
while True:
  if i<len(s) and s[i]=='1':
    i+=1
  else:
    break
if i>=k and len(s)>=2:
  print(s[1])
else:
  print(s[0])

Submission status: Wrong Answer

Solution code:
s=input()
k=int(input())
i=0
while True:
  if i<len(s) and s[i]=='1':
    i+=1
  else:
    break
if i<=k and len(s)>=2:
  print(s[1])
else:
  print(s[0])

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())
answer = '1'

for s in S:
    if s != '1':
        answer = s
        break
print(answer)

Submission status: Wrong Answer

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

for s in S:
    if s != '1':
        answer = s
        break
if not answer:
    answer ='1'
print(answer)

Submission status: Wrong Answer

Solution code:
def solve():
    S = input()
    K = int(input())
    for s in S:
        if s != '1':
            break
            
    print(s)
    
solve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = str(input())
k = int(input())
cnt = 0
for i in s:
    if i == "1":
        cnt += 1
        if cnt >= k:
            print("1")
            exit()
    elif i == "2":
        cnt += 2 * 5000000000000000
        if cnt >= k:
            print("2")
            exit()
    elif i == "3":
        cnt += 3 * 5000000000000000
        if cnt >= k:
            print("3")
            exit()
    elif i == "4":
        cnt += 4 * 5000000000000000
        if cnt >= k:
            print("4")
            exit()
    elif i == "5":
        cnt += 5 * 5000000000000000
        if cnt >= k:
            print("5")
            exit()
    elif i == "6":
        cnt += 6*5000000000000000
        if cnt >= k:
            print("6")
            exit()
    elif i == "7":
        cnt += 7*5000000000000000
        if cnt >= k:
            print("7")
            exit()
    elif i == "8":
        cnt += 8*5000000000000000
        if cnt >= k:
            print("8")
            exit()
    elif i == "9":
        cnt += 9*5000000000000000
        if cnt >= k:
            print("9")
            exit()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

cnt = 0
flg = 0
for i in range(len(s)):
	if s[i] == "1":
		cnt += 1
	else:
		if flg == 0:
			nxt = s[i]
			flg = 1
		else:
			break
if cnt < k:
	print (nxt)
else:
	print (1)

Submission status: Wrong Answer

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

cnt = 0
flg = 0
for i in range(len(s)):
	if s[i] == "1":
		cnt += 1
	else:
		if flg == 0:
			nxt = s[i]
			flg = 1
		else:
			break
if cnt < k:
	print (nxt)
else:
	print (cnt)

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())
cnt = 0
for s in S:
    cnt += 1
    if s == "1" and cnt < K:
        continue
    else:
        print(s)

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())
for s in S:
    if s == "1" and S.index(s) < K-1:
        continue
    else:
        print(s)

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())
for i in range(K+1):
    if i >= len(S):
        print(i-1)
        exit()
    if S[i] == "1":
        continue
    else:
        print(S[i])
        exit()
    print(1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())
for i in range(1,K+1):
    if i >= len(S):
        print(S[i-1])
        exit()
    if S[i] != "1":
        print(S[i])
        exit()
print(1)

Submission status: Wrong Answer

Solution code:
n=input()
k=int(input())
if len(n)==1:
    print(n)
cnt=0
for i in n:
    if n==1:
        cnt+=1
    else: 
        break
print(1 if cnt>=k else 2)

Submission status: Wrong Answer

Solution code:
s = 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 s[0] == "1":
  if k == 1:
    print(1)
  else:
    print(s[1])
else:
  print(s[0])

Submission status: Wrong Answer

Solution code:
#ABC106C
s=input()
k=int(input())
cnt=0
while(s[cnt]=='1' and cnt!=len(s)-1):
    cnt+=1
if(k-1<=cnt):
    print('1')
else:
    print(s[cnt])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

Solution code:
s=list(input())
k=int(input())
if len(s)==1 or k==1:
    print(int(s[0]))
else:
    for i in range(len(s)):
        if int(s[i])==1 or i!=len(s)-1 or i<k:
            continue
        else:
            print(int(s[i]))
            break

Submission status: Wrong Answer

Solution code:
s=list(input())
k=int(input())
if len(s)==1 or k==1:
    print(int(s[0]))
else:
    for i in range(len(s)):
        if int(s[i])==1 and i!=len(s)-1 and i<k:
            continue
        else:
            print(int(s[i]))
            break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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