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 MOD = 1e9 + 7;
const int mod = 998244353;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long x;
  cin >> x;
  long long lower = 0;
  long long mul = 1;
  long long digitos = 0;
  long long posicion = x;
  for (long long m = 1; m < 16; m++) {
    if (x > lower && x <= lower + 9 * mul * m) {
      digitos = m;
      break;
    }
    lower += 9 * mul * m;
    mul *= 10;
  }
  posicion -= lower;
  mul += (posicion + digitos - 1) / digitos - 1;
  string t = to_string(mul);
  posicion %= digitos;
  if (posicion == 0) {
    posicion = digitos - 1;
  } else {
    posicion -= 1;
  }
  cout << t[posicion];
  return 0;
}
