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;
bool custom(pair<int, int> a, pair<int, int> b) {
  if (a.first == b.first) {
    return a.second < b.second;
  }
  return a.first < b.first;
}
bool c1(string a) {
  int dec = 0;
  for (int i = 0; i < a.size() - 1; i++) {
    if (a[i] >= a[i + 1]) {
      dec += (a[i] > a[i + 1]);
    } else {
      dec = 0;
    }
    if (dec == 2) {
      return true;
    }
  }
  return false;
}
bool c2(string b) {
  char ant = b[0];
  for (auto& first : b) {
    if (ant > first) {
      return true;
    }
    ant = first;
  }
  return false;
}
int main() {
  int k;
  cin >> k;
  int i = 1;
  string first = to_string(i);
  while (k > first.size()) {
    k -= first.size();
    i++;
    first = to_string(i);
  }
  int c = 0;
  char an = first[0];
  while (k > 0) {
    an = first[c];
    c++;
    k--;
  }
  cout << an;
}
