The first line contains a single integer a (1 ≤ a ≤ 1018).

Print two integers: l, r (1 ≤ l ≤ r < 10200) — the required test data. Leading zeros aren't allowed. It's guaranteed that the solution exists.

Little X has met the following problem recently. Let's define f(x) as the sum of digits in decimal representation of number x (for example, f(1234) = 1 + 2 + 3 + 4). You are to calculate Of course Little X has solved this problem quickly, has locked it, and then has tried to hack others. He has seen the following C++ code:     ans = solve(l, r) % a;    if (ans <= 0)      ans += a; This code will fail only on the test with . You are given number a, help Little X to find a proper test for hack.

Output: 4 274156909188202245543251975887

Output: 1 10

Output: 30 1000000000000000029

Output: 20 119

Output: 38 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000037

Output: 78248276335360 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000078248276335359

Output: 100000226737215501 1000000342256099074

Output: 11 104159814575911521895900437683

Output: 17579858499136 1000017579858499135

Output: 21299454017088 1021299454017087

Output: 7178812010 1000000007178812009

Output: 18 373491632964141584901880128853

Output: 41043510630 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041043510629

Output: 64445946840 164445946839

Output: 1 100000000363983406

Output: 62756625645 162756625644

Output: 29628187785 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000029628187784

Output: 1750707016 10000000000000082279166

Output: 19 91538669534268237631205813954

Output: 18756039330 1000000018756039329

Output: 33025225395 133025225394

Output: 10 31419209973070694835605921721

Output: 11293812690 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011293812689

Output: 17090455295 1000000017090455294

Output: 1000000000000000000318535725 10000000000000000000474347452

Output: 1000000000112344411 10000000000000499495924

Output: 4105768865 1000000004105768864

Output: 54196889650 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000054196889649

Output: 82539276 100082539275

Output: 21 756327394975455765564039006894

Output: 18 834462547910491574217338029197

Output: 33467296102 133467296101

Output: 29290402248 1000000029290402247

Output: 100000000000364975756 1000000000000000000000810304920

Output: 14042642210 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014042642209

Output: 1 1000000000000000000

Output: 152733984349361469011846431680 959993043772541992831221103568

Output: 1 10

Output: 1 999999999999999999

Output: 1 1

Output: 1 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

Output: 271954821529133624119084682185 842962389297692137982918109644

Output: 2 1000000000000000001

Output: 2 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001

Output: 1 10

Output: 1 999999999999999999

Output: 3 100000000000000001

Output: 3 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002

Output: 1 2

Output: 2 560628874581466624394891386345

Output: 3 12

Output: 1 999999999999999999

Output: 3 1000000000000000002

Output: 2 484753237068140508175375198957

Output: 4 1000000000000000003

Output: 3 12

Output: 4 100000000000000002

Output: 1 999999999999999999

Output: 4 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003

Output: 60589628225833012402506508640 476021074301092421719330458533

Output: 5 1000000000000000004

Output: 4 100000000000000002

Output: 5 14

Output: 1 999999999999999999

Output: 5 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004

Output: 3 970058322674934706389231068789

Output: 3 12

Output: 1 3

Output: 6 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005

Output: 1 999999999999999999

Output: 6 1000000000000000005

Output: 4 13

Output: 2 55871031232345499780958936315

Output: 6 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005

Output: 3 1000000000000000002

Output: 1 100000000000000002

Output: 5 100000000000000003

Output: 362616219705629017281877038207 507426279207887760997532414555

Output: 8 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007

Output: 3 12

Output: 8 1000000000000000007

Output: 1 999999999999999999

Output: 10 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009

Output: 10 1000000000000000009

Output: 5 14

Output: 1 999999999999999999

Output: 766497685582961373626720988724 767827187351478693741362705772

Output: 1 4

Output: 7 1000000000000000006

Output: 3 138195336207216712697826834934

Output: 2 101

Output: 1 10000000000000000001

Output: 1 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

Output: 3 718616067857419895801319300801

Output: 12 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011

Output: 6 100000000000000004

Output: 12 1000000000000000011

Output: 1 999999999999999999

Output: 12 111

Output: 20 1000000000000000019

Output: 443430267371297029537868269322 669589969981508230102249960395

Output: 5 108706001421387984203387548191

Output: 25 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024

Output: 3 102

Output: 1 100000000000000005

Output: 36 135

Output: 1 8

Output: 1 999999999999999999

Output: 36 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035

Output: 236887950713794033359253044327 279127365623136466422319445558

Output: 36 1000000000000000035

Output: 10 109

Output: 15 917196073747383616219464813413

Output: 10 1000000000000000009

Output: 15 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014

Output: 1 100000000000000008

Output: 7 1000000000000000006

Output: 1 10000000000000000003

Output: 3 712103627809397077298598145528

Output: 15 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014

Output: 20 119

Output: 1 19

Output: 100 1000000000000000099

Output: 100 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000099

Output: 15 317461371738265596651100191179

Output: 100 199

Output: 1 999999999999999999

Output: 10000 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009999

Output: 10000 1000000000000009999

Output: 10000 19999

Output: 1 999999999999999999

Output: 1 799

Output: 16 405096487494461625470572996703

Output: 1000000 1000000000000999999

Output: 1000000 1999999

Output: 1000000 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000999999

Output: 1 49999

Output: 1 999999999999999999

Output: 25 510193929627372760172168189419

Output: 100000000 1000000000099999999

Output: 100000000 199999999

Output: 100000000003463175 1000000000003463174

Output: 6 645677361347371618702470195589

Output: 100000000 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000099999999

Output: 1 999999999999999999

Output: 100000000267181819 1000000000267181818

Output: 10000000000 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009999999999

Output: 10000000000 19999999999

Output: 10 59513165524731426243688794124

Output: 10000000000 1000000009999999999

Output: 1 999999999999999999

Output: 1000000000000 1000000999999999999

Output: 5 68003859961943303267839861223

Output: 1000000000000 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000999999999999

Output: 1000000000000 1999999999999

Output: 1 999999999999999999

Output: 1 22099999999

Output: 100000000000000 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000099999999999999

Output: 1 1849999999999

Output: 16 88507454722381482303672294243

Output: 100000000000000 1000099999999999999

Output: 100000000000000 199999999999999

Output: 1 999999999999999999

Output: 10000000000000000 19999999999999999

Output: 10000000000000000 1009999999999999999

Output: 14 745710281251211240385537516413

Output: 100157415972597443 1000157415972597442

Output: 1 999999999999999999

Output: 10000000000000000 10000000000000000000000000000000000000000000000000000000000000000000000000000000000009999999999999999

Output: 1000000000000000000 1999999999999999999

Output: 1 13999999999999999

Output: 1000000000000000000 10000000000000000000000000000000000000000000000000000000000000000000000000000000000999999999999999999

Output: 1 999999999999999999

Output: 334653977548913510701154186113 930726886942913510701154186112

Output: 450000000000000000 10000000000000000000000000000000000000000000000000000000000000000000000000000000000449999999999999999

Output: 450000000000000000 1449999999999999999

Output: 106338694611694612 1006338694611694611

Output: 16 903393383226597875557216873460

Output: 1 999999999999999999

Output: 3 747339437206868740592838549381

Output: 217386 1217385

Output: 1 1000000000000000436

Output: 46718 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000046717

Output: 4992 1000000000000004991

Output: 245636 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000245635

Output: 222489 1000000000000222488

Output: 1 100000000000000017196

Output: 19 79059383805632148461681983111

Output: 394112 1394111

Output: 10000000000000000016430 1000000000000000000036910

Output: 298910 1000000000000298909

Output: 22 503678960762690906899578709225

Output: 192550 1192549

Output: 383340 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000383339

Output: 132832 1000000000000132831

Output: 1 18307

Output: 8 250306380426341341210408508947

Output: 45568 1045567

Output: 58400 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000058399

Output: 80489673323014 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000080489673323013

Output: 46784276482382 1000046784276482381

Output: 7 244117795881137318925671426761

Output: 100000000371175769262 100000000001422732430133

Output: 79369612397850 179369612397849

Output: 1000204477325 11000204477324

Output: 1856648646979 1000001856648646978

Output: 1000000039205636583 100000000031802036486

Output: 20 189807284316095398840322929992

Output: 410071527505 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000410071527504

Output: 19 346172309135965857119743372879

Output: 2125765557779 1000002125765557778

Output: 1032241271211 11032241271210

Output: 1505206151742 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000001505206151741

Output: 71431307825 100000000034781246212

Output: 422144257386 1000000422144257385

Output: 1 1000000000000000206353952079

Output: 15286381826748 115286381826747

Output: 13824833743222 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000013824833743221

Output: 17 207810984732778827817671391819

Output: 1 1009653613321140134

Output: 110661753648181500 10000000000000000000000000000000000000000000000000000000000000000000000000000000000110661753648181499

Output: 701899590254677200 1701899590254677199

Output: 6 729970982260096943131177772178

Output: 1 1004267469017686360

Output: 298303361744649796 1298303361744649795

Output: 27 836261786463043940533780319869

Output: 348619600315836884 10000000000000000000000000000000000000000000000000000000000000000000000000000000000348619600315836883

Output: 281081230386987541 1281081230386987540

Output: 21 675460005904811312587038538806

Output: 267492957614127030 10000000000000000000000000000000000000000000000000000000000000000000000000000000000267492957614127029

Output: 11010579091980345 100000009067679532477760

Output: 4 180469323823937498734171536655

Output: 100000201636947446255 10000000000000000000449026162263765

Output: 17193177028997920 10000000000000000000000000000000000000000000000000000000000000000000000000000000000017193177028997919

Output: 12239203417873344 1012239203417873343

Output: 4441092618152672 104441092618152671

Output: 25 94279559582930883401153835157

Output: 37877927461250792 10000000000000000000000000000000000000000000000000000000000000000000000000000000000037877927461250791

Output: 10001298720672505824 100001063977470943525

Output: 91633648299128271 1091633648299128270

Output: 115280852208778647357238481678 737867854531785926773143566143

Output: 3150 10000003149

Output: 999996038 1000000000999996037

Output: 970281221 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000970281220

Output: 100000000017035760 1000000000000029777500

Output: 999989668000325458 1999989668000325457

Output: 11 386255753980640158083138296507

Output: 1000013659671838557942 10000000000013617275983468397

Output: 271305080615677658 10000000000000000000000000000000000000000000000000000000000000000000000000000000000271305080615677657

Output: 999999999999999098 1999999999999999097

Output: 10013818181818181693 10000013818181818031074

Output: 7 738978162693522218854521795457

Output: 275270499999999989 10000000000000000000000000000000000000000000000000000000000000000000000000000000000275270499999999988

Output: 999999999999998606 1999999999999998605

Output: 610643499999999881 10000000000000000000000000000000000000000000000000000000000000000000000000000000000610643499999999880

Output: 14000000000000000 100000013818181815819999

Output: 14 699022150891101238144747440974

Output: 10013818181818181807 10000013818181818168609

Output: 14 593502351162748461295198468072

Output: 999995499999999999 10000000000000000000000000000000000000000000000000000000000000000000000000000000000999995499999999998

Output: 999999999999999918 1999999999999999917


The single line contains six space-separated integers li (1 ≤ li ≤ 9) — the lengths of the six sticks. It is guaranteed that the input is such that you cannot make both animals from the sticks.

NoteIf you're out of creative ideas, see instructions below which show how to make a bear and an elephant in the first two samples. The stick of length 2 is in red, the sticks of length 4 are in green, the sticks of length 5 are in blue.

If you can make a bear from the given set, print string "Bear" (without the quotes). If you can make an elephant, print string "Elephant" (wıthout the quotes). If you can make neither a bear nor an elephant, print string "Alien" (without the quotes).

Two polar bears Menshykov and Uslada from the St.Petersburg zoo and elephant Horace from the Kiev zoo got six sticks to play with and assess the animals' creativity. Menshykov, Uslada and Horace decided to make either an elephant or a bear from those sticks. They can make an animal from sticks in the following way:   Four sticks represent the animal's legs, these sticks should have the same length.  Two remaining sticks represent the animal's head and body. The bear's head stick must be shorter than the body stick. The elephant, however, has a long trunk, so his head stick must be as long as the body stick. Note that there are no limits on the relations between the leg sticks and the head and body sticks. Your task is to find out which animal can be made from the given stick set. The zoo keeper wants the sticks back after the game, so they must never be broken, even bears understand it.

Input: 4 2 5 4 4 4

Output: Bear

Input: 4 4 5 4 4 5

Output: Elephant

Input: 1 2 3 4 5 6

Output: Alien

Input: 5 5 5 5 5 5

Output: Elephant

Input: 1 1 1 2 3 5

Output: Alien

Input: 1 1 1 1 1 1

