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:
# AtCoder Beginner Contest 106
# C - To Infinity

# 5000000000000000

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

whileone=-1
ans=-1
for i in range (len(S)):
    if S[i]=="1":
        whileone=i+1
    else:
        ans=S[i]
        break

if whileone>0 and whileone>K:
    print(1)
else:
    print(ans)

Submission status: Wrong Answer

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

s = str(int(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:
#!/usr/bin/env python3

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

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


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

Submission status: Wrong Answer

Solution code:
S=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())
if S[0]=='1' and k==1:
    print(1)
else:
    for s in S:
        if s!='1':
            print(s)
            exit()

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:
#coding: utf-8

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

# find not one
pos = None

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

if pos == None:
    print("1")
else:
    if pos < i:
        print("1")
    else:
        print(S[i])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
#import sys
#import numpy as np
import math
#from fractions import Fraction
import itertools
from collections import deque
from collections import Counter
import heapq
from fractions  import gcd
#input=sys.stdin.readline
#import bisect
s=input()
for a in s:
    if a!="1":
        print(a)
        break

Submission status: Wrong Answer

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

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

print(1)

Submission status: Wrong Answer

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

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

print(1)

Submission status: Wrong Answer

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

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

print(1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
S,K=list(input()),int(input())
for i in S:
    if i!='1'or K==0:
        print(i)
        exit()
    K-=1

Submission status: Wrong Answer

Solution code:
S,K=list(input()),int(input())
for i in S:
    if i!='1':
        print(i)
        exit()

Submission status: Wrong Answer

Solution code:
S,K=input(),int(input())
for i in list(S):
    if i!='1':print(i);break

Submission status: Wrong Answer

Solution code:
S = input()

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

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':

	S = input()
	n = int(input())

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

Submission status: Wrong Answer

Solution code:
A = str(input())
B = int(input())
count = 0

for i in range(len(A)):
    if A[i] == "1":
        count += 1
    elif len(A) == count:
        print(1)
        break
    else:
        if B <= count:
            print(1)
            break
        else:
            print(A[i])
            break

Submission status: Wrong Answer

Solution code:
A = str(input())
B = int(input())
count = 0

for i in range(len(A)):
    if A[i] == "1":
        count += 1
    else:
        if B <= count:
            print(1)
            break
        else:
            print(A[i])
            break

Submission status: Wrong Answer

Solution code:
A = str(input())
B = int(input())
count = 0

for i in range(len(A)):
    if A[i] == "1":
        count += 1
    else:
        if count == B:
            print(1)
            break
        else:
            print(A[i])
            break

Submission status: Wrong Answer

Solution code:
A = str(input())
B = input()
count = 0

for i in range(len(A)):
    if A[i] == 1:
        count += 1
    else:
        if count == B:
            print(1)
            break
        else:
            print(A[i])
            break

Submission status: Wrong Answer

Solution code:
A = str(input())
B = input()
count = 0

for i in range(len(A)):
    if A[i] == 1:
        count += 1
    else:
        if count == B:
            print(1)
        else:
            print(A[i])

Submission status: Wrong Answer

Solution code:
A = input()
B = input()

for i in range(len(A)):
    if A[i] != "1":
        print(A[i])
        break
    elif A[i] == 1 and B[i] == 1:
        print(1)

Submission status: Wrong Answer

Solution code:
A = input()
B = input()

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

Submission status: Wrong Answer

Solution code:
A = input()
B = input()

for i in range(len(B)):
    if A[i] != 1:
        print(A[i])
        break

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
#import numpy as np
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial#, gcd
from bisect import bisect_left, bisect_right #bisect_left(list, value)
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
pl = lambda x: print(*x, sep='\n')

S = input()
K = input()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

K = int(input())

num_digit = 0

for s in S:
    if s == 1:
        num_digit += 1
    else:
        num_digit += s * 5 * 10**15

    if num_digit >= K:
        print(s)
        break

Submission status: Wrong Answer

Solution code:
import sys
s = input()
n = int(input())
if n == 1:
	print(s[0])
	sys.exit()
for i in s:
	if i != '1':
		print(i)
		sys.exit()
print(1)

Submission status: Wrong Answer

Solution code:
import sys
s = input()
n = int(input())
if n == 1:
	print(s[0])
	sys.exit()
for i in s:
	if i != '1':
		print(i)
		sys.exit()

Submission status: Wrong Answer

Solution code:
import sys
s = input()
n = int(input())
for i in s:
	if i != '1':
		print(i)
		sys.exit()

Submission status: Wrong Answer

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

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

print(1)

Submission status: Wrong Answer

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

ans = '1'
if K == 1:
    ans = S[0]
else:
    for i in S:
        if i == ans:
            continue
        else:
            ans = i
            break

print(ans)

Submission status: Wrong Answer

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

ans = '1'
for c in k:
    if c != '1':
        ans = c
        break
print(ans)

Submission status: Wrong Answer

Solution code:
elems = map(int,list(raw_input()))
k = int(raw_input()) -1

for v in elems:
	if v == 1: k -=1
	else: k = 0
	if k <= 0:
		print v
		break

Submission status: Wrong Answer

Solution code:
elems = map(int,list(raw_input()))
k = int(raw_input()) -1
mem = {}
def fastp(a,p):
	if (a,p) not in mem:
		if p == 0:
			return 1
		mem[(a,p)] = (fastp(a,p/2) ** 2) * (a if p % 2 else 1)
	return mem[(a,p)]
for v in elems:
	if v == 1:
		k -=1
	else:
		k = 0
	if k == 0:
		print v
		break

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline

def main():
    ans = 0
    s = input()
    k = int(input())
    for i in range(len(s)):
        if s[i] != '1':
            if k > i+1:
                ans = s[i]
            else:
                ans = '1'
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline

def main():
    ans = 0
    s = input().rstrip('\n')
    k = int(input())
    for i in range(len(s)):
        if s[i] != '1':
            if k < i+1:
                ans = s[i]
            else:
                ans = '1'
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline

def main():
    ans = ''
    index = 0
    s = input().rstrip('\n')
    k = int(input())
    for i in range(len(s)):
        if s[i] != '1':
            ans = s[i]
            index = i
            break
    if ans == '' or k < index:
        ans = '1'
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline

def main():
    ans = ''
    index = 0
    s = input()
    k = int(input())
    for i in range(len(s)):
        if s[i] != '1':
            ans = s[i]
            index = i
            break
    if ans == '' or k < index:
        ans = '1'
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
s = input()
k = int(input())

i = 0
while i < len(s) - 1:
    if s[i] == '1':
        i += 1
    else:
        print(s[i])
        exit()
    if i == k -1:
        print(1)
        exit()
print(s[i])

Submission status: Wrong Answer

Solution code:
def main():
    s = input()
    k = int(input())
    r = '1'
    for i,v in enumerate(s):
        if v != '1':
            r = v
            break
    if k < i:
        print(1)
    else:
        print(r)
    
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

S = list(input().rstrip('\n'))
K = int(input())

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

Submission status: Wrong Answer

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

S = list(input().rstrip('\n'))
K = int(input())

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

        break
print(n)

Submission status: Wrong Answer

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

S = list(input().rstrip('\n'))
K = int(input())

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

Submission status: Wrong Answer

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

if len(s) <= k:
    for i in s:
        if i != 1:
            ans = i
            break
else:
    for i in range(0,k+1):
        if s[i] != 1:
            ans = s[i]
            break

print(ans)

Submission status: Wrong Answer

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

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

if s[0] == "1":
    if k == 1:
        print(1)
        exit()
    else:
        for i in range(len(s)):
            if s[i] == "1":
                continue
            elif (s[i] != "1") and (i+1 <= k):
                print(s[i])
                exit()
            elif (s[i] != "1") and (i+1 > k):
                print(1)
                exit()
        print(1)
        exit()

elif s[0] != "1":
    print(s[0])
    exit()

Submission status: Wrong Answer

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

for i in range(len(s)):
    if s[i] != 1:

        if s[0] == "1" and k == 1:
            print(1)
            exit()
        elif s[0] == "1" and k > 100:
            print(s[1])
            exit()
        elif s[0] == "1" and k <= 100:
            for i in range(100):
                if s[i] != 1 and i+1 <= k:
                    print(s[i])
                    exit()
            print(1)
            exit()
        elif s[0] != "1":
            print(s[0])
            exit()

print(1)

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
s = input()

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

Submission status: Wrong Answer

Solution code:
S=input();
K=input();
i = 0;
for i in range(len(S)) :
    if int(S[i]) > 1 :
        print(S[i]);
        break;

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=list(map(int,tuple(input())))
k=int(input())
i=0
if 1 in s:
  i=s.index(1)
  if i+1>=k:
      print(1)
  else:
      print(s[i+1])
else:
  print(s[0])

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:

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

if __name__=="__main__":
    S = input()
    K = int(input())
#    d = 5*10**15
    s = [int(c) for c in S]
#    print(s)
    solve()

Submission status: Wrong Answer

Solution code:

def solve():
    for i in s:
        if i == 1:
            continue
        else:
            print(i)
            exit()
if __name__=="__main__":
    S = input()
    K = int(input())
#    d = 5*10**15
    s = [int(c) for c in S]
#    print(s)
    solve()

Submission status: Wrong Answer

Solution code:
import sys
import itertools

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

in_n = lambda: int(readline())
in_nn = lambda: map(int, readline().split())
in_nl = lambda: list(map(int, readline().split()))
in_na = lambda: map(int, read().split())
in_s = lambda: readline().rstrip().decode('utf-8')


def main():

    S = list(map(int, in_s()))
    K = in_n()

    if not(set(S) - {1}):
        print(1)
        exit()

    gr = itertools.groupby(S)

    init_s = []
    for k, l in gr:
        init_s.append((k, len(list(l))))

    N = len(init_s)

    for t in range(100):
        for i in range(N):
            k, v = init_s[i]
            if k == 1:
                continue
            else:
                init_s[i] = (k, k * v)

    tv = 0
    for k, v in init_s:
        tv += v
        if tv > K:
            ans = k
            break

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
import itertools

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

in_n = lambda: int(readline())
in_nn = lambda: map(int, readline().split())
in_nl = lambda: list(map(int, readline().split()))
in_na = lambda: map(int, read().split())
in_s = lambda: readline().rstrip().decode('utf-8')


def main():

    S = list(map(int, in_s()))
    K = in_n()

    if not(set(S) - {1}):
        print(1)
        exit()

    gr = itertools.groupby(S)

    init_s = []
    for k, l in gr:
        init_s.append((k, len(list(l))))

    N = len(init_s)

    for t in range(100):
        for i in range(N):
            k, v = init_s[i]
            if k == 1:
                continue
            else:
                init_s[i] = (k, k * v)

    tv = 0
    for k, v in init_s:
        tv += v
        print(k, v)
        if tv > K:
            ans = k
            break

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
def readInt():
  return int(input())
def readInts():
  return list(map(int, input().split()))
def readChar():
  return input()
def readChars():
  return input().split()

s = readChar()
k = readInt()
if k==1:
  print(s[0])
  exit()
for i in range(len(s)):
  if s[i]!=str(1):
    print(s[i])
    exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for v in range(len(s)):
    if (s[v] == "2" or s[v] == "3" or s[v] == "4"):
        print(s[v])
        break
    if v+1 == k:
        print(s[v])
        break
    if v+1 == len(s):
        print(s[0])
        break

Submission status: Wrong Answer

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

for v in range(k):
    if (s[v] == "2" or s[v] == "3" or s[v] == "4"):
        print(s[v])
        break
    if v+1 == k:
        print(1)
        break

Submission status: Wrong Answer

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

for i, v in enumerate(s):
    if (v == "2" or v == "3" or v == "4"):
        print(v)
        break
    if i+1 == k:
        print(v)
        break

Submission status: Wrong Answer

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

for i, v in enumerate(s):
    if (v == "2" or v == "3" or v == "4") and k >= i+1:
        print(v)
        break
    if i+1 == k:
        print(v)
        break

Submission status: Wrong Answer

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

for i, v in enumerate(s):
    if (v == "2" or v == "3" or v == "4") and k >= i+1:
        print(v)
        break
    if i+1 == k and v == "1":
        print(1)
        break

Submission status: Wrong Answer

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

    for ch in S:
        if ch != '1':
            print(ch)
            return
    print("1")
    return

main()

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
k -= 1
cnt = 0

for i in range(len(s)):
    if s[i] == '1':
        cnt += 1
    else:
        break

if cnt < k:
    print(s[cnt])
else:
    print(1)

Submission status: Wrong Answer

Solution code:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7

S = X()
K = i()

for i in S:
    if i == "1":
        pass
    else:
        print(i)
        sys.exit()

print(1)

Submission status: Wrong Answer

Solution code:
def main():
    s = list(input())
    k = input()
    n = len(s)
    for i in range(n):
        if s[i] != "1":
            ans = s[i]
            break
        if i == n-1:
            ans = s[0]
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = list(input())
s = [int(l) for l in s]
k = int(input())

s_set = set(s)

if s[0] > 1:
  print(s[0])
elif sum(s_set) == 1:
  print(1)
else:
  i = 0
  while s[i] == 1:
    i += 1
    if s[i] != 1:
      print(s[i])
      break

Submission status: Wrong Answer

Solution code:
s = list(input())
s = [int(l) for l in s]
k = int(input())

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

Submission status: Wrong Answer

Solution code:
S=input()
K=int(input())
ans=0
mod=5*(10**15)
for i in range(len(S)):
  a=int(S[i])
  if a==1:
    ans+=1
  else:
    ans+=a*mod
  if ans>=K:
    print(a)
    break

Submission status: Wrong Answer

Solution code:
S=input()
K=int(input())
dp=[]
mod=5*(10**15)
for i in range(len(S)):
  if S[i]=='1':dp.append([int(S[i]),1])
  else:dp.append([int(S[i]),int(S[i])*mod])
ans=0
for i in range(len(dp)):
  ans+=dp[i][1]
  if ans>=K:
    print(dp[i][0])
    break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

    for i, v in enumerate(s, 1):
        if v != '1':
            tmp = v
            break
    if i >= k or i == len(s):
        print(1)
    else:
        print(tmp)

Submission status: Wrong Answer

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

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

    for i, v in enumerate(s, 1):
        if v != '1':
            tmp = v
            break
    if i >= k:
        print(1)
    else:
        print(tmp)

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)
            break

Submission status: Wrong Answer

Solution code:
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    s = input()
    k = I()
    for i in s:
        if i != '1':
            print(i)
            sys.exit()
    print(1)
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
# C - To Infinity

S = list(str(input()))
K = int(input())

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

Submission status: Wrong Answer

Solution code:
def mi():
    return map(int, input().split())

def ii():
    return int(input())

def main():
    S = input()
    K = ii()
    if S[0] == '1':
        if K == 1:
            ans = S[0]
        else:
            ans = S[1]
    else:
        ans = S[0]

    print(ans)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
f = True
for si in s:
    if si != "1":
        print(si)
        f = False
        break
if f: print("1")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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




num = 1


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

Submission status: Wrong Answer

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


ind = 0
num = 1


for i in range(len(s)):
    ind = i+1
    if s[i] != 1:
        num = int(s[i])
        break
        
if k>= ind:
    ans = num
else:
    ans = 1
    
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

# K文字目(k<=10**18)までについて、5000兆日後は、
# 最初の文字が'1'でない限り、その数字で埋め尽くされる
if S[0]=='1':
    print('1' if k<=1 else S[1])
else:
    print(S[0])

Submission status: Wrong Answer

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

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[0])
else:
    print(s[1])

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[0])
else:
    print(s[2])

