TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: 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?

Submission attempts (in order):
s = list(map(int, input().split()))
k = int(input())

answer = 1
for i in range(min(k, len(s))):
    if s[i] != 1:
        answer = s[i]
        break

print(answer)


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

print(s)

answer = 1
for i in range(min(k, len(s))):
    if s[i] != '1':
        answer = s[i]
        break

print(answer)

s = list(map(int, input().split()))
k = int(input())

answer = 1
for i in range(min(k, len(s))):
    if s[i] != '1':
        answer = s[i]
        break

print(answer)

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

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

print(answer)

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

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

print(answer)

n = int(input())
cnt = 0

for i in range(n):
    l, r = list(map(int, input().split(' ')))
    cnt += r - l + 1

print(cnt)

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

answer = 1
for i in range(min(k, len(s))):
    if s[i] != '1':
        answer = s[i]
        break

print(answer)

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
import sys
s=input()
k=int(input())
if(len(s)==1):
    print(s[0])
    sys.exit()
c=0
for i in range(k):
    if(s[i]==1):c+=1
    else:break
if(c==k):
    print(1)
else:
    if(c==0):print(s[0])
    else:print(s[c+1])

import sys
s=input()
k=int(input())
if(len(s)==1):
    print(s[0])
    sys.exit()
if(k==1):
    print(s[0])
    sys.exit()
c=0
for i in range(k):
    if(s[i]=='1'):c+=1
    else:break
if(c==k):
    print(1)
else:
    if(c==0):print(s[0])
    else:print(s[c+1])

import sys
s=input()
k=int(input())
if(len(s)==1):
    print(s[0])
    sys.exit()
if(k==1):
    print(s[0])
    sys.exit()
c=0
for i in range(k):
    if(s[i]=='1'):c+=1
    else:break
if(c==k):
    print(1)
else:
    print(s[c])

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
s=input()
k=int(input())
if s[0]!='1':
  print(s[0])
else:
  pos=0
  for i in range(len(s)):
    if i!=s[:i].count('1'):
      break
    pos=i
  if k<=pos:
    print('1')
  else:
    print(s[pos+1])

s=input()
k=int(input())
if s[0]!='1':
  print(s[0])
else:
  pos=0
  for i in range(len(s)):
    if i!=s[:i].count('1'):
      break
    pos=i
  if k<=pos:
    print('1')
  else:
    print(s[pos])

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
S = list(input())
K = int(input())
if K == 1:
    print(S[0])
else:
  for x in range(S):
    if int(x) != 1:
      print(S[x])
      break

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):
    ans = S[0]
else:
  for x in range(K):
    if S[x] != 1:
      ans = S[x]
      break
print(ans)


Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
s = input()
k = int(input())
for i in s:
    if i != "1":
        print(i)
        break
print(1)
        

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

Verdicts: Wrong Answer

Accepted
Problem: 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?

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

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


Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
S = input()
K = int(input())

k = -1
while S[k+1] == "1":
  k += 1
  print(k)

if K <= k:
  print(1)
else:
  print(S[k+1])

import sys
S = input()
K = int(input())

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

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
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])

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

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
s = input()
k = int(input())

print(s[0])

s = input()
k = int(input()) - 1


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

print(s[i])

Verdicts: Wrong Answer

Accepted
Problem: 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?

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

S=str(input())
K=int(input())
for i in range(K) :
#    print("checking "+S[i])
    if S[i]!="1" :
        break
print(S[i])

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
 
    return divisors


n = int(input())
ans = 0
if n < 105:
    print(0)
else:
    for i in range(105,n+2,2):
        m = make_divisors(i)
        if len(m) == 8:
            ans += 1

print(ans)

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

ct = 0
for i in range(len(s)):
    if s[i] != '1':
        ct += i+1
        break

if ct > k:
    print(1)
else:
    print(s[ct-1])

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
s = list(input())
k = int(input())
for i in range(k):
  s_ = s[i]
  if not s_=='1':
    print(s_)
    break
print('1')

s = list(input())
k = int(input())
for i in range(k):
  s_ = s[i]
  if not s_=='1':
    print(s_)
    exit()
print('1')


Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
s = input()
k = int(input())

