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 long long M = 1000000007;
void PV(vector<long long> v) {
  for (long long i = 0; i < v.size(); i++) cout << v[i] << " ";
  cout << "\n";
}
void PA(long long v[], long long n) {
  for (long long i = 0; i < n; i++) cout << v[i] << " ";
  cout << "\n";
}
void IN(long long a[], long long n) {
  for (long long i = 0; i < n; i++) cin >> a[i];
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  {
    long long k;
    cin >> k;
    long long i, j, l, u = 1;
    j = 1;
    l = 9;
    long long kk = k;
    while (k - l > 0 && kk - l > 0) {
      u++;
      kk = kk - l;
      j = j * 10;
      l = j * 9 * u;
    }
    l = kk % u;
    kk = ceil((long double)kk / u);
    kk = j + kk - 1;
    string ans = to_string(kk);
    if (l == 0)
      cout << ans[u - 1] << "\n";
    else
      cout << ans[l - 1] << "\n";
  }
  return 0;
}
