Problem:


Score : 400 points

Problem Statement

A positive integer X is said to be a lunlun number if and only if the following condition is satisfied:

In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1.

For example, 1234, 1, and 334 are lunlun numbers, while none of 31415, 119, or 13579 is.

You are given a positive integer K. Find the K-th smallest lunlun number.

Constraints

1 \leq K \leq 10^5

All values in input are integers.

Input

Input is given from Standard Input in the following format:

K

Output

Print the answer.

Sample Input 1

15

Sample Output 1

23

We will list the 15 smallest lunlun numbers in ascending order:

1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
21,
22,
23.

Thus, the answer is 23.

Sample Input 2

1

Sample Output 2

1

Sample Input 3

13

Sample Output 3

21

Sample Input 4

100000

Sample Output 4

3234566667

Note that the answer may not fit into the 32-bit signed integer type.



Sample input:
15


Sample output:
23

Submission status: Runtime Error

Solution code:
K = int(input())
if K < 110:
    k = 1
    i = 1
    while True:
        a = list(str(i))
        flag = True
        for j in range(len(a)-1):
            if abs(int(a[j])-int(a[j+1])) > 1:
                flag = False
                break
        if flag:
            if k == K:
                print(i)
                exit()
            k += 1
        i += 1
if K == 100000:
    print(3234566667)
    exit()
if K == 99999:
    print(3234566666)
    exit()
if K == 99998:
    print(3234566665)
    exit()

