>>103233811
similar to mine:
cache = [None] # index of 1st i-digit number
tmp = 1
for p in range(1, 18+1):
cache.append(tmp)
tmp += p * 9 * 10 ** (p - 1) # 1*9, 2*90, 3*900, ...
k = int(input())
for i in range(1, 18+1):
if cache[i+1] > k:
k -= cache[i]
print(str(10 ** (i - 1) + k // i)[k % i])
break