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: Runtime Error

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

for i, v in enumerate(s):
  if i == k:

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

Submission status: Runtime Error

Solution code:
s = input()
if input() != "1":
    s = s.lstrip("1")
print(s[0])

Submission status: Runtime Error

Solution code:
S=input()
K=int(input())
for k in range(K):
  if S[k]=='1':
    continue
  else:
    print(S[k])
    break
else:
  peint('1')

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

output = ''

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

if len(S) > K:
    for l in S:
        if l != '1':
            output = l
            break
else :
    for i in range(0, K+1):
        if S[i] != '1':
            output = S[i]
            break
            
print(output)

Submission status: Runtime Error

Solution code:
N = int(input())
K = int(input())
n = N 
ans = 0
c = 0
co
while n > 10: #桁数を数える
    c = c + 1 
    n = n // 10
while c > 0: 
    m = N // (10 * c)
    d = m % 10
    if d == 1:
        co = co + 1
    else:
        ans = d
        break
    c = c - i
if K < co:
    ans = n
print(ans)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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


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

Submission status: Runtime Error

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

flag = True

for i in range(len(k)):
  if s[i] != 1:
    prtin(s[i])
    flag = false
    break
    
if flag:
  print("1")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s=int(input())
k=int(input())
ans="1"

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

Submission status: Runtime Error

Solution code:
s=int(input())
k=int(input())
ans="1"

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

for _s in s:
    if _s == "1":
        if k == 1:
            print(1)
            break
        else:
            k -= 1
    else:
        print(i)
        break

Submission status: Runtime Error

Solution code:
n = list(input())
k = int(input())
if len(n) == 1:
    print(int(n[0]))
    exit()
for i in range(len(n)):
    if n[i] != "1":
        x = i
        break
if i+1 > k:
    print(1)
    exit()
else:
    print(n[x])

Submission status: Runtime Error

Solution code:
s = input()
n = len(s)
k = int(input())
for i in range(k):
    if i == n:
        break

    if s[i] != '1':
        ans = int(s[i])
        break
    else:
        continue
if ans:
    print(ans)
else:
    print(1)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = input()
k = int(input())
if (s[0] != '1'):
    print(s[0])
    exit(0)
first = s.find('1')
print(1) if k < first else print(s[first+1])

Submission status: Runtime Error

Solution code:
s = input()
k = int(input())
if (s[0] != '1'):
    print(s[0])
    exit(0)
first = s.find('1')
print(1) if k <= first or first == len(s) else print(s[first + 1])

Submission status: Runtime Error

Solution code:
s = input()
k = int(input())
if (s[0] != '1'):
  print(s[0])
  exit(0)
first = s.find('1')
print(1) if k <= first else print(s[first + 1])

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
s=input()
k=int(input())
if s=="1"*len(s):
  print(1)
else:
  i=0
  while True:
    if s[i]!="1":
      n=s[i]
      break
    else:
      i+=1
if k-1<i:
  print(1)
else:
  print(s[i])

Submission status: Runtime Error

Solution code:
S = str(input())
K = int(input())
 
if len(S) == 1:
        print(S[0])
        exit(0)
 
i = 0
while S[i] == '1' and i <= len(S):
        i += 1
 
print(S[i])

Submission status: Runtime Error

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

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

i = 0
while S[i] == '1' and i < len(S):
        i += 1

print(S[i])

Submission status: Runtime Error

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

#gosencho = 5 * (10**15)
#gosencho = 5000000000000000

