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

import java.util.*;
import java.io.*;
public class s2
{ 


    public static void main(String args[])  throws Exception
    { 
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String s=br.readLine();
int n=s.length();
        int test = Integer.parseInt(s);
  int a=0;
 int cnt=1;
 int c[]={0,9,180,2700,36000,450000,54000000};
    if(n==1)System.out.println(test);
    else {
        while(test>c[cnt]){
    
a=a+c[cnt]/cnt;
test=test-c[cnt];
    cnt++;
//System.out.println(a);
//System.out.println(test);
//System.out.println(cnt);
}

    if(test%cnt==0){
a=a+test/cnt;
//System.out.println(a);
String s1=String.valueOf(a);
System.out.println(s1.charAt(cnt-1));}
else {a=a+test/cnt+1;
  //  System.out.println(a);
    String s1=String.valueOf(a);
System.out.println(s1.charAt(test%cnt-1));}
}   } }


 
