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
#include <bits/stdc++.h>
int main() {
  long long k;
  scanf("%lld", &k);
  long long sum = 0, pow = 1;
  int len = 1;
  while (sum + 9 * pow * len < k) sum = sum + 9 * pow * len, pow *= 10, ++len;
  const long long cur = pow + (k - sum) / len + ((k - sum) % len != 0) - 1;
  const int pos = ((k - sum) % len == 0) ? len : (k - sum) % len;
  long long output = cur;
  for (int i = 0; i < len - pos; ++i) output /= 10;
  printf("%lld", output % 10);
}
