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:
#C
S = input()
K = int(input())
if K==1:
    print(S[0])
else:
    i = 0
    counter = 1
    while(i < len(S)):
        if int(S[i]) == 1 and counter-i ==1:
            i+=1
            counter +=1
        else:
            print(S[i])
            break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# encoding: utf-8
S = input()
K = int(input())

# confirm that 2 ** (5000 tri.) = (1024) ** (15 * 10 ** 14) >> 10 ** 18 >= K
tmp = 1
for i in range(5000 * (10 ** 12)):
    tmp = tmp << 1
    if tmp > K:
        for si in S:
            if si != "1": break
        print(si)
        break
else:
    print("WA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

S=str(input())
K=int(input())
LK=math.log10(K)
n=5*10**15
length=0
for i in range(len(S)) :
    length+=n*math.log10(int(S[i]))
    if LK<=length :
        break
print(S[i])

Submission status: Wrong Answer

Solution code:
S = list(map(int,input()))
K = int(input())
ans = 1
if K == 1 or S.count(S[0]) == len(S) or S.count(1) == len(S):
    print(S[0])
else:
  for x in range(K):
    if S[x] != 1:
      ans = S[x]
      break
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

a = list(map(int, S))

j = 1

for i in a:
    if i != 1:
        j = i
        break
    
print(j)

Submission status: Wrong Answer

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

a = list(map(int, S))

j = 0

for i in a:
    if i != 1:
        j = i
        break
    else:
        j = 1

print(j)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np

s = input()
k = input()

for i, str in enumerate(s, 1):
    if i > int(k):
        print(1)
        exit()

    if str != "1":
        print(str)
        exit()

Submission status: Wrong Answer

Solution code:
import numpy as np

s = input()
k = input()

for i, str in enumerate(s):
    if str != "1":
        print(str)
        exit()
    if i >= int(k):
        print(1)
        exit()

Submission status: Wrong Answer

Solution code:
# coding: utf-8

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

ans = list(str(S))

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

Submission status: Wrong Answer

Solution code:
import numpy as np

s = map(str, input().split())
k = map(str, input().split())

for st in s:
    for str in st:
        if str != "1":
            print(int(str))
            exit()

print("1")
exit()

Submission status: Wrong Answer

Solution code:
import numpy as np

s = map(str, input().split())
k = map(str, input().split())

for st in s:
    for str in st:
        if str != "1":
            print(int(str))
            exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

tyo = 5e15
# tyo = 2
cnt = 0

char = [int(ss) for ss in s]


MOD = 1000000007
def fast_power(base, power):
    """
    Returns the result of a^b i.e. a**b
    We assume that a >= 1 and b >= 0

    Remember two things!
     - Divide power by 2 and multiply base to itself (if the power is even)
     - Decrement power by 1 to make it even and then follow the first step
    """

    result = 1
    while power > 0:
        # If power is odd
        if power % 2 == 1:
            result = (result * base) % MOD

        # Divide the power by 2
        power = power / 2
        # Multiply base to itself
        base = (base * base) % MOD

    return result

# def pwr(a, b):
#     if b == 1:
#         return a
#
#     halfpow = pwr(a, b // 2)
#     if (b % 2) == 0:
#         return halfpow * halfpow
#     else:
#         return a * halfpow * halfpow
# print(fast_power(1, 100))
# exit()
res = 0

_sum = 0
ok = 0
for num in char:
    _sum = _sum + (fast_power(num, tyo))
    if _sum >= k and ok == 0:
        res = num
        ok = 1

print(res)

Submission status: Wrong Answer

Solution code:
S=input()
K=int(input())
co=0	
a=0
for j in S:
	a=a+1
	if j!='1':
		print(j)
		co=1
		break
	if a>K:
		break
if co==0:
	print('1')

Submission status: Wrong Answer

Solution code:
S=input()
K=int(input())
co=0
for j in S:
	if j!='1':
		print(j)
		co=1
		break
	if int(j)>K:
		break
if co==0:
	print('1')

Submission status: Wrong Answer

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

tyo = 5e15
# tyo = 2
cnt = 0

char = [int(ss) for ss in s]


MOD = 1000000007
def fast_power(base, power):
    """
    Returns the result of a^b i.e. a**b
    We assume that a >= 1 and b >= 0

    Remember two things!
     - Divide power by 2 and multiply base to itself (if the power is even)
     - Decrement power by 1 to make it even and then follow the first step
    """

    result = 1
    while power > 0:
        # If power is odd
        if power % 2 == 1:
            result = (result * base) % MOD

        # Divide the power by 2
        power = power / 2
        # Multiply base to itself
        base = (base * base) % MOD

    return result

# def pwr(a, b):
#     if b == 1:
#         return a
#
#     halfpow = pwr(a, b // 2)
#     if (b % 2) == 0:
#         return halfpow * halfpow
#     else:
#         return a * halfpow * halfpow
# print(fast_power(1, 100))
# exit()
res = 1

_sum = 0
ok = 0
for num in char:
    _sum = _sum + (fast_power(num, tyo))
    if _sum >= k and ok == 0:
        res = num
        ok = 1

print(res)

Submission status: Wrong Answer

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

tyo = 5e15
# tyo = 2
cnt = 0

char = [int(ss) for ss in s]


MOD = 1000000007
def fast_power(base, power):
    """
    Returns the result of a^b i.e. a**b
    We assume that a >= 1 and b >= 0

    Remember two things!
     - Divide power by 2 and multiply base to itself (if the power is even)
     - Decrement power by 1 to make it even and then follow the first step
    """

    result = 1
    while power > 0:
        # If power is odd
        if power % 2 == 1:
            result = (result * base) % MOD

        # Divide the power by 2
        power = power / 2
        # Multiply base to itself
        base = (base * base) % MOD

    return result

# def pwr(a, b):
#     if b == 1:
#         return a
#
#     halfpow = pwr(a, b // 2)
#     if (b % 2) == 0:
#         return halfpow * halfpow
#     else:
#         return a * halfpow * halfpow


res = 0

_sum = 0
ok = 0
for num in char:
    _sum = _sum + (fast_power(num, tyo))
    if _sum > k and ok == 0:
        res = num
        ok = 1

print(res)

Submission status: Wrong Answer

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

tyo = 5e15
# tyo = 2
cnt = 0

char = [int(ss) for ss in s]


MOD = 1000000007
def fast_power(base, power):
    """
    Returns the result of a^b i.e. a**b
    We assume that a >= 1 and b >= 0

    Remember two things!
     - Divide power by 2 and multiply base to itself (if the power is even)
     - Decrement power by 1 to make it even and then follow the first step
    """

    result = 1
    while power > 0:
        # If power is odd
        if power % 2 == 1:
            result = (result * base) % MOD

        # Divide the power by 2
        power = power / 2
        # Multiply base to itself
        base = (base * base) % MOD

    return result

# def pwr(a, b):
#     if b == 1:
#         return a
#
#     halfpow = pwr(a, b // 2)
#     if (b % 2) == 0:
#         return halfpow * halfpow
#     else:
#         return a * halfpow * halfpow


res = 0

_sum = 1
ok = 0
for num in char:
    _sum = _sum + (fast_power(num, tyo))
    if _sum >= k and ok == 0:
        res = num
        ok = 1

print(res)

Submission status: Wrong Answer

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

tyo = 5e15
# tyo = 2
cnt = 0

char = [int(ss) for ss in s]


MOD = 1000000007
def fast_power(base, power):
    """
    Returns the result of a^b i.e. a**b
    We assume that a >= 1 and b >= 0

    Remember two things!
     - Divide power by 2 and multiply base to itself (if the power is even)
     - Decrement power by 1 to make it even and then follow the first step
    """

    result = 1
    while power > 0:
        # If power is odd
        if power % 2 == 1:
            result = (result * base) % MOD

        # Divide the power by 2
        power = power / 2
        # Multiply base to itself
        base = (base * base) % MOD

    return result

# def pwr(a, b):
#     if b == 1:
#         return a
#
#     halfpow = pwr(a, b // 2)
#     if (b % 2) == 0:
#         return halfpow * halfpow
#     else:
#         return a * halfpow * halfpow


res = 0

_sum = 1
ok = 0
for num in char:
    _sum = _sum + (fast_power(num, tyo))
    if _sum > k and ok == 0:
        res = num
        ok = 1

print(res)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
S=input()
K=int(input())
co=0
for j in S:
	if j!='1' and int(j)<=K:
		print(j)
		co=1
		break
if co==0:
	print('1')

Submission status: Wrong Answer

Solution code:
s = input()
k,counter = int(input()),0
while counter < len(s):
    if s[counter] != "1":
        print(s[counter])
        counter = True
        break
    counter += 1
if counter != True:
    print(1)

Submission status: Wrong Answer

Solution code:
S=input()
K=int(input())
co=0
for j in S:
	if j!='1' and int(j)<=K:
		print(j)
		co=1
		break
	else:
		break
if co==0:
	print('1')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S=input()
K=int(input())
co=0
for j in S:
	if j!='1' and int(j)<=K:
		print(j)
		co=1
		break
	if int(j)>K:
		break
if co==0:
	print('1')

Submission status: Wrong Answer

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

char = [ss for ss in s]


res = '1'

_sum = 0
for num in char:
    if num != '1':
        res = num
        break

print(res)

Submission status: Wrong Answer

Solution code:
S = list(map(int,input()))
K = int(input())
if K == 1 or S.count(S[0]) == len(S) or S.count(1) == len(S):
    print(S[0])
else:
  for x in range(len(S)):
    if S[x] != 1:
      print(S[x])
      break

Submission status: Wrong Answer

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

char = [ss for ss in s]


res = '1'

_sum = 0
for num in range(k):
    if num != '1':
        res = num
        break

print(res)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

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

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

print(S[i])

Submission status: Wrong Answer

Solution code:
s = input()
k,counter,n = int(input()),0,0
while counter < len(s):
    if s[counter] == "1":
        n += 1
    else:
        print(s[counter])
        break
    counter += 1
if n == len(s):
    print(1)

Submission status: Wrong Answer

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

def func(N, K):
    for n in range(len(N)):
        if N[n] != 1:
            if K > n+1:
                return N[n]
    
    return 1

print(func(N, K))

Submission status: Wrong Answer

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

char = [int(ss) for ss in s]


res = 1

_sum = 0
for num in char:
    if num != 1:
        res = num
        break

print(res)

Submission status: Wrong Answer

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

tyo = 5e15
# tyo = 2
cnt = 0

char = [int(ss) for ss in s]


MOD = 1000000007
def fast_power(base, power):
    """
    Returns the result of a^b i.e. a**b
    We assume that a >= 1 and b >= 0

    Remember two things!
     - Divide power by 2 and multiply base to itself (if the power is even)
     - Decrement power by 1 to make it even and then follow the first step
    """

    result = 1
    while power > 0:
        # If power is odd
        if power % 2 == 1:
            result = (result * base) % MOD

        # Divide the power by 2
        power = power / 2
        # Multiply base to itself
        base = (base * base) % MOD

    return result

# def pwr(a, b):
#     if b == 1:
#         return a
#
#     halfpow = pwr(a, b // 2)
#     if (b % 2) == 0:
#         return halfpow * halfpow
#     else:
#         return a * halfpow * halfpow


res = 1

_sum = 0
# ok = 0
for num in char:
    # _sum = int(_sum) + (fast_power(num, tyo))
    if num != 1:
        res = num
        break

print(res)

Submission status: Wrong Answer

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

def func(N, K):
    for n in range(len(N)):
        if N[n] != '1':
            if K > n+1:
                return N[n]
            else:
                return '1'

print(func(N, K))

Submission status: Wrong Answer

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

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

print(tmp)

Submission status: Wrong Answer

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

tyo = 5e15
# tyo = 2
cnt = 0

char = [int(ss) for ss in s]


MOD = 1000000007
def fast_power(base, power):
    """
    Returns the result of a^b i.e. a**b
    We assume that a >= 1 and b >= 0

    Remember two things!
     - Divide power by 2 and multiply base to itself (if the power is even)
     - Decrement power by 1 to make it even and then follow the first step
    """

    result = 1
    while power > 0:
        # If power is odd
        if power % 2 == 1:
            result = (result * base) % MOD

        # Divide the power by 2
        power = power / 2
        # Multiply base to itself
        base = (base * base) % MOD

    return result

# def pwr(a, b):
#     if b == 1:
#         return a
#
#     halfpow = pwr(a, b // 2)
#     if (b % 2) == 0:
#         return halfpow * halfpow
#     else:
#         return a * halfpow * halfpow


res = 1

_sum = 0
ok = 0
for num in char:
    # _sum = int(_sum) + (fast_power(num, tyo))
    if num != 1 and ok == 0:
        res = num
        ok = 1

print(res)

Submission status: Wrong Answer

Solution code:
S=input()
K=int(input())
co=0
for j in S:
	if j!='1':
		print(j)
		co=1
		break
if co==0:
	print('1')

Submission status: Wrong Answer

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

for i, k in enumerate(range(int(K))):
    if S[k] != '1':
        print(S[k])
        break
    if i == len(K)-1:
        print('1')

Submission status: Wrong Answer

Solution code:
S = list(map(int,input()))
K = int(input())
if K == 1 or S.count(S[0]) == len(S):
    print(S[0])
else:
  for x in range(len(S)):
    if S[x] != 1:
      print(S[x])
      break

Submission status: Wrong Answer

Solution code:
S=input()
K=int(input())
co=0
for j in S:
	if j!='1':
		print(j)
		co=1
		break
if co==0:
	print(1)

Submission status: Wrong Answer

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

tyo = 5e15
# tyo = 2
cnt = 0

char = [int(ss) for ss in s]


MOD = 1000000007
def fast_power(base, power):
    """
    Returns the result of a^b i.e. a**b
    We assume that a >= 1 and b >= 0

    Remember two things!
     - Divide power by 2 and multiply base to itself (if the power is even)
     - Decrement power by 1 to make it even and then follow the first step
    """

    result = 1
    while power > 0:
        # If power is odd
        if power % 2 == 1:
            result = (result * base) % MOD

        # Divide the power by 2
        power = power / 2
        # Multiply base to itself
        base = (base * base) % MOD

    return result

# def pwr(a, b):
#     if b == 1:
#         return a
#
#     halfpow = pwr(a, b // 2)
#     if (b % 2) == 0:
#         return halfpow * halfpow
#     else:
#         return a * halfpow * halfpow


res = 1

_sum = 0
ok = 0
for num in char:
    _sum = int(_sum) + (fast_power(num, tyo))
    if num != 1 and ok == 0:
        res = num
        ok = 1

print(res)

Submission status: Wrong Answer

Solution code:
S=input()
K=int(input())
l=len(S)
r=0
q=1
if l==1:
    print(int(S))
else:
    for i in range(0,l-1):
        if int(S[i]) != 1:
            r=int(S[i])
            q=i
            break
    if q>=K:
        print(1) 
    else:
        print(r)

Submission status: Wrong Answer

Solution code:
S = list(map(int,input()))
K = int(input())
if K == 1 or S.count(1) == len(S):
    print(S[0])
else:
  for x in range(len(S)):
    if int(S[x]) != 1:
      print(S[x])
      break

Submission status: Wrong Answer

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

def func(N, K):
    if K == 1:
        return N[0]
    else:
        for n in N:
            if n != '1':
                return n
        else:
            return '1'

print(func(N, K))

Submission status: Wrong Answer

Solution code:
S = list(input())
K = int(input())
if K == 1 or S.count(1) == len(S):
    print(S[0])
else:
  for x in range(len(S)):
    if int(S[x]) != 1:
      print(S[x])
      break

Submission status: Wrong Answer

Solution code:
S=input()
K=int(input())
l=len(S)
r=0
q=0
if l==1:
    print(int(S))
else:
    for i in range(0,l):
        if int(S[i]) != 1:
            r=int(S[i])
            q=i
            break
    if q>=K:
        print(1) 
    else:
        print(r)

Submission status: Wrong Answer

Solution code:
S = list(input())
K = int(input())
if K == 1:
    print(S[0])
else:
  for x in range(len(S)):
    if int(S[x]) != 1:
      print(S[x])
      break

Submission status: Wrong Answer

Solution code:
import sys

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


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

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
for c in s:
    if (int(c) > 1):
        print(c)
        break
    k -= (int(c) - 1) * 5 * int(1e15)
    if k <= 0:
        print(c)
        break

Submission status: Wrong Answer

Solution code:
S=input()
K=int(input())
co=""
for j in S:
	if j=='1':
		co='1'
	else:
		co=j
		break
print(co)

Submission status: Wrong Answer

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


if s[0] == "1":
    if k == 1:
        print(1)
        #print("case11")
    else:
        print(s[1])
        #print("case12")
else:
    print(s[0])

Submission status: Wrong Answer

Solution code:
S=input()
K=int(input())
co=''
for j in S:
	if j=='1':
		co=1
	else:
		co=j
		break
print(co)

Submission status: Wrong Answer

Solution code:
import sys

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

if (k <= len(s)):
    for i in range(k - 1):
        if s[i] != '1':
            print(s[i])
            sys.exit()
    print('1')
else:
    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())
 