Output: Elephant

Input: 9 9 9 9 9 9

Output: Elephant

Input: 1 8 9 1 1 1

Output: Bear

Input: 9 9 9 1 9 9

Output: Bear

Input: 1 2 3 8 9 7

Output: Alien

Input: 5 5 5 6 6 6

Output: Alien

Input: 1 1 2 2 3 4

Output: Alien

Input: 4 4 4 4 4 2

Output: Bear

Input: 2 2 3 3 4 4

Output: Alien

Input: 4 4 4 4 4 5

Output: Bear

Input: 1 1 2 2 2 2

Output: Elephant

Input: 1 2 5 5 5 5

Output: Bear

Input: 4 4 2 2 2 2

Output: Elephant

Input: 1 1 1 1 1 2

Output: Bear

Input: 2 2 4 4 4 4

Output: Elephant

Input: 4 4 4 4 4 3

Output: Bear

Input: 4 4 5 6 7 8

Output: Alien

Input: 4 4 4 4 2 2

Output: Elephant

Input: 1 1 1 1 2 2

Output: Elephant

Input: 1 1 3 3 3 5

Output: Alien

Input: 1 2 2 3 3 3

Output: Alien

Input: 1 2 2 2 2 2

Output: Bear

Input: 1 3 3 3 4 5

Output: Alien

Input: 5 1 1 1 1 1

Output: Bear


The single line contains integer n (1 ≤ n ≤ 1012) — the number of cards.

NoteIn the first sample you can build only these two houses (remember, you must use all the cards):  Thus, 13 cards are enough only for two floor houses, so the answer is 1.The six cards in the second sample are not enough to build any house.

Print the number of distinct heights that the houses made of exactly n cards can have.

Polar bears Menshykov and Uslada from the zoo of St. Petersburg and elephant Horace from the zoo of Kiev decided to build a house of cards. For that they've already found a hefty deck of n playing cards. Let's describe the house they want to make:   The house consists of some non-zero number of floors.  Each floor consists of a non-zero number of rooms and the ceiling. A room is two cards that are leaned towards each other. The rooms are made in a row, each two adjoining rooms share a ceiling made by another card.  Each floor besides for the lowest one should contain less rooms than the floor below. Please note that the house may end by the floor with more than one room, and in this case they also must be covered by the ceiling. Also, the number of rooms on the adjoining floors doesn't have to differ by one, the difference may be more. While bears are practicing to put cards, Horace tries to figure out how many floors their house should consist of. The height of the house is the number of floors in it. It is possible that you can make a lot of different houses of different heights out of n cards. It seems that the elephant cannot solve this problem and he asks you to count the number of the distinct heights of the houses that they can make using exactly n cards.


First line of the input contains one letter describing direction of shifting ('L' or 'R' respectively for left or right). Second line contains a sequence of characters written by Mole. The size of this sequence will be no more than 100. Sequence contains only symbols that appear on Mole's keyboard. It doesn't contain spaces as there is no space on Mole's keyboard. It is guaranteed that even though Mole hands are moved, he is still pressing buttons on keyboard and not hitting outside it.

Print a line that contains the original message.

Our good friend Mole is trying to code a big message. He is typing on an unusual keyboard with characters arranged in following way:qwertyuiopasdfghjkl;zxcvbnm,./Unfortunately Mole is blind, so sometimes it is problem for him to put his hands accurately. He accidentally moved both his hands with one position to the left or to the right. That means that now he presses not a button he wants, but one neighboring button (left or right, as specified in input).We have a sequence of characters he has typed and we want to find the original message.

Input:
R
s;;upimrrfod;pbr

Output: allyouneedislove

Input:
R
wertyuiop;lkjhgfdsxcvbnm,.

Output: qwertyuiolkjhgfdsazxcvbnm,

Input:
L
zxcvbnm,kjhgfdsaqwertyuio

Output: xcvbnm,.lkjhgfdswertyuiop

Input:
R
bubbuduppudup

Output: vyvvysyooysyo

Input:
L
gggggggggggggggggggggggggggggggggggggggggg

Output: hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh

Input:
R
gggggggggggggggggggggggggggggggggggggggggg

Output: ffffffffffffffffffffffffffffffffffffffffff

Input:
L
ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg

Output: hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh

Input:
R
ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg

Output: fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff

Input:
L
xgwurenkxkiau,c,vonei.zltazmnkhqtwuogkgvgckvja,z.rhanuy.ybebmzcfwozkwvuuiolaqlgvvvewnbuinrncgjwjdsfw

Output: cheitrmlclosi.v.bpmro/x;ysx,mljwyeiphlhbhvlbks.x/tjsmiu/unrn,xvgepxlebiiop;sw;hbbbremniomtmvhkekfdge

Input:
L
uoz.vmks,wxrb,nwcvdzh.m,hwsios.lvu,ktes,,ythddhm.sh,d,c,cfj.wqam,bowofbyx,jathqayhreqvixvbmgdokofmym

Output: ipx/b,ld.ectn.mevbfxj/,.jedopd/;bi.lyrd..uyjffj,/dj.f.v.vgk/ews,.npepgnuc.ksyjwsujtrwbocbn,hfplpg,u,

Input:
R
oedjyrvuw/rn.v.hdwndbiposiewgsn.pnyf;/tsdohp,hrtd/mx,;coj./billd..mwbneohcikrdes/ucjr,wspthleyp,..f,

Output: iwshtecyq.eb,c,gsqbsvuoiauwqfab,obtdl.rasigomgers.nzmlxih,.vukks,,nqvbwigxujeswa.yxhemqaorgkwtom,,dm

Input:
R
vgj;o;ijrtfyck,dthccioltcx,crub;oceooognsuvfx/kgo.fbsudv,yod.erdrxhbeiyltxhnrobbb;ydrgroefcr/f;uvdjd

Output: cfhliluherdtxjmsrgxxuikrxzmxeyvlixwiiifbaycdz.jfi,dvayscmtis,wesezgvwutkrzgbeivvvltsefeiwdxe.dlycshs

Input:
L
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq

Output: wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww

Input:
L
oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo

Output: pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp

Input:
L
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

Input:
L
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz

Output: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Input:
R
....................................................................................................

Input:
R
oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo

Output: iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii

Input:
R
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww

Output: qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq

Input:
R
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Output: zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz

Input:
L
q

Output: w

Input:
L
o

Output: p

Input:
L
,

Input:
L
z

Output: x

Input:
R
.

Input:
R
o

Output: i

Input:
R
w

Output: q

Input:
R
x

Output: z

Input:
R
,./

Output: m,.

Input:
R
wertuk;;/

Output: qweryjll.

Input:
L
..


The first line of input contains two integers n and m, (2 ≤ n, m ≤ 20), denoting the number of horizontal streets and the number of vertical streets. The second line contains a string of length n, made of characters '<' and '>', denoting direction of each horizontal street. If the i-th character is equal to '<', the street is directed from east to west otherwise, the street is directed from west to east. Streets are listed in order from north to south. The third line contains a string of length m, made of characters '^' and 'v', denoting direction of each vertical street. If the i-th character is equal to '^', the street is directed from south to north, otherwise the street is directed from north to south. Streets are listed in order from west to east.

NoteThe figure above shows street directions in the second sample test case.

If the given pattern meets the mayor's criteria, print a single line containing "YES", otherwise print a single line containing "NO".

Imagine a city with n horizontal streets crossing m vertical streets, forming an (n - 1) × (m - 1) grid. In order to increase the traffic flow, mayor of the city has decided to make each street one way. This means in each horizontal street, the traffic moves only from west to east or only from east to west. Also, traffic moves only from north to south or only from south to north in each vertical street. It is possible to enter a horizontal street from a vertical street, or vice versa, at their intersection.  The mayor has received some street direction patterns. Your task is to check whether it is possible to reach any junction from any other junction in the proposed street direction pattern.

Input:
3 3
><>
v^v

Output: NO

Input:
4 6
<><>
v^v^v^

Output: YES

Input:
2 2
<>
v^

Output: YES

Input:
2 2
>>
^v

Output: NO

Input:
3 3
>><
^^v

Output: YES

Input:
3 4
>><
^v^v

Output: YES

Input:
3 8
>><
v^^^^^^^

Output: NO

Input:
7 2
<><<<<>
^^

Output: NO

Input:
4 5
><<<
^^^^v

Output: YES

Input:
2 20
><
^v^^v^^v^^^v^vv^vv^^

Output: NO

Input:
2 20
<>
v^vv^v^^vvv^^^v^vvv^

Output: YES

Input:
20 2
<><<><<>><<<>><><<<<
^^

Output: NO

Input:
20 2
><>><>><>><<<><<><><
^v

Output: YES

Input:
11 12
><<<><><<>>
vv^^^^vvvvv^

Output: NO

Input:
4 18
<<>>
v^v^v^^vvvv^v^^vv^

Output: YES

Input:
16 11
<<<<>><><<<<<><<
vv^v^vvvv^v

Output: NO

Input:
14 7
><<<<>>>>>>><<
vv^^^vv

Output: NO

Input:
5 14
<<><>
v^vv^^vv^v^^^v

Output: NO

Input:
8 18
>>>><>>>
v^vv^v^^^^^vvv^^vv

Output: NO

Input:
18 18
<<><>><<>><>><><<<
^^v^v^vvvv^v^vv^vv

Output: NO

Input:
4 18
<<<>
^^^^^vv^vv^^vv^v^v

Output: NO

Input:
19 18
><><>>><<<<<>>><<<>
^^v^^v^^v^vv^v^vvv

Output: NO

Input:
14 20
<<<><><<>><><<
vvvvvvv^v^vvvv^^^vv^

Output: NO

Input:
18 18
><>>><<<>><><>>>><
vv^^^^v^v^^^^v^v^^

Output: NO

Input:
8 18
<><<<>>>
^^^^^^v^^^vv^^vvvv

Output: NO

Input:
11 12
><><><<><><
^^v^^^^^^^^v

Output: YES

Input:
16 11
>><<><<<<>>><><<
^^^^vvvv^vv

Output: YES

Input:
14 7
<><><<<>>>><>>
vv^^v^^

Output: YES

Input:
5 14
>>>><
^v^v^^^vv^vv^v

Output: YES

Input:
8 18
<<<><>>>
v^^vvv^^v^v^vvvv^^

Output: YES

Input:
18 18
><><<><><>>><>>>><
^^vvv^v^^^v^vv^^^v

Output: YES

Input:
19 18
>>>><><<>>><<<><<<<
^v^^^^vv^^v^^^^v^v

Output: YES

Input:
14 20
<>><<<><<>>>>>
vv^^v^^^^v^^vv^^vvv^

Output: YES

Input:
20 19
<><>>>>><<<<<><<>>>>
v^vv^^vvvvvv^vvvv^v

Output: NO

Input:
20 19
<<<><<<>><<<>><><><>
v^v^vvv^vvv^^^vvv^^

Output: YES

Input:
19 20
<><<<><><><<<<<<<<>
^v^^^^v^^vvvv^^^^vvv

Output: NO

Input:
19 20
>>>>>>>><>>><><<<><
^v^v^^^vvv^^^v^^vvvv

Output: YES

Input:
20 20
<<<>>>><>><<>><<>>>>
^vvv^^^^vv^^^^^v^^vv

Output: NO

Input:
20 20
>>><><<><<<<<<<><<><
vv^vv^vv^^^^^vv^^^^^

Output: NO

Input:
20 20
><<><<<<<<<>>><>>><<
^^^^^^^^vvvv^vv^vvvv

Output: YES

Input:
20 20
<>>>>>>>><>>><>><<<>
vv^^vv^^^^v^vv^v^^^^

Output: YES

Input:
20 20
><>><<>><>>>>>>>><<>
^^v^vv^^^vvv^v^^^vv^

Output: NO

Input:
20 20
<<<<><<>><><<<>><<><
v^^^^vvv^^^vvvv^v^vv

Output: NO

Input:
20 20
><<<><<><>>><><<<<<<
vv^^vvv^^v^^v^vv^vvv

Output: NO

Input:
20 20
<<>>><>>>><<<<>>><<>
v^vv^^^^^vvv^^v^^v^v

Output: NO

Input:
20 20
><<><<><<<<<<>><><>>
v^^^v^vv^^v^^vvvv^vv

Output: NO

Input:
20 20
<<<<<<<<><>><><>><<<
^vvv^^^v^^^vvv^^^^^v

Output: NO

Input:
20 20
>>><<<<<>>><><><<><<
^^^vvv^^^v^^v^^v^vvv

Output: YES

Input:
20 20
<><<<><><>><><><<<<>
^^^vvvv^vv^v^^^^v^vv

Output: NO

Input:
20 20
>>>>>>>>>><>>><>><>>
^vvv^^^vv^^^^^^vvv^v