'''
for i in S:
        print(i)
        #K -= int(i) ** gosencho
        K -= pow(int(i), gosencho)
        if K <= 0:
                print(i)
                exit(0)
'''
'''
ans = ''
for i in S:
        for j in range(int(i)**gosencho):
                ans += i

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

i = 0
while S[i] == '1':
        i += 1
print(S[i])

Submission status: Runtime Error

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

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

i = 0
while S[i] == '1':
        i += 1
print(S[i])

Submission status: Runtime Error

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

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

i = 0
while S[i] == '1':
        i += 1
print(S[i])

Submission status: Runtime Error

Solution code:
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353


S = sys.stdin.buffer.readline().decode().rstrip()
K = int(sys.stdin.buffer.readline())

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

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

if S[0] == "1":
    if K <= int(S[1]) * 5 * 10 ** 15 + 1:
        print(S[1])
    else:
        print(S[2])
else:
    if K <= int(S[0]) * 5 * 10 ** 15:
        print(S[0])
    else:
        print(S[1])

Submission status: Runtime Error

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

if S[0] == "1":
    if K <= int(S[1]) * 5 * 10 ** 16 + 1:
        print(S[1])
    else:
        print(S[2])
else:
    if K <= int(S[0]) * 5 * 10 ** 16 + 1:
        print(S[0])
    else:
        print(S[1])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:

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

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

Submission status: Runtime Error

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


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

    main(s, k)

Submission status: Runtime Error

Solution code:
s=input()
k=int(input())
count=0
for i in s:
    count+=int(i)**(5*(10**10))
    if count>=k:
        print(i)
        exit()

Submission status: Runtime Error

Solution code:
s=input()
k=int(input())
ans=1
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: Runtime Error

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: Runtime Error

Solution code:
s = [int(i) for i in input().strip()]
k = int(input())
ind = 0
while k > 0:
    if s[ind] == 1:
        k -= 1
        ind += 1
    else:
        k = 0
print(s[ind])

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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 count ==0:
  print(st)
elif k <= count+1:
  print(1)
else:
  print(st)

Submission status: Runtime Error

Solution code:
import sys
S=int(input())
K=int(input())
for i,s in enumerate(str(S)):
    if s != "1":
        idx=i
        break 
if K < idx+1:
    print(1)
else:
    print(str(S)[idx])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

if set(S[:K]) == '1':
  print(1)
else:
  idx = 0
  while True:
    if S[idx] != '1':
      print(S[idx])
      exit()
    idx+=1

Submission status: Runtime Error

Solution code:
s=input()
k=int(input())
if k<=len(s):
  if len(set(s[:k]))==1 and s[0]=="1":
    print(1)
    exit(0)
print(s[1])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = str(input())
K = int(input())
L = []

count = 0
for s in S:
    count += 1
    if s != '1':
        t = s
        break

if K < count:
    print(1)
else:
    print(int(t))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

i = 0
while i < k and i < len(s):
    if s[i] != '1':
        break
    i += 1
print(s[i])

Submission status: Runtime Error

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

i = 0
while i < k:
    if s[i] != '1':
        break
    i += 1
print(s[i])

Submission status: Runtime Error

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

i = 0
while i < len(s):
    if math.log(int(s[i])) * (500 * 10 **12 - 1) > math.log(k):
#         print(i, s[i], int(s[i]) ** (500 * 10 *12))
        break
    i += 1
print(s[i])

Submission status: Runtime Error

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

i = 0
while i < len(s):
    if math.log(int(s[i])) * (500 * 10 **12 - 1) >= math.log(k):
#         print(i, s[i], int(s[i]) ** (500 * 10 *12))
        break
    i += 1
print(s[i])

Submission status: Runtime Error

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

i = 0
while i < len(s):
    if math.log(int(s[i])) * (500 * 10 **12) >= math.log(k):
#         print(i, s[i], int(s[i]) ** (500 * 10 *12))
        break
    i += 1
print(s[i])

Submission status: Runtime Error

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

i = 0
while i < len(s):
    if int(math.log(s[i])) * (500 * 10 **12) >= math.log(k):
#         print(i, s[i], int(s[i]) ** (500 * 10 *12))
        break
    i += 1
print(s[i])

Submission status: Runtime Error

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

i = 0
while i < len(s):
    if int(s[i]) ** (500 * 10 **12) >= k:
#         print(i, s[i], int(s[i]) ** (500 * 10 *12))
        break
    i += 1
print(s[i])

Submission status: Runtime Error

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

i = 0
while i < len(s):
    if int(s[i]) ** (500 * 10 *12) >= k:
#         print(i, s[i], int(s[i]) ** (500 * 10 *12))
        break
    i += 1
print(s[i])

Submission status: Runtime Error

Solution code:
S = input()
K = int(input())
for i, s in enumerate(S):
  if s != '1':
    c = i + 1
    break
if K < c:
  print(1)
else:
  print(S[c - 1])

Submission status: Runtime Error

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

print('1' if firstNot1 >= K else S[firstNot1])

Submission status: Runtime Error

Solution code:
from sys import stdin

s = stdin.readline().rstrip()
k = int(stdin.readline().rstrip())

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

if zantei == 1:
    print(1)
else:
    print(zantei)

Submission status: Runtime Error

Solution code:
from sys import stdin
from itertools import product

s = stdin.readline().rstrip()
k = int(stdin.readline().rstrip())

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

if zantei == 1:
    print(1)
 
else:
    print(zantei)

Submission status: Runtime Error

Solution code:
s = input()
k = int(input())
i = 0
while s[i] == '1':
    i += 1
print([1, s[i]][i < k])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

con = 0

for i in range(0,len(S)):
  if S[i] == "1":
    con += 1
  else:break
    

if K < con:
  print(1)
else:
  if S[0] == "1":
    print(int(S[1]))
  else:
    print(int(S[0]))

Submission status: Runtime Error

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

con = 0

for i in S:
  if i == "1":
    con += 1
    


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

Submission status: Runtime Error

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

con = 0

for i in S:
  if i == "1":
    con += 1
    

if K < con:
  print(1)
else:
  if S[0] == "1":
    print(int(S[1]))
  else:
    print(int(S[0]))

Submission status: Runtime Error

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

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

if k == 1:
    print(s[0])
else:
    i = 0
    while i <= k:
        if s[i] != '1':
            print(s[i])
            break
        elif i == k:
            print(s[i])
            break
        i += 1

Submission status: Runtime Error

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

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

if k == 1:
    print(s[0])
else:
    i == 0
    while i <= k:
        if s[i] != '1':
            print(s[i])
            break
        elif i == k:
            print(s[i])
            break
        i += 1

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
S=input()
if S[0]!="1":
  print(S[0])
else:
  K=int(input())
  i=0
  while S[i]=="1":
    i+=1
  if i<K:
    print(S[i])
  else:
    print(1)

Submission status: Runtime Error

Solution code:
N,K = map(int,input().split())
listn = list(str(N))
a = []
if len(str(N)) < K:
    for i in range(len(str(N))):
        if listn[i] != str(1):
            a.append(str(listn[i]))
else:
    for i in range(K):
        if listn[i] != str(1):
            a.append(str(listn[i]))
if a == []:
    print(1)
else:
    print(a[0])

Submission status: Runtime Error

Solution code:
N,K = map(int,input().split())
listn = list(str(N))
for i in range(K):
    if listn[i] != str(1):
        a.append(str(listn[i]))
if a == []:
    print(1)
else:
    print(a[0])

Submission status: Runtime Error

Solution code:
s = list(input())
k = int(input())
l1 = 0
i = 0
while int(s[i])==1:
    i+=1
    l1+=1
if l1 ==0:
    print(s[0])
else:
    if l1 >= k:
        print(1)
    else:
        print(int(s[1]))

Submission status: Runtime Error

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

i = 0
while S[i] == '1':
    i += 1

print(S[i] if K > i else 1)

Submission status: Runtime Error

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

if S[0] == '1':
    cnt = 0
    for s in S:
        if s == '1':
            cnt += 1
        else:
            not1 = s
            break
    if k <= cnt:
        print(1)
    else:
        print(not1)
else:
    print(S[0])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

i=0
while S[i]=='1':
    i+=1

print([1,S[i]][K>i])

Submission status: Runtime Error

Solution code:
s = list(input())
k = int(input())
s = s[:k+1]
nums = ["2","3","4","5","6","7","8","9"]

ans_idx = k
for n in nums:
    if n not in s:
        continue
    cur_idx = s.index(n)
    ans_idx = min(ans_idx,cur_idx)
print(s[ans_idx])

Submission status: Runtime Error

Solution code:
s = input()
t = input()

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

Submission status: Runtime Error

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

i = 0
while True:
    if S[i] != "1":
        print(S[i])
        break
    if i == K:
        print(S[i])
        break
    i += 1

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = input()
K = int(input())
flg = True
for i in range(K):
    if 100 <= i:
        break
    if S[i] != '1':
        flg = False
if flg:
    print('1')
    exit()
for i in range(len(S)):
    if S[i] != '1':
        print(S[i])
        exit()
print('1')

Submission status: Runtime Error

Solution code:
S = input()
K = int(input())
flg = True
for i in range(K):
    if 100 < i:
        break
    if S[i] != '1':
        flg = False
if flg:
    print('1')
    exit()
for i in range(len(S)):
    if S[i] != '1':
        print(S[i])
        exit()
print('1')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = input()
K = int(input())
key = []
for i in range(len(S)):
  if S[i] != "1":
    key.append([i,S[i]])
    break
if K < key[0][0]:
  print(1)
else:
  print(key[0][1])

Submission status: Runtime Error

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

if "1" in n:
    one = n.rfind("1")-n.find("1")+1
    #print(n.rfind("1")+1)
    if one < k:
        print(n[n.rfind("1")+1])
    elif one >= k:
        print(1)
elif "1" not in n:
    print(n[0])

Submission status: Runtime Error

Solution code:
s=input();k=int(input());print(1 if s[0:k]=="1"*k else s.replace("1","")[0])

Submission status: Runtime Error

Solution code:
s=input();k=int(input());print(1 if s[0:k]=="1"*k else input().replace("1","")[0])

Submission status: Runtime Error

Solution code:
print(s=input().replace("1","")[0])

Submission status: Runtime Error

Solution code:
S = list(input())
K = int(input())
i = 0
while S[i] == '1':
    i += 1
if K > i:
    print(int(S[i]))
else:
    print(1)

Submission status: Runtime Error

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

S_set_under_K = set(S[:K])

if len(S_set_under_K) == 1 and S_list[0] == 1:
    print(1)
else:
    print(S_list[1])

Submission status: Runtime Error

Solution code:

a = [int(c) for c in s]
k=int(input())
strong=0
for some in range(k):
  if a[some]==1:
    strong+=1
  if strong==k-1:
    print(some)
  if a[some]!=1:
    print(some)
    break

Submission status: Runtime Error

Solution code:
s=input()
k=input();k=int(k)
l=min(len(s),k)
for i in range(l+1):
  if s[i] == "1":
    tmp=1
  else:
    tmp=int(s[i])
    break
print(tmp)

Submission status: Runtime Error

Solution code:
s=input()
k=input();k=int(k)
l=min(len(s),k)
for i in range(l+1):
  if s[i] == "1":
    pass
  else:
    tmp=s[i]
    break
print(tmp)

Submission status: Runtime Error

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

if(k == 1):
    print(n[0])
elif(len(n)==1):
    print(n)
elif(n[0]== '1'):
    i = 1
    while(n[i] == '1' or i + 1 < len(n)):
        i += 1
    if(k <= i):
        print(1)
    else:
        print(n[i])
else:
    print(n[0])

Submission status: Runtime Error

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

if(k == 1):
    print(n[0])
elif(len(n)==1):
    print(n)
elif(n[0]== '1'):
    i = 1
    while(n[i] == '1'):
        i += 1
    if(k <= i):
        print(1)
    else:
        print(n[i])
else:
    print(n[0])

Submission status: Runtime Error

Solution code:
N = list(input())
K = int(input())
for i in range(len(K)) :
  a = int(N[i])
  if a!=1:
    print(a)
    exit()
print(1)

Submission status: Runtime Error

Solution code:
N = list(input())
K = int(input())
for i in range(len(K)) :
  a = int(i)
  if a!=1:
    print(a)
    exit()
print(1)

Submission status: Runtime Error

Solution code:
N = list(input())
K = int(input())
for i in N :
  a = int(i)
  ans += a**(5*10**15)
  if ans>=K:
    print(a)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = input()
k = int(input())
s = list(reversed(s))
cnt =0
while cnt < k and s[-1] == '1':
  cnt +=1
  s.pop()

print(s[-1])

Submission status: Runtime Error

Solution code:
n = input()
s = input()
if s == n[0] == 1:
  print(1)
else:
  print(n[1])

Submission status: Runtime Error

Solution code:
S=input()
K=int(input())
i=0
while int(S[i])<2:
  i+=1
  if i==len(S)-1: break
print(int(S[i]))

Submission status: Runtime Error

Solution code:
S=input()
K=int(input())
i=0
while int(S[i])<2:
  i+=1
print(int(S[i]))

Submission status: Runtime Error

Solution code:
S=input()
i=0
while int(S[i])<2:
  i+=1
print(int(S[i]))

Submission status: Runtime Error

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

count = 0
for i in range(k):
    c = s[i]
    if c != '1':
        print(c)
    else:
        count += 1
else:
    print('1')

Submission status: Runtime Error

Solution code:
import os, sys, re, math

def oneidx(S):
    idx = -1
    for s in S:
        if s == '1':
            idx += 1
        else:
            break
    return idx

S = input()
N = int(input())
idx = oneidx(S)

if idx >= N:
    print(N)
else:
    print(S[idx+1])

Submission status: Runtime Error

Solution code:
S = str(input())
K = int(input())
if S.count("1") == S(len):
    print(1)
    exit(0)
for s in S:
    if s != "1":
        print(s)
        exit()

Submission status: Runtime Error

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

    ans = 0
    if S[0] == '1':
        ans = S[1]
    else:
        ans = S[0]

    print(ans)


if __name__ == '__main__':
    func()

Submission status: Runtime Error

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

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


if __name__ == '__main__':
    func()

Submission status: Runtime Error

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

for i in range(5000000000000000):
    if '2' in s:
        ss = s.replace('2','22')
    if '3' in s:
        ss = s.replace('3','333')
    if '4' in s:
        ss = s.replace('4','4444')
    if '5' in s:
        ss = s.replsce('5','55555')
    if '6' in s:
        ss = s.replace('6','666666')
    if '7' in s:
        ss = s.replace('7','7777777')
    if '8' in s:
        ss = s.replace('8','88888888')
    if '9' in s:
        ss = s.replace('9','999999999')

print(ss[K])