if K == 1:
  print(int(S[0]))
elif len(S) == 1:
  print(int(S))
elif S[0] == "1":
  print(int(S[0]))
else:
  print(int(S[1]))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())
flag = False
check = True
count = 0
for i in S:
    if(int(i) == 1 and check == True):
        count += 1
    elif(int(i) != 1):
        if(count <= K and check == True):
            break
        else:
            check = False
        print(i)
        flag = True
        break
if(flag == False):
    print("1")

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
curr = 0
for c in s:
    curr += (int(c) - 1) * 5 * int(1e15)
    if curr >= k:
        print(c)
        break

Submission status: Wrong Answer

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


print(s[0])

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

Submission status: Wrong Answer

Solution code:
#兆：10**12
#5000兆:5*(10**15)

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


if K <= int(S[0])**(5*(10**5)):
    print(S[0])
elif K <= int(S[0])**(5*(10**5)) + int(S[1])**(5*(10**5)):
    print(S[1])
elif K <= int(S[0])**(5*(10**5)) + int(S[1])**(5*(10**5)) + int(S[2])**(5*(10**5)):
    print(S[2])
elif K <= int(S[0])**(5*(10**5)) + int(S[1])**(5*(10**5)) + int(S[2])**(5*(10**5)) + int(S[3])**(5*(10**5)):
    print(S[3])
