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:
def calc(S, K):

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

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

if __name__ == "__main__":
    S = input()
    K = int(input())

    calc(S, K)

Submission status: Wrong Answer

Solution code:
S = input()
k = int(input())
flag = False
pre = 0
ans = 1

for s in S:
    bit = format(5000000000000000-1,"b")
    temp = int(s)
    for i in bit[::-1]:
        temp = (temp**2)
        if i == "1":
            ans *= temp
        if ans >= k:
            print(s)
            flag = True
            break
    if flag:
        break

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# ABC106C - To Infinity
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])

Submission status: Wrong Answer

Solution code:
# ABC106C - To Infinity
s = input()
_ = int(input())
flg = False
for i in s:
    if i != "1":
        print(int(i))
        flg = True
        break
if not flg:
    print(1)

Submission status: Wrong Answer

Solution code:
# ABC106C - To Infinity
s = input()
_ = int(input())
flg = False
for i in s:
    if i != "1":
        print(i)
        flg = True
        break
if not flg:
    print(1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=input()
k=int(input())
s=s.strip("1")
s+="1"
print(s[0])

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:
S = list(input())
K = int(input())

res =0
for i in range(K):
    if S[i] == '1':
        if i == K:
            res = 1
        else:
            continue
    else:
        res = S[i]
        break
print(res)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
k = input()
s = int(input())
ls = []
for i in k:
    ls.append(int(i))
    
if set(ls[0:s+1]) == {1}:
    print(1)
else:
    flg = 1
    for i in ls:
        flg = int(i)
        if flg !=1:
            break
    print(flg)

Submission status: Wrong Answer

Solution code:
k = input()
s = int(input())
ls = []
for i in k:
    ls.append(int(i))
    
if set(ls[0:s+1]) == {1}:
    print(1)
else:
    flg = 1
    j =0
    while flg == 1:
        flg = int(ls[j])
        j +=1
    print(flg)

Submission status: Wrong Answer

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

max_s = 1

for string in s:
    if int(string) > max_s:
        max_s = int(string)
        break

print(max_s)

Submission status: Wrong Answer

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

if K == 1:
    print(S[0])
    exit()
else:
    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 == 1:
    print(S[0])
else:
    for i in S:
        if i != '1':
            print(i)
            exit()

Submission status: Wrong Answer

Solution code:
S = 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())
t=0
for i in range(len(s)):
    if s[t]!='1':
        if t<=k:
            print(s[t])
        else:
            print(1)
        quit()
    else:
        t+=1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#コメントの解き方だとTLE
# after = 5*10**15

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

'''part = 0

for i in s:
  i = int(i)
  part += i**after
  if k <= part:
    print(i)
    break'''

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

Submission status: Wrong Answer

Solution code:
s=input()
k=int(input())
if min(s) == '1' or k <= s.count('1'): print(1)
else: print(min(s))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
	
def main():
	S = input()
	S = list(S)
	K = int(input())
	
	if len(S) == 1:
		print(S[0])
	"""
	L = []
	for i in range(len(S)):
		if i == 0:
			tmp = int(S[i])
			if tmp == 1:
				L.append((i+1, tmp))
			else:
				tmp = (tmp ** ((5000 * 10000000000000)-1)) // 10
				L.append((i+1, tmp))
			continue
			
		_, base = L[i-1]
		tmp = int(S[i])
		if tmp == 1:
			tmp = 1
		else:
			tmp = (tmp ** ((5000 * 10000000000000)-1)) // 10
		L.append((i+1, tmp+base))
		
	for i in L:
		index, keta = i
		if i == 0:
			if K < keta:
				print(S[index])
				break
		if K < keta:
			print(S[index-1])
			break
			
	print(L)
	"""
	
	tmp = []
	for i in S:
		if int(i) == 1:
			tmp.append(1)
		else:
			tmp.append(int(i))
			break
	
	if len(tmp) < K:
		print(tmp[-1])
	else:
		tmp[K-1]
	
if __name__ == "__main__":
	main()

Submission status: Wrong Answer

Solution code:
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
  if k<=len(one_list):
    print('1')
  else:
    print(n[0])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = [int(i) for i in str(input())]
K = int(input())

k = 0
for i in range(len(S)):
    if S[i] == 1:
        if k < K:
            k += 1
            continue
        else:
            print(1)
            exit()
    else:
        print(S[i])
        exit()

Submission status: Wrong Answer

