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;
inline void read(int &x) {
  char ch;
  bool flag = false;
  for (ch = getchar(); !isdigit(ch); ch = getchar())
    if (ch == '-') flag = true;
  for (x = 0; isdigit(ch); x = x * 10 + ch - '0', ch = getchar())
    ;
  x = flag ? -x : x;
}
const int INF = 0x3f3f3f3f;
long long p[20];
int main() {
  long long k;
  cin >> k;
  int s = 0;
  for (int i = 1; i <= 12; i++) {
    p[i] += p[i - 1] + (9 * pow(10, i - 1) * i);
    if (k >= p[i]) {
      s = i;
    }
  }
  long long sum = k - p[s];
  long long h = sum / (s + 1);
  long long f = sum % (s + 1);
  long long ans = pow(10, s) + h - 1;
  if (!f)
    cout << ans % 10 << endl;
  else {
    ans++;
    vector<int> v;
    while (ans) {
      v.push_back(ans % 10);
      ans /= 10;
    }
    cout << v[v.size() - f] << endl;
  }
  return 0;
}