else:
    for i in range(len(S)):
        if S[i] != "1":
            print(S[i+1])
        break

Submission status: Wrong Answer

Solution code:
import sys

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


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

Submission status: Wrong Answer

Solution code:
#兆：10**12
#5000兆:5*(10**15)

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


if K <= int(S[0])**(5*(10**5)):
    print(S[0])
elif K <= int(S[0])**(5*(10**5)) + int(S[1])**(5*(10**5)):
    print(S[1])
elif K <= int(S[0])**(5*(10**5)) + int(S[1])**(5*(10**5)) + int(S[2])**(5*(10**5)):
    print(S[2])
elif K <= int(S[0])**(5*(10**5)) + int(S[1])**(5*(10**5)) + int(S[2])**(5*(10**5)) + int(S[3])**(5*(10**5)):
    print(S[3])
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())
flag = False
check = True
count = 0
for i in S:
    if(int(i) == 1):
        count += 1
    elif(int(i) != 1):
        if(count <= K and check == True):
            break
        else:
            check = False
        print(i)
        flag = True
        break
if(flag == False):
    print("1")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

chk=1
ans=f=0
for i in s:
    chk=1
    if i=="1": 
        ans+=1
        continue
    for j in range(p):
        chk*=int(i)
        if ans+chk>=k:
            print(i)
            f=1
            break
    ans+=chk
    if f==1: break
