#include using ll = long long; using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; n--; vector a; for (int i = 1; i < 10; i++) { for (int j = i + 1; j < 10; j++) { a.push_back(i * 10 + j); } } int k = a.size(); int l = n / k; int r = n % k; cout << a[r]; for (int i = 0; i < l; i++) { cout << a[r] % 10; } cout << endl; return 0; }