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 = str(input())
K = int(input())

ans = 1
index = 0
for j in range(len(S)):
    if S[j] != '1':
        ans = int(s[j])
        index = j
        break

if ans == 1:
    print(ans)
elif index < K-1:
    print(ans)
else:
    print(1)
        

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

ans = 1
index = 0
for j in range(len(S)):
    if S[j] != '1':
        ans = int(S[j])
        index = j
        break

if ans == 1:
    print(ans)
elif index > K-1:
    print(1)
else:
    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):
main():
    S = input()
    K = int(input())
    output = solve(S, K)
    return output

def solve(S, K):
    for s in S:
        if s != "1":
            return s
    return "1"

def main():
    S = input()
    K = int(input())
    output = solve(S, K)
    return output

def solve(S, K):
    for s in S:
        if s != "1":
            return s
    return "1"

if __name__ == "__main__":
    main()

def main():
    S = input()
    K = int(input())
    output = solve(S, K)
    print(output)
    return

def solve(S, K):
    if K <= len(S) and S[K-1] == "1":
        
        
        
        return "1"
    if K == 1:
        for s in S:
            if not s == "1":
                return s  
    return S[0]

if __name__ == "__main__":
    main()

main():
    S = input()
    K = int(input())
    output = solve(S, K)
    return output

def solve(S, K):
    for s in S:
        if s != "1":
            return s
    return "1"

if __name__ == "__main__":
    main()

def main():
    S = input()
    K = int(input())
    output = solve(S, K)
    print(output)
    return

def solve(S, K):
    if K <= len(S) and S[K-1] == "1":
        
        
        
        return "1"
    if K == 1:
        for s in S:
            if not s == "1":
                return s  
    return S[0]

if __name__ == "__main__":
    main()

def main():
    S = input()
    K = int(input())
    output = solve(S, K)
    print(output)
    return

def solve(S, K):
    
    for i in range(K):
        if S[i] != "1":
            return S[i]
    return "1"

if __name__ == "__main__":
    main()

Verdicts: Runtime Error

Wrong Answer

Wrong Answer

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 i in range(min(k,len(s))):
    if i!='1':
        print(i)
        exit()
print(s[k-1])

s=input()
k=int(input())
for i in range(max(k,len(s))):
    if i!='1':
        print(i)
        exit()
print(s[k-1])

S = [int(i) for i in input()]
K = int(input())
for s in S:
    if s == 1:
        K -= 1
        if K <= 0:
            print(1)
            break
    else:
        print(s)
        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):
S = int(input())
K = int(input())
if(S[0]!='1'):
  print(S[0])
else:
  i=0
  while(S[i]=='1'):
    i += 1
  if(K<=i):
    print('1')
  else:
    print(S[i])

S = input()
K = int(input())
if(S[0]!='1'):
  print(S[0])
else:
  i=0
  while(S[i]=='1'):
    i += 1
    if(i==len(S)):
      break
  if(K<=i):
    print('1')
  else:
    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 = int(input())
K = int(input())
numbers = (int(x) for x in str(S))
for i in range(5*(10**15)):
    times = 0
    temporary = []
    while times <= K:
        for a in numbers:
            times += a
            for j in renge(a):
                temporary.append(a)
    numbers = temporary
print(numbers[K-1])

s = input()
k = int(input())
if s[0] != '1':
    print(s[0])
else:
    ans = 1
    for i in range(k):
        if s[i] != '1':
            ans = s[i]
            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())
L = [int(i) for i in S]
count = 0
for i in L:
    if i != 1:
        if count >= K:
            print(i)
        else:
            print(1)
        exit()
    else:
        count += 1
print(1)

S = input()
K = int(input())
L = [int(i) for i in S]
count = 1
for i in L:
    if i != 1:
        if count <= K:
            print(i)
        else:
            print(1)
        exit()
    else:
        count += 1
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())
cnt  = 0
ans  = False
for i in range(k):
    if s[i] != '1':
        print(s[i])
        ans = True
if ans:
    print(1)

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

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

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):
S = input()
K = int(input())
t = 0
if S[0] != 1:
  print(S[0])
else:
  for i in range(len(S)):
    if S[i] != 1:
      t = i
      break
  if t <= K:
    print(1)
  else:
    print(S[t])

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