Solution code:
S = [int(i) for i in str(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の文字列、最初が何かに依存しそう
"""


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

if S[0] == "1":
    len_one = 0
    flag = 0
    for s in S:
        if s == "1" and flag == 0:
            len_one += 1
        else:
            flag = 1
    
    if K <= len_one:
        ans = 1
    else:
        ans = int(S[1])

else:
    ans = int(S[0])

print(ans)

Submission status: Wrong Answer

Solution code:
"""
Sの文字列、最初が何かに依存しそう
"""


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

if S[0] == "1":
    len_one = 0
    flag = 0
    for s in S:
        if s == "1" and flag == 0:
            len_one += 1
        else:
            flag = 0
    
    if K <= len_one:
        ans = 1
    else:
        ans = int(S[1])

else:
    ans = int(S[0])

print(ans)

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())
if S[0] == '1':
    while S[0] == '1' and len(S) > 1:
        S = S[1:]
print(S[0])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

N1 = []
NN = []

for i in range(len(N)) : 
    if N[i] == 1 : 
        N1.append(N[i])
    else : 
        NN.append(N[i])
        
if K <= len(N1) : 
    print(1)
else : 
    print(min(NN))

Submission status: Wrong Answer

Solution code:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    s = input()
    k = f()[0]

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

solve()

Submission status: Wrong Answer

Solution code:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    s = input()
    k = f()[0]

    slen = len(s)
    for i in range(slen):
        if int(s[i])!=1:
            if k<=i+1:
                print(1)
            else:
                print(int(s[i]))
            return

solve()

Submission status: Wrong Answer

Solution code:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    s = input()
    k = f()[0]

    slen = len(s)
    for i in range(slen):
        if int(s[i])!=1:
            print(int(s[i]))
            return

solve()

Submission status: Wrong Answer

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


check = 0

for i in range(len(S)):
    if int(S[i]) == 1:
        check = 1
    else:
        print(S[i])
        exit()
    #K番目までがすべて1なら1を返す。    
    if K == i and check == 1:
        print("1")
        exit()

Submission status: Wrong Answer

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


check = 0

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

for i in range(len(S)):
    if S[i] == '1':
        check = 1
    else:
        print(S[i])
        exit()
    #K番目までがすべて1なら1を返す。    
    if K == i and check == 1:
        print("1")
        exit()

Submission status: Wrong Answer

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


check = 0

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


for i in range(len(S)):
    if S[i] == '1':
        check = 1
    else:
        print(S[i])
        exit()
    #K番目までがすべて1なら1を返す。    
    if K == i and check == 1:
        print("1")
        exit()

Submission status: Wrong Answer

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


check = 0

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


for i in range(len(S)):
    if S[i] == 1:
        check = 1
    else:
        print(S[i])
        exit()
        check = -1
    #K番目までがすべて1なら1を返す。    
    if K == i and check == 1:
        print("1")
        exit()

Submission status: Wrong Answer

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


check = 0

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

for i in range(len(S)):
    if S[i] == 1:
        check = 1
    else:
        check = -1
    #K番目までがすべて1なら1を返す。    
    if K == i and check == 1:
        print("1")
        exit()

print(S[0])

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())
if len(S) == 1:
    print(S)
else:
    ind = 0 
    while True:
        if S[ind] != '1':
            break
        ind += 1
        if ind == len(S):
            break
    if K <= ind + 1:
        print('1')
    else:
        print(S[ind])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!

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

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!

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

cnt = []
for i in range(len(S)):
    cnt.append(1)
    
before = -1
while True:
    l = 0
    for i in range(len(cnt)):
        l += cnt[i]
        cnt[i] = int(S[i]) * cnt[i]

    total = 0
    now = 0
    for i in range(len(cnt)):
        total += cnt[i]
        if total >= K:
            now = i
            break
    
    if before == now:
        break
    before = now
print(S[now])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())
if S[:K-1].count('1') == len(S[:K-1]):
  print(1)
  exit()
else:
  for i in S:
    if i != '1':
      print(i)
      exit()

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())
if S.count('1') == len(S):
  print(1)
  exit()
else:
  for i in S:
    if i != '1':
      print(i)
      exit()

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())
if S.count('0') == len(S):
  print(1)
  exit()
else:
  for i in S:
    if i != '1':
      print(i)
      exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

c = 0
a = 1
for si in s:
    if si == "1":
        c += 0
    else:
        a = si
        break

print("1" if k - c <= 0 else a)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!

S = [int(x) for x in input()]
K = int(input())

n = 0
for i, s in enumerate(S):
    if i >= K:
        print(s)
        break
    if s != 1:
        print(s)
        break

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!

S = [int(x) for x in input()]
K = int(input())

n = 0
for i, s in enumerate(S):
    if i >= K:
        print(1)
        break
    if s != 1:
        print(s)
        break

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!

S = [int(x) for x in input()]
K = int(input())

for i, s in enumerate(S):
    if s != 1:
        print(s)
        break

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
for c in s:
    k -= 1
    if k == -1:
        print(c)
        break
    if c == '1':
        continue
    else:
        print(c)
        break
else:
    print('1')

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
for c in s:
    k -= 1
    if k <= 0:
        continue
    if c == '1':
        continue
    else:
        print(c)
        break
else:
    print('1')

Submission status: Wrong Answer

Solution code:
s = input()
k = input()
for c in s:
    if c == '1':
        continue
    else:
        print(c)
        break
else:
    print('1')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

ans = 0
pos = 0
for n in S:
    n = int(n)
    if n == 1: pos += 1
    else:
        pos += n * (5*10**15)
    if K <= pos:
        ans = n
        break

print(ans)

Submission status: Wrong Answer

Solution code:
from math import log
S = input()
K = log(int(input()))

ans = 0
pos = 0
for n in S:
    n = int(n)
    if n == 1: pos += log(1)
    else:
        pos += log(n * (5*10**15))
    if K <= pos:
        ans = n
        break

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
str = map(int,list(input()))
k = int (input())
counter = 1
for i in str :
  if i != 1 :
    ans = i
    break
  ans = 1
  if counter >= k:
      break
print(ans)

Submission status: Wrong Answer

Solution code:
str = map(int,list(input()))
for i in str :
  if i != 1 :
    ans = i
    break
  ans = 1
print(ans)

Submission status: Wrong Answer

Solution code:
str = map(int,list(input()))
for i in str :
  if i != 1 :
    print (i)
    break
print(1)

Submission status: Wrong Answer

Solution code:
str = map(int,list(input()))
for i in str :
  if i != 1 :
    print (i)
    break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = list(input())
K = int(input())
if not S[0] == "1":
    print(S[0])
elif S[0] == "1" and len(S) == 1:
    print(1)
else:
    print(S[1])

Submission status: Wrong Answer

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

if k < len(s) and all([s[i] == '1' for i in range(k)]):
    print(1)
else:
    for c in list(s):
        if c != '1':
            print(c)
            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])
        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().strip()
K = int(input().strip())
for i in range(K):
  if S[i] == 1:
    continue
  else:
    print(S[i])
    exit()
print(S[K])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#coding: utf-8
N = input()
K = int(input())
if N[0] == 1:
    for i in range(1, K+1):
        if N[i] != 1:
            print(N[i])
            break
        else:
            print(1)
            break
else:
    print(N[0])

Submission status: Wrong Answer

Solution code:
#coding: utf-8
N = input()
K = int(input())
if N[0] == 1:
    for i in range(1, len(N)):
        if N[i] != 1:
            print(N[i])
            break
else:
    print(N[0])

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
S = input()
K = int(input())

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

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())
length = len(S)
for i in range(length):
    #print(S[i])
    if S[i] != '1':
        break
    i += 1
if K <= i + 1 :
    ans = 1
else:
    ans = S[i]

print(ans)

Submission status: Wrong Answer

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


for i in range(len(n)):
  if i == k-1:
    print(n[i])
    
  else:
    if n[i] != "1":
      print(n[i])
      exit()

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())
if (K <= len(S)) :
    if (S[:K] == '1'*K) :
        print('1')
else :
    for ch in list(S):
        if (ch != '1'):
            print(ch)
            break

Submission status: Wrong Answer

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

for i, ch in enumerate(list(S)):
    if (ch != '1'):
        print(ch)
        break
    elif (i == len(S)-1) :
        print('1')

Submission status: Wrong Answer

Solution code:
n = input()
k = input()


if len(n) == 1:
  print(n)
else:
    for i  in range(max(int(k), len(n))):
      if n[i] != "1":
        print(n[i])
        exit()
    print(1)

Submission status: Wrong Answer

Solution code:
n = input()
k = input()


if len(n) == 1:
  print(n)
else:
  if k == "1":
    print(n[0])
  else:
    for i  in range(max(int(k), len(n))):
      if n[i] != "1":
        print(n[i])
        exit()
    print(1)

Submission status: Wrong Answer

Solution code:
n = input()
k = input()


if len(n) == 1:
  print(n)
else:
  if k == "1":
    print(n[0])
  else:
    if n[0] == "1":
      print(n[1])
    else:
      print(n[0])

Submission status: Wrong Answer

Solution code:
n = input()
k = input()


if len(n) == 1:
  print(n)
else:
  if n[0] == "1":
    if k == "1":
      print(1)
    else:
      print(n[1])
  else:
    print(n[0])

Submission status: Wrong Answer

Solution code:
n = input()
k = input()


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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
s = list(input())
K = int(input())
K -= 1
for i in range(int(len(s))):
    if int(i) == K:
        print(1)
        break
    if s[int(i)] == '1': continue
    else:
        print(s[int(i)])
        break

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
s = list(input())
K = int(input())
K -= 1
for i in range(int(len(s))):
    if int(i) == K:
        print(1)
        break
    if s[i] == '1': continue
    else:
        print(s[i])
        break

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
s = list(input())
K = input()

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

Submission status: Wrong Answer

Solution code:
# -*- coding:utf-8 -*-

def solve():
    S = input()
    K = int(input())
    INF = 5000000000000000

    now_k = 1
    for s in S:
        if now_k == K:
            print(s)
            exit()

        num = int(s)
        if num == 1:
            now_k += 1
            continue
        
        now_k += num * (INF+1) -1

        if K <= now_k:
            print(num)
            exit()




if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

Solution code:
# -*- coding:utf-8 -*-

def solve():
    S = input()
    K = int(input())
    INF = 5000000000000000

    now_k = 1
    for s in S:
        if now_k == K:
            print(s)
            exit()

        num = int(s)
        if num == 1:
            now_k += 1
            continue
        
        now_k += num * INF -1

        if K <= now_k:
            print(num)
            exit()




if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

Solution code:
# print(len(str(2**50)))
s=input()
k=int(input())
if k==1:
    print(s[0])
    exit()
for si in s:
    if si!='1':
        print(si)
        exit()

Submission status: Wrong Answer

Solution code:
# print(len(str(2**50)))
s=input()
k=int(input())
if len(s) >= k:
    if s[k-1]==1:
        print(1)
        exit()
    else:
        for si in s:
            if si !='1':
                print(si)
                exit()
else:
    for si in s:
        if si !='1':
            print(si)
            exit()

Submission status: Wrong Answer

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


def solve(S: int, K: int):
    for c in S:
        if c != '1':
            print(c)
            return
    print(1)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = str(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())
ans = '1'
for s in S:
    if s != '1':
        ans = s
        break
print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def c():
    S = input()
    S = list(S)
    K = int(input())
    if K == 1:
        print(S[0])
        return 0
    else:
        for k in S:
            if k!="1":
                print(k)
                return 0
    print(1)
    return 0
if __name__ == '__main__':
    c()

Submission status: Wrong Answer

Solution code:
def c():
    S = input()
    S = list(S)
    K = int(input())
    if K == 1:
        print(S[0])
    else:
        for k in S:
            if k!="1":
                print(k)
                return 0
    print(1)
if __name__ == '__main__':
    c()

Submission status: Wrong Answer

Solution code:
def c():
    S = input()
    S = list(S)
    K = int(input())
    if K == 1:
        print(S[0])
    else:
        for k in S:
            if k!="1":
                print(k)
                return 0
if __name__ == '__main__':
    c()

Submission status: Wrong Answer

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


for i, v in enumerate(s):
    if v != "1":
        break
after = "1" * i + v * 100
print(after[min(len(s) - 1, k)])

Submission status: Wrong Answer

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

l = len(s)
if k < len(s) and s[:k] == "1" * k:
    print(1)
else:
    for i in s:
        if i != "1":
            print(i)
            exit()

Submission status: Wrong Answer

Solution code:
s = str(input())
k = int(input())
if len(set(s)) == 1 and "1" in s:
    print(1)
elif s.count("1") >= k:
    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())
ret = "1"
for i in range(K):
    if len(S) < K:
        break
    if S[i] != "1":
        ret = S[i]
        break
print(ret)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = [int(i) for i in input()]
K = int(input())
for i in S:
    K -= i**(5*10**15)
    if K <= 0:
        print(i)

Submission status: Wrong Answer

Solution code:
s=[int(i) for i in input()]
k=int(input())
a=5000000000000000
for i in s:
  k-=i**a
  if k<0:
    print(i)

Submission status: Wrong Answer

Solution code:
S = list(input())
K = int(input())
p = ""
for i in S:
  if i == "1":
    K -= 1
    if K == 0:
      p = i
      break
  else:
    c = 0
    while K >= 1:
      if (K % int(i)) == 1:
        K = (K - 1) / int(i) + 1
      else:
        K /= int(i)
      c += 1
      if c < K:
        p = i
        break
print(p)

Submission status: Wrong Answer

Solution code:
S = [int(i) for i in input()]
K = int(input())
for num,i in enumerate(S):
    if i!=1:
        print(i)
        break
    else:
        if num==K:
            print(i)
            break

Submission status: Wrong Answer

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

while True:
    if s == '1':
        ans = 1
        break
    if s[0] == '1':
        s = s[1:]
    elif s[0] != '1':
        ans = s[0]
        break
print(ans)

Submission status: Wrong Answer

Solution code:
def main():
  S = map(int,list(input()))
  K = int(input())
  for i,n in enumerate(S):
    if n == 1:
      K -= n
    if K>0:
      return n
    else:
      return 1
  return 1

if __name__ == '__main__':
  print(main())