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
//package august19;
import java.util.*;
public class DigitsSequenceEasy {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn=new Scanner(System.in);
		int k=scn.nextInt();
		int[] dp=new int[10001];
		int x=1;
		int x1=x;
		for(int i=1; i<k+1;)
		{
			Stack<Integer> stk=new Stack<>();
			int x2=x;
			while(x!=0)
			{
				stk.push(x%10);
				x=x/10;
			}
			while(!stk.isEmpty() && i<10001)
			{
				dp[i]=stk.pop();
			//	System.out.println(i+","+dp[i]);
				i++;
			}
			x1++;
			x=x1;
		}
		System.out.println(dp[k]);
	}

}
