Let's write all the positive integer numbers one after another from 1 without any delimiters (i.e. as a single string). It will be the infinite sequence starting with 123456789101112131415161718192021222324252627282930313233343536...

Your task is to print the k-th digit of this sequence.

Input

The first and only line contains integer k (1 ≤ k ≤ 10000) — the position to process (1-based index).

Output

Print the k-th digit of the resulting infinite sequence.

Examples

Input


7


Output


7


Input


21


Output


5
digit=1
x=int(input())
start_range=1
end_range=9
nine=9
total=0
while(x>end_range):
    start_range=end_range+1
    digit+=1
    end_range+=(digit*nine*pow(10,digit-1))
    total=total+start_range

start=pow(10,digit-1)
number=int((x-start_range)/digit)
index=int((x-start_range)%digit)
start=start+number
string=str(start)
print(string[index])