S = input()
K = int(input())
t = 0
if S[0] != 1:
  print(S[0])
else:
  for i in range(len(S)):
    if S[i] != 1:
      t = i
      break
  if t < K:
    print(1)
  else:
    print(S[t])

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

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())
cnt=0
for ss in s:
  if ss==1:
    cnt+=1
  else:
    break
if cnt==0:
  print(s[0])
  exit()
if k<=cnt:
  print(1)
else:
  print(s[cnt])

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

s=input()
k=int(input())
cnt=0
for ss in s:
  if ss=='1':
    cnt+=1
  else:
    break
if cnt==0:
  print(s[0])
  exit()
if k<=cnt:
  print(1)
else:
  print(s[cnt])

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()
S_list = list(map(int, S.split()))
K = int(input())

S_set_under_K = set(S[:K])

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


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

S_set_under_K = set(S[:K])

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

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

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

for i in range(K):
    if int(S[i]) != 1:
        print(int(S[i]))
        exit()
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()
a = "1"
for i in range(int(input())):
  if s[i] != 1:
    a = s[i]
    break
print(a)

s = input()
a = "1"
for i in range(int(input())):
  if s[i] != "1":
    a = s[i]
    break
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())
ans=0
for i in range(len(s)):
    ans+=int(s[i])**500000000000
    if ans>=k:
        print(s[i])
        break

s=input()
k=int(input())
for i in range(k):
    if s[i]!="1":
        print(s[i])
        break
    if i==k-1:
        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=input()
k=int(input())
t=0
a=1
for i in range(len(s)):
    if s[i]!='1':
        t=i+1
        a=s[i]
if k<t:
    print(s[k-1])
else:
    print(a)

s=input()
k=int(input())
t=0
a=1
for i in range(len(s)):
    if s[i]!='1':
        t=i+1
        a=s[i]
        break
if k<t:
    print(s[k-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=list(map(int,tuple(input())))
k=int(input())
i=0
if 1 in s:
  i=s.index()
  if i+1>=k:
      print(1)
  else:
      print(s[i+1])
else:
  print(s[0])

s=list(map(int,tuple(input())))
k=int(input())
i=0
if 1 in s:
  for i in range(len(s)):
    if s[i]!=1:
      break
  if i>=k:
      print(1)
  else:
      print(s[i])
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):
# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import numpy as np
	
def main():
	S = input()
	S = list(S)
	K = int(input())
	
	if len(S) == 1:
		print(S[0])
	
	
	tmp = []
	for i in S:
		flg = False
		if int(i) == 1:
			tmp.append(1)
		else:	
			tmp.append(int(i))
			if flg = True:
				break
			flg = True
	
	a = np.random.randint(100)
	
	if len(tmp) < K:
		if a == 0
			print(tmp[-1])
		else:
			print(tmp[-2])
	else:
		tmp[K-1]
	
if __name__ == "__main__":
	main()


# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import numpy as np
	
def main():
	S = input()
	S = list(S)
	K = int(input())
	
	if len(S) == 1:
		print(S[0])
		sys.exit()
		
	tmp = -1
	for i, val in enumerate(S):
		if int(val) != 1:
			tmp = int(i)+1
			break
	
	if K >= tmp:
		print(S[tmp-1])
	else:
		print(1)
	
if __name__ == "__main__":
	main()


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, s in enumerate(S):
  if s == "1" and i+1==k:
    print(s)
    break
  else:
    print(s)
    break


S = input()
k = int(input())
for s in S:
  if s == "1" and k <= 5000000000000000:
    print(1)
    break
  else:
    print(s)
    break

S = input()
k = int(input())
d = {}
cnt = 0
cnt1 = 0
for i, s in enumerate(S):
  if s == "1" and k <= 5000000000000000:
    print(1)
    break
  elif s != "1":
    print(s)
    break
  else:
    print(S[i+1])

S = input()
k = int(input())
for i, s in enumerate(S):
  if s == "1" and i+1==k:
    print(s)
    break()
  else:
    print(s)
    break


S = input()
k = int(input())
cnt = 0
for i, s in enumerate(S):
  if s == "1":
    if i+1 == k:
      print(s)
      exit()
  else:
    print(s)
    exit()


Verdicts: 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):
s=input()
k=int(input())
for x in s:
  if x!=1:
    print(x)
    exit()