if f==0: print(s[-1])

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

index = len(s)
s2 = -1
for ii in range(0, len(s)):
    if s[ii] != "1":
        index = ii
        s2 = int(s[ii])
        break

if index != len(s):
    if K < index:
        print(1)
    else:
        print(s2)
else:
    if K <= index:
        print(1)

Submission status: Wrong Answer

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

#5 sen tyou = 5 * (10 ** 15)

co = 0
for i in s:
    co += 1
    if i == "1":
        if k == co:
            print(1)
            break
        else:
            continue
    else:
        print(str(i))

Submission status: Wrong Answer

Solution code:
s = str(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 = input()
k = int(input())

#5 sen tyou = 5 * (10 ** 15)

co = 0
for i in s:
    co += 1
    if i == "1":
        if k == co:
            print(1)
            break
        else:
            continue
    else:
        print(int(i))

Submission status: Wrong Answer

Solution code:
#兆：10**12
#5000兆:5*(10**15)

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


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

Submission status: Wrong Answer

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

tyo = 5e15
# tyo = 2
cnt = 0

char = [int(ss) for ss in s]


MOD = 1000000007
def fast_power(base, power):
    """
    Returns the result of a^b i.e. a**b
    We assume that a >= 1 and b >= 0

    Remember two things!
     - Divide power by 2 and multiply base to itself (if the power is even)
     - Decrement power by 1 to make it even and then follow the first step
    """

    result = 1
    while power > 0:
        # If power is odd
        if power % 2 == 1:
            result = (result * base) % MOD

        # Divide the power by 2
        power = power / 2
        # Multiply base to itself
        base = (base * base) % MOD

    return result

# def pwr(a, b):
#     if b == 1:
#         return a
#
#     halfpow = pwr(a, b // 2)
#     if (b % 2) == 0:
#         return halfpow * halfpow
#     else:
#         return a * halfpow * halfpow


res = 0

_sum = 0
ok = 0
for num in char:
    _sum = int(_sum) + (fast_power(num, tyo))
    if _sum > k and ok == 0:
        res = num
        ok = 1

print(res)

Submission status: Wrong Answer

Solution code:
import math

s = list(map(int, list(input())))
k = int(input())
n = 5000000000000000

digit = 0
result = 0
for i in s:
    digit += int(n * math.log10(i)) + 1
    if int(math.log10(k))+1 <= digit:
        result = i
        break

print(result)

Submission status: Wrong Answer

Solution code:
#兆：10**12
#5000兆:5*(10**15)

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


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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
p=5000000000000000
s=input()
n=int(input())

chk=1
ans=f=0
for i in s:
    chk=1
    if i=="1": 
        ans+=1
        continue
    for j in range(p-1):
        chk*=int(i)
#        if ans+chk>=p:
        if ans+chk>=n:
            print(i)
            f=1
            break
    ans+=chk
    if f==1: break
if f==0: print(s[-1])

Submission status: Wrong Answer

Solution code:
S=input()
K=int(input())
l=len(S)
r=0
q=0
if l==1:
    print(int(S))
else:
    for i in range(0,l-1):
        if int(S[i]) != 1:
            r=int(S[i])
            q=i
            break
    if q>=K:
        print(1) 
    else:
        print(r)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
S = int(input())
K = int(input())
S_list = [int(x) for x in list(str(S))]
 
def saiki(i):
  if i == len(S_list):
    print("1")
    exit()
  if K == i-1:
    print("1")
    exit()
  if S_list[i] > 1:
    print(S_list[i])
    exit()
  if S_list[i] == 1:
    saiki(i+1)
 
print(saiki(0))

Submission status: Wrong Answer

Solution code:
def main():
    S = input()
    K = int(input())
    S_splited = list(map(int, list(str(S))))
    offset = 0
    day = 5 * 10**18
    for i in S_splited:
        if i == 1:
            offset += 1
            continue
        elif offset >= K:
            break
        else:
            break
    print(i)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

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

if (t=='') and k<=len(s)  :
   t = '1'

print(t)

Submission status: Wrong Answer

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

#5 sen tyou = 5 * (10 ** 15)

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

Submission status: Wrong Answer

Solution code:
#兆：10**12
#5000兆:5*(10**15)

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

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