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>
using namespace std;
const int N = 700001, infi = 1000000, mod = 1000000007;
long long n, sol;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  long long acc = 0;
  long long as = 0;
  for (int i = 1; i < 13; i++) {
    if (!as)
      as = 1;
    else
      as *= 10;
    long long cur = 9 * as;
    if (acc + cur * i >= n) {
      long long st = as - 1;
      long long kam = (n - acc) / i;
      st += kam;
      if ((n - acc) % i) {
        st++;
        for (int j = 0; j < i - (n - acc) % i; j++) {
          st /= 10;
        }
      }
      return cout << st % 10, 0;
    }
    acc += cur * i;
  }
  cout << sol;
  return 0;
}