s=input()
k=int(input())
for x in s:
  if x==1:
    k-=1
    if k==0:
      print(1)
  else:
    print(x)
    exit()

s=input()
k=int(input())
for x in s:
  if x=='1':
    k-=1
    if k==0:
      print(1)
      exit()
  else:
    print(x)
    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())
l = 0
for i in S:
  if i == '1':
    l+=1
  	if l >= K:
      print(1)
      break
  else:
    print(int(i))
    break
    

S = input()
K = int(input())
l = 0
for i in S:
  if i == '1':
    l+=1
  	if l >= K:
      print(1)
      break
  else:
    print(i)
    break
    

S = input()
K = int(input())
l = 0
for i in S:
  if i == '1':
    l+=1
    if l >= K:
      break
  else:
    break
print(i)

Verdicts: 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):
s=input()
S=[0]*len(s)
for i in range(len(s)):
  S[i]=int(s[i])
k=int(input())
if len(s)>=k:
  if sum(S[:k])==k:
    print(1)
else:
  for i in range(len(S)):
    if S[i]!=1:
      print(S[i])
      break

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

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

s=input()
S=[0]*len(s)
for i in range(len(s)):
  S[i]=int(s[i])
k=int(input())
ans=0
if len(s)>=k:
  if sum(S[:k])==k:
    print(1)
    ans=1
if ans!=1:
  for i in range(len(S)):
    if S[i]!=1:
      print(S[i])
      break

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

s=input()
k=int(input())
cnt=0
if s[0]!="1":
	print(int(s[0]))
else:
	for i in s:
		cnt+=1
		if i!="1":
			if cnt<=k:
				print(int(i))
			else:
				print(1)

s=input()
k=int(input())
l=0
for i in s:
    if i=="1":
        l+=1
    else:
        break
print("1" if k<=l else s[l])

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):
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
a.sort()
b.sort()
c.sort()
n=len(a)
j=0
k=0
for i in range(n):
    while j<n and b[j]<=a[i]:
        j+=1
    while k<n and c[k]<=b[j]:
        k+=1



s=input()
k=int(input())
ans=-1
flag=True    
for i in range(min(len(s),k)):
    if s[i]!='1':
        flag=False
        ans=int(s[i])
        break
if flag:
    print(1)
else:
    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 s in S[:K+1]:
    if s != "1": 
      print(s)
      break
    else:
      print(1)
    

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

idx = min(K, len(S))
for s in S[:idx]:
    if s != "1": 
      print(s)
      break
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())
for i in range(len(S)):
  if S[i]!=1:
    print(S[i])
    exit()
print(1)

S=input()
K=int(input())
for i in range(len(S)):
  if i==K-1:
    print(S[i])
    exit()
  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())

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

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

for i in range(len(s)):
    if s[i]!='1':
        if k<=i:
            print('1')
            exit()
        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 = input()
K = int(input())
one_count = 0

for i in range(len(S)):
    if S[i] != '1':
        print(S[i])
        break
    else:
        one_count += 1

if one_count >= K:
    print('1')
else:
    print('0')

S = input()
k = int(input())

ans = '1'
for i in range(len(S)):
    if i + 1 <= k and S[i] != '1':
        ans = S[i]
        break
        
print(ans)

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 main(s, k):
    for s in s:
        if s != '1':
            print(s)
            return


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

    main(s, k)


def main(s: str, k: int):
    for i in range(k):
        if s[i] != "1":
            print(s[i])
            return

    print(1)


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

    main(s, k)


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):
# -*- coding: utf-8 -*-
s = input()
k = int(input())

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


# -*- coding: utf-8 -*-
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 = input()

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


s = input()
k = input()

ans = '1'
for i in range(k):
    if k[i] != '1':
        ans = k[i]
        break
print(ans)


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

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


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=list(input())
K=int(input())
l=0
for i in range(len(S)):
    if S[i]==1:
        l+=1
    else:
        a=S[i]
        break
if l>=K:
    print(1)
else:
    print(a)


S=list(input())
K=int(input())
l=0
for i in range(len(S)):
    if S[i]=='1':
        l+=1
    else:
        a=S[i]
        break
if l>=K:
    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):