Output: NO

Input:
20 20
<><>><><<<<<>><<>>><
v^^^v^v^v^vvvv^^^vv^

Output: NO

Input:
20 20
><<<><<<><<<><>>>><<
vvvv^^^^^vv^v^^vv^v^

Output: NO

Input:
20 20
<<><<<<<<>>>>><<<>>>
vvvvvv^v^vvv^^^^^^^^

Output: YES

Input:
20 20
><<><<>>>>><><>><>>>
v^^^^vvv^^^^^v^v^vv^

Output: NO

Input:
20 20
<<>>><>><<>>>><<<><<
^^vvv^^vvvv^vv^^v^v^

Output: NO

Input:
20 20
><<>><>>>><<><>><><<
^v^^^^^^vvvv^v^v^v^^

Output: NO

Input:
20 20
<<><<<<><><<>>><>>>>
^^vvvvv^v^^^^^^^vvv^

Output: NO

Input:
20 20
>><<<<<<><>>>><>>><>
^^^v^v^vv^^vv^vvv^^^

Output: NO

Input:
20 20
>>>>>>>>>>>>>>>>>>>>
vvvvvvvvvvvvvvvvvvvv

Output: NO

Input:
2 2
><
v^

Output: NO

Input:
2 2
<>
^v

Output: NO

Input:
3 3
>><
vvv

Output: NO

Input:
2 3
<>
v^^

Output: YES

Input:
4 4
>>><
vvv^

Output: NO

Input:
20 20
<><><><><><><><><><>
vvvvvvvvvvvvvvvvvvvv

Output: NO

Input:
4 4
<>>>
v^^^

Output: YES

Input:
20 20
<><><><><><><><><><>
v^v^v^v^v^v^v^v^v^v^

Output: YES

Input:
2 3
<>
^v^

Output: NO

Input:
4 3
<><>
^vv

Output: NO

Input:
3 3
<<>
vv^

Output: YES

Input:
2 3
><
vv^

Output: NO

Input:
7 6
>>><>><
^vv^vv

Output: YES

Input:
2 2
<<
v^

Output: NO

Input:
3 3
>><
^^^

Output: NO

Input:
3 3
<><
v^v

Output: NO

Input:
20 20
><><><><><><><><><><
^v^v^v^v^v^v^v^v^v^v

Output: YES

Input:
4 4
<>>>
vvv^

Output: YES


The only line of input contains integer k, (0 ≤ k ≤ 34), denoting the number of participants.

Print the figure of a bus with k passengers as described in sample tests. Character '#' denotes an empty seat, while 'O' denotes a taken seat. 'D' is the bus driver and other characters in the output are for the purpose of beautifying the figure. Strictly follow the sample test cases output format. Print exactly six lines. Do not output extra space or other characters.

The final round of Bayan Programming Contest will be held in Tehran, and the participants will be carried around with a yellow bus. The bus has 34 passenger seats: 4 seats in the last row and 3 seats in remaining rows.   The event coordinator has a list of k participants who should be picked up at the airport. When a participant gets on the bus, he will sit in the last row with an empty seat. If there is more than one empty seat in that row, he will take the leftmost one. In order to keep track of the people who are on the bus, the event coordinator needs a figure showing which seats are going to be taken by k participants. Your task is to draw the figure representing occupied seats.

Output:
+------------------------+
|O.O.O.#.#.#.#.#.#.#.#.|D|)
|O.O.O.#.#.#.#.#.#.#.#.|.|
|O.......................|
|O.O.#.#.#.#.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.#.#.#.#.#.#.#.#.|D|)
|O.O.O.#.#.#.#.#.#.#.#.|.|
|O.......................|
|O.O.#.#.#.#.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.O.O.#.#.#.#.|D|)
|O.O.O.O.O.O.#.#.#.#.#.|.|
|O.......................|
|O.O.O.O.O.O.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.O.O.#.#.#.#.|D|)
|O.O.O.O.O.O.#.#.#.#.#.|.|
|O.......................|
|O.O.O.O.O.O.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.O.O.O.O.O.#.|D|)
|O.O.O.O.O.O.O.O.O.O.#.|.|
|O.......................|
|O.O.O.O.O.O.O.O.O.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.O.O.O.O.O.#.|D|)
|O.O.O.O.O.O.O.O.O.O.#.|.|
|O.......................|
|O.O.O.O.O.O.O.O.O.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.#.#.#.#.#.#.#.#.#.|D|)
|O.#.#.#.#.#.#.#.#.#.#.|.|
|O.......................|
|O.#.#.#.#.#.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.#.#.#.#.#.#.#.#.#.|D|)
|O.#.#.#.#.#.#.#.#.#.#.|.|
|O.......................|
|O.#.#.#.#.#.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|#.#.#.#.#.#.#.#.#.#.#.|D|)
|#.#.#.#.#.#.#.#.#.#.#.|.|
|#.......................|
|#.#.#.#.#.#.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|#.#.#.#.#.#.#.#.#.#.#.|D|)
|#.#.#.#.#.#.#.#.#.#.#.|.|
|#.......................|
|#.#.#.#.#.#.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.#.#.#.#.#.#.#.#.#.#.|D|)
|#.#.#.#.#.#.#.#.#.#.#.|.|
|#.......................|
|#.#.#.#.#.#.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.#.#.#.#.#.#.#.#.#.#.|D|)
|#.#.#.#.#.#.#.#.#.#.#.|.|
|#.......................|
|#.#.#.#.#.#.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.#.#.#.#.#.#.#.#.#.#.|D|)
|O.#.#.#.#.#.#.#.#.#.#.|.|
|#.......................|
|#.#.#.#.#.#.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.#.#.#.#.#.#.#.#.#.#.|D|)
|O.#.#.#.#.#.#.#.#.#.#.|.|
|#.......................|
|#.#.#.#.#.#.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.#.#.#.#.#.#.#.#.#.#.|D|)
|O.#.#.#.#.#.#.#.#.#.#.|.|
|O.......................|
|#.#.#.#.#.#.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.#.#.#.#.#.#.#.#.#.#.|D|)
|O.#.#.#.#.#.#.#.#.#.#.|.|
|O.......................|
|#.#.#.#.#.#.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.#.#.#.#.#.#.#.#.#.#.|D|)
|O.#.#.#.#.#.#.#.#.#.#.|.|
|O.......................|
|O.#.#.#.#.#.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.#.#.#.#.#.#.#.#.#.#.|D|)
|O.#.#.#.#.#.#.#.#.#.#.|.|
|O.......................|
|O.#.#.#.#.#.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.#.#.#.#.#.#.#.#.#.|D|)
|O.O.#.#.#.#.#.#.#.#.#.|.|
|O.......................|
|O.#.#.#.#.#.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.#.#.#.#.#.#.#.#.#.|D|)
|O.O.#.#.#.#.#.#.#.#.#.|.|
|O.......................|
|O.#.#.#.#.#.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.#.#.#.#.#.#.#.#.#.|D|)
|O.O.#.#.#.#.#.#.#.#.#.|.|
|O.......................|
|O.O.#.#.#.#.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.#.#.#.#.#.#.#.#.#.|D|)
|O.O.#.#.#.#.#.#.#.#.#.|.|
|O.......................|
|O.O.#.#.#.#.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.#.#.#.#.#.#.#.#.|D|)
|O.O.#.#.#.#.#.#.#.#.#.|.|
|O.......................|
|O.O.#.#.#.#.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.#.#.#.#.#.#.#.#.|D|)
|O.O.#.#.#.#.#.#.#.#.#.|.|
|O.......................|
|O.O.#.#.#.#.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.#.#.#.#.#.#.#.#.|D|)
|O.O.O.#.#.#.#.#.#.#.#.|.|
|O.......................|
|O.O.O.#.#.#.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.#.#.#.#.#.#.#.#.|D|)
|O.O.O.#.#.#.#.#.#.#.#.|.|
|O.......................|
|O.O.O.#.#.#.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.#.#.#.#.#.#.#.|D|)
|O.O.O.#.#.#.#.#.#.#.#.|.|
|O.......................|
|O.O.O.#.#.#.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.#.#.#.#.#.#.#.|D|)
|O.O.O.#.#.#.#.#.#.#.#.|.|
|O.......................|
|O.O.O.#.#.#.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.#.#.#.#.#.#.#.|D|)
|O.O.O.O.#.#.#.#.#.#.#.|.|
|O.......................|
|O.O.O.#.#.#.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.#.#.#.#.#.#.#.|D|)
|O.O.O.O.#.#.#.#.#.#.#.|.|
|O.......................|
|O.O.O.#.#.#.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.#.#.#.#.#.#.#.|D|)
|O.O.O.O.#.#.#.#.#.#.#.|.|
|O.......................|
|O.O.O.O.#.#.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.#.#.#.#.#.#.#.|D|)
|O.O.O.O.#.#.#.#.#.#.#.|.|
|O.......................|
|O.O.O.O.#.#.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.#.#.#.#.#.#.|D|)
|O.O.O.O.#.#.#.#.#.#.#.|.|
|O.......................|
|O.O.O.O.#.#.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.#.#.#.#.#.#.|D|)
|O.O.O.O.#.#.#.#.#.#.#.|.|
|O.......................|
|O.O.O.O.#.#.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.#.#.#.#.#.#.|D|)
|O.O.O.O.O.#.#.#.#.#.#.|.|
|O.......................|
|O.O.O.O.#.#.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.#.#.#.#.#.#.|D|)
|O.O.O.O.O.#.#.#.#.#.#.|.|
|O.......................|
|O.O.O.O.#.#.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.#.#.#.#.#.#.|D|)
|O.O.O.O.O.#.#.#.#.#.#.|.|
|O.......................|
|O.O.O.O.O.#.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.#.#.#.#.#.#.|D|)
|O.O.O.O.O.#.#.#.#.#.#.|.|
|O.......................|
|O.O.O.O.O.#.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.O.#.#.#.#.#.|D|)
|O.O.O.O.O.#.#.#.#.#.#.|.|
|O.......................|
|O.O.O.O.O.#.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.O.#.#.#.#.#.|D|)
|O.O.O.O.O.#.#.#.#.#.#.|.|
|O.......................|
|O.O.O.O.O.#.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.O.#.#.#.#.#.|D|)
|O.O.O.O.O.O.#.#.#.#.#.|.|
|O.......................|
|O.O.O.O.O.#.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.O.#.#.#.#.#.|D|)
|O.O.O.O.O.O.#.#.#.#.#.|.|
|O.......................|
|O.O.O.O.O.#.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.O.#.#.#.#.#.|D|)
|O.O.O.O.O.O.#.#.#.#.#.|.|
|O.......................|
|O.O.O.O.O.O.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.O.#.#.#.#.#.|D|)
|O.O.O.O.O.O.#.#.#.#.#.|.|
|O.......................|
|O.O.O.O.O.O.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.O.O.#.#.#.#.|D|)
|O.O.O.O.O.O.O.#.#.#.#.|.|
|O.......................|
|O.O.O.O.O.O.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.O.O.#.#.#.#.|D|)
|O.O.O.O.O.O.O.#.#.#.#.|.|
|O.......................|
|O.O.O.O.O.O.#.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.O.O.#.#.#.#.|D|)
|O.O.O.O.O.O.O.#.#.#.#.|.|
|O.......................|
|O.O.O.O.O.O.O.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.O.O.#.#.#.#.|D|)
|O.O.O.O.O.O.O.#.#.#.#.|.|
|O.......................|
|O.O.O.O.O.O.O.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.O.O.O.#.#.#.|D|)
|O.O.O.O.O.O.O.#.#.#.#.|.|
|O.......................|
|O.O.O.O.O.O.O.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.O.O.O.#.#.#.|D|)
|O.O.O.O.O.O.O.#.#.#.#.|.|
|O.......................|
|O.O.O.O.O.O.O.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.O.O.O.#.#.#.|D|)
|O.O.O.O.O.O.O.O.#.#.#.|.|
|O.......................|
|O.O.O.O.O.O.O.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.O.O.O.#.#.#.|D|)
|O.O.O.O.O.O.O.O.#.#.#.|.|
|O.......................|
|O.O.O.O.O.O.O.#.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.O.O.O.#.#.#.|D|)
|O.O.O.O.O.O.O.O.#.#.#.|.|
|O.......................|
|O.O.O.O.O.O.O.O.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.O.O.O.#.#.#.|D|)
|O.O.O.O.O.O.O.O.#.#.#.|.|
|O.......................|
|O.O.O.O.O.O.O.O.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.O.O.O.O.#.#.|D|)
|O.O.O.O.O.O.O.O.#.#.#.|.|
|O.......................|
|O.O.O.O.O.O.O.O.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.O.O.O.O.#.#.|D|)
|O.O.O.O.O.O.O.O.#.#.#.|.|
|O.......................|
|O.O.O.O.O.O.O.O.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.O.O.O.O.#.#.|D|)
|O.O.O.O.O.O.O.O.O.#.#.|.|
|O.......................|
|O.O.O.O.O.O.O.O.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.O.O.O.O.#.#.|D|)
|O.O.O.O.O.O.O.O.O.#.#.|.|
|O.......................|
|O.O.O.O.O.O.O.O.#.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.O.O.O.O.#.#.|D|)
|O.O.O.O.O.O.O.O.O.#.#.|.|
|O.......................|
|O.O.O.O.O.O.O.O.O.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.O.O.O.O.#.#.|D|)
|O.O.O.O.O.O.O.O.O.#.#.|.|
|O.......................|
|O.O.O.O.O.O.O.O.O.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.O.O.O.O.O.#.|D|)
|O.O.O.O.O.O.O.O.O.#.#.|.|
|O.......................|
|O.O.O.O.O.O.O.O.O.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.O.O.O.O.O.#.|D|)
|O.O.O.O.O.O.O.O.O.#.#.|.|
|O.......................|
|O.O.O.O.O.O.O.O.O.#.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.O.O.O.O.O.#.|D|)
|O.O.O.O.O.O.O.O.O.O.#.|.|
|O.......................|
|O.O.O.O.O.O.O.O.O.O.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.O.O.O.O.O.#.|D|)
|O.O.O.O.O.O.O.O.O.O.#.|.|
|O.......................|
|O.O.O.O.O.O.O.O.O.O.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.O.O.O.O.O.O.|D|)
|O.O.O.O.O.O.O.O.O.O.#.|.|
|O.......................|
|O.O.O.O.O.O.O.O.O.O.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.O.O.O.O.O.O.|D|)
|O.O.O.O.O.O.O.O.O.O.#.|.|
|O.......................|
|O.O.O.O.O.O.O.O.O.O.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.O.O.O.O.O.O.|D|)
|O.O.O.O.O.O.O.O.O.O.O.|.|
|O.......................|
|O.O.O.O.O.O.O.O.O.O.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.O.O.O.O.O.O.|D|)
|O.O.O.O.O.O.O.O.O.O.O.|.|
|O.......................|
|O.O.O.O.O.O.O.O.O.O.#.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.O.O.O.O.O.O.|D|)
|O.O.O.O.O.O.O.O.O.O.O.|.|
|O.......................|
|O.O.O.O.O.O.O.O.O.O.O.|.|)
+------------------------+

