#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, count, A;
  count = 0;
  cin >> A;
  long long int K[200];
  for (i = 1; i < 10; i++) {
    K[count] = i;
    count++;
    if (count == A) {
      cout << K << "\n";
      return 0;
    }
  }
  for (i = 1; i < 10; i++) {
    K[count] = 9 + 10 * i;
    count++;
    if (count == A) {
      cout << K << "\n";
      return 0;
    }
  }
  for (i = 1; i < 10; i++) {
    K[count] = 99 + 100 * i;
    count++;
    if (count == A) {
      cout << K << "\n";
      return 0;
    }
  }
  for (i = 1; i < 10; i++) {
    K[count] = 999 + 1000 * i;
    count++;
    if (count == A) {
      cout << K << "\n";
      return 0;
    }
  }
  for (i = 1; i < 10; i++) {
    K[count] = 9999 + 10000 * i;
    count++;
    if (count == A) {
      cout << K << "\n";
      return 0;
    }
  }
  for (i = 1; i < 10; i++) {
    K[count] = 99999 + 100000 * i;
    count++;
    if (count == A) {
      cout << K << "\n";
      return 0;
    }
  }
  for (i = 1; i < 10; i++) {
    K[count] = 999999 + 1000000 * i;
    count++;
    if (count == A) {
      cout << K << "\n";
      return 0;
    }
  }
  for (i = 1; i < 10; i++) {
    K[count] = 9999999 + 10000000 * i;
    count++;
    if (count == A) {
      cout << K << "\n";
      return 0;
    }
  }
  for (i = 1; i < 10; i++) {
    K[count] = 999999 + 1000000 * i;
    count++;
    if (count == A) {
      cout << K << "\n";
      return 0;
    }
  }
  for (i = 1; i < 10; i++) {
    K[count] = 9999999 + 10000000 * i;
    count++;
    if (count == A) {
      cout << K << "\n";
      return 0;
    }
  }
  for (i = 1; i < 10; i++) {
    K[count] = 99999999 + 100000000 * i;
    count++;
    if (count == A) {
      cout << K << "\n";
      return 0;
    }
  }
  for (i = 1; i < 10; i++) {
    K[count] = 999999999 + 1000000000 * i;
    count++;
    if (count == A) {
      cout << K << "\n";
      return 0;
    }
  }
  for (i = 1; i < 10; i++) {
    K[count] = 9999999999 + 10000000000 * i;
    count++;
    if (count == A) {
      cout << K << "\n";
      return 0;
    }
  }
  for (i = 1; i < 10; i++) {
    K[count] = 99999999999 + 100000000000 * i;
    count++;
    if (count == A) {
      cout << K << "\n";
      return 0;
    }
  }
  for (i = 1; i < 10; i++) {
    K[count] == 999999999999 + 1000000000000 * i;
    count++;
    if (count == A) {
      cout << K << "\n";
      return 0;
    }
  }
  cout << K << "\n";
  return 0;
}
