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

def perfect(n):
    helper = 10
    while n > 0:
        helper += 9
        temp = list(str(helper))
        lst = [int(i) for i in temp]
        if sum(lst) == 10:
            n -= 1
    print(helper)
n = int(input())


lst_0 =  [10000009, 10000018, 10000027, 10000036, 10000045, 10000054, 10000063, 10000072, 10000081, 10000090, 10000108, 10000117, 10000126, 10000135, 10000144, 10000153, 10000162, 10000171, 10000180, 10000207, 10000216, 10000225, 10000234, 10000243, 10000252, 10000261, 10000270, 10000306, 10000315, 10000324, 10000333, 10000342, 10000351, 10000360, 10000405, 10000414, 10000423, 10000432, 10000441, 10000450, 10000504, 10000513, 10000522, 10000531, 10000540, 10000603, 10000612, 10000621, 10000630, 10000702, 10000711, 10000720, 10000801, 10000810, 10000900, 10001008, 10001017, 10001026, 10001035, 10001044, 10001053, 10001062, 10001071, 10001080, 10001107, 10001116, 10001125, 10001134, 10001143, 10001152, 10001161, 10001170, 10001206, 10001215, 10001224, 10001233, 10001242, 10001251, 10001260, 10001305, 10001314, 10001323, 10001332, 10001341, 10001350, 10001404, 10001413, 10001422, 10001431, 10001440, 10001503, 10001512, 10001521, 10001530, 10001602, 10001611, 10001620, 10001701, 10001710, 10001800, 10002007, 10002016, 10002025, 10002034, 10002043, 10002052, 10002061, 10002070, 10002106, 10002115, 10002124, 10002133, 10002142, 10002151, 10002160, 10002205, 10002214, 10002223, 10002232, 10002241, 10002250, 10002304, 10002313, 10002322, 10002331, 10002340, 10002403, 10002412, 10002421, 10002430, 10002502, 10002511, 10002520, 10002601, 10002610, 10002700, 10003006, 10003015, 10003024, 10003033, 10003042, 10003051, 10003060, 10003105, 10003114, 10003123, 10003132, 10003141, 10003150, 10003204, 10003213, 10003222, 10003231, 10003240, 10003303, 10003312, 10003321, 10003330, 10003402, 10003411, 10003420, 10003501, 10003510, 10003600, 10004005, 10004014, 10004023, 10004032, 10004041, 10004050, 10004104, 10004113, 10004122, 10004131, 10004140, 10004203, 10004212, 10004221, 10004230, 10004302, 10004311, 10004320, 10004401, 10004410, 10004500, 10005004, 10005013, 10005022, 10005031, 10005040, 10005103, 10005112, 10005121, 10005130, 10005202, 10005211, 10005220, 10005301, 10005310, 10005400, 10006003, 10006012, 10006021, 10006030, 10006102, 10006111, 10006120, 10006201, 10006210, 10006300, 10007002, 10007011, 10007020, 10007101, 10007110, 10007200, 10008001, 10008010, 10008100, 10009000, 10010008, 10010017, 10010026, 10010035, 10010044, 10010053, 10010062, 10010071, 10010080, 10010107, 10010116, 10010125, 10010134, 10010143, 10010152, 10010161, 10010170, 10010206, 10010215, 10010224, 10010233, 10010242, 10010251, 10010260, 10010305, 10010314, 10010323, 10010332, 10010341, 10010350, 10010404, 10010413, 10010422, 10010431, 10010440, 10010503, 10010512, 10010521, 10010530, 10010602, 10010611, 10010620, 10010701, 10010710, 10010800, 10011007, 10011016, 10011025, 10011034, 10011043, 10011052, 10011061, 10011070, 10011106, 10011115, 10011124, 10011133, 10011142, 10011151, 10011160, 10011205, 10011214, 10011223, 10011232, 10011241, 10011250, 10011304, 10011313, 10011322, 10011331, 10011340, 10011403, 10011412, 10011421, 10011430, 10011502, 10011511, 10011520, 10011601, 10011610, 10011700, 10012006, 10012015, 10012024, 10012033, 10012042, 10012051, 10012060, 10012105, 10012114, 10012123, 10012132, 10012141, 10012150, 10012204, 10012213, 10012222, 10012231, 10012240, 10012303, 10012312, 10012321, 10012330, 10012402, 10012411, 10012420, 10012501, 10012510, 10012600, 10013005, 10013014, 10013023, 10013032, 10013041, 10013050, 10013104, 10013113, 10013122, 10013131, 10013140, 10013203, 10013212, 10013221, 10013230, 10013302, 10013311, 10013320, 10013401, 10013410, 10013500, 10014004, 10014013, 10014022, 10014031, 10014040, 10014103, 10014112, 10014121, 10014130, 10014202, 10014211, 10014220, 10014301, 10014310, 10014400, 10015003, 10015012, 10015021, 10015030, 10015102, 10015111, 10015120, 10015201, 10015210, 10015300, 10016002, 10016011, 10016020, 10016101, 10016110, 10016200, 10017001, 10017010, 10017100, 10018000, 10020007, 10020016, 10020025, 10020034, 10020043, 10020052, 10020061, 10020070, 10020106, 10020115, 10020124, 10020133, 10020142, 10020151, 10020160, 10020205, 10020214, 10020223, 10020232, 10020241, 10020250, 10020304, 10020313, 10020322, 10020331, 10020340, 10020403, 10020412, 10020421, 10020430, 10020502, 10020511, 10020520, 10020601, 10020610, 10020700, 10021006, 10021015, 10021024, 10021033, 10021042, 10021051, 10021060, 10021105, 10021114, 10021123, 10021132, 10021141, 10021150, 10021204, 10021213, 10021222, 10021231, 10021240, 10021303, 10021312, 10021321, 10021330, 10021402, 10021411, 10021420, 10021501, 10021510, 10021600, 10022005, 10022014, 10022023, 10022032, 10022041, 10022050, 10022104, 10022113, 10022122, 10022131, 10022140, 10022203, 10022212, 10022221, 10022230, 10022302, 10022311, 10022320, 10022401, 10022410, 10022500, 10023004, 10023013, 10023022, 10023031, 10023040, 10023103, 10023112, 10023121, 10023130, 10023202, 10023211, 10023220, 10023301, 10023310, 10023400, 10024003, 10024012, 10024021, 10024030, 10024102, 10024111, 10024120, 10024201, 10024210, 10024300, 10025002, 10025011, 10025020, 10025101, 10025110, 10025200, 10026001, 10026010, 10026100, 10027000, 10030006, 10030015, 10030024, 10030033, 10030042, 10030051, 10030060, 10030105, 10030114, 10030123, 10030132, 10030141, 10030150, 10030204, 10030213, 10030222, 10030231, 10030240, 10030303, 10030312, 10030321, 10030330, 10030402, 10030411, 10030420, 10030501, 10030510, 10030600, 10031005, 10031014, 10031023, 10031032, 10031041, 10031050, 10031104, 10031113, 10031122, 10031131, 10031140, 10031203, 10031212, 10031221, 10031230, 10031302, 10031311, 10031320, 10031401, 10031410, 10031500, 10032004, 10032013, 10032022, 10032031, 10032040, 10032103, 10032112, 10032121, 10032130, 10032202, 10032211, 10032220, 10032301, 10032310, 10032400, 10033003, 10033012, 10033021, 10033030, 10033102, 10033111, 10033120, 10033201, 10033210, 10033300, 10034002, 10034011, 10034020, 10034101, 10034110, 10034200, 10035001, 10035010, 10035100, 10036000, 10040005, 10040014, 10040023, 10040032, 10040041, 10040050, 10040104, 10040113, 10040122, 10040131, 10040140, 10040203, 10040212, 10040221, 10040230, 10040302, 10040311, 10040320, 10040401, 10040410, 10040500, 10041004, 10041013, 10041022, 10041031, 10041040, 10041103, 10041112, 10041121, 10041130, 10041202, 10041211, 10041220, 10041301, 10041310, 10041400, 10042003, 10042012, 10042021, 10042030, 10042102, 10042111, 10042120, 10042201, 10042210, 10042300, 10043002, 10043011, 10043020, 10043101, 10043110, 10043200, 10044001, 10044010, 10044100, 10045000, 10050004, 10050013, 10050022, 10050031, 10050040, 10050103, 10050112, 10050121, 10050130, 10050202, 10050211, 10050220, 10050301, 10050310, 10050400, 10051003, 10051012, 10051021, 10051030, 10051102, 10051111, 10051120, 10051201, 10051210, 10051300, 10052002, 10052011, 10052020, 10052101, 10052110, 10052200, 10053001, 10053010, 10053100, 10054000, 10060003, 10060012, 10060021, 10060030, 10060102, 10060111, 10060120, 10060201, 10060210, 10060300, 10061002, 10061011, 10061020, 10061101, 10061110, 10061200, 10062001, 10062010, 10062100, 10063000, 10070002, 10070011, 10070020, 10070101, 10070110, 10070200, 10071001, 10071010, 10071100, 10072000, 10080001, 10080010, 10080100, 10081000, 10090000, 10100008, 10100017, 10100026, 10100035, 10100044, 10100053, 10100062, 10100071, 10100080, 10100107, 10100116, 10100125, 10100134, 10100143, 10100152, 10100161, 10100170, 10100206, 10100215, 10100224, 10100233, 10100242, 10100251, 10100260, 10100305, 10100314, 10100323, 10100332, 10100341, 10100350, 10100404, 10100413, 10100422, 10100431, 10100440, 10100503, 10100512, 10100521, 10100530, 10100602, 10100611, 10100620, 10100701, 10100710, 10100800, 10101007, 10101016, 10101025, 10101034, 10101043, 10101052, 10101061, 10101070, 10101106, 10101115, 10101124, 10101133, 10101142, 10101151, 10101160, 10101205, 10101214, 10101223, 10101232, 10101241, 10101250, 10101304, 10101313, 10101322, 10101331, 10101340, 10101403, 10101412, 10101421, 10101430, 10101502, 10101511, 10101520, 10101601, 10101610, 10101700, 10102006, 10102015, 10102024, 10102033, 10102042, 10102051, 10102060, 10102105, 10102114, 10102123, 10102132, 10102141, 10102150, 10102204, 10102213, 10102222, 10102231, 10102240, 10102303, 10102312, 10102321, 10102330, 10102402, 10102411, 10102420, 10102501, 10102510, 10102600, 10103005, 10103014, 10103023, 10103032, 10103041, 10103050, 10103104, 10103113, 10103122, 10103131, 10103140, 10103203, 10103212, 10103221, 10103230, 10103302, 10103311, 10103320, 10103401, 10103410, 10103500, 10104004, 10104013, 10104022, 10104031, 10104040, 10104103, 10104112, 10104121, 10104130, 10104202, 10104211, 10104220, 10104301, 10104310, 10104400, 10105003, 10105012, 10105021, 10105030, 10105102, 10105111, 10105120, 10105201, 10105210, 10105300, 10106002, 10106011, 10106020, 10106101, 10106110, 10106200, 10107001, 10107010, 10107100, 10108000, 10110007, 10110016, 10110025, 10110034, 10110043, 10110052, 10110061, 10110070, 10110106, 10110115, 10110124, 10110133, 10110142, 10110151, 10110160, 10110205, 10110214, 10110223, 10110232, 10110241, 10110250, 10110304, 10110313, 10110322, 10110331, 10110340, 10110403, 10110412, 10110421, 10110430, 10110502, 10110511, 10110520, 10110601, 10110610, 10110700, 10111006, 10111015, 10111024, 10111033, 10111042, 10111051, 10111060, 10111105, 10111114, 10111123, 10111132, 10111141, 10111150, 10111204, 10111213, 10111222, 10111231, 10111240, 10111303, 10111312, 10111321, 10111330, 10111402, 10111411, 10111420, 10111501, 10111510, 10111600, 10112005, 10112014, 10112023, 10112032, 10112041, 10112050, 10112104, 10112113, 10112122, 10112131, 10112140, 10112203, 10112212, 10112221, 10112230, 10112302, 10112311, 10112320, 10112401, 10112410, 10112500, 10113004, 10113013, 10113022, 10113031, 10113040, 10113103, 10113112, 10113121, 10113130, 10113202, 10113211, 10113220, 10113301, 10113310, 10113400, 10114003, 10114012, 10114021, 10114030, 10114102, 10114111, 10114120, 10114201, 10114210, 10114300, 10115002, 10115011, 10115020, 10115101, 10115110, 10115200, 10116001, 10116010, 10116100, 10117000, 10120006, 10120015, 10120024, 10120033, 10120042, 10120051, 10120060, 10120105, 10120114, 10120123, 10120132, 10120141, 10120150, 10120204, 10120213, 10120222, 10120231, 10120240, 10120303, 10120312, 10120321, 10120330, 10120402, 10120411, 10120420, 10120501, 10120510, 10120600, 10121005, 10121014, 10121023, 10121032, 10121041, 10121050, 10121104, 10121113, 10121122, 10121131, 10121140, 10121203, 10121212, 10121221, 10121230, 10121302, 10121311, 10121320, 10121401, 10121410, 10121500, 10122004, 10122013, 10122022, 10122031, 10122040, 10122103, 10122112, 10122121, 10122130, 10122202, 10122211, 10122220, 10122301, 10122310, 10122400, 10123003, 10123012, 10123021, 10123030, 10123102, 10123111, 10123120, 10123201, 10123210, 10123300, 10124002, 10124011, 10124020, 10124101, 10124110, 10124200, 10125001, 10125010, 10125100, 10126000, 10130005, 10130014, 10130023, 10130032, 10130041, 10130050, 10130104, 10130113, 10130122, 10130131, 10130140, 10130203, 10130212, 10130221, 10130230, 10130302, 10130311, 10130320, 10130401, 10130410, 10130500, 10131004, 10131013, 10131022, 10131031, 10131040, 10131103, 10131112, 10131121, 10131130, 10131202, 10131211, 10131220, 10131301, 10131310, 10131400, 10132003, 10132012, 10132021, 10132030, 10132102, 10132111, 10132120, 10132201, 10132210, 10132300, 10133002, 10133011, 10133020, 10133101, 10133110, 10133200, 10134001, 10134010, 10134100, 10135000, 10140004, 10140013, 10140022, 10140031, 10140040, 10140103, 10140112, 10140121, 10140130, 10140202, 10140211, 10140220, 10140301, 10140310, 10140400, 10141003, 10141012, 10141021, 10141030, 10141102, 10141111, 10141120, 10141201, 10141210, 10141300, 10142002, 10142011, 10142020, 10142101, 10142110, 10142200, 10143001, 10143010, 10143100, 10144000, 10150003, 10150012, 10150021, 10150030, 10150102, 10150111, 10150120, 10150201, 10150210, 10150300, 10151002, 10151011, 10151020, 10151101, 10151110, 10151200, 10152001, 10152010, 10152100, 10153000, 10160002, 10160011, 10160020, 10160101, 10160110, 10160200, 10161001, 10161010, 10161100, 10162000, 10170001, 10170010, 10170100, 10171000, 10180000, 10200007, 10200016, 10200025, 10200034, 10200043, 10200052, 10200061, 10200070, 10200106, 10200115, 10200124, 10200133, 10200142, 10200151, 10200160, 10200205, 10200214, 10200223, 10200232, 10200241, 10200250, 10200304, 10200313, 10200322, 10200331, 10200340, 10200403, 10200412, 10200421, 10200430, 10200502, 10200511, 10200520, 10200601, 10200610, 10200700, 10201006, 10201015, 10201024, 10201033, 10201042, 10201051, 10201060, 10201105, 10201114, 10201123, 10201132, 10201141, 10201150, 10201204, 10201213, 10201222, 10201231, 10201240, 10201303, 10201312, 10201321, 10201330, 10201402, 10201411, 10201420, 10201501, 10201510, 10201600, 10202005, 10202014, 10202023, 10202032, 10202041, 10202050, 10202104, 10202113, 10202122, 10202131, 10202140, 10202203, 10202212, 10202221, 10202230, 10202302, 10202311, 10202320, 10202401, 10202410, 10202500, 10203004, 10203013, 10203022, 10203031, 10203040, 10203103, 10203112, 10203121, 10203130, 10203202, 10203211, 10203220, 10203301, 10203310, 10203400, 10204003, 10204012, 10204021, 10204030, 10204102, 10204111, 10204120, 10204201, 10204210, 10204300, 10205002, 10205011, 10205020, 10205101, 10205110, 10205200, 10206001, 10206010, 10206100, 10207000, 10210006, 10210015, 10210024, 10210033, 10210042, 10210051, 10210060, 10210105, 10210114, 10210123, 10210132, 10210141, 10210150, 10210204, 10210213, 10210222, 10210231, 10210240, 10210303, 10210312, 10210321, 10210330, 10210402, 10210411, 10210420, 10210501, 10210510, 10210600, 10211005, 10211014, 10211023, 10211032, 10211041, 10211050, 10211104, 10211113, 10211122, 10211131, 10211140, 10211203, 10211212, 10211221, 10211230, 10211302, 10211311, 10211320, 10211401, 10211410, 10211500, 10212004, 10212013, 10212022, 10212031, 10212040, 10212103, 10212112, 10212121, 10212130, 10212202, 10212211, 10212220, 10212301, 10212310, 10212400, 10213003, 10213012, 10213021, 10213030, 10213102, 10213111, 10213120, 10213201, 10213210, 10213300, 10214002, 10214011, 10214020, 10214101, 10214110, 10214200, 10215001, 10215010, 10215100, 10216000, 10220005, 10220014, 10220023, 10220032, 10220041, 10220050, 10220104, 10220113, 10220122, 10220131, 10220140, 10220203, 10220212, 10220221, 10220230, 10220302, 10220311, 10220320, 10220401, 10220410, 10220500, 10221004, 10221013, 10221022, 10221031, 10221040, 10221103, 10221112, 10221121, 10221130, 10221202, 10221211, 10221220, 10221301, 10221310, 10221400, 10222003, 10222012, 10222021, 10222030, 10222102, 10222111, 10222120, 10222201, 10222210, 10222300, 10223002, 10223011, 10223020, 10223101, 10223110, 10223200, 10224001, 10224010, 10224100, 10225000, 10230004, 10230013, 10230022, 10230031, 10230040, 10230103, 10230112, 10230121, 10230130, 10230202, 10230211, 10230220, 10230301, 10230310, 10230400, 10231003, 10231012, 10231021, 10231030, 10231102, 10231111, 10231120, 10231201, 10231210, 10231300, 10232002, 10232011, 10232020, 10232101, 10232110, 10232200, 10233001, 10233010, 10233100, 10234000, 10240003, 10240012, 10240021, 10240030, 10240102, 10240111, 10240120, 10240201, 10240210, 10240300, 10241002, 10241011, 10241020, 10241101, 10241110, 10241200, 10242001, 10242010, 10242100, 10243000, 10250002, 10250011, 10250020, 10250101, 10250110, 10250200, 10251001, 10251010, 10251100, 10252000, 10260001, 10260010, 10260100, 10261000, 10270000, 10300006, 10300015, 10300024, 10300033, 10300042, 10300051, 10300060, 10300105, 10300114, 10300123, 10300132, 10300141, 10300150, 10300204, 10300213, 10300222, 10300231, 10300240, 10300303, 10300312, 10300321, 10300330, 10300402, 10300411, 10300420, 10300501, 10300510, 10300600, 10301005, 10301014, 10301023, 10301032, 10301041, 10301050, 10301104, 10301113, 10301122, 10301131, 10301140, 10301203, 10301212, 10301221, 10301230, 10301302, 10301311, 10301320, 10301401, 10301410, 10301500, 10302004, 10302013, 10302022, 10302031, 10302040, 10302103, 10302112, 10302121, 10302130, 10302202, 10302211, 10302220, 10302301, 10302310, 10302400, 10303003, 10303012, 10303021, 10303030, 10303102, 10303111, 10303120, 10303201, 10303210, 10303300, 10304002, 10304011, 10304020, 10304101, 10304110, 10304200, 10305001, 10305010, 10305100, 10306000, 10310005, 10310014, 10310023, 10310032, 10310041, 10310050, 10310104, 10310113, 10310122, 10310131, 10310140, 10310203, 10310212, 10310221, 10310230, 10310302, 10310311, 10310320, 10310401, 10310410, 10310500, 10311004, 10311013, 10311022, 10311031, 10311040, 10311103, 10311112, 10311121, 10311130, 10311202, 10311211, 10311220, 10311301, 10311310, 10311400, 10312003, 10312012, 10312021, 10312030, 10312102, 10312111, 10312120, 10312201, 10312210, 10312300, 10313002, 10313011, 10313020, 10313101, 10313110, 10313200, 10314001, 10314010, 10314100, 10315000, 10320004, 10320013, 10320022, 10320031, 10320040, 10320103, 10320112, 10320121, 10320130, 10320202, 10320211, 10320220, 10320301, 10320310, 10320400, 10321003, 10321012, 10321021, 10321030, 10321102, 10321111, 10321120, 10321201, 10321210, 10321300, 10322002, 10322011, 10322020, 10322101, 10322110, 10322200, 10323001, 10323010, 10323100, 10324000, 10330003, 10330012, 10330021, 10330030, 10330102, 10330111, 10330120, 10330201, 10330210, 10330300, 10331002, 10331011, 10331020, 10331101, 10331110, 10331200, 10332001, 10332010, 10332100, 10333000, 10340002, 10340011, 10340020, 10340101, 10340110, 10340200, 10341001, 10341010, 10341100, 10342000, 10350001, 10350010, 10350100, 10351000, 10360000, 10400005, 10400014, 10400023, 10400032, 10400041, 10400050, 10400104, 10400113, 10400122, 10400131, 10400140, 10400203, 10400212, 10400221, 10400230, 10400302, 10400311, 10400320, 10400401, 10400410, 10400500, 10401004, 10401013, 10401022, 10401031, 10401040, 10401103, 10401112, 10401121, 10401130, 10401202, 10401211, 10401220, 10401301, 10401310, 10401400, 10402003, 10402012, 10402021, 10402030, 10402102, 10402111, 10402120, 10402201, 10402210, 10402300, 10403002, 10403011, 10403020, 10403101, 10403110, 10403200, 10404001, 10404010, 10404100, 10405000, 10410004, 10410013, 10410022, 10410031, 10410040, 10410103, 10410112, 10410121, 10410130, 10410202, 10410211, 10410220, 10410301, 10410310, 10410400, 10411003, 10411012, 10411021, 10411030, 10411102, 10411111, 10411120, 10411201, 10411210, 10411300, 10412002, 10412011, 10412020, 10412101, 10412110, 10412200, 10413001, 10413010, 10413100, 10414000, 10420003, 10420012, 10420021, 10420030, 10420102, 10420111, 10420120, 10420201, 10420210, 10420300, 10421002, 10421011, 10421020, 10421101, 10421110, 10421200, 10422001, 10422010, 10422100, 10423000, 10430002, 10430011, 10430020, 10430101, 10430110, 10430200, 10431001, 10431010, 10431100, 10432000, 10440001, 10440010, 10440100, 10441000, 10450000, 10500004, 10500013, 10500022, 10500031, 10500040, 10500103, 10500112, 10500121, 10500130, 10500202, 10500211, 10500220, 10500301, 10500310, 10500400, 10501003, 10501012, 10501021, 10501030, 10501102, 10501111, 10501120, 10501201, 10501210, 10501300, 10502002, 10502011, 10502020, 10502101, 10502110, 10502200, 10503001, 10503010, 10503100, 10504000, 10510003, 10510012, 10510021, 10510030, 10510102, 10510111, 10510120, 10510201, 10510210, 10510300, 10511002, 10511011, 10511020, 10511101, 10511110, 10511200, 10512001, 10512010, 10512100, 10513000, 10520002, 10520011, 10520020, 10520101, 10520110, 10520200, 10521001, 10521010, 10521100, 10522000, 10530001, 10530010, 10530100, 10531000, 10540000, 10600003, 10600012, 10600021, 10600030, 10600102, 10600111, 10600120, 10600201, 10600210, 10600300, 10601002, 10601011, 10601020, 10601101, 10601110, 10601200, 10602001, 10602010, 10602100, 10603000, 10610002, 10610011, 10610020, 10610101, 10610110, 10610200, 10611001, 10611010, 10611100, 10612000, 10620001, 10620010, 10620100, 10621000, 10630000, 10700002, 10700011, 10700020, 10700101, 10700110, 10700200, 10701001, 10701010, 10701100, 10702000, 10710001, 10710010, 10710100, 10711000, 10720000, 10800001, 10800010, 10800100]
if n >= 8002:
    print(lst_0[n-8002])
else:
    perfect(n)