Output:
+------------------------+
|O.O.O.O.O.O.O.O.O.O.O.|D|)
|O.O.O.O.O.O.O.O.O.O.O.|.|
|O.......................|
|O.O.O.O.O.O.O.O.O.O.O.|.|)
+------------------------+


The single line of the input contains six integers x, t, a, b, da, db (0 ≤ x ≤ 600; 1 ≤ t, a, b, da, db ≤ 300) — Valera's result, the contest's duration, the initial cost of the first problem, the initial cost of the second problem, the number of points that the first and the second problem lose per minute, correspondingly. It is guaranteed that at each minute of the contest each problem has a non-negative cost, that is, a - i·da ≥ 0 and b - i·db ≥ 0 for all 0 ≤ i ≤ t - 1.

NoteIn the first sample Valera could have acted like this: he could have submitted the first problem at minute 0 and the second problem — at minute 2. Then the first problem brings him 20 points and the second problem brings him 10 points, that in total gives the required 30 points.

If Valera could have earned exactly x points at a contest, print "YES", otherwise print "NO" (without the quotes).

A boy Valera registered on site Codeforces as Valera, and wrote his first Codeforces Round #300. He boasted to a friend Arkady about winning as much as x points for his first contest. But Arkady did not believe his friend's words and decided to check whether Valera could have shown such a result.He knows that the contest number 300 was unusual because there were only two problems. The contest lasted for t minutes, the minutes are numbered starting from zero. The first problem had the initial cost of a points, and every minute its cost reduced by da points. The second problem had the initial cost of b points, and every minute this cost reduced by db points. Thus, as soon as the zero minute of the contest is over, the first problem will cost a - da points, and the second problem will cost b - db points. It is guaranteed that at any moment of the contest each problem has a non-negative cost.Arkady asks you to find out whether Valera could have got exactly x points for this contest. You should assume that Valera could have solved any number of the offered problems. You should also assume that for each problem Valera made no more than one attempt, besides, he could have submitted both problems at the same minute of the contest, starting with minute 0 and ending with minute number t - 1. Please note that Valera can't submit a solution exactly t minutes after the start of the contest or later.

Input: 30 5 20 20 3 5

Output: YES

Input: 10 4 100 5 5 1

Output: NO

Input: 0 7 30 50 3 4

Output: YES

Input: 50 10 30 20 1 2

Output: YES

Input: 40 1 40 5 11 2

Output: YES

Input: 35 8 20 20 1 2

Output: YES

Input: 10 2 27 4 11 1

Output: NO

Input: 64 12 258 141 10 7

Output: YES

Input: 5 3 11 100 2 4

Output: NO

Input: 5 4 11 80 2 4

Output: YES

Input: 28 3 16 20 3 10

Output: NO

Input: 6 2 11 1 11 1

Output: NO

Input: 15 5 230 213 32 25

Output: NO

Input: 223 92 123 118 1 1

Output: YES

Input: 375 6 133 267 19 36

Output: NO

Input: 80 5 39 40 1 1

Output: NO

Input: 543 4 31 69 6 5

Output: NO

Input: 38 100 99 245 1 1

Output: YES

Input: 3 1 20 15 17 5

Output: NO

Input: 360 5 215 4 52 1

Output: NO

Input: 363 2 280 239 5 231

Output: NO

Input: 46 7 18 6 3 1

Output: NO

Input: 5 3 135 12 21 6

Output: NO

Input: 15 5 230 213 32 25

Output: NO

Input: 2 5 29 36 5 6

Output: NO

Input: 59 4 113 45 25 12

Output: YES

Input: 74 72 104 71 1 1

Output: YES

Input: 16 24 26 23 1 1

Output: YES

Input: 11 1 10 1 10 1

Output: YES

Input: 13 3 11 14 5 1

Output: YES

Input: 1 2 1 2 1 2

Output: YES

Input: 145 26 25 150 1 4

Output: YES

Input: 59 18 50 17 1 1

Output: YES

Input: 230 125 175 124 1 1

Output: YES

Input: 142 1 66 76 18 39

Output: YES

Input: 0 3 5 6 1 2

Output: YES

Input: 6 46 95 45 1 1

Output: YES

Input: 16 73 92 72 1 1

Output: YES

Input: 3 18 272 17 6 1

Output: YES

Input: 1 21 178 20 1 1

Output: YES

Input: 0 15 86 84 5 2

Output: YES

Input: 0 35 208 98 6 2

Output: YES

Input: 0 11 67 82 6 4

Output: YES

Input: 30 9 18 83 1 7

Output: NO

Input: 18 12 11 54 1 3

Output: NO

Input: 41 77 96 145 1 1

Output: YES

Input: 27 45 44 169 1 2

Output: YES

Input: 50 5 30 60 3 3

Output: NO

Input: 49 2 50 20 2 1

Output: NO

Input: 49 2 50 20 2 1

Output: NO

Input: 17 10 10 20 1 2

Output: YES


The first line contains two integers a and c (0 ≤ a, c ≤ 109). Both numbers are written in decimal notation.

Print the single integer b, such that a tor b = c. If there are several possible numbers b, print the smallest one. You should print the number in decimal notation.