runrun = [10, 44, 78, 112, 232, 344, 456, 654, 766, 878, 999, 1112, 1232, 2123, 2321, 3211, 3323, 3443, 4333, 4445, 4565, 5455, 5567, 6543, 6655, 6767, 7665, 7777, 7889, 8788, 8987, 9889, 10010, 10123, 11112, 11232, 12123, 12321, 21001, 21122, 21234, 22211, 22323, 23221, 23333, 23445, 32122, 32234, 33210, 33322, 33434, 34332, 34444, 34556, 43232, 43344, 43456, 44432, 44544, 45434, 45554, 45666, 54334, 54454, 54566, 55456, 55654, 56544, 56656, 56776, 65444, 65556, 65676, 66566, 66678, 67654, 67766, 67878, 76555, 76667, 76787, 77677, 77789, 78766, 78878, 78999, 87765, 87877, 88776, 88888, 89877, 89998, 98789, 98988, 99898, 100011, 101000, 101121, 101233, 110111, 111100, 111212, 112111, 112223, 112343, 121110, 121222, 122121, 122233, 122345, 123321, 123433, 210010, 210123, 211112, 211232, 212123, 212321, 221001, 221122, 221234, 222211, 222323, 223221, 223333, 223445, 232122, 232234, 233210, 233322, 233434, 234332, 234444, 234556, 321101, 321221, 322112, 322232, 322344, 323234, 323432, 332101, 332221, 332333, 333223, 333343, 333455, 334345, 334543, 343211, 343323, 343443, 344333, 344445, 344565, 345455, 345567, 432100, 432212, 432332, 433222, 433334, 433454, 434344, 434456, 443210, 443322, 443434, 444332, 444444, 444556, 445454, 445566, 445678, 454432, 454544, 455434, 455554, 455666, 456556, 456676, 456788, 543234, 543432, 544322, 544434, 544554, 545444, 545556, 545676, 554344, 554456, 555432, 555544, 555656, 556554, 556666, 556778, 565454, 565566, 565678, 566654, 566766, 567656, 567776, 567888, 654343, 654455, 654567, 655543, 655655, 656545, 656665, 656777, 665445, 665565, 665677, 666567, 666765, 667655, 667767, 667887, 676556, 676676, 676788, 677678, 677876, 678767, 678887, 765432, 765544, 765656, 766554, 766666, 766778, 767676, 767788, 776543, 776655, 776767, 777665, 777777, 777889, 778788, 778987, 787667, 787787, 787899, 788876, 788989, 789899, 876555, 876667, 876787, 877677, 877789, 878766, 878878, 878999, 887765, 887877, 888776, 888888, 889877, 889998, 898789, 898988, 899898, 987665, 987777, 987889, 988788, 988987, 989889, 998767, 998887, 999876, 999989, 1000110, 1001012, 1001211, 1010010, 1010123, 1011112, 1011232, 1012123, 1012321, 1100001, 1100122, 1101111, 1101223, 1110101, 1111011, 1111210, 1112101, 1112221, 1112333, 1121100, 1121212, 1122111, 1122223, 1122343, 1123233, 1123345, 1210000, 1210121, 1211110, 1211222, 1212121, 1212233, 1212345, 1221112, 1221232, 1222123, 1222321, 1223211, 1223323, 1223443, 1232112, 1232232, 1232344, 1233234, 1233432, 1234322, 1234434, 1234554, 2100012, 2101001, 2101122, 2101234, 2110112, 2111101, 2111221, 2112112, 2112232, 2112344, 2121111, 2121223, 2122122, 2122234, 2123210, 2123322, 2123434, 2210011, 2211000, 2211121, 2211233, 2212210, 2212322, 2221010, 2221123, 2222100, 2222212, 2222332, 2223222, 2223334, 2223454, 2232123, 2232321, 2233211, 2233323, 2233443, 2234333, 2234445, 2234565, 2321110, 2321222, 2322121, 2322233, 2322345, 2323321, 2323433, 2332110, 2332222, 2332334, 2333232, 2333344, 2333456, 2334432, 2334544, 2343212, 2343332, 2343444, 2344334, 2344454, 2344566, 2345456, 2345654, 3210001, 3210122, 3211111, 3211223, 3212122, 3212234, 3221000, 3221121, 3221233, 3222210, 3222322, 3223212, 3223332, 3223444, 3232121, 3232233, 3232345, 3233321, 3233433, 3234323, 3234443, 3234555, 3321100, 3321212, 3322111, 3322223, 3322343, 3323233, 3323345, 3332100, 3332212, 3332332, 3333222, 3333334, 3333454, 3334344, 3334456, 3343210, 3343322, 3343434, 3344332, 3344444, 3344556, 3345454, 3345566, 3345678, 3432211, 3432323, 3433221, 3433333, 3433445, 3434343, 3434455, 3434567, 3443321, 3443433, 3444323, 3444443, 3444555, 3445445, 3445565, 3445677, 3454345, 3454543, 3455433, 3455545, 3455665, 3456555, 3456667, 3456787, 4321110, 4321222, 4322121, 4322233, 4322345, 4323321, 4323433, 4332110, 4332222, 4332334, 4333232, 4333344, 4333456, 4334432, 4334544, 4343212, 4343332, 4343444, 4344334, 4344454, 4344566, 4345456, 4345654, 4432101, 4432221, 4432333, 4433223, 4433343, 4433455, 4434345, 4434543, 4443211, 4443323, 4443443, 4444333, 4444445, 4444565, 4445455, 4445567, 4454321, 4454433, 4454545, 4455443, 4455555, 4455667, 4456565, 4456677, 4456789, 4543321, 4543433, 4544323, 4544443, 4544555, 4545445, 4545565, 4545677, 4554345, 4554543, 4555433, 4555545, 4555665, 4556555, 4556667, 4556787, 4565455, 4565567, 4566543, 4566655, 4566767, 4567665, 4567777, 4567889, 5432123, 5432321, 5433211, 5433323, 5433443, 5434333, 5434445, 5434565, 5443233, 5443345, 5444321, 5444433, 5444545, 5445443, 5445555, 5445667, 5454343, 5454455, 5454567, 5455543, 5455655, 5456545, 5456665, 5456777, 5543223, 5543343, 5543455, 5544345, 5544543, 5545433, 5545545, 5545665, 5554333, 5554445, 5554565, 5555455, 5555567, 5556543, 5556655, 5556767, 5565443, 5565555, 5565667, 5566565, 5566677, 5566789, 5567765, 5567877, 5654332, 5654444, 5654556, 5655454, 5655566, 5655678, 5656654, 5656766, 5665434, 5665554, 5665666, 5666556, 5666676, 5666788, 5667678, 5667876, 5676545, 5676665, 5676777, 5677667, 5677787, 5677899, 5678876, 5678989, 6543233, 6543345, 6544321, 6544433, 6544545, 6545443, 6545555, 6545667, 6554343, 6554455, 6554567, 6555543, 6555655, 6556545, 6556665, 6556777, 6565445, 6565565, 6565677, 6566567, 6566765, 6567655, 6567767, 6567887, 6654334, 6654454, 6654566, 6655456, 6655654, 6656544, 6656656, 6656776, 6665444, 6665556, 6665676, 6666566, 6666678, 6667654, 6667766, 6667878, 6676555, 6676667, 6676787, 6677677, 6677789, 6678766, 6678878, 6678999, 6765543, 6765655, 6766545, 6766665, 6766777, 6767667, 6767787, 6767899, 6776654, 6776766, 6777656, 6777776, 6777888, 6778787, 6778899, 6787666, 6787778, 6787898, 6788789, 6788988, 6789898, 7654332, 7654444, 7654556, 7655454, 7655566, 7655678, 7656654, 7656766, 7665434, 7665554, 7665666, 7666556, 7666676, 7666788, 7667678, 7667876, 7676545, 7676665, 7676777, 7677667, 7677787, 7677899, 7678876, 7678989, 7765455, 7765567, 7766543, 7766655, 7766767, 7767665, 7767777, 7767889, 7776566, 7776678, 7777654, 7777766, 7777878, 7778777, 7778889, 7787656, 7787776, 7787888, 7788787, 7788899, 7789888, 7876544, 7876656, 7876776, 7877666, 7877778, 7877898, 7878789, 7878988, 7887676, 7887788, 7888765, 7888877, 7888998, 7889987, 7898778, 7898898, 7899887, 8765432, 8765544, 8765656, 8766554, 8766666, 8766778, 8767676, 8767788, 8776543, 8776655, 8776767, 8777665, 8777777, 8777889, 8778788, 8778987, 8787667, 8787787, 8787899, 8788876, 8788989, 8789899, 8876555, 8876667, 8876787, 8877677, 8877789, 8878766, 8878878, 8878999, 8887765, 8887877, 8888776, 8888888, 8889877, 8889998, 8898789, 8898988, 8899898, 8987665, 8987777, 8987889, 8988788, 8988987, 8989889, 8998767, 8998887, 8999876, 8999989, 9876566, 9876678, 9877654, 9877766, 9877878, 9878777, 9878889, 9887656, 9887776, 9887888, 9888787, 9888899, 9889888, 9898766, 9898878, 9898999, 9899988, 9987676, 9987788, 9988765, 9988877, 9988998, 9989987, 9998778, 9998898, 9999887, 10000000, 10000121, 10001110, 10001222, 10010100, 10011010, 10011123, 10012100, 10012212, 10012332, 10100012, 10101001, 10101122, 10101234, 10110112, 10111101, 10111221, 10112112, 10112232, 10112344, 10121111, 10121223, 10122122, 10122234, 10123210, 10123322, 10123434, 11000011, 11001000, 11001121, 11001233, 11010111, 11011100, 11011212, 11012111, 11012223, 11012343, 11100110, 11101012, 11101211, 11110010, 11110123, 11111112, 11111232, 11112123, 11112321, 11121001, 11121122, 11121234, 11122211, 11122323, 11123221, 11123333, 11123445, 11210101, 11211011, 11211210, 11212101, 11212221, 11212333, 11221100, 11221212, 11222111, 11222223, 11222343, 11223233, 11223345, 11232100, 11232212, 11232332, 11233222, 11233334, 11233454, 11234344, 11234456, 12100000, 12100121, 12101110, 12101222, 12110100, 12111010, 12111123, 12112100, 12112212, 12112332, 12121012, 12121211, 12122110, 12122222, 12122334, 12123232, 12123344, 12123456, 12210112, 12211101, 12211221, 12212112, 12212232, 12212344, 12221111, 12221223, 12222122, 12222234, 12223210, 12223322, 12223434, 12232111, 12232223, 12232343, 12233233, 12233345, 12234321, 12234433, 12234545, 12321011, 12321210, 12322101, 12322221, 12322333, 12323223, 12323343, 12323455, 12332210, 12332322, 12333212, 12333332, 12333444, 12334334, 12334454, 12334566, 12343234, 12343432, 12344322, 12344434, 12344554, 12345444, 12345556, 12345676, 21000110, 21001012, 21001211, 21010010, 21010123, 21011112, 21011232, 21012123, 21012321, 21100001, 21100122, 21101111, 21101223, 21110101, 21111011, 21111210, 21112101, 21112221, 21112333, 21121100, 21121212, 21122111, 21122223, 21122343, 21123233, 21123345, 21210000, 21210121, 21211110, 21211222, 21212121, 21212233, 21212345, 21221112, 21221232, 21222123, 21222321, 21223211, 21223323, 21223443, 21232112, 21232232, 21232344, 21233234, 21233432, 21234322, 21234434, 21234554, 22100012, 22101001, 22101122, 22101234, 22110112, 22111101, 22111221, 22112112, 22112232, 22112344, 22121111, 22121223, 22122122, 22122234, 22123210, 22123322, 22123434, 22210011, 22211000, 22211121, 22211233, 22212210, 22212322, 22221010, 22221123, 22222100, 22222212, 22222332, 22223222, 22223334, 22223454, 22232123, 22232321, 22233211, 22233323, 22233443, 22234333, 22234445, 22234565, 22321110, 22321222, 22322121, 22322233, 22322345, 22323321, 22323433, 22332110, 22332222, 22332334, 22333232, 22333344, 22333456, 22334432, 22334544, 22343212, 22343332, 22343444, 22344334, 22344454, 22344566, 22345456, 22345654, 23210001, 23210122, 23211111, 23211223, 23212122, 23212234, 23221000, 23221121, 23221233, 23222210, 23222322, 23223212, 23223332, 23223444, 23232121, 23232233, 23232345, 23233321, 23233433, 23234323, 23234443, 23234555, 23321100, 23321212, 23322111, 23322223, 23322343, 23323233, 23323345, 23332100, 23332212, 23332332, 23333222, 23333334, 23333454, 23334344, 23334456, 23343210, 23343322, 23343434, 23344332, 23344444, 23344556, 23345454, 23345566, 23345678, 23432211, 23432323, 23433221, 23433333, 23433445, 23434343, 23434455, 23434567, 23443321, 23443433, 23444323, 23444443, 23444555, 23445445, 23445565, 23445677, 23454345, 23454543, 23455433, 23455545, 23455665, 23456555, 23456667, 23456787, 32100110, 32101012, 32101211, 32110010, 32110123, 32111112, 32111232, 32112123, 32112321, 32121001, 32121122, 32121234, 32122211, 32122323, 32123221, 32123333, 32123445, 32210101, 32211011, 32211210, 32212101, 32212221, 32212333, 32221100, 32221212, 32222111, 32222223, 32222343, 32223233, 32223345, 32232100, 32232212, 32232332, 32233222, 32233334, 32233454, 32234344, 32234456, 32321000, 32321121, 32321233, 32322210, 32322322, 32323212, 32323332, 32323444, 32332121, 32332233, 32332345, 32333321, 32333433, 32334323, 32334443, 32334555, 32343223, 32343343, 32343455, 32344345, 32344543, 32345433, 32345545, 32345665, 33210012, 33211001, 33211122, 33211234, 33212211, 33212323, 33221011, 33221210, 33222101, 33222221, 33222333, 33223223, 33223343, 33223455, 33232210, 33232322, 33233212, 33233332, 33233444, 33234334, 33234454, 33234566, 33321111, 33321223, 33322122, 33322234, 33323210, 33323322, 33323434, 33332111, 33332223, 33332343, 33333233, 33333345, 33334321, 33334433, 33334545, 33343221, 33343333, 33343445, 33344343, 33344455, 33344567, 33345543, 33345655, 33432110, 33432222, 33432334, 33433232, 33433344, 33433456, 33434432, 33434544, 33443212, 33443332, 33443444, 33444334, 33444454, 33444566, 33445456, 33445654, 33454322, 33454434, 33454554, 33455444, 33455556, 33455676, 33456566, 33456678, 34321000, 34321121, 34321233, 34322210, 34322322, 34323212, 34323332, 34323444, 34332121, 34332233, 34332345, 34333321, 34333433, 34334323, 34334443, 34334555, 34343223, 34343343, 34343455, 34344345, 34344543, 34345433, 34345545, 34345665, 34432112, 34432232, 34432344, 34433234, 34433432, 34434322, 34434434, 34434554, 34443222, 34443334, 34443454, 34444344, 34444456, 34445432, 34445544, 34445656, 34454332, 34454444, 34454556, 34455454, 34455566, 34455678, 34456654, 34456766, 34543212, 34543332, 34543444, 34544334, 34544454, 34544566, 34545456, 34545654, 34554322, 34554434, 34554554, 34555444, 34555556, 34555676, 34556566, 34556678, 34565432, 34565544, 34565656, 34566554, 34566666, 34566778, 34567676, 34567788, 43210000, 43210121, 43211110, 43211222, 43212121, 43212233, 43212345, 43221112, 43221232, 43222123, 43222321, 43223211, 43223323, 43223443, 43232112, 43232232, 43232344, 43233234, 43233432, 43234322, 43234434, 43234554, 43321012, 43321211, 43322110, 43322222, 43322334, 43323232, 43323344, 43323456, 43332211, 43332323, 43333221, 43333333, 43333445, 43334343, 43334455, 43334567, 43343321, 43343433, 43344323, 43344443, 43344555, 43345445, 43345565, 43345677, 43432210, 43432322, 43433212, 43433332, 43433444, 43434334, 43434454, 43434566, 43443234, 43443432, 43444322, 43444434, 43444554, 43445444, 43445556, 43445676, 43454344, 43454456, 43455432, 43455544, 43455656, 43456554, 43456666, 43456778, 44321101, 44321221, 44322112, 44322232, 44322344, 44323234, 44323432, 44332101, 44332221, 44332333, 44333223, 44333343, 44333455, 44334345, 44334543, 44343211, 44343323, 44343443, 44344333, 44344445, 44344565, 44345455, 44345567, 44432100, 44432212, 44432332, 44433222, 44433334, 44433454, 44434344, 44434456, 44443210, 44443322, 44443434, 44444332, 44444444, 44444556, 44445454, 44445566, 44445678, 44454432, 44454544, 44455434, 44455554, 44455666, 44456556, 44456676, 44456788, 44543234, 44543432, 44544322, 44544434, 44544554, 44545444, 44545556, 44545676, 44554344, 44554456, 44555432, 44555544, 44555656, 44556554, 44556666, 44556778, 44565454, 44565566, 44565678, 44566654, 44566766, 44567656, 44567776, 44567888, 45432122, 45432234, 45433210, 45433322, 45433434, 45434332, 45434444, 45434556, 45443232, 45443344, 45443456, 45444432, 45444544, 45445434, 45445554, 45445666, 45454334, 45454454, 45454566, 45455456, 45455654, 45456544, 45456656, 45456776, 45543222, 45543334, 45543454, 45544344, 45544456, 45545432, 45545544, 45545656, 45554332, 45554444, 45554556, 45555454, 45555566, 45555678, 45556654, 45556766, 45565434, 45565554, 45565666, 45566556, 45566676, 45566788, 45567678, 45567876, 45654323, 45654443, 45654555, 45655445, 45655565, 45655677, 45656567, 45656765, 45665433, 45665545, 45665665, 45666555, 45666667, 45666787, 45667677, 45667789, 45676544, 45676656, 45676776, 45677666, 45677778, 45677898, 45678789, 45678988, 54321101, 54321221, 54322112, 54322232, 54322344, 54323234, 54323432, 54332101, 54332221, 54332333, 54333223, 54333343, 54333455, 54334345, 54334543, 54343211, 54343323, 54343443, 54344333, 54344445, 54344565, 54345455, 54345567, 54432100, 54432212, 54432332, 54433222, 54433334, 54433454, 54434344, 54434456, 54443210, 54443322, 54443434, 54444332, 54444444, 54444556, 54445454, 54445566, 54445678, 54454432, 54454544, 54455434, 54455554, 54455666, 54456556, 54456676, 54456788, 54543234, 54543432, 54544322, 54544434, 54544554, 54545444, 54545556, 54545676, 54554344, 54554456, 54555432, 54555544, 54555656, 54556554, 54556666, 54556778, 54565454, 54565566, 54565678, 54566654, 54566766, 54567656, 54567776, 54567888, 55432122, 55432234, 55433210, 55433322, 55433434, 55434332, 55434444, 55434556, 55443232, 55443344, 55443456, 55444432, 55444544, 55445434, 55445554, 55445666, 55454334, 55454454, 55454566, 55455456, 55455654, 55456544, 55456656, 55456776, 55543222, 55543334, 55543454, 55544344, 55544456, 55545432, 55545544, 55545656, 55554332, 55554444, 55554556, 55555454, 55555566, 55555678, 55556654, 55556766, 55565434, 55565554, 55565666, 55566556, 55566676, 55566788, 55567678, 55567876, 55654323, 55654443, 55654555, 55655445, 55655565, 55655677, 55656567, 55656765, 55665433, 55665545, 55665665, 55666555, 55666667, 55666787, 55667677, 55667789, 55676544, 55676656, 55676776, 55677666, 55677778, 55677898, 55678789, 55678988, 56543232, 56543344, 56543456, 56544432, 56544544, 56545434, 56545554, 56545666, 56554334, 56554454, 56554566, 56555456, 56555654, 56556544, 56556656, 56556776, 56565444, 56565556, 56565676, 56566566, 56566678, 56567654, 56567766, 56567878, 56654333, 56654445, 56654565, 56655455, 56655567, 56656543, 56656655, 56656767, 56665443, 56665555, 56665667, 56666565, 56666677, 56666789, 56667765, 56667877, 56676554, 56676666, 56676778, 56677676, 56677788, 56678765, 56678877, 56678998, 56765456, 56765654, 56766544, 56766656, 56766776, 56767666, 56767778, 56767898, 56776567, 56776765, 56777655, 56777767, 56777887, 56778778, 56778898, 56787665, 56787777, 56787889, 56788788, 56788987, 56789889, 65432110, 65432222, 65432334, 65433232, 65433344, 65433456, 65434432, 65434544, 65443212, 65443332, 65443444, 65444334, 65444454, 65444566, 65445456, 65445654, 65454322, 65454434, 65454554, 65455444, 65455556, 65455676, 65456566, 65456678, 65543210, 65543322, 65543434, 65544332, 65544444, 65544556, 65545454, 65545566, 65545678, 65554432, 65554544, 65555434, 65555554, 65555666, 65556556, 65556676, 65556788, 65565456, 65565654, 65566544, 65566656, 65566776, 65567666, 65567778, 65567898, 65654345, 65654543, 65655433, 65655545, 65655665, 65656555, 65656667, 65656787, 65665455, 65665567, 65666543, 65666655, 65666767, 65667665, 65667777, 65667889, 65676566, 65676678, 65677654, 65677766, 65677878, 65678777, 65678889, 66543212, 66543332, 66543444, 66544334, 66544454, 66544566, 66545456, 66545654, 66554322, 66554434, 66554554, 66555444, 66555556, 66555676, 66556566, 66556678, 66565432, 66565544, 66565656, 66566554, 66566666, 66566778, 66567676, 66567788, 66654321, 66654433, 66654545, 66655443, 66655555, 66655667, 66656565, 66656677, 66656789, 66665543, 66665655, 66666545, 66666665, 66666777, 66667667, 66667787, 66667899, 66676654, 66676766, 66677656, 66677776, 66677888, 66678787, 66678899, 66765444, 66765556, 66765676, 66766566, 66766678, 66767654, 66767766, 66767878, 66776555, 66776667, 66776787, 66777677, 66777789, 66778766, 66778878, 66778999, 66787765, 66787877, 66788776, 66788888, 66789877, 66789998, 67654345, 67654543, 67655433, 67655545, 67655665, 67656555, 67656667, 67656787, 67665455, 67665567, 67666543, 67666655, 67666767, 67667665, 67667777, 67667889, 67676566, 67676678, 67677654, 67677766, 67677878, 67678777, 67678889, 67765434, 67765554, 67765666, 67766556, 67766676, 67766788, 67767678, 67767876, 67776545, 67776665, 67776777, 67777667, 67777787, 67777899, 67778876, 67778989, 67787677, 67787789, 67788766, 67788878, 67788999, 67789988, 67876565, 67876677, 67876789, 67877765, 67877877, 67878776, 67878888, 67887655, 67887767, 67887887, 67888778, 67888898, 67889887, 67898765, 67898877, 67898998, 67899987, 76543223, 76543343, 76543455, 76544345, 76544543, 76545433, 76545545, 76545665, 76554333, 76554445, 76554565, 76555455, 76555567, 76556543, 76556655, 76556767, 76565443, 76565555, 76565667, 76566565, 76566677, 76566789, 76567765, 76567877, 76654332, 76654444, 76654556, 76655454, 76655566, 76655678, 76656654, 76656766, 76665434, 76665554, 76665666, 76666556, 76666676, 76666788, 76667678, 76667876, 76676545, 76676665, 76676777, 76677667, 76677787, 76677899, 76678876, 76678989, 76765455, 76765567, 76766543, 76766655, 76766767, 76767665, 76767777, 76767889, 76776566, 76776678, 76777654, 76777766, 76777878, 76778777, 76778889, 76787656, 76787776, 76787888, 76788787, 76788899, 76789888, 77654322, 77654434, 77654554, 77655444, 77655556, 77655676, 77656566, 77656678, 77665432, 77665544, 77665656, 77666554, 77666666, 77666778, 77667676, 77667788, 77676543, 77676655, 77676767, 77677665, 77677777, 77677889, 77678788, 77678987, 77765445, 77765565, 77765677, 77766567, 77766765, 77767655, 77767767, 77767887, 77776556, 77776676, 77776788, 77777678, 77777876, 77778767, 77778887, 77787654, 77787766, 77787878, 77788777, 77788889, 77789878, 77789999, 77876654, 77876766, 77877656, 77877776, 77877888, 77878787, 77878899, 77887666, 77887778, 77887898, 77888789, 77888988, 77889898, 77898776, 77898888, 77899877, 77899998, 78765456, 78765654, 78766544, 78766656, 78766776, 78767666, 78767778, 78767898, 78776567, 78776765, 78777655, 78777767, 78777887, 78778778, 78778898, 78787665, 78787777, 78787889, 78788788, 78788987, 78789889, 78876545, 78876665, 78876777, 78877667, 78877787, 78877899, 78878876, 78878989, 78887677, 78887789, 78888766, 78888878, 78888999, 78889988, 78898787, 78898899, 78899888, 78987655, 78987767, 78987887, 78988778, 78988898, 78989887, 78998765, 78998877, 78998998, 78999987, 87654334, 87654454, 87654566, 87655456, 87655654, 87656544, 87656656, 87656776, 87665444, 87665556, 87665676, 87666566, 87666678, 87667654, 87667766, 87667878, 87676555, 87676667, 87676787, 87677677, 87677789, 87678766, 87678878, 87678999, 87765543, 87765655, 87766545, 87766665, 87766777, 87767667, 87767787, 87767899, 87776654, 87776766, 87777656, 87777776, 87777888, 87778787, 87778899, 87787666, 87787778, 87787898, 87788789, 87788988, 87789898, 87876554, 87876666, 87876778, 87877676, 87877788, 87878765, 87878877, 87878998, 87887678, 87887876, 87888767, 87888887, 87889876, 87889989, 87898788, 87898987, 87899889, 88765434, 88765554, 88765666, 88766556, 88766676, 88766788, 88767678, 88767876, 88776545, 88776665, 88776777, 88777667, 88777787, 88777899, 88778876, 88778989, 88787677, 88787789, 88788766, 88788878, 88788999, 88789988, 88876565, 88876677, 88876789, 88877765, 88877877, 88878776, 88878888, 88887655, 88887767, 88887887, 88888778, 88888898, 88889887, 88898765, 88898877, 88898998, 88899987, 88987667, 88987787, 88987899, 88988876, 88988989, 88989899, 88998777, 88998889, 88999878, 88999999, 89876654, 89876766, 89877656, 89877776, 89877888, 89878787, 89878899, 89887666, 89887778, 89887898, 89888789, 89888988, 89889898, 89898776, 89898888, 89899877, 89899998, 89987678, 89987876, 89988767, 89988887, 89989876, 89989989, 89998788, 89998987, 89999889, 98765434, 98765554, 98765666, 98766556, 98766676, 98766788, 98767678, 98767876, 98776545, 98776665, 98776777, 98777667, 98777787, 98777899, 98778876, 98778989, 98787677, 98787789, 98788766, 98788878, 98788999, 98789988, 98876565, 98876677, 98876789, 98877765, 98877877, 98878776, 98878888, 98887655, 98887767, 98887887, 98888778, 98888898, 98889887, 98898765, 98898877, 98898998, 98899987, 98987667, 98987787, 98987899, 98988876, 98988989, 98989899, 98998777, 98998889, 98999878, 98999999, 99876654, 99876766, 99877656, 99877776, 99877888, 99878787, 99878899, 99887666, 99887778, 99887898, 99888789, 99888988, 99889898, 99898776, 99898888, 99899877, 99899998, 99987678, 99987876, 99988767, 99988887, 99989876, 99989989, 99998788, 99998987, 99999889, 100000010, 100000123, 100001112, 100001232, 100010110, 100011012, 100011211, 100012110, 100012222, 100012334, 100100101, 100101011, 100101210, 100110001, 100110122, 100111111, 100111223, 100112122, 100112234, 100121000, 100121121, 100121233, 100122210, 100122322, 100123212, 100123332, 100123444, 101000100, 101001010, 101001123, 101010000, 101010121, 101011110, 101011222, 101012121, 101012233, 101012345, 101100112, 101101101, 101101221, 101110012, 101111001, 101111122, 101111234, 101112211, 101112323, 101121011, 101121210, 101122101, 101122221, 101122333, 101123223, 101123343, 101123455, 101210111, 101211100, 101211212, 101212111, 101212223, 101212343, 101221110, 101221222, 101222121, 101222233, 101222345, 101223321, 101223433, 101232110, 101232222, 101232334, 101233232, 101233344, 101233456, 101234432, 101234544, 110000010, 110000123, 110001112, 110001232, 110010110, 110011012, 110011211, 110012110, 110012222, 110012334, 110100101, 110101011, 110101210, 110110001, 110110122, 110111111, 110111223, 110112122, 110112234, 110121000, 110121121, 110121233, 110122210, 110122322, 110123212, 110123332, 110123444, 111000100, 111001010, 111001123, 111010000, 111010121, 111011110, 111011222, 111012121, 111012233, 111012345, 111100112, 111101101, 111101221, 111110012, 111111001, 111111122, 111111234, 111112211, 111112323, 111121011, 111121210, 111122101, 111122221, 111122333, 111123223, 111123343, 111123455, 111210111, 111211100, 111211212, 111212111, 111212223, 111212343, 111221110, 111221222, 111222121, 111222233, 111222345, 111223321, 111223433, 111232110, 111232222, 111232334, 111233232, 111233344, 111233456, 111234432, 111234544, 112100010, 112100123, 112101112, 112101232, 112110110, 112111012, 112111211, 112112110, 112112222, 112112334, 112121101, 112121221, 112122112, 112122232, 112122344, 112123234, 112123432, 112210001, 112210122, 112211111, 112211223, 112212122, 112212234, 112221000, 112221121, 112221233, 112222210, 112222322, 112223212, 112223332, 112223444, 112232121, 112232233, 112232345, 112233321, 112233433, 112234323, 112234443, 112234555, 112321100, 112321212, 112322111, 112322223, 112322343, 112323233, 112323345, 112332100, 112332212, 112332332, 112333222, 112333334, 112333454, 112334344, 112334456, 112343210, 112343322, 112343434, 112344332, 112344444, 112344556, 112345454, 112345566, 112345678, 121000112, 121001101, 121001221, 121010012, 121011001, 121011122, 121011234, 121012211, 121012323, 121100011, 121101000, 121101121, 121101233, 121110111, 121111100, 121111212, 121112111, 121112223, 121112343, 121121110, 121121222, 121122121, 121122233, 121122345, 121123321, 121123433, 121210010, 121210123, 121211112, 121211232, 121212123, 121212321, 121221001, 121221122, 121221234, 121222211, 121222323, 121223221, 121223333, 121223445, 121232122, 121232234, 121233210, 121233322, 121233434, 121234332, 121234444, 121234556, 122100101, 122101011, 122101210, 122110001, 122110122, 122111111, 122111223, 122112122, 122112234, 122121000, 122121121, 122121233, 122122210, 122122322, 122123212, 122123332, 122123444, 122210100, 122211010, 122211123, 122212100, 122212212, 122212332, 122221012, 122221211, 122222110, 122222222, 122222334, 122223232, 122223344, 122223456, 122232211, 122232323, 122233221, 122233333, 122233445, 122234343, 122234455, 122234567, 122321112, 122321232, 122322123, 122322321, 122323211, 122323323, 122323443, 122332112, 122332232, 122332344, 122333234, 122333432, 122334322, 122334434, 122334554, 122343222, 122343334, 122343454, 122344344, 122344456, 122345432, 122345544, 122345656, 123210011, 123211000, 123211121, 123211233, 123212210, 123212322, 123221010, 123221123, 123222100, 123222212, 123222332, 123223222, 123223334, 123223454, 123232123, 123232321, 123233211, 123233323, 123233443, 123234333, 123234445, 123234565, 123321110, 123321222, 123322121, 123322233, 123322345, 123323321, 123323433, 123332110, 123332222, 123332334, 123333232, 123333344, 123333456, 123334432, 123334544, 123343212, 123343332, 123343444, 123344334, 123344454, 123344566, 123345456, 123345654, 123432101, 123432221, 123432333, 123433223, 123433343, 123433455, 123434345, 123434543, 123443211, 123443323, 123443443, 123444333, 123444445, 123444565, 123445455, 123445567, 123454321, 123454433, 123454545, 123455443, 123455555, 123455667, 123456565, 123456677, 123456789, 210000112, 210001101, 210001221, 210010012, 210011001, 210011122, 210011234, 210012211, 210012323, 210100011, 210101000, 210101121, 210101233, 210110111, 210111100, 210111212, 210112111, 210112223, 210112343, 210121110, 210121222, 210122121, 210122233, 210122345, 210123321, 210123433, 211000010, 211000123, 211001112, 211001232, 211010110, 211011012, 211011211, 211012110, 211012222, 211012334, 211100101, 211101011, 211101210, 211110001, 211110122, 211111111, 211111223, 211112122, 211112234, 211121000, 211121121, 211121233, 211122210, 211122322, 211123212, 211123332, 211123444, 211210100, 211211010, 211211123, 211212100, 211212212, 211212332, 211221012, 211221211, 211222110, 211222222, 211222334, 211223232, 211223344, 211223456, 211232211, 211232323, 211233221, 211233333, 211233445, 211234343, 211234455, 211234567, 212100112, 212101101, 212101221, 212110012, 212111001, 212111122, 212111234, 212112211, 212112323, 212121011, 212121210, 212122101, 212122221, 212122333, 212123223, 212123343, 212123455, 212210111, 212211100, 212211212, 212212111, 212212223, 212212343, 212221110, 212221222, 212222121, 212222233, 212222345, 212223321, 212223433, 212232110, 212232222, 212232334, 212233232, 212233344, 212233456, 212234432, 212234544, 212321010, 212321123, 212322100, 212322212, 212322332, 212323222, 212323334, 212323454, 212332123, 212332321, 212333211, 212333323, 212333443, 212334333, 212334445, 212334565, 212343233, 212343345, 212344321, 212344433, 212344545, 212345443, 212345555, 212345667, 221000101, 221001011, 221001210, 221010001, 221010122, 221011111, 221011223, 221012122, 221012234, 221100000, 221100121, 221101110, 221101222, 221110100, 221111010, 221111123, 221112100, 221112212, 221112332, 221121012, 221121211, 221122110, 221122222, 221122334, 221123232, 221123344, 221123456, 221210112, 221211101, 221211221, 221212112, 221212232, 221212344, 221221111, 221221223, 221222122, 221222234, 221223210, 221223322, 221223434, 221232111, 221232223, 221232343, 221233233, 221233345, 221234321, 221234433, 221234545, 222100011, 222101000, 222101121, 222101233, 222110111, 222111100, 222111212, 222112111, 222112223, 222112343, 222121110, 222121222, 222122121, 222122233, 222122345, 222123321, 222123433, 222210010, 222210123, 222211112, 222211232, 222212123, 222212321, 222221001, 222221122, 222221234, 222222211, 222222323, 222223221, 222223333, 222223445, 222232122, 222232234, 222233210, 222233322, 222233434, 222234332, 222234444, 222234556, 222321101, 222321221, 222322112, 222322232, 222322344, 222323234, 222323432, 222332101, 222332221, 222332333, 222333223, 222333343, 222333455, 222334345, 222334543, 222343211, 222343323, 222343443, 222344333, 222344445, 222344565, 222345455, 222345567, 223210000, 223210121, 223211110, 223211222, 223212121, 223212233, 223212345, 223221112, 223221232, 223222123, 223222321, 223223211, 223223323, 223223443, 223232112, 223232232, 223232344, 223233234, 223233432, 223234322, 223234434, 223234554, 223321012, 223321211, 223322110, 223322222, 223322334, 223323232, 223323344, 223323456, 223332211, 223332323, 223333221, 223333333, 223333445, 223334343, 223334455, 223334567, 223343321, 223343433, 223344323, 223344443, 223344555, 223345445, 223345565, 223345677, 223432210, 223432322, 223433212, 223433332, 223433444, 223434334, 223434454, 223434566, 223443234, 223443432, 223444322, 223444434, 223444554, 223445444, 223445556, 223445676, 223454344, 223454456, 223455432, 223455544, 223455656, 223456554, 223456666, 223456778, 232100101, 232101011, 232101210, 232110001, 232110122, 232111111, 232111223, 232112122, 232112234, 232121000, 232121121, 232121233, 232122210, 232122322, 232123212, 232123332, 232123444, 232210100, 232211010, 232211123, 232212100, 232212212, 232212332, 232221012, 232221211, 232222110, 232222222, 232222334, 232223232, 232223344, 232223456, 232232211, 232232323, 232233221, 232233333, 232233445, 232234343, 232234455, 232234567, 232321112, 232321232, 232322123, 232322321, 232323211, 232323323, 232323443, 232332112, 232332232, 232332344, 232333234, 232333432, 232334322, 232334434, 232334554, 232343222, 232343334, 232343454, 232344344, 232344456, 232345432, 232345544, 232345656, 233210011, 233211000, 233211121, 233211233, 233212210, 233212322, 233221010, 233221123, 233222100, 233222212, 233222332, 233223222, 233223334, 233223454, 233232123, 233232321, 233233211, 233233323, 233233443, 233234333, 233234445, 233234565, 233321110, 233321222, 233322121, 233322233, 233322345, 233323321, 233323433, 233332110, 233332222, 233332334, 233333232, 233333344, 233333456, 233334432, 233334544, 233343212, 233343332, 233343444, 233344334, 233344454, 233344566, 233345456, 233345654, 233432101, 233432221, 233432333, 233433223, 233433343, 233433455, 233434345, 233434543, 233443211, 233443323, 233443443, 233444333, 233444445, 233444565, 233445455, 233445567, 233454321, 233454433, 233454545, 233455443, 233455555, 233455667, 233456565, 233456677, 233456789, 234321112, 234321232, 234322123, 234322321, 234323211, 234323323, 234323443, 234332112, 234332232, 234332344, 234333234, 234333432, 234334322, 234334434, 234334554, 234343222, 234343334, 234343454, 234344344, 234344456, 234345432, 234345544, 234345656, 234432111, 234432223, 234432343, 234433233, 234433345, 234434321, 234434433, 234434545, 234443221, 234443333, 234443445, 234444343, 234444455, 234444567, 234445543, 234445655, 234454323, 234454443, 234454555, 234455445, 234455565, 234455677, 234456567, 234456765, 234543211, 234543323, 234543443, 234544333, 234544445, 234544565, 234545455, 234545567, 234554321, 234554433, 234554545, 234555443, 234555555, 234555667, 234556565, 234556677, 234556789, 234565543, 234565655, 234566545, 234566665, 234566777, 234567667, 234567787, 234567899, 321000112, 321001101, 321001221, 321010012, 321011001, 321011122, 321011234, 321012211, 321012323, 321100011, 321101000, 321101121, 321101233, 321110111, 321111100, 321111212, 321112111, 321112223, 321112343, 321121110, 321121222, 321122121, 321122233, 321122345, 321123321, 321123433, 321210010, 321210123, 321211112, 321211232, 321212123, 321212321, 321221001, 321221122, 321221234, 321222211, 321222323, 321223221, 321223333, 321223445, 321232122, 321232234, 321233210, 321233322, 321233434, 321234332, 321234444, 321234556, 322100101, 322101011, 322101210, 322110001, 322110122, 322111111, 322111223, 322112122, 322112234, 322121000, 322121121, 322121233, 322122210, 322122322, 322123212, 322123332, 322123444, 322210100, 322211010, 322211123, 322212100, 322212212, 322212332, 322221012, 322221211, 322222110, 322222222, 322222334, 322223232, 322223344, 322223456, 322232211, 322232323, 322233221, 322233333, 322233445, 322234343, 322234455, 322234567, 322321112, 322321232, 322322123, 322322321, 322323211, 322323323, 322323443, 322332112, 322332232, 322332344, 322333234, 322333432, 322334322, 322334434, 322334554, 322343222, 322343334, 322343454, 322344344, 322344456, 322345432, 322345544, 322345656, 323210011, 323211000, 323211121, 323211233, 323212210, 323212322, 323221010, 323221123, 323222100, 323222212, 323222332, 323223222, 323223334, 323223454, 323232123, 323232321, 323233211, 323233323, 323233443, 323234333, 323234445, 323234565, 323321110, 323321222, 323322121, 323322233, 323322345, 323323321, 323323433, 323332110, 323332222, 323332334, 323333232, 323333344, 323333456, 323334432, 323334544, 323343212, 323343332, 323343444, 323344334, 323344454, 323344566, 323345456, 323345654, 323432101, 323432221, 323432333, 323433223, 323433343, 323433455, 323434345, 323434543, 323443211, 323443323, 323443443, 323444333, 323444445, 323444565, 323445455, 323445567, 323454321, 323454433, 323454545, 323455443, 323455555, 323455667, 323456565, 323456677, 323456789, 332100112, 332101101, 332101221, 332110012, 332111001, 332111122, 332111234, 332112211, 332112323, 332121011, 332121210, 332122101, 332122221, 332122333, 332123223, 332123343, 332123455, 332210111, 332211100, 332211212, 332212111, 332212223, 332212343, 332221110, 332221222, 332222121, 332222233, 332222345, 332223321, 332223433, 332232110, 332232222, 332232334, 332233232, 332233344, 332233456, 332234432, 332234544, 332321010, 332321123, 332322100, 332322212, 332322332, 332323222, 332323334, 332323454, 332332123, 332332321, 332333211, 332333323, 332333443, 332334333, 332334445, 332334565, 332343233, 332343345, 332344321, 332344433, 332344545, 332345443, 332345555, 332345667, 333210101, 333211011, 333211210, 333212101, 333212221, 333212333, 333221100, 333221212, 333222111, 333222223, 333222343, 333223233, 333223345, 333232100, 333232212, 333232332, 333233222, 333233334, 333233454, 333234344, 333234456, 333321000, 333321121, 333321233, 333322210, 333322322, 333323212, 333323332, 333323444, 333332121, 333332233, 333332345, 333333321, 333333433, 333334323, 333334443, 333334555, 333343223, 333343343, 333343455, 333344345, 333344543, 333345433, 333345545, 333345665, 333432112, 333432232, 333432344, 333433234, 333433432, 333434322, 333434434, 333434554, 333443222, 333443334, 333443454, 333444344, 333444456, 333445432, 333445544, 333445656, 333454332, 333454444, 333454556, 333455454, 333455566, 333455678, 333456654, 333456766, 334321010, 334321123, 334322100, 334322212, 334322332, 334323222, 334323334, 334323454, 334332123, 334332321, 334333211, 334333323, 334333443, 334334333, 334334445, 334334565, 334343233, 334343345, 334344321, 334344433, 334344545, 334345443, 334345555, 334345667, 334432122, 334432234, 334433210, 334433322, 334433434, 334434332, 334434444, 334434556, 334443232, 334443344, 334443456, 334444432, 334444544, 334445434, 334445554, 334445666, 334454334, 334454454, 334454566, 334455456, 334455654, 334456544, 334456656, 334456776, 334543222, 334543334, 334543454, 334544344, 334544456, 334545432, 334545544, 334545656, 334554332, 334554444, 334554556, 334555454, 334555566, 334555678, 334556654, 334556766, 334565434, 334565554, 334565666, 334566556, 334566676, 334566788, 334567678, 334567876, 343210010, 343210123, 343211112, 343211232, 343212123, 343212321, 343221001, 343221122, 343221234, 343222211, 343222323, 343223221, 343223333, 343223445, 343232122, 343232234, 343233210, 343233322, 343233434, 343234332, 343234444, 343234556, 343321101, 343321221, 343322112, 343322232, 343322344, 343323234, 343323432, 343332101, 343332221, 343332333, 343333223, 343333343, 343333455, 343334345, 343334543, 343343211, 343343323, 343343443, 343344333, 343344445, 343344565, 343345455, 343345567, 343432100, 343432212, 343432332, 343433222, 343433334, 343433454, 343434344, 343434456, 343443210, 343443322, 343443434, 343444332, 343444444, 343444556, 343445454, 343445566, 343445678, 343454432, 343454544, 343455434, 343455554, 343455666, 343456556, 343456676, 343456788, 344321111, 344321223, 344322122, 344322234, 344323210, 344323322, 344323434, 344332111, 344332223, 344332343, 344333233, 344333345, 344334321, 344334433, 344334545, 344343221, 344343333, 344343445, 344344343, 344344455, 344344567, 344345543, 344345655, 344432110, 344432222, 344432334, 344433232, 344433344, 344433456, 344434432, 344434544, 344443212, 344443332, 344443444, 344444334, 344444454, 344444566, 344445456, 344445654, 344454322, 344454434, 344454554, 344455444, 344455556, 344455676, 344456566, 344456678, 344543210, 344543322, 344543434, 344544332, 344544444, 344544556, 344545454, 344545566, 344545678, 344554432, 344554544, 344555434, 344555554, 344555666, 344556556, 344556676, 344556788, 344565456, 344565654, 344566544, 344566656, 344566776, 344567666, 344567778, 344567898, 345432210, 345432322, 345433212, 345433332, 345433444, 345434334, 345434454, 345434566, 345443234, 345443432, 345444322, 345444434, 345444554, 345445444, 345445556, 345445676, 345454344, 345454456, 345455432, 345455544, 345455656, 345456554, 345456666, 345456778, 345543232, 345543344, 345543456, 345544432, 345544544, 345545434, 345545554, 345545666, 345554334, 345554454, 345554566, 345555456, 345555654, 345556544, 345556656, 345556776, 345565444, 345565556, 345565676, 345566566, 345566678, 345567654, 345567766, 345567878, 345654333, 345654445, 345654565, 345655455, 345655567, 345656543, 345656655, 345656767, 345665443, 345665555, 345665667, 345666565, 345666677, 345666789, 345667765, 345667877, 345676554, 345676666, 345676778, 345677676, 345677788, 345678765, 345678877, 345678998, 432100111, 432101100, 432101212, 432110011, 432111000, 432111121, 432111233, 432112210, 432112322, 432121010, 432121123, 432122100, 432122212, 432122332, 432123222, 432123334, 432123454, 432210110, 432211012, 432211211, 432212110, 432212222, 432212334, 432221101, 432221221, 432222112, 432222232, 432222344, 432223234, 432223432, 432232101, 432232221, 432232333, 432233223, 432233343, 432233455, 432234345, 432234543, 432321001, 432321122, 432321234, 432322211, 432322323, 432323221, 432323333, 432323445, 432332122, 432332234, 432333210, 432333322, 432333434, 432334332, 432334444, 432334556, 432343232, 432343344, 432343456, 432344432, 432344544, 432345434, 432345554, 432345666, 433210100, 433211010, 433211123, 433212100, 433212212, 433212332, 433221012, 433221211, 433222110, 433222222, 433222334, 433223232, 433223344, 433223456, 433232211, 433232323, 433233221, 433233333, 433233445, 433234343, 433234455, 433234567, 433321112, 433321232, 433322123, 433322321, 433323211, 433323323, 433323443, 433332112, 433332232, 433332344, 433333234, 433333432, 433334322, 433334434, 433334554, 433343222, 433343334, 433343454, 433344344, 433344456, 433345432, 433345544, 433345656, 433432111, 433432223, 433432343, 433433233, 433433345, 433434321, 433434433, 433434545, 433443221, 433443333, 433443445, 433444343, 433444455, 433444567, 433445543, 433445655, 433454323, 433454443, 433454555, 433455445, 433455565, 433455677, 433456567, 433456765, 434321001, 434321122, 434321234, 434322211, 434322323, 434323221, 434323333, 434323445, 434332122, 434332234, 434333210, 434333322, 434333434, 434334332, 434334444, 434334556, 434343232, 434343344, 434343456, 434344432, 434344544, 434345434, 434345554, 434345666, 434432121, 434432233, 434432345, 434433321, 434433433, 434434323, 434434443, 434434555, 434443223, 434443343, 434443455, 434444345, 434444543, 434445433, 434445545, 434445665, 434454333, 434454445, 434454565, 434455455, 434455567, 434456543, 434456655, 434456767, 434543221, 434543333, 434543445, 434544343, 434544455, 434544567, 434545543, 434545655, 434554323, 434554443, 434554555, 434555445, 434555565, 434555677, 434556567, 434556765, 434565433, 434565545, 434565665, 434566555, 434566667, 434566787, 434567677, 434567789, 443210001, 443210122, 443211111, 443211223, 443212122, 443212234, 443221000, 443221121, 443221233, 443222210, 443222322, 443223212, 443223332, 443223444, 443232121, 443232233, 443232345, 443233321, 443233433, 443234323, 443234443, 443234555, 443321100, 443321212, 443322111, 443322223, 443322343, 443323233, 443323345, 443332100, 443332212, 443332332, 443333222, 443333334, 443333454, 443334344, 443334456, 443343210, 443343322, 443343434, 443344332, 443344444, 443344556, 443345454, 443345566, 443345678, 443432211, 443432323, 443433221, 443433333, 443433445, 443434343, 443434455, 443434567, 443443321, 443443433, 443444323, 443444443, 443444555, 443445445, 443445565, 443445677, 443454345, 443454543, 443455433, 443455545, 443455665, 443456555, 443456667, 443456787, 444321110, 444321222, 444322121, 444322233, 444322345, 444323321, 444323433, 444332110, 444332222, 444332334, 444333232, 444333344, 444333456, 444334432, 444334544, 444343212, 444343332, 444343444, 444344334, 444344454, 444344566, 444345456, 444345654, 444432101, 444432221, 444432333, 444433223, 444433343, 444433455, 444434345, 444434543, 444443211, 444443323, 444443443, 444444333, 444444445, 444444565, 444445455, 444445567, 444454321, 444454433, 444454545, 444455443, 444455555, 444455667, 444456565, 444456677, 444456789, 444543321, 444543433, 444544323, 444544443, 444544555, 444545445, 444545565, 444545677, 444554345, 444554543, 444555433, 444555545, 444555665, 444556555, 444556667, 444556787, 444565455, 444565567, 444566543, 444566655, 444566767, 444567665, 444567777, 444567889, 445432123, 445432321, 445433211, 445433323, 445433443, 445434333, 445434445, 445434565, 445443233, 445443345, 445444321, 445444433, 445444545, 445445443, 445445555, 445445667, 445454343, 445454455, 445454567, 445455543, 445455655, 445456545, 445456665, 445456777, 445543223, 445543343, 445543455, 445544345, 445544543, 445545433, 445545545, 445545665, 445554333, 445554445, 445554565, 445555455, 445555567, 445556543, 445556655, 445556767, 445565443, 445565555, 445565667, 445566565, 445566677, 445566789, 445567765, 445567877, 445654332, 445654444, 445654556, 445655454, 445655566, 445655678, 445656654, 445656766, 445665434, 445665554, 445665666, 445666556, 445666676, 445666788, 445667678, 445667876, 445676545, 445676665, 445676777, 445677667, 445677787, 445677899, 445678876, 445678989, 454321110, 454321222, 454322121, 454322233, 454322345, 454323321, 454323433, 454332110, 454332222, 454332334, 454333232, 454333344, 454333456, 454334432, 454334544, 454343212, 454343332, 454343444, 454344334, 454344454, 454344566, 454345456, 454345654, 454432101, 454432221, 454432333, 454433223, 454433343, 454433455, 454434345, 454434543, 454443211, 454443323, 454443443, 454444333, 454444445, 454444565, 454445455, 454445567, 454454321, 454454433, 454454545, 454455443, 454455555, 454455667, 454456565, 454456677, 454456789, 454543321, 454543433, 454544323, 454544443, 454544555, 454545445, 454545565, 454545677, 454554345, 454554543, 454555433, 454555545, 454555665, 454556555, 454556667, 454556787, 454565455, 454565567, 454566543, 454566655, 454566767, 454567665, 454567777, 454567889, 455432123, 455432321, 455433211, 455433323, 455433443, 455434333, 455434445, 455434565, 455443233, 455443345, 455444321, 455444433, 455444545, 455445443, 455445555, 455445667, 455454343, 455454455, 455454567, 455455543, 455455655, 455456545, 455456665, 455456777, 455543223, 455543343, 455543455, 455544345, 455544543, 455545433, 455545545, 455545665, 455554333, 455554445, 455554565, 455555455, 455555567, 455556543, 455556655, 455556767, 455565443, 455565555, 455565667, 455566565, 455566677, 455566789, 455567765, 455567877, 455654332, 455654444, 455654556, 455655454, 455655566, 455655678, 455656654, 455656766, 455665434, 455665554, 455665666, 455666556, 455666676, 455666788, 455667678, 455667876, 455676545, 455676665, 455676777, 455677667, 455677787, 455677899, 455678876, 455678989, 456543233, 456543345, 456544321, 456544433, 456544545, 456545443, 456545555, 456545667, 456554343, 456554455, 456554567, 456555543, 456555655, 456556545, 456556665, 456556777, 456565445, 456565565, 456565677, 456566567, 456566765, 456567655, 456567767, 456567887, 456654334, 456654454, 456654566, 456655456, 456655654, 456656544, 456656656, 456656776, 456665444, 456665556, 456665676, 456666566, 456666678, 456667654, 456667766, 456667878, 456676555, 456676667, 456676787, 456677677, 456677789, 456678766, 456678878, 456678999, 456765543, 456765655, 456766545, 456766665, 456766777, 456767667, 456767787, 456767899, 456776654, 456776766, 456777656, 456777776, 456777888, 456778787, 456778899, 456787666, 456787778, 456787898, 456788789, 456788988, 456789898, 543210011, 543211000, 543211121, 543211233, 543212210, 543212322, 543221010, 543221123, 543222100, 543222212, 543222332, 543223222, 543223334, 543223454, 543232123, 543232321, 543233211, 543233323, 543233443, 543234333, 543234445, 543234565, 543321110, 543321222, 543322121, 543322233, 543322345, 543323321, 543323433, 543332110, 543332222, 543332334, 543333232, 543333344, 543333456, 543334432, 543334544, 543343212, 543343332, 543343444, 543344334, 543344454, 543344566, 543345456, 543345654, 543432101, 543432221, 543432333, 543433223, 543433343, 543433455, 543434345, 543434543, 543443211, 543443323, 543443443, 543444333, 543444445, 543444565, 543445455, 543445567, 543454321, 543454433, 543454545, 543455443, 543455555, 543455667, 543456565, 543456677, 543456789, 544321112, 544321232, 544322123, 544322321, 544323211, 544323323, 544323443, 544332112, 544332232, 544332344, 544333234, 544333432, 544334322, 544334434, 544334554, 544343222, 544343334, 544343454, 544344344, 544344456, 544345432, 544345544, 544345656, 544432111, 544432223, 544432343, 544433233, 544433345, 544434321, 544434433, 544434545, 544443221, 544443333, 544443445, 544444343, 544444455, 544444567, 544445543, 544445655, 544454323, 544454443, 544454555, 544455445, 544455565, 544455677, 544456567, 544456765, 544543211, 544543323, 544543443, 544544333, 544544445, 544544565, 544545455, 544545567, 544554321, 544554433, 544554545, 544555443, 544555555, 544555667, 544556565, 544556677, 544556789, 544565543, 544565655, 544566545, 544566665, 544566777, 544567667, 544567787, 544567899, 545432211, 545432323, 545433221, 545433333, 545433445, 545434343, 545434455, 545434567, 545443321, 545443433, 545444323, 545444443, 545444555, 545445445, 545445565, 545445677, 545454345, 545454543, 545455433, 545455545, 545455665, 545456555, 545456667, 545456787, 545543233, 545543345, 545544321, 545544433, 545544545, 545545443, 545545555, 545545667, 545554343, 545554455, 545554567, 545555543, 545555655, 545556545, 545556665, 545556777, 545565445, 545565565, 545565677, 545566567, 545566765, 545567655, 545567767, 545567887, 545654334, 545654454, 545654566, 545655456, 545655654, 545656544, 545656656, 545656776, 545665444, 545665556, 545665676, 545666566, 545666678, 545667654, 545667766, 545667878, 545676555, 545676667, 545676787, 545677677, 545677789, 545678766, 545678878, 545678999, 554321112, 554321232, 554322123, 554322321, 554323211, 554323323, 554323443, 554332112, 554332232, 554332344, 554333234, 554333432, 554334322, 554334434, 554334554, 554343222, 554343334, 554343454, 554344344, 554344456, 554345432, 554345544, 554345656, 554432111, 554432223, 554432343, 554433233, 554433345, 554434321, 554434433, 554434545, 554443221, 554443333, 554443445, 554444343, 554444455, 554444567, 554445543, 554445655, 554454323, 554454443, 554454555, 554455445, 554455565, 554455677, 554456567, 554456765, 554543211, 554543323, 554543443, 554544333, 554544445, 554544565, 554545455, 554545567, 554554321, 554554433, 554554545, 554555443, 554555555, 554555667, 554556565, 554556677, 554556789, 554565543, 554565655, 554566545, 554566665, 554566777, 554567667, 554567787, 554567899, 555432211, 555432323, 555433221, 555433333, 555433445, 555434343, 555434455, 555434567, 555443321, 555443433, 555444323, 555444443, 555444555, 555445445, 555445565, 555445677, 555454345, 555454543, 555455433, 555455545, 555455665, 555456555, 555456667, 555456787, 555543233, 555543345, 555544321, 555544433, 555544545, 555545443, 555545555, 555545667, 555554343, 555554455, 555554567, 555555543, 555555655, 555556545, 555556665, 555556777, 555565445, 555565565, 555565677, 555566567, 555566765, 555567655, 555567767, 555567887, 555654334, 555654454, 555654566, 555655456, 555655654, 555656544, 555656656, 555656776, 555665444, 555665556, 555665676, 555666566, 555666678, 555667654, 555667766, 555667878, 555676555, 555676667, 555676787, 555677677, 555677789, 555678766, 555678878, 555678999, 556543321, 556543433, 556544323, 556544443, 556544555, 556545445, 556545565, 556545677, 556554345, 556554543, 556555433, 556555545, 556555665, 556556555, 556556667, 556556787, 556565455, 556565567, 556566543, 556566655, 556566767, 556567665, 556567777, 556567889, 556654344, 556654456, 556655432, 556655544, 556655656, 556656554, 556656666, 556656778, 556665454, 556665566, 556665678, 556666654, 556666766, 556667656, 556667776, 556667888, 556676565, 556676677, 556676789, 556677765, 556677877, 556678776, 556678888, 556765433, 556765545, 556765665, 556766555, 556766667, 556766787, 556767677, 556767789, 556776544, 556776656, 556776776, 556777666, 556777778, 556777898, 556778789, 556778988, 556787676, 556787788, 556788765, 556788877, 556788998, 556789987, 565432121, 565432233, 565432345, 565433321, 565433433, 565434323, 565434443, 565434555, 565443223, 565443343, 565443455, 565444345, 565444543, 565445433, 565445545, 565445665, 565454333, 565454445, 565454565, 565455455, 565455567, 565456543, 565456655, 565456767, 565543221, 565543333, 565543445, 565544343, 565544455, 565544567, 565545543, 565545655, 565554323, 565554443, 565554555, 565555445, 565555565, 565555677, 565556567, 565556765, 565565433, 565565545, 565565665, 565566555, 565566667, 565566787, 565567677, 565567789, 565654322, 565654434, 565654554, 565655444, 565655556, 565655676, 565656566, 565656678, 565665432, 565665544, 565665656, 565666554, 565666666, 565666778, 565667676, 565667788, 565676543, 565676655, 565676767, 565677665, 565677777, 565677889, 565678788, 565678987, 566543223, 566543343, 566543455, 566544345, 566544543, 566545433, 566545545, 566545665, 566554333, 566554445, 566554565, 566555455, 566555567, 566556543, 566556655, 566556767, 566565443, 566565555, 566565667, 566566565, 566566677, 566566789, 566567765, 566567877, 566654332, 566654444, 566654556, 566655454, 566655566, 566655678, 566656654, 566656766, 566665434, 566665554, 566665666, 566666556, 566666676, 566666788, 566667678, 566667876, 566676545, 566676665, 566676777, 566677667, 566677787, 566677899, 566678876, 566678989, 566765455, 566765567, 566766543, 566766655, 566766767, 566767665, 566767777, 566767889, 566776566, 566776678, 566777654, 566777766, 566777878, 566778777, 566778889, 566787656, 566787776, 566787888, 566788787, 566788899, 566789888, 567654322, 567654434, 567654554, 567655444, 567655556, 567655676, 567656566, 567656678, 567665432, 567665544, 567665656, 567666554, 567666666, 567666778, 567667676, 567667788, 567676543, 567676655, 567676767, 567677665, 567677777, 567677889, 567678788, 567678987, 567765445, 567765565, 567765677, 567766567, 567766765, 567767655, 567767767, 567767887, 567776556, 567776676, 567776788, 567777678, 567777876, 567778767, 567778887, 567787654, 567787766, 567787878, 567788777, 567788889, 567789878, 567789999, 567876654, 567876766, 567877656, 567877776, 567877888, 567878787, 567878899, 567887666, 567887778, 567887898, 567888789, 567888988, 567889898, 567898776, 567898888, 567899877, 567899998, 654321111, 654321223, 654322122, 654322234, 654323210, 654323322, 654323434, 654332111, 654332223, 654332343, 654333233, 654333345, 654334321, 654334433, 654334545, 654343221, 654343333, 654343445, 654344343, 654344455, 654344567, 654345543, 654345655, 654432110, 654432222, 654432334, 654433232, 654433344, 654433456, 654434432, 654434544, 654443212, 654443332, 654443444, 654444334, 654444454, 654444566, 654445456, 654445654, 654454322, 654454434, 654454554, 654455444, 654455556, 654455676, 654456566, 654456678, 654543210, 654543322, 654543434, 654544332, 654544444, 654544556, 654545454, 654545566, 654545678, 654554432, 654554544, 654555434, 654555554, 654555666, 654556556, 654556676, 654556788, 654565456, 654565654, 654566544, 654566656, 654566776, 654567666, 654567778, 654567898, 655432210, 655432322, 655433212, 655433332, 655433444, 655434334, 655434454, 655434566, 655443234, 655443432, 655444322, 655444434, 655444554, 655445444, 655445556, 655445676, 655454344, 655454456, 655455432, 655455544, 655455656, 655456554, 655456666, 655456778, 655543232, 655543344, 655543456, 655544432, 655544544, 655545434, 655545554, 655545666, 655554334, 655554454, 655554566, 655555456, 655555654, 655556544, 655556656, 655556776, 655565444, 655565556, 655565676, 655566566, 655566678, 655567654, 655567766, 655567878, 655654333, 655654445, 655654565, 655655455, 655655567, 655656543, 655656655, 655656767, 655665443, 655665555, 655665667, 655666565, 655666677, 655666789, 655667765, 655667877, 655676554, 655676666, 655676778, 655677676, 655677788, 655678765, 655678877, 655678998, 656543234, 656543432, 656544322, 656544434, 656544554, 656545444, 656545556, 656545676, 656554344, 656554456, 656555432, 656555544, 656555656, 656556554, 656556666, 656556778, 656565454, 656565566, 656565678, 656566654, 656566766, 656567656, 656567776, 656567888, 656654343, 656654455, 656654567, 656655543, 656655655, 656656545, 656656665, 656656777, 656665445, 656665565, 656665677, 656666567, 656666765, 656667655, 656667767, 656667887, 656676556, 656676676, 656676788, 656677678, 656677876, 656678767, 656678887, 656765432, 656765544, 656765656, 656766554, 656766666, 656766778, 656767676, 656767788, 656776543, 656776655, 656776767, 656777665, 656777777, 656777889, 656778788, 656778987, 656787667, 656787787, 656787899, 656788876, 656788989, 656789899, 665432112, 665432232, 665432344, 665433234, 665433432, 665434322, 665434434, 665434554, 665443222, 665443334, 665443454, 665444344, 665444456, 665445432, 665445544, 665445656, 665454332, 665454444, 665454556, 665455454, 665455566, 665455678, 665456654, 665456766, 665543212, 665543332, 665543444, 665544334, 665544454, 665544566, 665545456, 665545654, 665554322, 665554434, 665554554, 665555444, 665555556, 665555676, 665556566, 665556678, 665565432, 665565544, 665565656, 665566554, 665566666, 665566778, 665567676, 665567788, 665654321, 665654433, 665654545, 665655443, 665655555, 665655667, 665656565, 665656677, 665656789, 665665543, 665665655, 665666545, 665666665, 665666777, 665667667, 665667787, 665667899, 665676654, 665676766, 665677656, 665677776, 665677888, 665678787, 665678899, 666543222, 666543334, 666543454, 666544344, 666544456, 666545432, 666545544, 666545656, 666554332, 666554444, 666554556, 666555454, 666555566, 666555678, 666556654, 666556766, 666565434, 666565554, 666565666, 666566556, 666566676, 666566788, 666567678, 666567876, 666654323, 666654443, 666654555, 666655445, 666655565, 666655677, 666656567, 666656765, 666665433, 666665545, 666665665, 666666555, 666666667, 666666787, 666667677, 666667789, 666676544, 666676656, 666676776, 666677666, 666677778, 666677898, 666678789, 666678988, 666765454, 666765566, 666765678, 666766654, 666766766, 666767656, 666767776, 666767888, 666776565, 666776677, 666776789, 666777765, 666777877, 666778776, 666778888, 666787655, 666787767, 666787887, 666788778, 666788898, 666789887, 667654321, 667654433, 667654545, 667655443, 667655555, 667655667, 667656565, 667656677, 667656789, 667665543, 667665655, 667666545, 667666665, 667666777, 667667667, 667667787, 667667899, 667676654, 667676766, 667677656, 667677776, 667677888, 667678787, 667678899, 667765444, 667765556, 667765676, 667766566, 667766678, 667767654, 667767766, 667767878, 667776555, 667776667, 667776787, 667777677, 667777789, 667778766, 667778878, 667778999, 667787765, 667787877, 667788776, 667788888, 667789877, 667789998, 667876567, 667876765, 667877655, 667877767, 667877887, 667878778, 667878898, 667887665, 667887777, 667887889, 667888788, 667888987, 667889889, 667898767, 667898887, 667899876, 667899989, 676543233, 676543345, 676544321, 676544433, 676544545, 676545443, 676545555, 676545667, 676554343, 676554455, 676554567, 676555543, 676555655, 676556545, 676556665, 676556777, 676565445, 676565565, 676565677, 676566567, 676566765, 676567655, 676567767, 676567887, 676654334, 676654454, 676654566, 676655456, 676655654, 676656544, 676656656, 676656776, 676665444, 676665556, 676665676, 676666566, 676666678, 676667654, 676667766, 676667878, 676676555, 676676667, 676676787, 676677677, 676677789, 676678766, 676678878, 676678999, 676765543, 676765655, 676766545, 676766665, 676766777, 676767667, 676767787, 676767899, 676776654, 676776766, 676777656, 676777776, 676777888, 676778787, 676778899, 676787666, 676787778, 676787898, 676788789, 676788988, 676789898, 677654332, 677654444, 677654556, 677655454, 677655566, 677655678, 677656654, 677656766, 677665434, 677665554, 677665666, 677666556, 677666676, 677666788, 677667678, 677667876, 677676545, 677676665, 677676777, 677677667, 677677787, 677677899, 677678876, 677678989, 677765455, 677765567, 677766543, 677766655, 677766767, 677767665, 677767777, 677767889, 677776566, 677776678, 677777654, 677777766, 677777878, 677778777, 677778889, 677787656, 677787776, 677787888, 677788787, 677788899, 677789888, 677876544, 677876656, 677876776, 677877666, 677877778, 677877898, 677878789, 677878988, 677887676, 677887788, 677888765, 677888877, 677888998, 677889987, 677898778, 677898898, 677899887, 678765432, 678765544, 678765656, 678766554, 678766666, 678766778, 678767676, 678767788, 678776543, 678776655, 678776767, 678777665, 678777777, 678777889, 678778788, 678778987, 678787667, 678787787, 678787899, 678788876, 678788989, 678789899, 678876555, 678876667, 678876787, 678877677, 678877789, 678878766, 678878878, 678878999, 678887765, 678887877, 678888776, 678888888, 678889877, 678889998, 678898789, 678898988, 678899898, 678987665, 678987777, 678987889, 678988788, 678988987, 678989889, 678998767, 678998887, 678999876, 678999989, 765432123, 765432321, 765433211, 765433323, 765433443, 765434333, 765434445, 765434565, 765443233, 765443345, 765444321, 765444433, 765444545, 765445443, 765445555, 765445667, 765454343, 765454455, 765454567, 765455543, 765455655, 765456545, 765456665, 765456777, 765543223, 765543343, 765543455, 765544345, 765544543, 765545433, 765545545, 765545665, 765554333, 765554445, 765554565, 765555455, 765555567, 765556543, 765556655, 765556767, 765565443, 765565555, 765565667, 765566565, 765566677, 765566789, 765567765, 765567877, 765654332, 765654444, 765654556, 765655454, 765655566, 765655678, 765656654, 765656766, 765665434, 765665554, 765665666, 765666556, 765666676, 765666788, 765667678, 765667876, 765676545, 765676665, 765676777, 765677667, 765677787, 765677899, 765678876, 765678989, 766543233, 766543345, 766544321, 766544433, 766544545, 766545443, 766545555, 766545667, 766554343, 766554455, 766554567, 766555543, 766555655, 766556545, 766556665, 766556777, 766565445, 766565565, 766565677, 766566567, 766566765, 766567655, 766567767, 766567887, 766654334, 766654454, 766654566, 766655456, 766655654, 766656544, 766656656, 766656776, 766665444, 766665556, 766665676, 766666566, 766666678, 766667654, 766667766, 766667878, 766676555, 766676667, 766676787, 766677677, 766677789, 766678766, 766678878, 766678999, 766765543, 766765655, 766766545, 766766665, 766766777, 766767667, 766767787, 766767899, 766776654, 766776766, 766777656, 766777776, 766777888, 766778787, 766778899, 766787666, 766787778, 766787898, 766788789, 766788988, 766789898, 767654332, 767654444, 767654556, 767655454, 767655566, 767655678, 767656654, 767656766, 767665434, 767665554, 767665666, 767666556, 767666676, 767666788, 767667678, 767667876, 767676545, 767676665, 767676777, 767677667, 767677787, 767677899, 767678876, 767678989, 767765455, 767765567, 767766543, 767766655, 767766767, 767767665, 767767777, 767767889, 767776566, 767776678, 767777654, 767777766, 767777878, 767778777, 767778889, 767787656, 767787776, 767787888, 767788787, 767788899, 767789888, 767876544, 767876656, 767876776, 767877666, 767877778, 767877898, 767878789, 767878988, 767887676, 767887788, 767888765, 767888877, 767888998, 767889987, 767898778, 767898898, 767899887, 776543210, 776543322, 776543434, 776544332, 776544444, 776544556, 776545454, 776545566, 776545678, 776554432, 776554544, 776555434, 776555554, 776555666, 776556556, 776556676, 776556788, 776565456, 776565654, 776566544, 776566656, 776566776, 776567666, 776567778, 776567898, 776654345, 776654543, 776655433, 776655545, 776655665, 776656555, 776656667, 776656787, 776665455, 776665567, 776666543, 776666655, 776666767, 776667665, 776667777, 776667889, 776676566, 776676678, 776677654, 776677766, 776677878, 776678777, 776678889, 776765434, 776765554, 776765666, 776766556, 776766676, 776766788, 776767678, 776767876, 776776545, 776776665, 776776777, 776777667, 776777787, 776777899, 776778876, 776778989, 776787677, 776787789, 776788766, 776788878, 776788999, 776789988, 777654343, 777654455, 777654567, 777655543, 777655655, 777656545, 777656665, 777656777, 777665445, 777665565, 777665677, 777666567, 777666765, 777667655, 777667767, 777667887, 777676556, 777676676, 777676788, 777677678, 777677876, 777678767, 777678887, 777765432, 777765544, 777765656, 777766554, 777766666, 777766778, 777767676, 777767788, 777776543, 777776655, 777776767, 777777665, 777777777, 777777889, 777778788, 777778987, 777787667, 777787787, 777787899, 777788876, 777788989, 777789899, 777876555, 777876667, 777876787, 777877677, 777877789, 777878766, 777878878, 777878999, 777887765, 777887877, 777888776, 777888888, 777889877, 777889998, 777898789, 777898988, 777899898, 778765443, 778765555, 778765667, 778766565, 778766677, 778766789, 778767765, 778767877, 778776554, 778776666, 778776778, 778777676, 778777788, 778778765, 778778877, 778778998, 778787678, 778787876, 778788767, 778788887, 778789876, 778789989, 778876566, 778876678, 778877654, 778877766, 778877878, 778878777, 778878889, 778887656, 778887776, 778887888, 778888787, 778888899, 778889888, 778898766, 778898878, 778898999, 778899988, 778987676, 778987788, 778988765, 778988877, 778988998, 778989987, 778998778, 778998898, 778999887, 787654321, 787654433, 787654545, 787655443, 787655555, 787655667, 787656565, 787656677, 787656789, 787665543, 787665655, 787666545, 787666665, 787666777, 787667667, 787667787, 787667899, 787676654, 787676766, 787677656, 787677776, 787677888, 787678787, 787678899, 787765444, 787765556, 787765676, 787766566, 787766678, 787767654, 787767766, 787767878, 787776555, 787776667, 787776787, 787777677, 787777789, 787778766, 787778878, 787778999, 787787765, 787787877, 787788776, 787788888, 787789877, 787789998, 787876567, 787876765, 787877655, 787877767, 787877887, 787878778, 787878898, 787887665, 787887777, 787887889, 787888788, 787888987, 787889889, 787898767, 787898887, 787899876, 787899989, 788765455, 788765567, 788766543, 788766655, 788766767, 788767665, 788767777, 788767889, 788776566, 788776678, 788777654, 788777766, 788777878, 788778777, 788778889, 788787656, 788787776, 788787888, 788788787, 788788899, 788789888, 788876544, 788876656, 788876776, 788877666, 788877778, 788877898, 788878789, 788878988, 788887676, 788887788, 788888765, 788888877, 788888998, 788889987, 788898778, 788898898, 788899887, 788987654, 788987766, 788987878, 788988777, 788988889, 788989878, 788989999, 788998876, 788998989, 788999899, 789876555, 789876667, 789876787, 789877677, 789877789, 789878766, 789878878, 789878999, 789887765, 789887877, 789888776, 789888888, 789889877, 789889998, 789898789, 789898988, 789899898, 789987665, 789987777, 789987889, 789988788, 789988987, 789989889, 789998767, 789998887, 789999876, 789999989, 876543233, 876543345, 876544321, 876544433, 876544545, 876545443, 876545555, 876545667, 876554343, 876554455, 876554567, 876555543, 876555655, 876556545, 876556665, 876556777, 876565445, 876565565, 876565677, 876566567, 876566765, 876567655, 876567767, 876567887, 876654334, 876654454, 876654566, 876655456, 876655654, 876656544, 876656656, 876656776, 876665444, 876665556, 876665676, 876666566, 876666678, 876667654, 876667766, 876667878, 876676555, 876676667, 876676787, 876677677, 876677789, 876678766, 876678878, 876678999, 876765543, 876765655, 876766545, 876766665, 876766777, 876767667, 876767787, 876767899, 876776654, 876776766, 876777656, 876777776, 876777888, 876778787, 876778899, 876787666, 876787778, 876787898, 876788789, 876788988, 876789898, 877654332, 877654444, 877654556, 877655454, 877655566, 877655678, 877656654, 877656766, 877665434, 877665554, 877665666, 877666556, 877666676, 877666788, 877667678, 877667876, 877676545, 877676665, 877676777, 877677667, 877677787, 877677899, 877678876, 877678989, 877765455, 877765567, 877766543, 877766655, 877766767, 877767665, 877767777, 877767889, 877776566, 877776678, 877777654, 877777766, 877777878, 877778777, 877778889, 877787656, 877787776, 877787888, 877788787, 877788899, 877789888, 877876544, 877876656, 877876776, 877877666, 877877778, 877877898, 877878789, 877878988, 877887676, 877887788, 877888765, 877888877, 877888998, 877889987, 877898778, 877898898, 877899887, 878765432, 878765544, 878765656, 878766554, 878766666, 878766778, 878767676, 878767788, 878776543, 878776655, 878776767, 878777665, 878777777, 878777889, 878778788, 878778987, 878787667, 878787787, 878787899, 878788876, 878788989, 878789899, 878876555, 878876667, 878876787, 878877677, 878877789, 878878766, 878878878, 878878999, 878887765, 878887877, 878888776, 878888888, 878889877, 878889998, 878898789, 878898988, 878899898, 878987665, 878987777, 878987889, 878988788, 878988987, 878989889, 878998767, 878998887, 878999876, 878999989, 887654344, 887654456, 887655432, 887655544, 887655656, 887656554, 887656666, 887656778, 887665454, 887665566, 887665678, 887666654, 887666766, 887667656, 887667776, 887667888, 887676565, 887676677, 887676789, 887677765, 887677877, 887678776, 887678888, 887765433, 887765545, 887765665, 887766555, 887766667, 887766787, 887767677, 887767789, 887776544, 887776656, 887776776, 887777666, 887777778, 887777898, 887778789, 887778988, 887787676, 887787788, 887788765, 887788877, 887788998, 887789987, 887876556, 887876676, 887876788, 887877678, 887877876, 887878767, 887878887, 887887654, 887887766, 887887878, 887888777, 887888889, 887889878, 887889999, 887898876, 887898989, 887899899, 888765444, 888765556, 888765676, 888766566, 888766678, 888767654, 888767766, 888767878, 888776555, 888776667, 888776787, 888777677, 888777789, 888778766, 888778878, 888778999, 888787765, 888787877, 888788776, 888788888, 888789877, 888789998, 888876567, 888876765, 888877655, 888877767, 888877887, 888878778, 888878898, 888887665, 888887777, 888887889, 888888788, 888888987, 888889889, 888898767, 888898887, 888899876, 888899989, 888987677, 888987789, 888988766, 888988878, 888988999, 888989988, 888998787, 888998899, 888999888, 889876544, 889876656, 889876776, 889877666, 889877778, 889877898, 889878789, 889878988, 889887676, 889887788, 889888765, 889888877, 889888998, 889889987, 889898778, 889898898, 889899887, 889987654, 889987766, 889987878, 889988777, 889988889, 889989878, 889989999, 889998876, 889998989, 889999899, 898765444, 898765556, 898765676, 898766566, 898766678, 898767654, 898767766, 898767878, 898776555, 898776667, 898776787, 898777677, 898777789, 898778766, 898778878, 898778999, 898787765, 898787877, 898788776, 898788888, 898789877, 898789998, 898876567, 898876765, 898877655, 898877767, 898877887, 898878778, 898878898, 898887665, 898887777, 898887889, 898888788, 898888987, 898889889, 898898767, 898898887, 898899876, 898899989, 898987677, 898987789, 898988766, 898988878, 898988999, 898989988, 898998787, 898998899, 898999888, 899876544, 899876656, 899876776, 899877666, 899877778, 899877898, 899878789, 899878988, 899887676, 899887788, 899888765, 899888877, 899888998, 899889987, 899898778, 899898898, 899899887, 899987654, 899987766, 899987878, 899988777, 899988889, 899989878, 899989999, 899998876, 899998989, 899999899, 987654333, 987654445, 987654565, 987655455, 987655567, 987656543, 987656655, 987656767, 987665443, 987665555, 987665667, 987666565, 987666677, 987666789, 987667765, 987667877, 987676554, 987676666, 987676778, 987677676, 987677788, 987678765, 987678877, 987678998, 987765456, 987765654, 987766544, 987766656, 987766776, 987767666, 987767778, 987767898, 987776567, 987776765, 987777655, 987777767, 987777887, 987778778, 987778898, 987787665, 987787777, 987787889, 987788788, 987788987, 987789889, 987876545, 987876665, 987876777, 987877667, 987877787, 987877899, 987878876, 987878989, 987887677, 987887789, 987888766, 987888878, 987888999, 987889988, 987898787, 987898899, 987899888, 988765433, 988765545, 988765665, 988766555, 988766667, 988766787, 988767677, 988767789, 988776544, 988776656, 988776776, 988777666, 988777778, 988777898, 988778789, 988778988, 988787676, 988787788, 988788765, 988788877, 988788998, 988789987, 988876556, 988876676, 988876788, 988877678, 988877876, 988878767, 988878887, 988887654, 988887766, 988887878, 988888777, 988888889, 988889878, 988889999, 988898876, 988898989, 988899899, 988987666, 988987778, 988987898, 988988789, 988988988, 988989898, 988998776, 988998888, 988999877, 988999998, 989876567, 989876765, 989877655, 989877767, 989877887, 989878778, 989878898, 989887665, 989887777, 989887889, 989888788, 989888987, 989889889, 989898767, 989898887, 989899876, 989899989, 989987677, 989987789, 989988766, 989988878, 989988999, 989989988, 989998787, 989998899, 989999888, 998765433, 998765545, 998765665, 998766555, 998766667, 998766787, 998767677, 998767789, 998776544, 998776656, 998776776, 998777666, 998777778, 998777898, 998778789, 998778988, 998787676, 998787788, 998788765, 998788877, 998788998, 998789987, 998876556, 998876676, 998876788, 998877678, 998877876, 998878767, 998878887, 998887654, 998887766, 998887878, 998888777, 998888889, 998889878, 998889999, 998898876, 998898989, 998899899, 998987666, 998987778, 998987898, 998988789, 998988988, 998989898, 998998776, 998998888, 998999877, 998999998, 999876567, 999876765, 999877655, 999877767, 999877887, 999878778, 999878898, 999887665, 999887777, 999887889, 999888788, 999888987, 999889889, 999898767, 999898887, 999899876, 999899989, 999987677, 999987789, 999988766, 999988878, 999988999, 999989988, 999998787, 999998899, 999999888, 1000000001, 1000000122, 1000001111, 1000001223, 1000010101, 1000011011, 1000011210, 1000012101, 1000012221, 1000012333, 1000100100, 1000101010, 1000101123, 1000110000, 1000110121, 1000111110, 1000111222, 1000112121, 1000112233, 1000112345, 1000121112, 1000121232, 1000122123, 1000122321, 1000123211, 1000123323, 1000123443, 1001000012, 1001001001, 1001001122, 1001001234, 1001010112, 1001011101, 1001011221, 1001012112, 1001012232, 1001012344, 1001100111, 1001101100, 1001101212, 1001110011, 1001111000, 1001111121, 1001111233, 1001112210, 1001112322, 1001121010, 1001121123, 1001122100, 1001122212, 1001122332, 1001123222, 1001123334, 1001123454, 1001210110, 1001211012, 1001211211, 1001212110, 1001212222, 1001212334, 1001221101, 1001221221, 1001222112, 1001222232, 1001222344, 1001223234, 1001223432, 1001232101, 1001232221, 1001232333, 1001233223, 1001233343, 1001233455, 1001234345, 1001234543, 1010000001, 1010000122, 1010001111, 1010001223, 1010010101, 1010011011, 1010011210, 1010012101, 1010012221, 1010012333, 1010100100, 1010101010, 1010101123, 1010110000, 1010110121, 1010111110, 1010111222, 1010112121, 1010112233, 1010112345, 1010121112, 1010121232, 1010122123, 1010122321, 1010123211, 1010123323, 1010123443, 1011000012, 1011001001, 1011001122, 1011001234, 1011010112, 1011011101, 1011011221, 1011012112, 1011012232, 1011012344, 1011100111, 1011101100, 1011101212, 1011110011, 1011111000, 1011111121, 1011111233, 1011112210, 1011112322, 1011121010, 1011121123, 1011122100, 1011122212, 1011122332, 1011123222, 1011123334, 1011123454, 1011210110, 1011211012, 1011211211, 1011212110, 1011212222, 1011212334, 1011221101, 1011221221, 1011222112, 1011222232, 1011222344, 1011223234, 1011223432, 1011232101, 1011232221, 1011232333, 1011233223, 1011233343, 1011233455, 1011234345, 1011234543, 1012100001, 1012100122, 1012101111, 1012101223, 1012110101, 1012111011, 1012111210, 1012112101, 1012112221, 1012112333, 1012121100, 1012121212, 1012122111, 1012122223, 1012122343, 1012123233, 1012123345, 1012210000, 1012210121, 1012211110, 1012211222, 1012212121, 1012212233, 1012212345, 1012221112, 1012221232, 1012222123, 1012222321, 1012223211, 1012223323, 1012223443, 1012232112, 1012232232, 1012232344, 1012233234, 1012233432, 1012234322, 1012234434, 1012234554, 1012321012, 1012321211, 1012322110, 1012322222, 1012322334, 1012323232, 1012323344, 1012323456, 1012332211, 1012332323, 1012333221, 1012333333, 1012333445, 1012334343, 1012334455, 1012334567, 1012343321, 1012343433, 1012344323, 1012344443, 1012344555, 1012345445, 1012345565, 1012345677, 1100000111, 1100001100, 1100001212, 1100010011, 1100011000, 1100011121, 1100011233, 1100012210, 1100012322, 1100100010, 1100100123, 1100101112, 1100101232, 1100110110, 1100111012, 1100111211, 1100112110, 1100112222, 1100112334, 1100121101, 1100121221, 1100122112, 1100122232, 1100122344, 1100123234, 1100123432, 1101000001, 1101000122, 1101001111, 1101001223, 1101010101, 1101011011, 1101011210, 1101012101, 1101012221, 1101012333, 1101100100, 1101101010, 1101101123, 1101110000, 1101110121, 1101111110, 1101111222, 1101112121, 1101112233, 1101112345, 1101121112, 1101121232, 1101122123, 1101122321, 1101123211, 1101123323, 1101123443, 1101210012, 1101211001, 1101211122, 1101211234, 1101212211, 1101212323, 1101221011, 1101221210, 1101222101, 1101222221, 1101222333, 1101223223, 1101223343, 1101223455, 1101232210, 1101232322, 1101233212, 1101233332, 1101233444, 1101234334, 1101234454, 1101234566]
if K > 71000:
    k = 10 * (7100)
    i = runrun(k//10-1)
else:
    k = 10 * (K // 10)
    i = runrun[k//10-1]
while True:
    a = list(str(i))
    flag = True
    for j in range(len(a)-1):
        if abs(int(a[j])-int(a[j+1])) > 1:
            flag = False
            break
    if flag:
        if k == K:
            print(i)
            exit()
        k += 1
    i += 1