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;
long long digits[] = {0,         9,          189,        2889,
                      38889,     488889,     5888889,    68888889,
                      788888889, 8888888889, 98888888889};
long long nos[] = {0,         0,          9,           99,          999,
                   9999,      99999,      999999,      9999999,     99999999,
                   999999999, 9999999999, 99999999999, 999999999999};
int main() {
  long long x;
  cin >> x;
  int noDigits = 11;
  for (int i = 1; i < 11; i++) {
    if (digits[i] > x) {
      noDigits = i;
      break;
    }
  }
  long long leftOver = x - digits[noDigits - 1];
  long long toAdd = leftOver / noDigits;
  int index = leftOver % noDigits;
  --index;
  long long no = nos[noDigits] + toAdd;
  if (index == -1)
    cout << to_string(no)[to_string(no).size() - 1] - '0' << endl;
  else {
    ++no;
    int res = to_string(no)[index] - '0';
    cout << res << endl;
  }
}