if len(s)>k and all(s[i]=="1" for i in range(k)):
    print(1)
else:
    print(s[0])


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

if len(s)>k and all(s[i]=="1" for i in range(k)):
    print(1)
else:
    while s[0]=="1":
        s.pop(0)
    print(s[0])


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

if all(s[i]=="1" for i in range(min(len(s),k))):
    print(1)
else:
    while s[0]=="1":
        s.pop(0)
    print(s[0])


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

if all(s[i]=="1" for i in range(min(len(s),k))):
    print(1)
else:
    while s[0]=="1":
        s = s[1:]
    print(s[0])


Verdicts: Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
import sys
# N,M = [int(n) for n in input().split()]
# S = str(input())
# T = str(input())

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

for i in range(len(S)):
    if (S[i] == "1"):
        numplace+=1
    else:
        numplace+= int(S[i])**5000000000000000
    if(numplace>=K):
        print(S[i])
        sys.exit()


import sys
# N,M = [int(n) for n in input().split()]
# S = str(input())
# T = str(input())
S = str(input())
K = int(input())

for i in range(len(S)):
    if(S[i] == "1" and i+1 == K:
        print("1")
        sys.exit()
    elif(S[i]!="1"):
        print(S[i])
        sys.exit()


import sys
# N,M = [int(n) for n in input().split()]
# S = str(input())
# T = str(input())
S = str(input())
K = int(input())

for i in range(len(S)):
    if(S[i] == "1" and i+1 == K):
        print("1")
        sys.exit()
    elif(S[i]!="1"):
        print(S[i])
        sys.exit()


Verdicts: Time Limit Exceeded

Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
import math
from collections import deque

s = input()
k = int(input())
s_list = list(map(int, list(s)))

if len(s) == 1:
    print(int(s))
elif k == 1:
    print(s_list[0])
else:
    print(s_list[0])

S = input()
K = int(input())
s_list = list(map(int, list(S)))

flag = False
for k in range( min(len(S), K) ):
    if s_list[k] != 1:
        flag = True
        break

if flag:
    print(s_list[k])
else:
    print(1)

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
s = input()
k = int(input())
onesum = 0
while s[0] == "1" and len(s) > 0
    s = s[1:]
    onesum += 1
if k <= onesum:
    print(1)
else:
    print(s[0])


s = input()
k = int(input())
onesum = 0
while s[0] == "1":
    onesum += 1
    if len(s) == 1:
        break
    s = s[1:]
if k <= onesum:
    print(1)
else:
    print(s[0])


Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
s=input()
k=int(input())
if s[0]=="1":
  print(1)
else:
  print(s[1])

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

  

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
s = input()
k = int(input())
for i in range(min(k,len(s))):
    if s[i] != 1:
        print(s[i])
        exit()
else:
    print(1)

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

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
s = list(input())
k = int(input())
if k >= 2 and s[0] == 1:
    print(s[1])
if len(s) == 1:
    print(s[0])
else:
    print(s[0])


s = list(input())
k = int(input())
for i in range(k):
    if s[i] != 1:
        l = [i for i in s if i != 1]
        print(l[0])
        break
else:
    print(1)


s = list(input())
k = int(input())
cnt = 0
if k >= len(s):
    x = len(s)
else:
    x = k

for i in range(x):
    if s[i] == 1:
        cnt += 1
if cnt == len(s):
    print(1)
else:
    for j in s:
        if int(j) >= 1:
            print(int(j))
            break

s = list(input())
k = int(input())
cnt = 0
x = min(len(s),k)
for i in range(x):
    if s[i] != '1':
        print(s[i])
        break
else:
    print(1)

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
s=input()
k=int(input())

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

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

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

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

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
s = input()
k = int(input())
for i in (len(s)):
    if s[i] != "1":
        ans = int(s[i])
        break
print(ans)

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

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

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

Verdicts: Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: 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?

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

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

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
s = input()
k = int(input())

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

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


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

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


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
data = input()
num = int(input())

cnt = 0
for lop in range(len(data)):
    cnt = cnt + (int(data[lop])*1000000000000000000)**5
    if cnt > num:
        print(data[lop])
        break

data = input()
num = int(input())

cnt = 0
for lop in range(len(data)):
    if int(data[lop]) == 1:
        cnt = cnt + 1
        if num == cnt:
            print(data[lop])
            break
    else :    
        cnt = cnt + (int(data[lop])*1000000000000000000)**5
        if cnt > num:
            print(data[lop])
            break

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
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)

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


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


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
# -*- coding: utf-8 -*-