Submission status: Wrong Answer

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
def main():
    S = readline().strip().decode()
    K = int(readline())
    if (S[0] == '1'):
        if K == 1:
            print('1')
            return
        else:
            print(S[1])
    else:
        print(S[0])
    
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())
mem = 1
for i in S:
  if i != "1": 
    print(i)
    break
  else: mem += 1 
  if mem == K: print(i)  
else: 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)
      break
  else: print("1")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())
ans = -1
for i, s in enumerate(S):
    if i == K:
        ans = s
        break
    if s == '1':
        continue
    else:
        ans = s
        break

print(ans)

Submission status: Wrong Answer

Solution code:
S = input()
K = input()
ans = -1
for i, s in enumerate(S):
    if i == K:
        ans = s
        break
    if s == '1':
        continue
    else:
        ans = s
        break

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=list(map(int,list(input())))
k=int(input())
if s[0]!=1:
  print(s[0])
elif k>1:
  print(s[1])
else:
  print(1)

Submission status: Wrong Answer

Solution code:
s=list(map(int,list(input())))
k=int(input())
if s[0]!=1:print(s[0])
elif len(s)>1 and k>1:print(s[1])
else:print(1)

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=input()
k=int(input())
for i in range(len(s)):
    if s[i]=="1":
        k-=1
    else:
        k-=int(s[i])*(5*10**16)
    if k<=0:
        print(s[i])
        exit()