#include <iostream>
using namespace std;
long long m, n, br, s, i, a[5000] = {100122,100125,100170,100200,100233,100270,100344,100350,100440,100455,100566,100575,100640,100800,100825,100899,101202,101232,101808,101898,102120,102204,102231,102357,102527,102564,102816,102897,103206,103230,103824,103896,104112,104118,104130,104192,104208,104229,104247,104340,104364,104377,104562,104598,104784,104832,104858,104895,105154,105210,105228,105300,105450,105462,105672,105840,105894,106116,106212,106227,106371,106560,106848,106893,107214,107226,107856,107892,108114,108135,108216,108225,108336,108378,108558,108621,108864,108891,109218,109224,109872,109890,110112,110160,110187,110220,110223,110260,110297,110385,110445,110484,110556,110704,110880,110889,111222,111888,112104,112110,112140,112147,112184,112221,112224,112266,112320,112332,112392,112406,112480,112554,112644,112665,112776,112887,112896,112924,113220,113226,113886,113904,114108,114219,114228,114399,114552,114589,114885,114912,115218,115230,115440,115506,115736,115884,115920,116106,116145,116217,116232,116328,116406,116550,116667,116883,116928,116957,117126,117216,117234,117364,117882,117936,118104,118215,118236,118413,118548,118881,118944,119140,119214,119238,119340,119510,119658,119880,119952,120102,120150,120176,120204,120213,120240,120250,120285,120324,120420,120435,120528,120546,120620,120690,120768,120879,120960,120990,121176,121212,121242,121286,121878,121968,122100,122211,122244,122427,122544,122877,122976,123210,123246,123876,123984,124155,124209,124248,124320,124434,124542,124713,124875,124992,125100,125208,125250,125430,125550,125800,125874,126117,126133,126207,126252,126360,126392,126441,126540,126651,126873,127206,127254,127872,128160,128168,128205,128256,128304,128316,128448,128464,128538,128736,128760,128871,129204,129258,129870,130104,130140,130203,130221,130240,130260,130351,130425,130455,130536,130572,130832,130869,130980,131202,131262,131868,132165,132192,132201,132264,132275,132312,132462,132534,132682,132759,132867,133126,133200,133266,133380,133570,133644,133866,134199,134268,134469,134532,134865,135108,135198,135270,135420,135594,135864,136160,136170,136197,136272,136308,136323,136476,136493,136530,136752,136782,136863,137196,137274,137862,138195,138276,138483,138528,138713,138861,139194,139278,139860,140112,140119,140130,140175,140193,140230,140238,140280,140304,140378,140400,140415,140490,140526,140600,140616,140637,140805,140859,140896,140970,141192,141282,141858,142191,142284,142497,142524,142857,143154,143190,143208,143264,143286,143338,143856,144152,144180,144189,144288,144300,144342,144448,144504,144522,144744,144828,144855,145116,145188,145290,145410,145638,145854,145928,146187,146292,146511,146520,146853,147112,147186,147294,147420,147630,147852,148185,148296,148518,148851,149184,149298,149850,150120,150183,150220,150255,150300,150405,150516,150525,150660,150775,150849,150960,151182,151302,151848,152144,152181,152190,152292,152304,152361,152514,152532,152551,152736,152847,152874,153180,153306,153476,153846,154105,154143,154179,154224,154253,154308,154364,154440,154512,154539,154623,154660,154845,155124,155178,155310,155400,155682,155844,155992,156168,156177,156195,156288,156312,156325,156510,156546,156806,156843,156897,157176,157314,157842,158175,158316,158508,158553,158841,159174,159318,159840,160110,160128,160136,160173,160200,160210,160272,160284,160320,160380,160395,160432,160506,160560,160580,160704,160728,160839,160920,160950,161172,161322,161460,161616,161690,161838,162171,162324,162504,162567,162837,163170,163326,163836,164169,164205,164280,164328,164502,164574,164835,164943,165132,165168,165240,165242,165330,165390,165726,165834,166167,166332,166500,166581,166833,167166,167334,167832,168128,168156,168165,168210,168276,168336,168350,168399,168480,168498,168588,168609,168720,168831,168868,168966,169164,169182,169312,169338,169830,170100,170136,170163,170200,170289,170340,170385,170459,170496,170595,170748,170829,170940,171162,171342,171532,171828,172161,172215,172272,172344,172494,172602,172827,172989,173160,173346,173826,174159,174348,174492,174609,174825,174899,175140,175158,175350,175380,175500,175602,175750,175770,175824,176120,176121,176157,176220,176231,176256,176268,176352,176416,176418,176490,176616,176638,176712,176823,177156,177354,177822,178155,178356,178488,178623,178821,179154,179358,179820,180144,180153,180190,180225,180264,180306,180360,180375,180486,180560,180630,180792,180819,180930,181152,181362,181818,182151,182169,182196,182299,182336,182364,182484,182520,182595,182637,182780,182817,183150,183366,183816,184112,184149,184230,184260,184368,184437,184482,184644,184667,184704,184815,185148,185370,185814,186147,186372,186480,186651,186813,186961,187110,187146,187220,187272,187374,187442,187812,188145,188235,188256,188376,188478,188658,188811,189144,189378,189540,189588,189810,190143,190152,190180,190323,190365,190380,190476,190513,190665,190809,190836,190920,191142,191382,191808,192104,192132,192141,192240,192252,192384,192400,192456,192474,192672,192696,192807,192992,193140,193386,193806,194139,194388,194472,194679,194805,195138,195156,195210,195286,195360,195390,195804,195858,196137,196182,196245,196248,196322,196392,196470,196560,196581,196686,196803,196840,197136,197394,197802,198135,198209,198288,198396,198468,198616,198693,198801,199134,199398,199800,200100,200133,200160,200170,200244,200250,200340,200355,200400,200466,200475,200540,200688,200700,200725,200799,200880,200910,201132,201402,201798,202101,202131,202404,202464,202707,202797,203130,203406,203574,203580,203796,203870,204102,204120,204129,204240,204255,204408,204425,204462,204714,204795,205128,205164,205350,205410,205794,205902,206103,206127,206412,206460,206721,206793,207126,207414,207644,207792,208104,208125,208143,208224,208236,208260,208273,208384,208416,208458,208494,208680,208728,208754,208791,209124,209198,209304,209418,209494,209790,210105,210123,210160,210168,210195,210308,210345,210357,210420,210456,210567,210600,210735,210789,210900,210924,211122,211422,211788,212106,212121,212232,212265,212424,212454,212742,212787,213120,213426,213786,214107,214119,214428,214452,214749,214785,215118,215172,215340,215430,215784,215946,216108,216117,216228,216270,216432,216450,216513,216672,216756,216783,217116,217434,217560,217620,217782,217930,218109,218115,218436,218448,218763,218781,219114,219438,219780,220110,220113,220150,220176,220187,220224,220275,220320,220335,220374,220440,220446,220520,220594,220770,220779,220890,220968,221112,221130,221238,221260,221408,221442,221778,222111,222444,222777,223110,223446,223776,224109,224112,224154,224208,224220,224280,224294,224368,224442,224448,224532,224553,224640,224664,224775,224784,224812,224960,225108,225180,225330,225450,225700,225774,225990,226107,226113,226440,226452,226773,226791,227106,227454,227772,228105,228114,228216,228285,228438,228456,228475,228771,228798,229104,229458,229770,230103,230115,230140,230184,230325,230391,230436,230460,230621,230769,230805,230880,231102,231176,231336,231462,231546,231660,231768,231990,232101,232116,232212,232290,232434,232464,232551,232656,232767,232812,232841,233100,233466,233766,234117,234247,234252,234432,234468,234728,234765,234819,235188,235320,235470,235764,236118,236208,236295,236430,236472,236763,236826,237474,237762,238119,238140,238221,238280,238391,238428,238476,238539,238680,238761,238833,239478,239760,240120,240130,240165,240192,240204,240300,240315,240352,240408,240426,240480,240500,240570,240648,240759,240840,240870,241482,241758,242121,242165,242352,242424,242484,242572,242757,242847,242979,243486,243756,244122,244200,244305,244422,244488,244755,244854,245196,245310,245490,245532,245700,245754,246123,246420,246492,246753,246861,247104,247234,247266,247456,247494,247752,248124,248196,248310,248418,248496,248589,248640,248751,248868,248899,249498,249750,250120,250125,250200,250305,250416,250425,250500,250675,250749,250860,250875,251502,251748,252126,252192,252234,252266,252315,252414,252504,252525,252720,252747,252784,252882,253154,253368,253506,253598,253746,253968,254127,254412,254508,254745,254889,255150,255204,255300,255374,255510,255744,256128,256176,256188,256320,256336,256410,256512,256608,256632,256743,256896,256928,257514,257742,258129,258408,258516,258741,258903,259518,259740,260110,260130,260184,260208,260221,260280,260295,260325,260406,260442,260480,260520,260702,260739,260850,260910,261522,261738,261812,262131,262404,262524,262737,262917,263526,263736,264132,264143,264180,264330,264384,264402,264528,264550,264624,264627,264735,264924,264957,265212,265290,265530,265734,266112,266133,266247,266252,266400,266437,266511,266532,266733,266760,266931,267534,267732,268134,268176,268335,268398,268536,268731,268938,269538,269730,270100,270135,270216,270285,270396,270459,270540,270729,270840,270945,271542,271728,272136,272160,272172,272187,272320,272340,272357,272394,272544,272616,272646,272727,272952,272986,273208,273294,273504,273546,273726,273780,274137,274392,274548,274725,274959,275132,275220,275280,275400,275550,275650,275724,275946,276138,276168,276345,276390,276552,276575,276723,276966,277554,277722,278139,278388,278556,278721,278973,279558,279720,279868,280140,280164,280224,280238,280260,280275,280350,280386,280460,280476,280497,280560,280608,280665,280719,280756,280800,280830,280980,281562,281718,282141,282384,282564,282717,282987,283566,283716,284142,284160,284355,284382,284568,284715,284994,285120,285228,285270,285418,285570,285714,286121,286143,286195,286308,286380,286416,286528,286572,286676,286713,286935,287490,287574,287712,287820,288144,288156,288198,288304,288360,288378,288576,288600,288684,288711,288896,289170,289340,289578,289710,290145,290232,290265,290376,290493,290580,290709,290783,290820,291582,291708,292146,292152,292365,292374,292584,292707,293586,293706,294147,294224,294273,294372,294483,294588,294705,294840,295236,295260,295590,295704,296148,296370,296592,296703,297110,297432,297594,297702,297924,298149,298368,298596,298701,299182,299322,299552,299598,299700,300105,300144,300150,300240,300255,300366,300375,300440,300510,300600,300625,300699,300810,301476,301602,301698,301860,302151,302364,302604,302697,303606,303696,304128,304140,304152,304209,304288,304362,304380,304399,304584,304608,304695,304722,305244,305250,305610,305694,306153,306180,306323,306360,306612,306693,306952,307614,307692,308136,308154,308210,308286,308358,308385,308448,308469,308506,308616,308691,308728,308880,308913,309618,309690,310155,310245,310248,310356,310527,310620,310689,310800,310837,311622,311688,312132,312156,312169,312336,312354,312390,312576,312624,312650,312687,312741,313626,313686,314157,314352,314628,314685,315240,315252,315462,315630,315684,315900,315980,316128,316158,316350,316395,316632,316683,317634,317682,318159,318348,318636,318681,319464,319638,319680,319754,319902,320112,320124,320160,320220,320235,320256,320272,320346,320400,320420,320544,320568,320640,320679,320760,320790,320864,321642,321678,322161,322196,322299,322344,322455,322529,322644,322677,322920,323136,323190,323306,323380,323646,323676,324120,324162,324342,324405,324648,324675,325156,325230,325260,325350,325600,325650,325674,326163,326340,326652,326673,327654,327672,328116,328164,328338,328410,328560,328656,328671,328779,329448,329658,329670,329940,330165,330225,330264,330336,330480,330484,330561,330660,330669,330780,330891,331662,331668,332112,332166,332334,332415,332664,332667,333666,334167,334332,334665,334668,335220,335268,335664,335670,336108,336168,336182,336231,336256,336312,336330,336420,336441,336552,336663,336672,336700,336798,336960,336996,337662,337674,338143,338169,338328,338364,338624,338661,338676,339660,339678,340104,340119,340170,340200,340215,340272,340289,340326,340400,340425,340578,340659,340680,340770,340918,340992,341496,341658,341682,341806,341880,342144,342171,342324,342361,342657,342684,343434,343656,343686,343980,344100,344172,344322,344430,344544,344655,344688,344817,344988,345210,345276,345506,345654,345690,346173,346320,346653,346692,347652,347694,348174,348318,348435,348651,348696,348725,348984,349650,349698,350100,350168,350175,350205,350280,350316,350325,350427,350575,350595,350649,350700,350760,350945,351130,351378,351648,351702,352176,352240,352242,352314,352440,352462,352512,352536,352647,352704,352832,352836,352869,352980,353646,353706,354177,354312,354645,354708,355200,355284,355644,355710,356178,356310,356445,356643,356712,356976,357102,357210,357272,357420,357642,357714,358179,358308,358641,358716,359640,359718,360126,360180,360195,360288,360306,360380,360450,360528,360612,360639,360720,360750,360855,360972,361152,361342,361638,361722,362181,362304,362637,362724,363528,363636,363726,363858,364104,364117,364154,364182,364302,364338,364392,364413,364455,364598,364635,364672,364728,364968,365190,365292,365634,365730,366183,366300,366633,366732,367632,367734,368184,368224,368253,368298,368460,368483,368520,368631,368736,368874,368964,369630,369738,370185,370296,370629,370740,370999,371106,371406,371628,371742,372186,372294,372465,372627,372744,372775,372960,373626,373746,374187,374220,374255,374292,374440,374544,374625,374748,374847,374884,375180,375300,375550,375624,375750,376188,376290,376470,376512,376623,376752,376893,376956,377104,377406,377622,377696,377754,378108,378140,378189,378288,378351,378399,378621,378756,379620,379758,380133,380160,380175,380190,380286,380304,380323,380360,380475,380619,380646,380730,380760,380952,381618,381762,382191,382284,382617,382764,383616,383766,384192,384208,384264,384282,384480,384504,384615,384768,384800,384912,384948,385110,385170,385308,385392,385560,385614,385770,385836,385910,386193,386280,386613,386772,387612,387774,388194,388278,388485,388611,388776,388944,389610,389778,390165,390195,390276,390312,390420,390572,390609,390663,390720,390780,391230,391238,391460,391608,391782,392112,392126,392196,392274,392364,392385,392490,392496,392607,392644,392784,392931,392940,393606,393786,394197,394272,394605,394788,395160,395316,395604,395790,396198,396270,396418,396495,396576,396603,396792,396825,396936,397602,397794,398199,398268,398601,398796,399114,399168,399304,399378,399600,399798,400140,400155,400192,400200,400266,400275,400320,400340,400488,400500,400525,400599,400680,400710,400800,400932,400950,401598,401802,402201,402264,402597,402804,403434,403596,403744,403806,404202,404262,404505,404595,404808,404928,405150,405324,405594,405810,406112,406116,406203,406260,406371,406377,406593,406667,406812,407592,407814,407962,408204,408221,408240,408258,408480,408510,408591,408816,408850,408924,408969,409590,409818,410145,410205,410256,410328,410589,410697,410700,410820,411588,411822,412206,412254,412515,412587,412824,412920,413118,413364,413586,413826,414207,414252,414437,414585,414828,415140,415332,415584,415830,416176,416208,416250,416286,416448,416472,416520,416546,416583,416768,416832,416916,416988,417582,417834,418176,418209,418248,418285,418396,418581,418608,418803,418836,418988,419580,419838,420120,420135,420147,420210,420246,420320,420336,420357,420390,420525,420579,420616,420690,420714,420840,420875,420912,421578,421842,422211,422244,422577,422844,423576,423846,424212,424242,424464,424530,424575,424848,424908,425130,425204,425250,425340,425500,425574,425850,426213,426240,426573,426852,427122,427350,427572,427854,428214,428238,428535,428571,428856,428904,429462,429570,429624,429792,429858,430125,430215,430236,430344,430569,430680,430731,430860,431568,431862,432160,432216,432234,432297,432456,432540,432567,432864,432900,433566,433866,434124,434217,434232,434343,434403,434565,434713,434868,435120,435348,435564,435638,435870,436218,436230,436545,436563,436872,436896,437184,437266,437414,437562,437874,438219,438228,438561,438876,439560,439878,440100,440115,440154,440220,440226,440300,440352,440374,440448,440550,440559,440640,440670,440748,440781,440880,440892,441126,441336,441558,441882,442187,442221,442224,442260,442476,442520,442557,442816,442884,443556,443886,444222,444555,444888,444925,445110,445356,445554,445890,446220,446223,446553,446892,447552,447894,448128,448144,448218,448224,448308,448329,448416,448440,448551,448560,448588,448736,448884,448896,449550,449898,450105,450216,450225,450360,450475,450549,450660,450765,450900,451548,451656,451770,451902,452214,452226,452547,452565,452880,452904,453546,453906,454212,454227,454545,454908,455100,455130,455322,455364,455490,455544,455840,455910,455988,456192,456210,456228,456247,456432,456543,456570,456876,456912,456950,457542,457914,458208,458229,458541,458916,459170,459270,459540,459918,460161,460206,460230,460280,460368,460391,460539,460575,460650,460782,460872,460920,461538,461922,462105,462132,462204,462231,462315,462352,462429,462537,462672,462759,462924,463536,463926,464128,464202,464232,464319,464424,464535,464580,464609,464868,464928,465372,465534,465682,465930,466200,466233,466533,466932,467532,467934,468198,468234,468494,468504,468531,468585,468864,468936,468975,469134,469308,469530,469938,470196,470235,470376,470529,470640,470799,470940,471528,471942,472194,472236,472416,472527,472590,472860,472944,473526,473688,473748,473946,474192,474237,474525,474948,475200,475228,475380,475450,475524,475950,476136,476153,476190,476238,476280,476301,476442,476523,476560,476595,476782,476856,476952,477522,477954,478188,478239,478521,478956,479520,479958,480112,480168,480186,480240,480260,480330,480384,480408,480519,480600,480630,480704,480816,480852,480960,481518,481888,481962,482184,482241,482517,482964,483138,483294,483368,483516,483966,484110,484182,484242,484330,484515,484605,484704,484737,484848,484968,485388,485514,485970,486180,486243,486513,486972,487512,487974,488178,488244,488400,488511,488610,488844,488976,489510,489978,490140,490176,490245,490287,490392,490455,490509,490620,490805,490833,490980,491508,491982,492174,492246,492507,492615,492840,492984,493136,493290,493506,493580,493986,494172,494208,494209,494247,494468,494505,494532,494912,494949,494988,495396,495504,495720,495726,495990,496170,496248,496341,496392,496503,496620,496651,496836,496992,497142,497280,497502,497994,498168,498249,498501,498996,499500,499998,500166,500175,500240,500250,500400,500425,500499,500610,500625,500832,500850,501498,502164,502251,502497,503496,504144,504162,504252,504273,504384,504468,504495,504532,504630,504828,505404,505494,506115,506160,506253,506308,506345,506493,506715,506736,507492,507546,507936,508158,508254,508491,508635,508824,509490,510119,510156,510255,510300,510408,510489,510600,510748,510867,511146,511266,511488,512154,512256,512352,512376,512487,512640,512672,512820,513190,513216,513486,514152,514257,514485,515412,515484,516150,516258,516483,516645,516816,517482,517704,517752,518148,518259,518481,518851,519480,520146,520182,520220,520260,520368,520416,520442,520479,520560,520590,520650,520812,520884,520923,520960,521478,522144,522261,522477,522551,523476,524142,524262,524475,524655,524808,525150,525252,525400,525420,525474,525770,526140,526263,526473,527102,527310,527472,527620,528120,528138,528264,528286,528360,528363,528471,528660,528693,528768,528804,529322,529470,530136,530265,530424,530469,530580,530901,531468,532134,532152,532171,532224,532245,532266,532467,532494,532504,532665,532800,532874,533466,533574,533910,533984,534132,534267,534465,535428,535464,536130,536268,536352,536463,536670,536796,537462,538128,538269,538461,539154,539238,539460,539682,539784,540126,540189,540200,540270,540432,540459,540570,540675,540792,540918,541458,542124,542271,542457,543456,544122,544272,544320,544344,544374,544455,544640,544680,544714,544788,545436,545454,546120,546156,546231,546273,546416,546453,546507,546588,546897,547452,548118,548274,548451,548685,548784,549450,550116,550125,550264,550275,550375,550440,550449,550560,550671,550800,550935,551152,551232,551448,551522,552114,552276,552299,552336,552447,552690,552780,553158,553224,553446,554112,554277,554445,555444,555814,556110,556278,556443,556695,556776,557442,558108,558279,558441,558589,559440,559602,559884,560106,560160,560180,560196,560217,560280,560328,560385,560439,560448,560476,560520,560550,560700,560735,560772,560920,560952,560994,561330,561438,561660,561816,562104,562281,562437,563436,564102,564282,564435,564705,564768,565434,565452,566100,566283,566433,567162,567210,567432,568284,568320,568431,568710,568764,569430,570133,570240,570285,570429,570456,570540,570836,570969,571428,572130,572242,572286,572390,572427,572616,572649,572715,572760,572832,572871,573426,574164,574203,574287,574425,574533,574943,574980,575100,575276,575350,575424,575460,576288,576312,576396,576423,576608,576720,576756,577422,578289,578340,578421,578680,579420,580160,580203,580290,580419,580464,580493,580530,580725,580752,580986,581166,581196,581418,582291,582417,583416,583638,583848,584292,584304,584415,584730,584748,585414,585468,585630,585858,586293,586413,587412,588168,588189,588294,588411,588448,588546,588735,588744,588966,589114,589248,589410,589558,590295,590409,590472,590520,591408,592296,592407,592740,592777,593406,594135,594220,594297,594405,594627,594864,595170,595182,595350,595404,595476,595700,596298,596403,596736,596745,597402,598104,598253,598299,598364,598401,598644,598845,599400,600140,600210,600288,600300,600325,600399,600480,600510,600732,600750,600880,601398,602172,602175,602301,602397,602559,602952,602989,603396,604302,604395,604728,604755,605394,605484,605616,605880,606303,606393,607392,608256,608280,608304,608391,608418,608576,608724,608760,608798,609168,609174,609390,609464,610305,610389,610488,610500,611388,611658,611832,612306,612360,612387,612646,612720,612765,613386,614307,614385,615384,615492,615902,616140,616161,616176,616198,616272,616308,616383,616420,616572,616605,616716,616770,616896,616938,617382,618309,618381,619380,620120,620217,620310,620379,620490,620496,620527,620712,620775,621108,621230,621378,622311,622377,623154,623178,623376,624264,624312,624338,624375,624429,624672,624708,624780,624819,625300,625374,625500,626313,626373,627264,627372,627594,627912,628314,628371,628704,628785,629370,629740,630147,630180,630315,630369,630480,630504,630585,630665,630924,631368,632256,632316,632367,632700,632790,633366,634317,634365,635364,635508,636318,636363,636696,636795,637140,637182,637362,637686,637806,638145,638176,638319,638361,638435,638583,638928,639360,640100,640224,640248,640320,640359,640440,640470,640512,640544,640692,640800,640840,641358,642321,642357,643356,644112,644133,644184,644207,644322,644355,644392,644598,644688,644805,644910,645354,645516,645946,646272,646323,646353,646380,646612,646760,647352,648240,648324,648351,648684,648810,649350,649572,649944,650275,650312,650325,650349,650460,650520,650700,650793,651126,651186,651348,651496,652326,652347,652680,652815,653346,654327,654345,655344,655524,656232,656328,656343,656451,656676,656820,656861,657342,658119,658188,658329,658341,658611,658896,659340,660150,660154,660231,660330,660339,660450,660528,660561,660672,660825,660960,660968,661338,662331,662337,663336,663390,663714,663780,664224,664332,664335,664668,664830,665112,665190,665280,665334,665532,665630,666333,666703,667116,667184,667332,667406,668331,668334,668664,668835,669330,670329,670335,670440,670536,670995,671328,671550,671976,672105,672192,672216,672327,672336,672364,672462,672512,672624,672660,672840,672882,673326,674325,674337,675250,675324,675540,675990,676286,676323,676338,676656,676728,676767,676845,677322,678321,678339,679194,679320,680208,680238,680319,680340,680400,680430,680544,680578,680652,680800,680850,680985,681318,682132,682155,682317,682341,682465,682539,682992,683316,684288,684315,684342,684648,684722,684855,685314,685548,685980,686196,686313,686343,686637,686868,687312,688200,688311,688344,688473,688644,688860,688903,689310,689742,689754,690120,690161,690309,690345,690420,690552,690975,691308,692307,692346,692640,692865,693198,693306,693528,694305,694347,695304,695556,695970,696192,696303,696348,696377,696636,696870,697302,697410,697820,698301,698349,699300,700200,700225,700245,700299,700336,700350,700410,700560,700595,700632,700650,700854,700875,700965,701298,702260,702297,702351,702741,702756,703296,703666,704110,704160,704184,704295,704352,704480,704484,704517,704628,704880,704924,705294,705564,705960,706293,706353,707202,707292,708291,708354,708624,708885,709290,710289,710355,710400,710568,710955,711288,712176,712287,712356,712620,712890,713124,713138,713286,713434,714204,714285,714357,714420,714544,714663,714840,715284,715506,715572,715728,715770,715950,716283,716358,716616,716895,717282,718281,718359,719280,720168,720252,720279,720360,720390,720495,720576,720612,720760,720900,720945,721206,721278,722277,722304,722361,722684,723276,724275,724362,724608,724905,725200,725274,725348,725580,725940,726165,726273,726363,726495,727272,728160,728208,728234,728271,728308,728364,728604,728676,728715,728784,728826,728910,729270,730269,730365,730380,730584,730935,731268,731430,731860,732267,732366,732600,732915,733266,734265,734367,735210,735264,735560,735588,735930,736115,736128,736152,736263,736368,736448,736506,736596,736920,736966,737262,737484,738261,738369,738779,739260,740259,740370,740592,740629,740925,741258,741312,741702,741798,742212,742257,742371,742689,742812,743256,744144,744255,744372,744403,744588,744930,745254,745596,745920,746253,746373,747252,748170,748251,748374,748440,748473,748510,748584,748880,748935,749214,749250,750175,750249,750360,750375,750600,750915,751248,752136,752247,752376,752517,752580,752940,752987,753246,754208,754245,754319,754377,754689,754812,755244,755604,755910,756216,756243,756280,756378,756576,756702,756798,756945,757242,758241,758379,759132,759240,759462,760128,760239,760266,760320,760350,760380,760572,760608,760646,760720,760905,760950,761238,762237,762381,763218,763236,764235,764382,764568,764955,765234,765450,765612,765900,766233,766383,767232,767676,767826,768120,768231,768384,768416,768528,768564,768960,769230,770175,770220,770229,770340,770385,770451,770525,770616,770715,770784,770895,771228,772227,772386,772560,772965,773226,774225,774387,774817,775150,775224,775372,775620,775890,776112,776223,776388,776556,776970,777222,777592,778221,778389,779220,779328,779738,780182,780219,780273,780330,780390,780552,780624,780663,780840,780885,780975,781218,781440,782136,782217,782391,782460,782476,782920,783216,783290,784104,784215,784224,784252,784392,784539,784548,784728,784770,784980,784992,785214,785628,785880,786213,786393,787212,788211,788394,788544,788985,789210,790209,790320,790395,790632,790875,791208,791226,792180,792207,792396,792429,792540,792836,792990,793206,793650,793854,794205,794397,795204,795636,795870,796203,796398,796536,796995,797202,798201,798228,798336,798399,798608,798741,798756,799200,799470,799940,800100,800125,800199,800280,800310,800384,800400,800532,800550,800640,800680,800865,800976,801198,802197,802401,803196,803418,804195,804402,804528,805140,805194,805230,805490,805644,805860,806156,806193,806341,806403,806637,806868,807192,808101,808191,808404,808524,809190,810189,810300,810405,810648,810855,811188,812187,812224,812232,812261,812406,812520,812742,812754,813186,814185,814407,814555,815184,815652,815850,816102,816183,816408,816442,816480,816516,816561,816960,817182,817344,817774,818181,818409,819180,819234,819624,819882,820179,820287,820290,820410,820512,820656,820697,820845,821178,822177,822411,823176,824103,824175,824412,824508,825100,825174,825396,825660,825840,826173,826236,826413,826728,826767,827172,828144,828171,828414,828504,828874,829170,830169,830280,830415,830664,830835,831168,832104,832130,832167,832352,832416,832500,832572,832611,832896,832944,833166,833238,833490,833980,834165,834417,835164,835668,835830,836163,836190,836352,836385,836418,836496,836570,836792,837162,837310,838161,838419,839160,840105,840159,840196,840240,840270,840294,840420,840455,840492,840640,840672,840714,840780,840825,841158,841232,842157,842421,843156,844155,844422,844488,845154,845598,845676,845820,845910,846153,846423,846893,847152,847242,847374,848106,848151,848424,848484,848583,848928,849150,850149,850260,850408,850425,850500,850680,850815,851148,851518,852147,852426,852480,853146,854145,854244,854427,854700,854793,855144,855360,855684,855810,856107,856143,856428,856476,857142,858104,858141,858195,858363,858429,858585,858924,859140,860139,860250,860301,860430,860472,860688,860731,860805,861138,861246,861656,862137,862431,863136,864108,864135,864320,864432,864468,864594,864912,865134,865692,865800,866133,866433,867132,867510,868131,868168,868248,868279,868434,868464,868686,868806,869130,869352,870129,870203,870240,870435,870696,870795,871128,871572,871938,872109,872127,872436,872460,873126,874125,874152,874368,874437,874532,874828,875124,875250,875420,875700,875790,876123,876438,876456,877122,878121,878439,879120,880110,880119,880200,880230,880308,880341,880440,880452,880600,880605,880704,880748,880785,880896,881118,882117,882252,882441,882672,882819,882931,883116,884115,884374,884442,884448,884520,884559,884952,885114,885708,885780,886113,886443,887112,888111,888444,888481,889110,889254,890109,890220,890445,890712,890775,891108,891330,892107,892440,892446,893106,893376,893846,894105,894447,895104,895716,895770,896103,896112,896140,896256,896288,896436,896448,896616,896658,896832,896880,897102,897156,897546,897966,898101,898449,899100,899174,899248,900210,900315,900432,900450,900720,900765,900950,901530,901986,902205,902319,902451,902615,903258,903688,904113,904428,904452,905724,905760,906453,908424,908454,910200,910260,910385,910455,910533,910644,910728,910755,910845,910980,912114,912384,912420,912456,912494,912627,912864,913308,914457,915732,915750,916416,916458,917262,918340,918459,918540,918969,920115,920160,920190,920322,920412,920460,920560,920736,920745,920782,922461,923520,923994,924112,924210,924264,924297,924408,924462,924630,924704,924858,925444,925740,926463,928116,928145,928256,928404,928464,928638,928848,930180,930217,930465,930735,930744,931266,931392,931882,932400,932466,934467,935286,935550,935730,935748,935952,936117,936396,936468,936507,936988,938268,938469,938616,938871,940170,940329,940392,940470,940725,940752,940799,942471,943164,943574,944118,944388,944472,944649,944832,945270,945350,945720,945756,946215,946275,946473,946645,948384,948474,949494,950160,950400,950456,950475,950715,950760,950900,952119,952272,952306,952380,952476,952560,952602,952884,952935,954477,955710,955764,956376,956478,957116,957264,958479,959274,960120,960150,960224,960336,960372,960480,960520,960660,960705,960768,960816,961186,962407,962481,964368,964482,965700,965772,966168,966276,966483,966588,966736,966897,968121,968220,968253,968364,968484,968660,969408,969570,969918,970140,970485,970695,970776,972360,972486,973278,974487,975468,975690,975780,976122,976356,976488,976671,976800,978489,979242,980130,980280,980315,980343,980352,980490,980574,980685,980784,980833,980910,982491,984123,984348,984492,984533,985680,985788,986272,986493,986580,986901,987282,987752,988344,988416,988418,988455,988494,988936,989172,989602,990120,990225,990231,990495,990675,990792,992124,992155,992192,992340,992496,992682,992784,994284,994497,994560,994923,995670,995796,996336,996498,998499,999370};
int main ( ) 
{
    cin >> n >> m;
    s = 0;
    br = 0;
    while (1) 
    {
        if (a[i] >= n) break;
        i ++;
    }
    while (1) 
    {
        if (a[i] >= n && a[i] <= m) 
        {
            br ++;
            s += a[i];
        }
        else break;
                i ++;
    }
    cout << br << " " << s << endl;
    return 0;
}