def main():
    s = input()
    k = int(input())

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


if __name__ == '__main__':
    main()


# -*- coding: utf-8 -*-


def main():
    s = input()
    k = int(input())
    one_count = 0

    for si in s:
        if si == '1':
            one_count += 1
        else:
            break

    if s[0] == '1':
        if k == 1:
            print(s[0])
        elif one_count >= k:
            print(1)
        elif one_count < k:
            print(s[k - 1])
        else:
            print(s[1])
    else:
        print(s[0])


if __name__ == '__main__':
    main()


# -*- coding: utf-8 -*-


def main():
    s = input()
    k = int(input())
    count = 0

    for si in s:
        if si == '1':
            count += 1
        else:
            break

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


if __name__ == '__main__':
    main()


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
s = input()
k = int(input())

for i in range(k):
    if s[i] == 1:
        continue
    else:
        print(s[i])
        exit()
        
print(1)

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

for i in range(k):
    if int(s[i]) == 1:
        continue
    else:
        print(s[i])
        exit()
        
print(1)

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
s=str(input())
n = int(input())
for i in range(n):
    if s[i] != "1":
        print(int(s[i]))
        break
	else:
    	print("1")

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

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
S = str(input())
K = int(input())
if S[0] == 1 and K == 1:
    print(1)
#     print('A')
elif len(S) <= K and list(map(int,list(S[:K]))).count(1) == K:
    print(1)
#     print('B')
elif len(S) == 1:
    print(S[0])
#     print('C')
elif S[0] != 1:
    print(S[0])
else :
    print(S[1])

S = str(input())
K = int(input())
if S[0] == 1 & K == 1:
    print(1)
elif len(S) != 1:
    print(S[0])
else:
    print(S[0])

S = str(input())
K = int(input())
i = 0
if S[0] == '1' and K == 1:
    print(1)
#     print('A')
elif list(map(int,list(S[:(K-1)]))).count(1) == K-1:
    print(S[K-1])
#     print('B')

elif len(S) == 1:
    print(S[0])
#     print('C')
elif S[0] != '1':
    print(S[0])
#     print('D')
else :
    while(1):
        if list(S[:(K-1)])[i] == '1':
            i = i + 1
        elif i > K:
            print(S[1])
#             print('E')
        else:
            print(list(S[:(K-1)])[i])
            break
    

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
a=input()
b=int(input())
c=1
if a[0]!="1":
  print(a[0])
if a[0]=="1":
  for i in range(len(a)-1):
    if a[i]=="1" and a[i+1]=="1":
      c=c+1
    else:
      break
if c>b:
  print(1)
else:
  print(a[c-1])


a=input()
b=int(input())
c=0
if a[0]!="1":
  print(a[0])
if a[0]=="1":
  for i in range(len(a)-1):
    if a[i]=="1" and a[i+1]=="1":
      c=c+1
    else:
      break
if c>=b:
  print(1)
else:
  print(a[c-1])


a=input()
b=int(input())
c=0
if a[0]!=1:
  print(a[0])
else:
  for i in range(len(a)-1):
    if a[i]==a[i+1]:
      c=c+1
    else:
      break
  if c>=b:
    print(1)
  else:
    print(a[1])

a=input()
b=int(input())
c=0
if a[0]!="1":
  print(a[0])
if a[0]=="1":
  for i in range(len(a)-1):
    if a[i]=="1" and a[i+1]=="1":
      c=c+1
    else:
      break
if c>b:
  print(1)
else:
  print(a[c])


a=input()
b=int(input())
c=1
if a[0]!="1":
  print(a[0])
if a[0]=="1":
  for i in range(len(a)-1):
    if a[i]=="1" and a[i+1]=="1":
      c=c+1
    else:
      break
  if c>=b:
    print(1)
  else:
    print(a[c+1])


