#include int main () { int n = 0; int res = 0; char ans[2000001] = ""; int a = 1; int b = 0; int c = 0; res = scanf("%d", &n); n--; while (n%36 >= (a*(17-a))/2) { a++; } b = a+1+n%36-((a-1)*(18-a))/2; c = n/36; ans[0] = '0'+((char)a); for (int i = 0; i <= c; i++) { ans[i+1] = '0'+((char)b); } ans[c+2] = '\0'; printf("%s\n", ans); return 0; }