We consider a positive integer perfect, if and only if the sum of its digits is exactly $10$. Given a positive integer $k$, your task is to find the $k$-th smallest perfect positive integer.
A single line with a positive integer $k$ ($1 \leq k \leq 10\,000$).
The first perfect integer is $19$ and the second one is $28$.
1
19
2
28
13
136
101
1432
1023
100270
9999
10800010
10000
10800100
2333
310060
9139
10134010
9859
10422001
5987
2221201
3
37
4
46
5
55
7
73
9
91
10
109
15
154
51
613
99
1414
138
2224
233
5050
666
27100
1234
110206
3567
1033003
4445
1221301
5689
2114002
6666
3102004
7777
5300200
8888
10110061
9411
10214200
5539
2101114
6259
2511100
2387
312220
8515
10030114
ls=[19,28,37,46,55,64,73,82,91,109,118,127,136,145,154,163,172,181,190,208,217,226,235,244,253,262,271,280,307,316,325,334,343,352,361,370,406,415,424,433,442,451,460,505,514,523,532,541,550,604,613,622,631,640,703,712,721,730,802,811,820,901,910,1009,1018,1027,1036,1045,1054,1063,1072,1081,1090,1108,1117,1126,1135,1144,1153,1162,1171,1180,1207,1216,1225,1234,1243,1252,1261,1270,1306,1315,1324,1333,1342,1351,1360,1405,1414,1423,1432,1441,1450,1504,1513,1522,1531,1540,1603,1612,1621,1630,1702,1711,1720,1801,1810,1900,2008,2017,2026,2035,2044,2053,2062,2071,2080,2107,2116,2125,2134,2143,2152,2161,2170,2206,2215,2224,2233,2242,2251,2260,2305,2314,2323,2332,2341,2350,2404,2413,2422,2431,2440,2503,2512,2521,2530,2602,2611,2620,2701,2710,2800,3007,3016,3025,3034,3043,3052,3061,3070,3106,3115,3124,3133,3142,3151,3160,3205,3214,3223,3232,3241,3250,3304,3313,3322,3331,3340,3403,3412,3421,3430,3502,3511,3520,3601,3610,3700,4006,4015,4024,4033,4042,4051,4060,4105,4114,4123,4132,4141,4150,4204,4213,4222,4231,4240,4303,4312,4321,4330,4402,4411,4420,4501,4510,4600,5005,5014,5023,5032,5041,5050,5104,5113,5122,5131,5140,5203,5212,5221,5230,5302,5311,5320,5401,5410,5500,6004,6013,6022,6031,6040,6103,6112,6121,6130,6202,6211,6220,6301,6310,6400,7003,7012,7021,7030,7102,7111,7120,7201,7210,7300,8002,8011,8020,8101,8110,8200,9001,9010,9100,10009,10018,10027,10036,10045,10054,10063,10072,10081,10090,10108,10117,10126,10135,10144,10153,10162,10171,10180,10207,10216,10225,10234,10243,10252,10261,10270,10306,10315,10324,10333,10342,10351,10360,10405,10414,10423,10432,10441,10450,10504,10513,10522,10531,10540,10603,10612,10621,10630,10702,10711,10720,10801,10810,10900,11008,11017,11026,11035,11044,11053,11062,11071,11080,11107,11116,11125,11134,11143,11152,11161,11170,11206,11215,11224,11233,11242,11251,11260,11305,11314,11323,11332,11341,11350,11404,11413,11422,11431,11440,11503,11512,11521,11530,11602,11611,11620,11701,11710,11800,12007,12016,12025,12034,12043,12052,12061,12070,12106,12115,12124,12133,12142,12151,12160,12205,12214,12223,12232,12241,12250,12304,12313,12322,12331,12340,12403,12412,12421,12430,12502,12511,12520,12601,12610,12700,13006,13015,13024,13033,13042,13051,13060,13105,13114,13123,13132,13141,13150,13204,13213,13222,13231,13240,13303,13312,13321,13330,13402,13411,13420,13501,13510,13600,14005,14014,14023,14032,14041,14050,14104,14113,14122,14131,14140,14203,14212,14221,14230,14302,14311,14320,14401,14410,14500,15004,15013,15022,15031,15040,15103,15112,15121,15130,15202,15211,15220,15301,15310,15400,16003,16012,16021,16030,16102,16111,16120,16201,16210,16300,17002,17011,17020,17101,17110,17200,18001,18010,18100,19000,20008,20017,20026,20035,20044,20053,20062,20071,20080,20107,20116,20125,20134,20143,20152,20161,20170,20206,20215,20224,20233,20242,20251,20260,20305,20314,20323,20332,20341,20350,20404,20413,20422,20431,20440,20503,20512,20521,20530,20602,20611,20620,20701,20710,20800,21007,21016,21025,21034,21043,21052,21061,21070,21106,21115,21124,21133,21142,21151,21160,21205,21214,21223,21232,21241,21250,21304,21313,21322,21331,21340,21403,21412,21421,21430,21502,21511,21520,21601,21610,21700,22006,22015,22024,22033,22042,22051,22060,22105,22114,22123,22132,22141,22150,22204,22213,22222,22231,22240,22303,22312,22321,22330,22402,22411,22420,22501,22510,22600,23005,23014,23023,23032,23041,23050,23104,23113,23122,23131,23140,23203,23212,23221,23230,23302,23311,23320,23401,23410,23500,24004,24013,24022,24031,24040,24103,24112,24121,24130,24202,24211,24220,24301,24310,24400,25003,25012,25021,25030,25102,25111,25120,25201,25210,25300,26002,26011,26020,26101,26110,26200,27001,27010,27100,28000,30007,30016,30025,30034,30043,30052,30061,30070,30106,30115,30124,30133,30142,30151,30160,30205,30214,30223,30232,30241,30250,30304,30313,30322,30331,30340,30403,30412,30421,30430,30502,30511,30520,30601,30610,30700,31006,31015,31024,31033,31042,31051,31060,31105,31114,31123,31132,31141,31150,31204,31213,31222,31231,31240,31303,31312,31321,31330,31402,31411,31420,31501,31510,31600,32005,32014,32023,32032,32041,32050,32104,32113,32122,32131,32140,32203,32212,32221,32230,32302,32311,32320,32401,32410,32500,33004,33013,33022,33031,33040,33103,33112,33121,33130,33202,33211,33220,33301,33310,33400,34003,34012,34021,34030,34102,34111,34120,34201,34210,34300,35002,35011,35020,35101,35110,35200,36001,36010,36100,37000,40006,40015,40024,40033,40042,40051,40060,40105,40114,40123,40132,40141,40150,40204,40213,40222,40231,40240,40303,40312,40321,40330,40402,40411,40420,40501,40510,40600,41005,41014,41023,41032,41041,41050,41104,41113,41122,41131,41140,41203,41212,41221,41230,41302,41311,41320,41401,41410,41500,42004,42013,42022,42031,42040,42103,42112,42121,42130,42202,42211,42220,42301,42310,42400,43003,43012,43021,43030,43102,43111,43120,43201,43210,43300,44002,44011,44020,44101,44110,44200,45001,45010,45100,46000,50005,50014,50023,50032,50041,50050,50104,50113,50122,50131,50140,50203,50212,50221,50230,50302,50311,50320,50401,50410,50500,51004,51013,51022,51031,51040,51103,51112,51121,51130,51202,51211,51220,51301,51310,51400,52003,52012,52021,52030,52102,52111,52120,52201,52210,52300,53002,53011,53020,53101,53110,53200,54001,54010,54100,55000,60004,60013,60022,60031,60040,60103,60112,60121,60130,60202,60211,60220,60301,60310,60400,61003,61012,61021,61030,61102,61111,61120,61201,61210,61300,62002,62011,62020,62101,62110,62200,63001,63010,63100,64000,70003,70012,70021,70030,70102,70111,70120,70201,70210,70300,71002,71011,71020,71101,71110,71200,72001,72010,72100,73000,80002,80011,80020,80101,80110,80200,81001,81010,81100,82000,90001,90010,90100,91000,100009,100018,100027,100036,100045,]
k=int(input())
print(ls[k-1])
 		 			  	 	  	  	 		  						 	