a=input()
b=int(input())
c=1
if a[0]!="1":
  print(a[0])
if a[0]=="1":
  for i in range(len(a)-1):
    if a[i]=="1" and a[i+1]=="1":
      c=c+1
    else:
      break
  if c>=b:
    print(1)
  else:
    print(a[c])

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
S = input()
K = input()

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

elif set(S) == 1:
    print(S)

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

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

S = input()
K = input()

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

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
import sys
s = str(input())
n = int(input())
i = 0
print(s[i])
while True:
    if int(s[i]) == 1:
        if (n-1) == i:
            print("1")
            sys.exit()
        else:
            i += 1
    else:
        print(s[i])
        sys.exit()


import sys
s = str(input())
n = int(input())
i = 0
while True:
    if s[i] == 1:
        if n-1 == i:
            print("1")
            sys.exit()
        else:
            i += 1
    else:
        print(s[i])
        sys.exit()


s = str(input())
n = int(input())
if s[0] == 1:
    print(s[1])
else:
    print(s[0])

import sys
s = str(input())
n = int(input())
i = 0
while True:
    if s[i] == 1:
        i +=1
    else:
        print(s[i])
        sys.exit()

import sys
s = str(input())
n = int(input())
i = 0
while True:
    if int(s[i]) == 1:
        if (n-1) == i:
            print("1")
            sys.exit()
        else:
            i += 1
    else:
        print(s[i])
        sys.exit()


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
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])

s = input()
k = int(input())
num = 0
for i in s:
    if i == "1":
        num +=1
        if num == k:
            print(1)
            exit()
    else:
        print(i)
        exit()

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
S=input()
K=int(input())

print(S[0])

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

one = True
for i in range(K):
  one = one and S[i]=='1'
  if not one:
    print(S[i])
    break
if one:
  print(1)

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
for i,n in enumerate(int(input())):
  if n!= 1:
    break
print(n if i<int(input()) else 1)

for i,n in enumerate(int(input())):
  if n!= 1:
    break
print(n if i<input() else 1)

for i,n in enumerate(input()):
  if n!= 1:
    break
print(n if i<int(input()) else 1)

S = input()
K = input()
for i,n in enumerate(S):
  if n!= 1:
    break
print(n if i<K else 1)

for i,n in enumerate(input()):
  if n!= '1':
    break
print(n if i<int(input()) else 1)

Verdicts: Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
s = input()
k = int(input())
day = 5 * (10 ** 15)

for c in s:
  i = int(c)
  l = i ** day
  if k <= l:
    print(c)
    exit()
  else:
    k -= l

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

for c in s:
  if c != '1':
    print(c)
    exit()
  else:
    k -= 1
    if k == 0:
      print(1)
      exit()
print(1)

Verdicts: Time Limit Exceeded

Accepted
Problem: 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?

Submission attempts (in order):
s = list(input())
k = int(input())

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

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

for w in s:
    if w == "1":
        k -= 1
        if k == 0:
            print(1)
            break
    else:
        print(int(w))
        break
        

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
S = list(input())
K = int(input())
S = [int(i) for i in S]
if K == 1 or len(S)==1:
    print(S[0])
else:
    if S[0] == 1:
        print(1)
    else:
        print(S[0])

S = input().split()
K = int(input())
S = [int(i) for i in S]
if S[0] == 1:
    print(S[1])
else:
    print(S[0])

import sys
S = list(input())
K = int(input())
S = [int(i) for i in S]
count = 0
for i in range(K):
    if S[i] is not 1:
        print(S[i])
        sys.exit()
    else:
        count+= 1
if count == K:
    print(1)

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
S = [int(s) for s in input()]
K = int(input())
if len(S) >= K and S[K-1] == 1:
    print(1)
else:    
    for k, s in enumerate(S, start=1):
        if s == 1:
            print(1)
            break
        else:
            print(s)
            break

S = [int(s) for s in input()]
K = int(input())
if set(S[:K]) == {1}:
    print(1)
else:
    for i in S:
        if i != 1:
            print(i)
            break

Verdicts: Wrong Answer

Accepted