Little Petya very much likes computers. Recently he has received a new "Ternatron IV" as a gift from his mother. Unlike other modern computers, "Ternatron IV" operates with ternary and not binary logic. Petya immediately wondered how the xor operation is performed on this computer (and whether there is anything like it).It turned out that the operation does exist (however, it is called tor) and it works like this. Suppose that we need to calculate the value of the expression a tor b. Both numbers a and b are written in the ternary notation one under the other one (b under a). If they have a different number of digits, then leading zeroes are added to the shorter number until the lengths are the same. Then the numbers are summed together digit by digit. The result of summing each two digits is calculated modulo 3. Note that there is no carry between digits (i. e. during this operation the digits aren't transferred). For example: 1410 tor 5010 = 01123 tor 12123 = 10213 = 3410.Petya wrote numbers a and c on a piece of paper. Help him find such number b, that a tor b = c. If there are several such numbers, print the smallest one.

Input: 14 34

Output: 50

Input: 50 34

Output: 14

Input: 387420489 225159023

Output: 1000000001

Input: 5 5

Output: 0

Input: 23476 23875625

Output: 23860906

Input: 11111 10101010

Output: 10116146

Input: 1 23865354

Output: 23865356

Input: 0 0

Output: 0

Input: 2376234 0

Output: 4732515

Input: 1 0

Output: 2

Input: 581130733 0

Output: 1162261466

Input: 581131733 1

Output: 1162260467

Input: 0 1000000000

Output: 1000000000

Input: 1000000000 0

Output: 693711461

Input: 1000000000 100000000

Output: 650219958

Input: 956747697 9487

Output: 736688812

Input: 229485033 8860

Output: 308580772

Input: 5341 813849430

Output: 813850920

Input: 227927516 956217829

Output: 872370713

Input: 390 380875228

Output: 380874919

Input: 336391083 911759145

Output: 1135529718

Input: 154618752 504073566

Output: 753527130

Input: 6436017 645491133

Output: 639142839

Input: 4232 755480607

Output: 755485882

Input: 19079106 69880743

Output: 56293527

Input: 460318555 440850074

Output: 25179124

Input: 227651149 379776728

Output: 168088492

Input: 621847819 8794

Output: 1114556841

Input: 827112516 566664600

Output: 908742057

Input: 460311350 820538776

Output: 404875070

Input: 276659168 241268656

Output: 358409486

Input: 9925 9952

Output: 27

Input: 830218526 438129941

Output: 784719357

Input: 630005197 848951646

Output: 754665575

Input: 123256190 174927955

Output: 243699845

Input: 937475611 769913258

Output: 994719535

Input: 561666539 29904379

Output: 1152454076

Input: 551731805 8515539

Output: 1049769112

Input: 6560 96330685

Output: 96330968

Input: 337894292 55

Output: 243175169

Input: 479225038 396637601

Output: 47143216

Input: 111174087 482024380

Output: 430083082

Input: 785233275 1523

Output: 393767834

Input: 47229813 6200

Output: 89081162

Input: 264662333 6952

Output: 141903557

Input: 523162963 922976263

Output: 414184806

Input: 6347 7416

Output: 10549

Input: 278014879 3453211

Output: 171855414

Input: 991084922 66

Output: 690049933

Input: 929361351 7373

Output: 679915097

Input: 532643581 213098335

Output: 842718489

Input: 69272798 718909239

Output: 668771236

Input: 440760623 316634331

Output: 1052493562

Input: 9001 9662

Output: 1390

Input: 417584836 896784933

Output: 481392203

Input: 640735701 335933492

Output: 992169746

Input: 5440 6647

Output: 10711

Input: 3545 6259

Output: 3536

Input: 847932562 1405

Output: 488901051

Input: 359103580 852

Output: 201115550

Input: 406369748 625641695

Output: 221459919

Input: 345157805 719310676

Output: 504894191

Input: 9150 823789822

Output: 823781437

Input: 8727 702561605

Output: 702556127

Input: 931392186 677650263

Output: 923604336

Input: 976954722 548418041

Output: 862925051

Input: 168971531 697371009

Output: 588009082

Input: 5849 7211

Output: 10146

Input: 934045591 4156

Output: 661009836

Input: 427471963 436868749

Output: 67345761

Input: 702754885 762686553

Output: 81198815

Input: 897312963 177161062

Output: 620860447

Input: 268520356 1999

Output: 135088146

Input: 635318406 289972012

Output: 950864476

Input: 237819544 904440360

Output: 857959352

Input: 44788825 4485

Output: 89397617

Input: 7376 994270908

Output: 994283218

Input: 893244884 654169485

Output: 1095395095

Input: 960725158 342144655

Output: 548529624

Input: 460645829 46697832

Output: 792961330

Input: 8389 172682371

Output: 172696203

Input: 294567098 631452590

Output: 745235571

Input: 5573 8790

Output: 13021

Input: 285938679 907528096

Output: 1068058915

Input: 774578699 101087409

Output: 940495066

Input: 153749013 598457896

Output: 444892699

Input: 364059865 346004232

Output: 40934348

Input: 237924125 573400957

Output: 507664538

Input: 987310001 827978268

Output: 275919178

Input: 922263603 387506683

Output: 1064907553

Input: 5712 384487208

Output: 384482225

Input: 9099 3208

Output: 14035

Input: 948688087 38251290

Output: 768385433

Input: 260153932 138945442

Output: 271056231

Input: 497129325 766959165

Output: 276817557

Input: 783390583 7679

Output: 399664540

Input: 657244587 28654748

Output: 921153434

Input: 455705795 757666961

Output: 303798597

Input: 815932189 211656771

Output: 562850021

Input: 511307975 307916669

Output: 1137612240

Input: 274842194 1000000000

Output: 1162261466


The first line contains a positive integer n — the original number. The number of digits in this number does not exceed 105. The number is written without any leading zeroes.

Print two permutations of digits of number n, such that the sum of these numbers ends with the maximum number of zeroes. The permutations can have leading zeroes (if they are present, they all should be printed). The permutations do not have to be different. If there are several answers, print any of them.

Andrey's favourite number is n. Andrey's friends gave him two identical numbers n as a New Year present. He hung them on a wall and watched them adoringly.Then Andrey got bored from looking at the same number and he started to swap digits first in one, then in the other number, then again in the first number and so on (arbitrary number of changes could be made in each number). At some point it turned out that if we sum the resulting numbers, then the number of zeroes with which the sum will end would be maximum among the possible variants of digit permutations in those numbers.Given number n, can you find the two digit permutations that have this property?

Output:
981
819

Output:
500
500

Output:
1160
1160

Output:
6110
6110

Output:
9901
1099

Output:
4778
4778

Output:
8774
8774

Output:
877720
777280

Output:
7766115
7766115

Output:
672400
427600

Output:
77481
77418

Output:
87741
87741

Output:
14778
14778

Output:
78721300
31278700

Output:
9877766444
9877764446

Output:
877654322200
222345677800

Output:
997533877542213
995333122457787

Output:
7765551998877221100500
7765551001122778899500

Output:
11111222444444477777
11111222444444477777

Output:
77444444411111777222
77444444411111222777

Output:
77777444444422211111
77777444444422211111

Output:
7887777665544332222113000000
3112222334455667777887000000

Output:
774499999776666666555444333333322000003
744300000223333333444555666666677999997

Output:
69999888777776655554444332222211100004000000000000
40000111222223344445555667777788899996000000000000

Output:
4444444444444433333333333333332222222222211111111111111111111
4444444444444433333333333333332222222222211111111111111111111

Output:
1111111111111111111122222222222333333333333333344444444444444
1111111111111111111122222222222333333333333333344444444444444

Output:
440
440

Output:
545
455


CPCPCPC CCCCCCPPPPPP CCCCCCPPCPPPPPPPPPP CCCCCCCCCC

The only line of the input data contains a non-empty string consisting of letters "С" and "P" whose length does not exceed 100 characters. If the i-th character in the string is the letter "С", that means that the i-th object (the numbering goes from the left to the right) on Polycarpus' wall is a postcard. And if the i-th character is the letter "P", than the i-th object on the wall is a photo.

NoteIn the first sample Polycarpus needs to take one item to the closet 7 times.In the second sample Polycarpus can first take 3 postcards to the closet; then 3 more. He can take the 6 photos that are left in the similar way, going to the closet twice.In the third sample Polycarpus can visit the closet twice, both times carrying 3 postcards. Then he can take there 2 photos at once, then one postcard and finally, he can carry the last 10 photos if he visits the closet twice.In the fourth sample Polycarpus can visit the closet twice and take there all 10 postcards (5 items during each go).

Print the only number — the minimum number of times Polycarpus has to visit the closet.

Polycarpus has postcards and photos hung in a row on the wall. He decided to put them away to the closet and hang on the wall a famous painter's picture. Polycarpus does it like that: he goes from the left to the right and removes the objects consecutively. As Polycarpus doesn't want any mix-ups to happen, he will not carry in his hands objects of two different types. In other words, Polycarpus can't carry both postcards and photos simultaneously. Sometimes he goes to the closet and puts the objects there, thus leaving his hands free. Polycarpus must put all the postcards and photos to the closet. He cannot skip objects. What minimum number of times he should visit the closet if he cannot carry more than 5 items?

Input: CPCPCPC

Input: CCCCCCPPPPPP

Output: 4

Input: CCCCCCPPCPPPPPPPPPP

Output: 6

Input: CCCCCCCCCC

Input: CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC

Output: 20

Input: CPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCPCP

Output: 100

Input: CCCCCCPPPPPPCCCCCCPPPPPPCCCCCCPPPPPPCCCCCCPPPPPPCCCCCCPPPPPPCCCCCCPPPPPPCCCCCCPPPPPP

Output: 28

Input: P

Input: C

Input: PC

Input: PPPPP

Input: PPPP

Input: CP

Input: CPCCPCPPPC

Input: PPCPCCPCPPCCPPPPPPCP

Output: 12

Input: PCPCCPCPPCCPCPCCPPPPPCPCPCPCCC

Output: 20

Input: CCPPPPPCPCCPPPCCPPCPCCPCPPCPPCCCPPCPPPCC

Output: 21

Input: CPPCCCCCCPCCCCPCCPCPPPCPCCCCCCCPCCPPCCCPCCCCCPPCCC

Output: 23

Input: PPCCCCPPCCPPPCCCCPPPPPCPPPCPPPCCCPCCCPCPPPCPCCCPCCPPCCPPPPPC

Output: 26

Input: PPCPPCCCCCPCCCPCCPCCCCPPPCCCCPCPCCPCPCPCPPPPCCPPPPPPPCPCPPPCPCPCPCPPPC

Output: 39

Input: CCPCPPPPCPPPPCCCCPCCPCPCCPPCPCCCPPCCCCPCCCPCPCCPPPCPPPCPCPPPPPCPCCPCCPPCCCPCPPPC

Output: 43

Input: CCPPCPCPCPPCCCPCPPPCCCCCPCPPCCCPPCPCPPPPCPPCPPPPCCCPCCPCPPPCPCPPCCCPCCCCCCPCCCCPCCPPPPCCPP

Output: 47

Input: PPCPPPPCCCCPPPPCPPPPPPPPCPCPPCCPPPPPPPPCPPPPCCCCPPPPCPPCPCPPPCCPPCPPCCCPCPPCCCCCCPCPCPCPPCPCPCPPPCCC

Output: 49

Input: CCPCCCPPCPPCPCCCPCPPCPPCPPCCCCCCCPCPPCPCCPCCPCPCPCCCPCCCPPPCCPCCPPCCCCCPPPPCPCPPCPCPCCPCPPP

Output: 53

Input: PCPCPPPPCPCPPPCPPCCCPCPCPCPPCPPPPCCPPPCPPPCPPPPCCPPCCCPCCPCCCCPCCPCPPCPCCCPCPPCP

Output: 47

Input: PCCPPCCCPPCPPCC

Output: 8

Input: CCCPPPPPPCCCCPCCPCCCCCCPCCCPPPCPC

Output: 15

Input: CPPCCPPCCPPPCCCPPPPCPPPPPPPCCPCPCCPPPPCCCPPCCPCCPPCCCPCCPCPPPPCCPP

Output: 31

Input: CCCCCPPPCCPCPCCPPPPCPCCCPCPPCPCPPPPPCCPCPCPC

Output: 25

Input: PPPPPPPPPCPCP

Output: 6

Input: PPPCPCPCCCPPCPCCPPPPCCCPCCP

Output: 15

Input: PCPCCPCPPPPPPCPCCPCPCPCCPPPCPCPCPPCPPCCPCPCCCPCCCPPCPCPCCPCPPPPCCCCCCPPCCPCCCCCPCCCCPPPCPCCCCCPCPCP

Output: 59

Input: PCCPCPPCCCCCPCCCPCCCPPCCCCCPPPCCPPPPPPPPCPPPCCPPCPPCPCP

Output: 26

Input: CPCPCCPPPPCCPPCPPCPPCCCCCCPCCPPPCPPCPCCCCCCPCPCCCCCPCCCCCCPCCPPCCP

Output: 35

Input: PPCCCCCCPP

Input: CCCCCCCCCCCCPPCCCCPP

Output: 6

Input: PPPPPPPPPPPCCCCCCCCCCCCCCCCCCP

Output: 8

Input: PPPPPPPPPPPPPPPPPPPPPCCCCCCCCCCCPPPPCCCC

Output: 10

Input: PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPCCCCCCCCCPPPC

Output: 12

Input: CCCCCCCCCPPPPPPPPPPPPPPPPPPPPCCCCCCCCCCCCCCCCCCCCCCCCPPPPPCC

Output: 13

Input: CCCCCCCCCCCCCCCCCCCCCCCCCPPPCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC

Output: 15

Input: CCCCCPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPCCCCCCCCCCCCCPPPPPPPCCPPP

Output: 18

Input: PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPCCCCCCCCCCCCCCCCCCCCCCCCCCCPPPPPPPPPPPPPPPPPPP

Output: 19

Input: PPPPPPPPPPPPPPPPPPPPPPPCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCPPPPPCCCPPPPCCCCCPCC

Output: 23


The first input line contains the single integer n (1 ≤ n ≤ 1000) — the number of pages in the book. The second line contains seven non-negative space-separated integers that do not exceed 1000 — those integers represent how many pages Petr can read on Monday, Tuesday, Wednesday, Thursday, Friday, Saturday and Sunday correspondingly. It is guaranteed that at least one of those numbers is larger than zero.

NoteNote to the first sample:By the end of Monday and therefore, by the beginning of Tuesday Petr has 85 pages left. He has 65 pages left by Wednesday, 45 by Thursday, 30 by Friday, 20 by Saturday and on Saturday Petr finishes reading the book (and he also has time to read 10 pages of something else).Note to the second sample:On Monday of the first week Petr will read the first page. On Monday of the second week Petr will read the second page and will finish reading the book.

Print a single number — the number of the day of the week, when Petr will finish reading the book. The days of the week are numbered starting with one in the natural order: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday.

One Sunday Petr went to a bookshop and bought a new book on sports programming. The book had exactly n pages.Petr decided to start reading it starting from the next day, that is, from Monday. Petr's got a very tight schedule and for each day of the week he knows how many pages he will be able to read on that day. Some days are so busy that Petr will have no time to read whatsoever. However, we know that he will be able to read at least one page a week.Assuming that Petr will not skip days and will read as much as he can every day, determine on which day of the week he will read the last page of the book.

Input:
100
15 20 20 15 10 30 45

Output: 6

Input:
2
1 0 0 0 0 0 0

Output: 1

Input:
100
100 200 100 200 300 400 500

Output: 1

Input:
3
1 1 1 1 1 1 1

Output: 3

Input:
1
1 1 1 1 1 1 1

Output: 1

Input:
20
5 3 7 2 1 6 4

Output: 6

Input:
10
5 1 1 1 1 1 5

Output: 6

Input:
50
10 1 10 1 10 1 10

Output: 1

Input:
77
11 11 11 11 11 11 10

Output: 1

Input:
1
1000 1000 1000 1000 1000 1000 1000

Output: 1

Input:
1000
100 100 100 100 100 100 100

Output: 3

Input:
999
10 20 10 20 30 20 10

Output: 3

Input:
433
109 58 77 10 39 125 15

Output: 7

Input:
1
0 0 0 0 0 0 1

Output: 7

Input:
5
1 0 1 0 1 0 1

Output: 1

Input:
997
1 1 0 0 1 0 1

Output: 1

Input:
1000
1 1 1 1 1 1 1

Output: 6

Input:
1000
1000 1000 1000 1000 1000 1000 1000

Output: 1

Input:
1000
1 0 0 0 0 0 0

Output: 1

Input:
1000
0 0 0 0 0 0 1

Output: 7

Input:
1000
1 0 0 1 0 0 1

Output: 1

Input:
509
105 23 98 0 7 0 155

Output: 2

Input:
7
1 1 1 1 1 1 1

Output: 7

Input:
2
1 1 0 0 0 0 0

Output: 2

Input:
1
0 0 0 0 0 1 0

Output: 6

Input:
10
0 0 0 0 0 0 1

Output: 7

Input:
5
0 0 0 0 0 6 0

Output: 6

Input:
3
0 1 0 0 0 0 0

Output: 2

Input:
10
0 0 0 0 0 0 10

Output: 7

Input:
28
1 2 3 4 5 6 7

Output: 7

Input:
100
5 5 5 5 5 5 5

Output: 6

Input:
4
1 0 0 0 0 0 1

Output: 7

Input:
2
0 0 0 0 0 0 1

Output: 7

Input:
7
0 0 0 0 0 0 7

Output: 7

Input:
7
2 1 1 1 1 1 0

Output: 6

Input:
2
0 0 1 1 0 0 0

Output: 4

Input:
6
1 1 1 1 1 1 0

Output: 6

Input:
5
1 1 1 0 0 1 1

Output: 7

Input:
100
10 20 30 10 10 10 10

Output: 7

Input:
1
0 0 0 1 0 0 0

Output: 4

Input:
70
10 10 10 10 10 10 10

Output: 7

Input:
22
1 2 3 4 5 6 10

Output: 7

Input:
5
0 0 0 1 0 0 0

Output: 4

Input:
2
0 0 0 1 0 0 0

Output: 4

Input:
6
1 0 0 0 0 0 2

Output: 7

Input:
10
1 2 2 1 2 1 1

Output: 7

Input:
5
0 0 0 0 0 0 10

Output: 7

Input:
4
0 1 1 0 0 0 0

Output: 3

Input:
100
0 0 0 0 0 1 0

Output: 6


The first line contains three integers n, R and r (1 ≤ n ≤ 100, 1 ≤ r, R ≤ 1000) — the number of plates, the radius of the table and the plates' radius.

NoteThe possible arrangement of the plates for the first sample is:

Print "YES" (without the quotes) if it is possible to place n plates on the table by the rules given above. If it is impossible, print "NO". Remember, that each plate must touch the edge of the table.

Gerald is setting the New Year table. The table has the form of a circle; its radius equals R. Gerald invited many guests and is concerned whether the table has enough space for plates for all those guests. Consider all plates to be round and have the same radii that equal r. Each plate must be completely inside the table and must touch the edge of the table. Of course, the plates must not intersect, but they can touch each other. Help Gerald determine whether the table is large enough for n plates.

Input: 4 10 4

Output: YES

Input: 5 10 4

Output: NO

Input: 1 10 10

Output: YES

Input: 3 10 20

Output: NO

Input: 2 20 11

Output: NO

Input: 6 9 3

Output: YES

Input: 1 999 1000

Output: NO

Input: 1 1000 999

Output: YES

Input: 2 1000 500

Output: YES

Input: 2 1000 499

Output: YES

Input: 10 1000 236

Output: YES

Input: 10 1000 237

Output: NO

Input: 6 999 334

Output: NO

Input: 100 1000 1

Output: YES

Input: 100 1000 50

Output: NO

Input: 13 927 179

Output: YES

Input: 13 145 28

Output: NO

Input: 37 307 24

Output: YES

Input: 37 857 67

Output: NO

Input: 100 821 25

Output: YES

Input: 100 197 6

Output: NO

Input: 93 704 23

Output: YES

Input: 93 857 28

Output: NO

Input: 85 870 31

Output: YES

Input: 85 449 16

Output: NO

Input: 29 10 1

Output: NO

Input: 3 10 5

Output: NO

Input: 2 4 2

Output: YES

Input: 2 10 5

Output: YES

Input: 4 2 1

Output: NO

Input: 3 2 1

Output: NO

Input: 59 486 43

Output: NO

Input: 4 997 413

Output: NO

Input: 100 100 5

Output: NO

Input: 2 100 50

Output: YES

Input: 2 2 1

Output: YES

Input: 1 100 45

Output: YES

Input: 2 20 10

Output: YES

Input: 36 474 38

Output: NO

Input: 6 996 333

Output: NO

Input: 23 100 12

Output: NO

Input: 100 886 27

Output: NO

Input: 7 997 332

Output: NO

Input: 10 72 17

Output: NO

Input: 2 10 10

Output: NO


The only input line contains three integers: a, x, y, where a (1 ≤ a ≤ 100) is the side of the square, x and y ( - 106 ≤ x ≤ 106, 0 ≤ y ≤ 106) are coordinates of the stone.

Print the number of the square, inside which the stone fell. If the stone is on a border of some stone or outside the court, print "-1" without the quotes.

So nearly half of the winter is over and Maria is dreaming about summer. She's fed up with skates and sleds, she was dreaming about Hopscotch all night long. It's a very popular children's game. The game field, the court, looks as is shown in the figure (all blocks are square and are numbered from bottom to top, blocks in the same row are numbered from left to right). Let us describe the hopscotch with numbers that denote the number of squares in the row, staring from the lowest one: 1-1-2-1-2-1-2-(1-2)..., where then the period is repeated (1-2).  The coordinate system is defined as shown in the figure. Side of all the squares are equal and have length a.Maria is a very smart and clever girl, and she is concerned with quite serious issues: if she throws a stone into a point with coordinates (x, y), then will she hit some square? If the answer is positive, you are also required to determine the number of the square.It is believed that the stone has fallen into the square if it is located strictly inside it. In other words a stone that has fallen on the square border is not considered a to hit a square.

Input: 1 0 0

Output: -1

Input: 3 1 1

Output: 1

Input: 3 0 10

Output: 5

Input: 3 0 7

Output: -1

Input: 3 4 0

Output: -1

Input: 9 3 2

Output: 1

Input: 100 0 953748

Output: 14306

Input: 17 0 1000000

Output: 88235

Input: 17 15 99999

Output: 8824

Input: 55 -20 1000000

Output: 27272

Input: 1 154871 37516

Output: -1

Input: 1 -1 0

Output: -1

Input: 1 -1 1

Output: -1

Input: 1 0 2

Output: -1

Input: 1 0 552012

Output: -1

Input: 1 1 293372

Output: -1

Input: 1 -1 551084

Output: -1

Input: 5 -744240 145890

Output: -1

Input: 5 -4 2

Output: -1

Input: 5 -5 7

Output: -1

Input: 5 -3 14

Output: 3

Input: 5 0 660386

Output: 198116

Input: 5 5 918098

Output: -1

Input: 5 -5 659458

Output: -1

Input: 10 -227776 821899

Output: -1

Input: 10 -5 1

Output: -1

Input: 10 -3 11

Output: 2

Input: 10 -2 23

Output: 3

Input: 10 0 336395

Output: 50459

Input: 10 10 77755

Output: -1

Input: 10 -10 335467

Output: -1

Input: 100 350728 439252

Output: -1

Input: 100 9 64

Output: 1

Input: 100 -9 176

Output: 2

Input: 100 -28 236

Output: 3

Input: 100 100 211460

Output: -1

Input: 100 -100 952820

Output: -1

Input: 7 -3 0

Output: -1

Input: 8 4 3

Output: -1

Input: 17 0 99999

Output: -1

Input: 17 -2 99999

Output: 8823

Input: 55 -55 1000000

Output: -1

Input: 92 19 920000

Output: -1

Input: 58 50 195112

Output: -1

Input: 2 -3 0

Output: -1

Input: 2 -3 1

Output: -1

Input: 2 -3 2

Output: -1

Input: 2 -3 3

Output: -1

Input: 2 -3 4

Output: -1

Input: 2 -3 5

Output: -1

Input: 2 -3 6

Output: -1

Input: 2 -3 7

Output: -1

Input: 2 -2 0

Output: -1

Input: 2 -2 1

Output: -1

Input: 2 -2 2

Output: -1

Input: 2 -2 3

Output: -1

Input: 2 -2 4

Output: -1

Input: 2 -2 5

Output: -1

Input: 2 -2 6

Output: -1

Input: 2 -2 7

Output: -1

Input: 2 -1 0

Output: -1

Input: 2 -1 1

Output: -1

Input: 2 -1 2

Output: -1

Input: 2 -1 3

Output: -1

Input: 2 -1 4

Output: -1

Input: 2 -1 5

Output: 3

Input: 2 -1 6

Output: -1

Input: 2 -1 7

Output: -1

Input: 2 0 0

Output: -1

Input: 2 0 1

Output: 1

Input: 2 0 2

Output: -1

Input: 2 0 3

Output: 2

Input: 2 0 4

Output: -1

Input: 2 0 5

Output: -1

Input: 2 0 6

Output: -1

Input: 2 0 7

Output: 5

Input: 2 1 0

Output: -1

Input: 2 1 1

Output: -1

Input: 2 1 2

Output: -1

Input: 2 1 3

Output: -1

Input: 2 1 4

Output: -1

Input: 2 1 5

Output: 4

Input: 2 1 6

Output: -1

Input: 2 1 7

Output: -1

Input: 2 2 0

Output: -1

Input: 2 2 1

Output: -1

Input: 2 2 2

Output: -1

Input: 2 2 3

Output: -1

Input: 2 2 4

Output: -1

Input: 2 2 5

Output: -1

Input: 2 2 6

Output: -1

Input: 2 2 7

Output: -1

Input: 2 3 0

Output: -1

Input: 2 3 1

Output: -1

Input: 2 3 2

Output: -1

Input: 2 3 3

Output: -1

Input: 2 3 4

Output: -1

Input: 2 3 5

Output: -1

Input: 2 3 6

Output: -1

Input: 2 3 7

Output: -1

Input: 4 2 1

Output: -1

Input: 10 1 60

Output: -1

Input: 3 1 9

Output: -1

Input: 3 -1 7

Output: 3

Input: 100 50 1

Output: -1

Input: 4 2 15

Output: -1

Input: 3 10 8

Output: -1

Input: 10 11 21

Output: -1

Input: 3 -2 7

Output: 3

Input: 50 -1 10

Output: 1

Input: 3 4 100

Output: -1

Input: 49 28 27

Output: -1

Input: 10 9 5

Output: -1

Input: 10 5 35

Output: -1

Input: 4 2 3

Output: -1

Input: 4 -2 1

Output: -1

Input: 2 -10 1

Output: -1

Input: 10 7 1

Output: -1

Input: 10 5 15

Output: -1

Input: 3 10 2

Output: -1

Input: 3 10 100

Output: -1

Input: 10 5 25

Output: 4

Input: 50 1 200

Output: -1

Input: 10 6 5

Output: -1

Input: 2 100 3

Output: -1

Input: 3 6 7

Output: -1

Input: 3 100 1

Output: -1

Input: 100 50 50

Output: -1

Input: 5 1 35

Output: -1

Input: 100 25 200

Output: -1

Input: 5 -1 6

Output: 2

Input: 5 2 6

Output: 2

Input: 6 3 1

Output: -1

Input: 3 0 3

Output: -1

Input: 2 100 1

Output: -1

Input: 50 0 20

Output: 1

Input: 10 5 95

Output: -1

Input: 1 0 1

Output: -1

Input: 15 8 1546

Output: -1

Input: 10 5 31

Output: -1

Input: 1 0 3

Output: -1

Input: 100 80 50

Output: -1


The only line contains integer n from the problem's statement (1 ≤ n ≤ 109).

NoteLet's consider the first sample test. If initially Sam has a parallelepiped consisting of 32 = 2 × 4 × 4 hay blocks in his barn, then after the theft the barn has 4 = (2 - 1) × (4 - 2) × (4 - 2) hay blocks left. Thus, the thieves could have stolen 32 - 4 = 28 hay blocks. If Sam initially had a parallelepiped consisting of 45 = 5 × 3 × 3 hay blocks in his barn, then after the theft the barn has 4 = (5 - 1) × (3 - 2) × (3 - 2) hay blocks left. Thus, the thieves could have stolen 45 - 4 = 41 hay blocks. No other variants of the blocks' initial arrangement (that leave Sam with exactly 4 blocks after the theft) can permit the thieves to steal less than 28 or more than 41 blocks.

Print space-separated minimum and maximum number of hay blocks that could have been stolen by the thieves. Note that the answer to the problem can be large enough, so you must use the 64-bit integer type for calculations. Please, do not use the %lld specificator to read or write 64-bit integers in С++. It is preferred to use cin, cout streams or the %I64d specificator.

Once upon a time in the Kingdom of Far Far Away lived Sam the Farmer. Sam had a cow named Dawn and he was deeply attached to her. Sam would spend the whole summer stocking hay to feed Dawn in winter. Sam scythed hay and put it into haystack. As Sam was a bright farmer, he tried to make the process of storing hay simpler and more convenient to use. He collected the hay into cubical hay blocks of the same size. Then he stored the blocks in his barn. After a summer spent in hard toil Sam stored A·B·C hay blocks and stored them in a barn as a rectangular parallelepiped A layers high. Each layer had B rows and each row had C blocks.At the end of the autumn Sam came into the barn to admire one more time the hay he'd been stacking during this hard summer. Unfortunately, Sam was horrified to see that the hay blocks had been carelessly scattered around the barn. The place was a complete mess. As it turned out, thieves had sneaked into the barn. They completely dissembled and took away a layer of blocks from the parallelepiped's front, back, top and sides. As a result, the barn only had a parallelepiped containing (A - 1) × (B - 2) × (C - 2) hay blocks. To hide the evidence of the crime, the thieves had dissembled the parallelepiped into single 1 × 1 × 1 blocks and scattered them around the barn. After the theft Sam counted n hay blocks in the barn but he forgot numbers A, B и C.Given number n, find the minimally possible and maximally possible number of stolen hay blocks.

Output: 28 41

Output: 47 65

Output: 48 105

Output: 17 17

Output: 34 57

Output: 40 73

Output: 41 81

Output: 58 121

Output: 55 129

Output: 56 137

Output: 57 153

Output: 64 169

Output: 1499998867 2399998177

Output: 106 441

Output: 144 777

Output: 396 2793

Output: 487 5993

Output: 1840 7273

Output: 591 8217

Output: 3601 15889

Output: 1603 35785

Output: 8873 166769

Output: 17884 403849

Output: 312497 499985

Output: 140995 5168449

Output: 316416 6324969

Output: 1082167 7919233

Output: 210976 56270409

Output: 546725 61294889

Output: 8302235 62673953

Output: 19223945 361072953

Output: 445273517 712437617

Output: 15587889 794119137

Output: 1209066 1016314569

Output: 1683461 1655189993

Output: 539319577 1849095633

Output: 2122207 2058077713

Output: 290355727 2293890625

Output: 1559669027 2495470433

Output: 10714371 2659148961

Output: 78417139 3376916497

Output: 2844347 3624102041

Output: 129486993 3766885449

Output: 3045276 4076863497

Output: 253364145 4279036065

Output: 647722381 4280599537

Output: 3151876 4294967305

Output: 3301020 4586471433

Output: 3414276 4831838217

Output: 3414952 4843238409

Output: 10508698 4925735225

Output: 3574502 5027713433

Output: 634644469 5049945137

Output: 3573148 5159780361

Output: 1977822262 5274192665

Output: 3693060 5435817993

Output: 3886608 5881075209

Output: 3988228 6115295241

Output: 4036708 6227020809

Output: 4082888 6333465609

Output: 4201476 6442450953

Output: 4185636 6572966409

Output: 196667409 6848634297

Output: 4307008 6861254409

Output: 4320292 6879707145

Output: 4331048 6918912009

Output: 4388720 7057290249

Output: 4396766 7078579209

Output: 4529412 7247757321

Output: 4474050 7264857609

Output: 4511288 7351344009

Output: 4548514 7449361929

Output: 4563150 7485004809

Output: 40069269 7490839977

Output: 4614600 7610803209

Output: 4637398 7668460809

Output: 4685478 7783776009

Output: 4707050 7841433609

Output: 4725040 7887559689

Output: 4752650 7956748809

Output: 1000183267 7999145825

Output: 1000724227 7999147105

Output: 1000161721 7999241297

Output: 1000368197 7999543601

Output: 1022096687 7999972673

Output: 4999998997 7999998385

Output: 4999999427 7999999073

Output: 4999999477 7999999153

Output: 4999999657 7999999441

Output: 4999999697 7999999505

Output: 1059701759 7999999937

Output: 129518035 7999999945

Output: 490196227 7999999953

Output: 928571477 7999999961

Output: 4924975 7999999969

Output: 1000000044 7999999977

Output: 15309947 7999999985

Output: 504345691 7999999993

Output: 52392027 8000000001

Output: 4770064 8000000009


The single line contains space-separated integers n and m (1 ≤ n, m ≤ 1000) that represent the size of the drill exercise field.

NoteIn the first sample test Sir Lancelot can place his 4 soldiers on the 2 × 4 court as follows (the soldiers' locations are marked with gray circles on the scheme):  In the second sample test he can place 6 soldiers on the 3 × 4 site in the following manner:

Print the desired maximum number of warriors.

Once upon a time in the Kingdom of Far Far Away lived Sir Lancelot, the chief Royal General. He was very proud of his men and he liked to invite the King to come and watch drill exercises which demonstrated the fighting techniques and tactics of the squad he was in charge of. But time went by and one day Sir Lancelot had a major argument with the Fairy Godmother (there were rumors that the argument occurred after the general spoke badly of the Godmother's flying techniques. That seemed to hurt the Fairy Godmother very deeply). As the result of the argument, the Godmother put a rather strange curse upon the general. It sounded all complicated and quite harmless: "If the squared distance between some two soldiers equals to 5, then those soldiers will conflict with each other!"The drill exercises are held on a rectangular n × m field, split into nm square 1 × 1 segments for each soldier. Thus, the square of the distance between the soldiers that stand on squares (x1, y1) and (x2, y2) equals exactly (x1 - x2)2 + (y1 - y2)2. Now not all nm squad soldiers can participate in the drill exercises as it was before the Fairy Godmother's curse. Unless, of course, the general wants the soldiers to fight with each other or even worse... For example, if he puts a soldier in the square (2, 2), then he cannot put soldiers in the squares (1, 4), (3, 4), (4, 1) and (4, 3) — each of them will conflict with the soldier in the square (2, 2).Your task is to help the general. You are given the size of the drill exercise field. You are asked to calculate the maximum number of soldiers that can be simultaneously positioned on this field, so that no two soldiers fall under the Fairy Godmother's curse.

Input: 2 4

Output: 4

Input: 3 4

Output: 6

Input: 4 4

Output: 8

Input: 4 3

Output: 6

Input: 4 2

Output: 4

Input: 1 1

Output: 1

Input: 3 5

Output: 8

Input: 5 3

Output: 8

Input: 506 44

Output: 11132

Input: 555 349

Output: 96848

Input: 757 210

Output: 79485

Input: 419 503

Output: 105379

Input: 515 19

Output: 4893

Input: 204 718

Output: 73236

Input: 862 330

Output: 142230

Input: 494 982

Output: 242554

Input: 967 4

Output: 1934

Input: 449 838

Output: 188131

Input: 635 458

Output: 145415

Input: 156 911

Output: 71058

Input: 409 295

Output: 60328

Input: 755 458

Output: 172895

Input: 936 759

Output: 355212

Input: 771 460

Output: 177330

Input: 563 802

Output: 225763

Input: 953 874

Output: 416461

Input: 354 720

Output: 127440

Input: 915 72

Output: 32940

Input: 860 762

Output: 327660

Input: 396 387

Output: 76626

Input: 675 710

Output: 239625

Input: 728 174

Output: 63336

Input: 883 312

Output: 137748

Input: 701 600

Output: 210300

Input: 824 729

Output: 300348

Input: 886 80

Output: 35440

Input: 762 742

Output: 282702

Input: 781 586

Output: 228833

Input: 44 343

Output: 7546

Input: 847 237

Output: 100370

Input: 169 291

Output: 24590

Input: 961 61

Output: 29311

Input: 695 305

Output: 105988

Input: 854 503

Output: 214781

Input: 1 744

Output: 744

Input: 1 383

Output: 383

Input: 1 166

Output: 166

Input: 557 1

Output: 557

Input: 650 1

Output: 650

Input: 1 995

Output: 995

Input: 1 865

Output: 865

Input: 1 393

Output: 393

Input: 363 1

Output: 363

Input: 1 506

Output: 506

Input: 2 348

Output: 348

Input: 583 2

Output: 584

Input: 2 89

Output: 90

Input: 576 2

Output: 576

Input: 180 2

Output: 180

Input: 719 2

Output: 720

Input: 2 951

Output: 952

Input: 313 2

Output: 314

Input: 433 2

Output: 434

Input: 804 2

Output: 804

Input: 1 991

Output: 991

Input: 1 992

Output: 992

Input: 1 993

Output: 993

Input: 994 1

Output: 994

Input: 995 1

Output: 995

Input: 996 1

Output: 996

Input: 997 1

Output: 997

Input: 1 998

Output: 998

Input: 1 999

Output: 999

Input: 1 1000

Output: 1000

Input: 991 2

Output: 992

Input: 2 992

Output: 992

Input: 993 2

Output: 994

Input: 994 2

Output: 996

Input: 995 2

Output: 996

Input: 2 996

Output: 996

Input: 997 2

Output: 998

Input: 2 998

Output: 1000

Input: 2 999

Output: 1000

Input: 2 1000

Output: 1000

Input: 997 997

Output: 497005

Input: 997 998

Output: 497503

Input: 997 999

Output: 498002

Input: 997 1000

Output: 498500

Input: 998 997

Output: 497503

Input: 998 998

Output: 498002

Input: 998 999

Output: 498501

Input: 998 1000

Output: 499000

Input: 999 997

Output: 498002

Input: 999 998

Output: 498501

Input: 999 999

Output: 499001

Input: 999 1000

Output: 499500

Input: 1000 997

Output: 498500

Input: 1000 998

Output: 499000

Input: 1000 999

Output: 499500

Input: 1000 1000

Output: 500000

Input: 3 3

Output: 5

Input: 1 2

Output: 2

Input: 2 2

Output: 4


The input contains numbers written on the edges of the lock of the box. The first line contains space-separated integers r1 and r2 that define the required sums of numbers in the rows of the square. The second line contains space-separated integers c1 and c2 that define the required sums of numbers in the columns of the square. The third line contains space-separated integers d1 and d2 that define the required sums of numbers on the main and on the side diagonals of the square (1 ≤ r1, r2, c1, c2, d1, d2 ≤ 20). Correspondence between the above 6 variables and places where they are written is shown on the picture below. For more clarifications please look at the second sample test that demonstrates the example given in the problem statement.

NotePay attention to the last test from the statement: it is impossible to open the box because for that Vasilisa the Wise would need 4 identical gems containing number "5". However, Vasilisa only has one gem with each number from 1 to 9.

Print the scheme of decorating the box with stones: two lines containing two space-separated integers from 1 to 9. The numbers should be pairwise different. If there is no solution for the given lock, then print the single number "-1" (without the quotes). If there are several solutions, output any.

Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with that.The box's lock looks as follows: it contains 4 identical deepenings for gems as a 2 × 2 square, and some integer numbers are written at the lock's edge near the deepenings. The example of a lock is given on the picture below.  The box is accompanied with 9 gems. Their shapes match the deepenings' shapes and each gem contains one number from 1 to 9 (each number is written on exactly one gem). The box will only open after it is decorated with gems correctly: that is, each deepening in the lock should be filled with exactly one gem. Also, the sums of numbers in the square's rows, columns and two diagonals of the square should match the numbers written at the lock's edge. For example, the above lock will open if we fill the deepenings with gems with numbers as is shown on the picture below.  Now Vasilisa the Wise wants to define, given the numbers on the box's lock, which gems she should put in the deepenings to open the box. Help Vasilisa to solve this challenging task.

Input:
3 7
4 6
5 5

Output:
1 2
3 4

Output:
1 2
3 4

Output:
1 2
3 4

Input:
11 10
13 8
5 16

Output:
4 7
9 1

Output:
4 7
9 1

Output:
4 7
9 1

Input:
1 2
3 4
5 6

Output: -1

Input:
10 10
10 10
10 10

Output: -1

Input:
5 13
8 10
11 7

Output:
3 2
5 8

Output:
3 2
5 8

Output:
3 2
5 8

Input:
12 17
10 19
13 16

Output: -1

Input:
11 11
17 5
12 10

Output:
9 2
8 3

Output:
9 2
8 3

Output:
9 2
8 3

Input:
12 11
11 12
16 7

Output: -1

Input:
5 9
7 7
8 6

Output:
3 2
4 5

Output:
3 2
4 5

Output:
3 2
4 5

Input:
10 7
4 13
11 6

Output: -1

Input:
18 10
16 12
12 16

Output: -1

Input:
13 6
10 9
6 13

Output: -1

Input:
14 16
16 14
18 12

Output: -1

Input:
16 10
16 10
12 14

Output: -1

Input:
11 9
12 8
11 9

Output: -1

Input:
5 14
10 9
10 9

Output: -1

Input:
2 4
1 5
3 3

Output: -1

Input:
17 16
14 19
18 15

Output: -1

Input:
12 12
14 10
16 8

Output:
9 3
5 7

Output:
9 3
5 7

Output:
9 3
5 7

Input:
15 11
16 10
9 17

Output:
7 8
9 2

Output:
7 8
9 2

Output:
7 8
9 2

Input:
8 10
9 9
13 5

Output:
6 2
3 7

Output:
6 2
3 7

Output:
6 2
3 7

Input:
13 7
10 10
5 15

Output:
4 9
6 1

Output:
4 9
6 1

Output:
4 9
6 1

Input:
14 11
9 16
16 9

Output: -1

Input:
12 8
14 6
8 12

Output: -1

Input:
10 6
6 10
4 12

Output: -1

Input:
10 8
10 8
4 14

Output: -1

Input:
14 13
9 18
14 13

Output: -1

Input:
9 14
8 15
8 15

Output: -1

Input:
3 8
2 9
6 5

Output: -1

Input:
14 17
18 13
15 16

Output: -1

Input:
16 14
15 15
17 13

Output:
9 7
6 8

Output:
9 7
6 8

Output:
9 7
6 8

Input:
14 11
16 9
13 12

Output:
9 5
7 4

Output:
9 5
7 4

Output:
9 5
7 4

Input:
13 10
11 12
7 16

Output:
4 9
7 3

Output:
4 9
7 3

Output:
4 9
7 3

Input:
14 8
11 11
13 9

Output:
8 6
3 5

Output:
8 6
3 5

Output:
8 6
3 5

Input:
12 11
13 10
10 13

Output: -1

Input:
6 5
2 9
5 6

Output: -1

Input:
7 8
8 7
12 3

Output: -1

Input:
7 11
7 11
6 12

Output: -1

Input:
8 5
11 2
8 5

Output: -1

Input:
10 16
14 12
14 12

Output: -1

Input:
7 9
4 12
5 11

Output: -1

Input:
11 13
19 5
12 12

Output: -1

Input:
8 12
5 15
11 9

Output:
2 6
3 9

Output:
2 6
3 9

Output:
2 6
3 9

Input:
16 5
13 8
10 11

Output:
9 7
4 1

Output:
9 7
4 1

Output:
9 7
4 1

Input:
3 14
8 9
10 7

Output:
2 1
6 8

Output:
2 1
6 8

Output:
2 1
6 8

Input:
12 14
11 15
9 17

Output:
3 9
8 6

Output:
3 9
8 6

Output:
3 9
8 6

Input:
13 7
9 11
14 6

Output:
8 5
1 6

Output:
8 5
1 6

Output:
8 5
1 6

Input:
13 8
15 6
11 10

Output:
9 4
6 2

Output:
9 4
6 2

Output:
9 4
6 2

Input:
9 6
5 10
3 12

Output:
1 8
4 2

Output:
1 8
4 2

Output:
1 8
4 2

Input:
12 7
5 14
8 11

Output:
3 9
2 5

Output:
3 9
2 5

Output:
3 9
2 5

Input:
9 12
3 17
10 10

Output: -1

Input:
3 8
4 6
5 5

Output: -1


The first line contains an even integer n (2 ≤ n ≤ 50) — the length of the ticket number that needs to be checked. The second line contains an integer whose length equals exactly n — the ticket number. The number may contain leading zeros.

NoteIn the first sample the sum of digits in the first half does not equal the sum of digits in the second half (4 ≠ 7).In the second sample the ticket number is not the lucky number.

On the first line print "YES" if the given ticket number is lucky. Otherwise, print "NO" (without the quotes).

Petya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal record contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.Petya loves tickets very much. As we know, each ticket has a number that is a positive integer. Its length equals n (n is always even). Petya calls a ticket lucky if the ticket's number is a lucky number and the sum of digits in the first half (the sum of the first n / 2 digits) equals the sum of digits in the second half (the sum of the last n / 2 digits). Check if the given ticket is lucky.

Input:
2
47

Output: NO

Input:
4
4738

Output: NO

Input:
4
4774

Output: YES

Input:
4
4570

Output: NO

Input:
6
477477

Output: YES

Input:
6
777777

Output: YES

Input:
20
44444444444444444444

Output: YES

Input:
2
44

Output: YES

Input:
10
4745474547

Output: NO

Input:
14
77770004444444

Output: NO

Input:
10
4747777744

Output: YES

Input:
10
1234567890

Output: NO

Input:
50
44444444444444444444444444444444444444444444444444

Output: YES

Input:
50
44444444444444444444444444444444444444444444444447

Output: NO

Input:
50
74444444444444444444444444444444444444444444444444

Output: NO

Input:
50
07777777777777777777777777777777777777777777777770

Output: NO

Input:
50
77777777777777777777777777777777777777777777777777

Output: YES

Input:
50
44747747774474747747747447777447774747447477444474

Output: YES

Input:
48
447474444777444474747747744774447444747474774474

Output: YES

Input:
32
74474474777444474444747774474774

Output: YES

Input:
40
4747777444447747777447447747447474774777

Output: YES

Input:
10
4477477444

Output: YES

Input:
18
447747474447744747

Output: YES

Input:
26
44747744444774744774474447

Output: YES

Input:
50
44707747774474747747747447777447774747447477444474

Output: NO

Input:
40
4747777444447737777447447747447474774777

Output: NO

Input:
36
764477744747444444447747747474744444

Output: NO

Input:
22
4477407474777477744447

Output: NO

Input:
32
74274474777444474444747774474774

Output: NO

Input:
16
4744447974444747

Output: NO

Input:
2
11

Output: NO

Input:
2
22

Output: NO

Input:
2
33

Output: NO

Input:
2
74

Output: NO

Input:
2
55

Output: NO

Input:
2
66

Output: NO

Input:
2
77

Output: YES

Input:
2
88

Output: NO

Input:
2
99

Output: NO

Input:
4
4004

Output: NO

Input:
14
00077774444444

Output: NO

Input:
6
004444

Output: NO

Input:
4
0044

Output: NO

Input:
14
77771114444444

Output: NO

Input:
14
44444447777000

Output: NO

Input:
6
004774

Output: NO


The input data contains integers vp, vd, t, f and c, one per line (1 ≤ vp, vd ≤ 100, 1 ≤ t, f ≤ 10, 1 ≤ c ≤ 1000).

NoteIn the first case one hour after the escape the dragon will discover it, and the princess will be 1 mile away from the cave. In two hours the dragon will overtake the princess 2 miles away from the cave, and she will need to drop the first bijou. Return to the cave and fixing the treasury will take the dragon two more hours; meanwhile the princess will be 4 miles away from the cave. Next time the dragon will overtake the princess 8 miles away from the cave, and she will need the second bijou, but after this she will reach the castle without any further trouble.The second case is similar to the first one, but the second time the dragon overtakes the princess when she has reached the castle, and she won't need the second bijou.

Output the minimal number of bijous required for the escape to succeed.

The princess is going to escape the dragon's cave, and she needs to plan it carefully.The princess runs at vp miles per hour, and the dragon flies at vd miles per hour. The dragon will discover the escape after t hours and will chase the princess immediately. Looks like there's no chance to success, but the princess noticed that the dragon is very greedy and not too smart. To delay him, the princess decides to borrow a couple of bijous from his treasury. Once the dragon overtakes the princess, she will drop one bijou to distract him. In this case he will stop, pick up the item, return to the cave and spend f hours to straighten the things out in the treasury. Only after this will he resume the chase again from the very beginning.The princess is going to run on the straight. The distance between the cave and the king's castle she's aiming for is c miles. How many bijous will she need to take from the treasury to be able to reach the castle? If the dragon overtakes the princess at exactly the same moment she has reached the castle, we assume that she reached the castle before the dragon reached her, and doesn't need an extra bijou to hold him off.

Input:
1
2
1
1
10

Output: 2

Input:
1
2
1
1
8

Output: 1

Input:
5
8
1
2
100

Output: 2

Input:
2
100
10
10
739

Output: 22

Input:
17
99
2
3
293

Output: 3

Input:
5
5
1
1
1000

Output: 0

Input:
100
99
1
1
1000

Output: 0

Input:
1
100
1
1
1

Output: 0

Input:
1
100
1
1
1000

Output: 152

Input:
10
1
10
1
11

Output: 0

Input:
98
94
4
3
437

Output: 0

Input:
58
4
1
10
392

Output: 0

Input:
74
11
8
7
835

Output: 0

Input:
86
21
7
2
982

Output: 0

Input:
2
27
4
9
937

Output: 15

Input:
62
89
8
1
83

Output: 0

Input:
78
7
7
6
38

Output: 0

Input:
94
14
2
3
481

Output: 0

Input:
6
24
9
8
628

Output: 3

Input:
59
7
8
10
357

Output: 0

Input:
75
26
4
3
504

Output: 0

Input:
87
32
3
8
754

Output: 0

Input:
51
42
10
4
901

Output: 0

Input:
63
4
7
1
48

Output: 0

Input:
79
10
4
6
3

Output: 0

Input:
95
20
9
3
149

Output: 0

Input:
55
35
5
10
592

Output: 0

Input:
71
45
2
6
547

Output: 0

Input:
83
7
7
7
46

Output: 0

Input:
100
32
1
8
537

Output: 0

Input:
17
42
10
5
684

Output: 1

Input:
77
1
6
8
831

Output: 0

Input:
93
19
3
3
82

Output: 0

Input:
5
25
8
9
228

Output: 2

Input:
21
35
5
6
535

Output: 1

Input:
85
45
2
1
682

Output: 0

Input:
97
4
8
8
829

Output: 0

Input:
13
14
3
3
79

Output: 0

Input:
25
28
4
9
226

Output: 0

Input:
34
9
6
6
70

Output: 0

Input:
50
15
1
3
216

Output: 0

Input:
10
25
9
8
363

Output: 1

Input:
26
36
4
7
318

Output: 0

Input:
38
50
1
8
761

Output: 1

Input:
2
12
6
4
907

Output: 10

Input:
14
18
5
9
862

Output: 1

Input:
30
28
4
6
9

Output: 0

Input:
46
39
8
3
964

Output: 0

Input:
6
45
7
8
407

Output: 4

Input:
67
34
7
4
954

Output: 0

Input:
31
40
6
1
397

Output: 0

Input:
43
50
1
8
544

Output: 1

Input:
59
9
7
3
498

Output: 0

Input:
71
19
2
10
645

Output: 0

Input:
35
37
9
5
792

Output: 0

Input:
47
43
10
9
43

Output: 0

Input:
63
53
5
4
189

Output: 0

Input:
79
11
2
1
144

Output: 0

Input:
39
22
8
6
291

Output: 0

Input:
49
7
2
5
326

Output: 0

Input:
2
1
1
1
1000

Output: 0

Input:
100
1
1
1
1000

Output: 0

Input:
2
1
1
1
100

Output: 0

Input:
2
1
1
1
10

Output: 0

Input:
5
3
3
3
999

Output: 0


Input data contains integer numbers k, l, m, n and d, each number in a separate line (1 ≤ k, l, m, n ≤ 10, 1 ≤ d ≤ 105).

NoteIn the first case every first dragon got punched with a frying pan. Some of the dragons suffered from other reasons as well, but the pan alone would be enough.In the second case dragons 1, 7, 11, 13, 17, 19 and 23 escaped unharmed.

«One dragon. Two dragon. Three dragon», — the princess was counting. She had trouble falling asleep, and she got bored of counting lambs when she was nine.However, just counting dragons was boring as well, so she entertained herself at best she could. Tonight she imagined that all dragons were here to steal her, and she was fighting them off. Every k-th dragon got punched in the face with a frying pan. Every l-th dragon got his tail shut into the balcony door. Every m-th dragon got his paws trampled with sharp heels. Finally, she threatened every n-th dragon to call her mom, and he withdrew in panic.How many imaginary dragons suffered moral or physical damage tonight, if the princess counted a total of d dragons?

Input:
1
2
3
4
12

Output: 12

Input:
2
3
4
5
24

Output: 17

Input:
1
1
1
1
100000

Output: 100000

Input:
10
9
8
7
6

Output: 0

Input:
8
4
4
3
65437

Output: 32718

Input:
8
4
1
10
59392

Output: 59392

Input:
4
1
8
7
44835

Output: 44835

Input:
6
1
7
2
62982

Output: 62982

Input:
2
7
4
9
56937

Output: 35246

Input:
2
9
8
1
75083

Output: 75083

Input:
8
7
7
6
69038

Output: 24656

Input:
4
4
2
3
54481

Output: 36320

Input:
6
4
9
8
72628

Output: 28244

Input:
9
7
8
10
42357

Output: 16540

Input:
5
6
4
3
60504

Output: 36302

Input:
7
2
3
8
21754

Output: 15539

Input:
1
2
10
4
39901

Output: 39901

Input:
3
4
7
1
58048

Output: 58048

Input:
9
10
4
6
52003

Output: 21956

Input:
5
10
9
3
70149

Output: 32736

Input:
5
5
5
10
55592

Output: 11118

Input:
1
5
2
6
49547

Output: 49547

Input:
3
7
7
7
84046

Output: 36019

Input:
10
2
1
8
63537

Output: 63537

Input:
7
2
10
5
81684

Output: 53678

Input:
7
1
6
8
99831

Output: 99831

Input:
3
9
3
3
61082

Output: 20360

Input:
5
5
8
9
79228

Output: 29931

Input:
1
5
5
6
89535

Output: 89535

Input:
5
5
2
1
7682

Output: 7682

Input:
7
4
8
8
25829

Output: 9224

Input:
3
4
3
3
87079

Output: 43539

Input:
5
8
4
9
5226

Output: 2438

Input:
4
9
6
6
1070

Output: 415

Input:
10
10
10
10
100000

Output: 10000

Input:
1
1
1
1
1

Output: 1

Input:
10
10
10
10
1

Output: 0

Input:
10
10
1
10
10

Output: 10

Input:
10
10
1
10
100

Output: 100

Input:
2
2
2
2
1

Output: 0