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.Scanner;

public class cf_contest_1177_problem_B {
    public static void main(String[] args) {

        Scanner s = new Scanner(System.in);
        long k = s.nextLong();
        if (k<=9)
            System.out.println(k);
        else
        {

            int c = 1;
            while(k>c*((Math.pow(10,c)) - Math.pow(10,c-1)))
            {
                k-=c*((Math.pow(10,c)) - Math.pow(10,c-1));
//                System.out.println(k + " hello " + c);
                c++;
            }
//            System.out.println("k is " + k);
            long mo = k%c;

//            System.out.println("mo is " + mo);
            k = k/c;

            if (mo == 0) {
                mo = c;
                k--;
            }
            mo--;
//            k = Math.max(k-1,0);
//            System.out.println("k/c is " + k);
            long j = (long) (Math.pow(10,c-1) + k);

            String j1 = "" + j;
//            System.out.println("j1 is " + j1);
//            System.out.println("final ans= " + j1.charAt((int)mo));
//            System.out.println();
            System.out.println(j1.charAt((int)mo));
        }

    }
}