def main():
  S = map(int,list(input()))
  K = int(input())
  for i,n in enumerate(S):
    if n == 1:
      K -= n
    if K>0:
      return n
    else:
      return 1
  return 1

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


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

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


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())
s = len(str(S))
l = [str(x) for x in S]
i = 0
while i <= s - 1:
  if l[i] == '1':
    i = i + 1
  else:
    break

if i == 100:
  print(1)
if K < 99:
  print(l[K-1])
else:
  print(l[i-1])

S = input()
K = int(input())
s = len(str(S))
l = [str(x) for x in S]
i = 0
while i <= s - 1:
  if l[i] == '1':
    i = i + 1
  else:
    break

if i == 100:
  print(1)
if K < 99:
  print(l[K-1])
else:
  print(l[i-1])


S = input()
K = input()
s = len(str(S))
i=0

while i < s-1:
  if S[i] == '1':
    i = i + 1
  else:
    break
if int(K) > i:
  print(S[k])
else:
  print(1)

S = input()
K = int(input())
s = len(str(S))
l = [str(x) for x in S]
i = 0
while i <= s - 1:
  if l[i] == '1':
    i = i + 1
  else:
    break

if i == 100:
  print(1)
if K < 99:
  print(l[K-1])
else:
  print(l[i-1])


S = input()
K = int(input())
s = len(str(S))
l = [str(x) for x in S]
i = 0
while i <= s - 1:
  if l[i] == '1':
    i = i + 1
  else:
    break

if i == s:
  print(1)
else:
  print(l[K-1])

S = input()
K = input()
s = len(str(S))
i=0

while i < s-1:
  if S[i] == '1':
    i = i + 1
  else:
    break
if K > i:
  print(S[k])
else:
  print(1)

S = input()
K = input()
s = len(str(S))
i=0

while i < s-1:
  if S[i] == '1':
    i = i + 1
  else:
    break
if K > i:
  print(S[k])
else:
  print(1)

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

l = [str(x) for x in S]
i = 0
while i <= s - 1:
  if l[i] == '1':
    i = i + 1
  else:
    break
if i == s:
  print(1)
else:
  print(l[K])

S = input()
K = int(input())
s = len(str(S))
i=0

while i < s-1:
  if S[i] == '1':
    i = i + 1
  else:
    break

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

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

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

def main():
    S  = input()
    K  = input()

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




if __name__ == '__main__':
    main()


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

    cnt = 0
    while cnt<len(S) and  S[cnt]=='1':
        cnt = cnt + 1
    
    if K<=cnt:
        print(S[0])
    elif cnt==len(S):
        print(S[cnt-1])
    else:
        print(S[cnt])


if __name__ == '__main__':
    main()

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())
# 5000000000000000 = 5 * 10**15
S = [int(e) for e in set(S)]
number = 0
days = 5 * 10**15
for e in S:
    result = 1
    if e == 1:
        number += 1
        continue
    for f in range(days):
        initial = number
        result *= e
        number = initial + result
        if number >= K:
            print(e)
            exit()
        number = initial

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

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

if K-1 < i:
    print(1)
else:
    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 = input()
k = int(input())

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


S = input()
k = int(input())

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


S = input()
k = int(input())


def ans():
    if len(S) == 1:
        return S
    else:
        for i in range(len(S)):
            if i + 1 == k:
                return S[i]
            if S[i] != '1':
                return S[i]

    return 1


print(ans())


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=list(map(int,list(input())))
k=int(input())
for i in range(len(s)):
    if s[i]!=1:
        if i*(5000000000000+1)>k:
            print(1)
        else:
            print(s[i])
        break
else:
    print(1)



s=input()
k=int(input())
l=0
for i in s:
    if i=="1":
        l+=1
    else:
        break
print("1" if k<=l else s[l])


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 = input()

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

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

con = 0

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

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

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 = long(input())

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

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

	is_1 = True
	for i in range(K) :
		if (len(S) < i) :
			break

		# print("S[i] : " + S[i])
		if (S[i] != "1") :
			is_1 = False
			break

	if (is_1) :
		print("1")
		return

	for i in range(len(S)) :
		if (S[i] == "1") :
			continue

		print(S[i])
		break


main()


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

import sys
s = input()
k = int(input())
for i in range(k):
    if s[i] != '1':
        print(s[i])
        sys.exit()
    else:
        continue
print(1)

Verdicts: Wrong Answer

Accepted