#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;   }   