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 = 2e5 + 10;
const int inf = 1e9;
const int mod = 1e9 + 7;
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(0);
  int k;
  cin >> k;
  int ml = 1;
  int cnt = 0;
  int ans = 0;
  for (int i = 1;; i++) {
    if (i / ml == 1 && i % ml == 0) {
      ml *= 10;
      cnt++;
    }
    ans += cnt;
    if (ans >= k) {
      ans -= k;
      while (i) {
        ans--;
        if (ans == -1) {
          cout << i % 10 << '\n';
          return 0;
        }
        i /= 10;
      }
    }
  }
  return 0;
}
