Statistics claims that students sleep no more than three hours a day. But even in the world of their dreams, while they are snoring peacefully, the sense of impending doom is still upon them.A poor student is dreaming that he is sitting the mathematical analysis exam. And he is examined by the most formidable professor of all times, a three times Soviet Union Hero, a Noble Prize laureate in student expulsion, venerable Petr Palych.The poor student couldn't answer a single question. Thus, instead of a large spacious office he is going to apply for a job to thorium mines. But wait a minute! Petr Palych decided to give the student the last chance! Yes, that is possible only in dreams. So the professor began: "Once a Venusian girl and a Marsian boy met on the Earth and decided to take a walk holding hands. But the problem is the girl has al fingers on her left hand and ar fingers on the right one. The boy correspondingly has bl and br fingers. They can only feel comfortable when holding hands, when no pair of the girl's fingers will touch each other. That is, they are comfortable when between any two girl's fingers there is a boy's finger. And in addition, no three fingers of the boy should touch each other. Determine if they can hold hands so that the both were comfortable."The boy any the girl don't care who goes to the left and who goes to the right. The difference is only that if the boy goes to the left of the girl, he will take her left hand with his right one, and if he goes to the right of the girl, then it is vice versa.

Print YES or NO, that is, the answer to Petr Palych's question.

NoteThe boy and the girl don't really care who goes to the left.

The first line contains two positive integers not exceeding 100. They are the number of fingers on the Venusian girl's left and right hand correspondingly. The second line contains two integers not exceeding 100. They are the number of fingers on the Marsian boy's left and right hands correspondingly.

Input:
5 1
10 5

Output: YES

Input:
4 5
3 3

Output: YES

Input:
1 2
11 6

Output: NO

Input:
1 1
1 1

Output: YES

Input:
2 2
1 1

Output: YES

Input:
3 3
1 1

Output: NO

Input:
4 4
1 1

Output: NO

Input:
100 100
50 50

Output: NO

Input:
100 3
4 1

Output: YES

Input:
100 5
1 1

Output: NO

Input:
100 4
1 1

Output: NO

Input:
100 1
4 1

Output: YES

Input:
1 100
1 4

Output: YES

Input:
1 100
5 4

Output: YES

Input:
1 100
1 5

Output: NO

Input:
43 100
65 24

Output: NO

Input:
4 2
12 1

Output: NO

Input:
6 11
13 11

Output: YES

Input:
2 6
12 12

Output: YES

Input:
14 7
2 9

Output: NO

Input:
1 14
7 14

Output: NO

Input:
6 11
2 10

Output: YES

Input:
5 12
13 11

Output: YES

Input:
15 1
11 9

Output: NO

Input:
7 12
10 6

Output: YES

Input:
15 7
15 15

Output: YES

Input:
1 5
14 1

Output: YES

Input:
2 4
6 6

Output: YES

Input:
12 8
4 12

Output: YES

Input:
6 14
5 5

Output: YES

Input:
19 17
5 8

Output: NO

Input:
9 21
13 16

Output: YES

Input:
11 2
11 22

Output: YES

Input:
15 3
12 16

Output: YES

Input:
13 2
13 5

Output: NO

Input:
21 1
5 19

Output: NO

Input:
9 15
16 2

Output: YES

Input:
7 18
23 19

Output: YES

Input:
13 17
19 1

Output: YES

Input:
5 15
13 9

Output: YES

Input:
11 17
6 4

Output: NO

Input:
18 3
16 15

Output: NO

Input:
5 23
12 17

Output: NO

Input:
25 8
14 24

Output: YES

Input:
18 22
22 19

Output: YES

Input:
2 25
8 24

Output: NO

Input:
7 25
18 15

Output: YES

Input:
8 22
2 3

Output: NO

Input:
25 9
16 12

Output: YES

Input:
19 4
25 17

Output: NO

Input:
24 43
96 39

Output: YES

Input:
13 23
19 63

Output: NO

Input:
93 12
87 54

Output: NO

Input:
94 35
53 79

Output: YES

Input:
65 8
73 25

Output: NO

Input:
25 14
19 91

Output: YES

Input:
58 86
40 46

Output: NO

Input:
82 60
100 38

Output: YES

Input:
36 62
81 12

Output: YES

Input:
30 38
12 100

Output: NO


The "Bulls and Cows" game needs two people to play. The thinker thinks of a number and the guesser tries to guess it.The thinker thinks of a four-digit number in the decimal system. All the digits in the number are different and the number may have a leading zero. It can't have more than one leading zero, because all it's digits should be different. The guesser tries to guess the number. He makes a series of guesses, trying experimental numbers and receives answers from the first person in the format "x bulls y cows". x represents the number of digits in the experimental number that occupy the same positions as in the sought number. y represents the number of digits of the experimental number that present in the sought number, but occupy different positions. Naturally, the experimental numbers, as well as the sought number, are represented by four-digit numbers where all digits are different and a leading zero can be present.For example, let's suppose that the thinker thought of the number 0123. Then the guessers' experimental number 1263 will receive a reply "1 bull 2 cows" (3 occupies the same positions in both numbers and 1 and 2 are present in both numbers but they occupy different positions). Also, the answer to number 8103 will be "2 bulls 1 cow" (analogically, 1 and 3 occupy the same positions and 0 occupies a different one). When the guesser is answered "4 bulls 0 cows", the game is over.Now the guesser has already made several guesses and wants to know whether his next guess can possibly be the last one.

If the input data is enough to determine the sought number, print the number with four digits on a single line. If it has less than four digits, add leading zero. If the data is not enough, print "Need more data" without the quotes. If the thinker happens to have made a mistake in his replies, print "Incorrect data" without the quotes.

The first input line contains an integer n (1 ≤ n ≤ 10) which represents the number of already made guesses. Then follow n lines in the form of "ai bi ci", where ai is the i-th experimental number, bi is the number of bulls, ci is the number of cows (1 ≤ i ≤ n, 0 ≤ bi, ci, bi + ci ≤ 4). The experimental numbers are correct, i.e., each of them contains exactly four digits, in each of them all the four digits are different, and there can be a leading zero. All the experimental numbers are different. As the guesser hasn't guessed the number yet, the answer "4 bulls 0 cows" is not present.

Input:
2
1263 1 2
8103 2 1

Output: Need more data

Input:
2
1234 2 2
1256 0 2

Output: 2134

Input:
2
0123 1 1
4567 1 2

Output: Incorrect data

Input:
1
1234 0 0

Output: Need more data

Input:
4
4789 1 0
7189 1 0
7829 1 0
7893 1 0

Output: 4123

Input:
4
1789 1 0
7198 1 0
9817 1 0
8971 1 0

Output: Incorrect data

Input:
6
1234 3 0
1235 3 0
1236 3 0
1237 3 0
1238 3 0
1239 3 0

Output: 1230

Input:
3
0123 0 4
1230 0 4
3012 0 4

Output: 2301

Input:
1
0714 1 1

Output: Need more data

Input:
2
0159 1 0
0153 1 0

Output: Need more data

Input:
3
9703 3 0
0925 0 2
3059 0 3

Output: Need more data

Input:
4
1689 0 1
0159 0 2
4326 0 1
9048 0 2

Output: Need more data

Input:
5
9084 1 0
4615 0 1
0826 0 2
1275 0 3
5631 0 1

Output: Need more data

Input:
6
1586 0 2
6105 1 1
5382 0 1
8164 0 2
0647 0 1
6059 1 1

Output: Need more data

Input:
7
7401 0 2
1524 0 0
1495 0 0
9230 0 2
9874 1 0
9574 1 0
4693 1 1

Output: 6073

Input:
8
7954 0 1
5638 0 1
8204 0 2
8293 1 1
3598 0 1
0894 0 1
6324 1 2
0572 0 1

Output: Need more data

Input:
9
8742 0 1
5183 1 1
6149 1 0
3568 0 2
9258 1 2
5193 1 2
7403 0 1
9124 0 2
3058 0 2

Output: 5239

Input:
10
7098 2 1
7693 1 1
6428 0 2
5209 0 2
1683 0 2
0432 0 1
5697 1 1
2437 0 0
4593 1 0
1784 0 1

Output: 8096

Input:
10
8795 0 3
4971 1 1
5032 0 1
5479 0 3
2501 0 1
9052 1 0
3649 0 1
1927 1 0
9173 0 1
8014 0 2

Output: 4857

Input:
10
0459 2 0
2371 0 1
5209 2 1
1306 0 0
0213 1 0
4173 0 0
5076 0 1
9674 0 1
2894 0 3
3527 0 2

Output: 8259

Input:
10
0132 0 1
6801 0 1
8749 1 1
8036 0 0
7384 0 2
8594 1 1
9307 1 0
7390 0 1
6127 1 1
0381 0 1

Output: 1547

Input:
10
9360 0 1
5208 0 2
7861 1 0
8916 0 1
5937 1 1
7082 0 1
3402 0 2
7230 1 0
1794 0 1
8293 0 2

Output: 4835

Input:
2
3794 2 2
8647 0 4

Output: Incorrect data

Input:
2
9726 3 1
6583 1 1

Output: Incorrect data

Input:
3
6093 3 0
7902 2 0
2305 2 1

Output: Incorrect data

Input:
3
6108 0 3
4975 1 1
0981 1 2

Output: Incorrect data

Input:
4
7153 2 1
5810 1 0
8439 0 2
2794 1 3

Output: Incorrect data

Input:
4
4259 1 3
1985 0 3
5263 2 2
5703 3 1

Output: Incorrect data

Input:
5
9784 3 0
2657 0 3
7536 1 0
0762 1 3
2014 1 1

Output: Incorrect data

Input:
5
2746 0 3
1509 3 0
4135 2 0
7536 0 4
1825 3 0

Output: Incorrect data

Input:
6
5132 1 0
3085 3 0
0523 1 3
6912 3 0
7406 2 1
3179 2 1

Output: Incorrect data

Input:
6
1034 3 0
0514 2 2
1092 2 2
0814 0 4
9182 2 0
9534 0 0

Output: Incorrect data

Input:
7
9230 3 1
7401 3 1
6073 0 0
1495 0 0
9574 2 0
4693 2 2
1524 1 2

Output: Incorrect data

Input:
4
0789 1 0
7189 1 0
7829 1 0
7893 1 0

Output: 0123

Input:
1
1234 3 1

Output: Incorrect data

Input:
2
1234 0 0
5678 0 0

Output: Incorrect data

Input:
2
1340 0 0
2435 0 0

Output: Need more data

Input:
3
1024 0 1
5678 3 0
1542 0 0

Output: 0678

Input:
3
1234 0 4
2413 0 4
4123 0 4

Output: Incorrect data

Input:
5
0123 0 1
4567 0 1
8901 0 1
6789 0 1
2345 0 1

Output: Incorrect data

Input:
1
1234 2 2

Output: Need more data

Input:
2
1234 2 2
2134 2 2

Output: Incorrect data

Input:
3
6789 0 2
1234 0 2
3467 0 0

Output: Need more data

Input:
3
6789 0 2
1234 2 0
3467 0 0

Output: 1298

Input:
4
0123 1 0
0342 1 0
5678 2 0
2981 0 1

Output: 0679

Input:
3
1234 3 0
5678 0 0
1239 3 0

Output: 1230

Input:
6
3102 3 0
4102 3 0
5102 3 0
6102 3 0
7102 3 0
8102 3 0

Output: 9102

Input:
4
0123 1 3
3012 1 3
2301 2 2
1230 0 4

Output: Incorrect data

Input:
10
0231 2 2
3021 2 2
2301 2 2
0451 2 2
5041 2 2
4501 2 2
0671 2 2
7061 2 2
8901 2 2
0891 2 2

Output: Incorrect data

Input:
8
1023 2 2
1032 2 2
1045 2 2
1054 2 2
1067 2 2
1076 2 2
1089 2 2
1098 2 2

Output: Incorrect data

Input:
2
5678 1 3
5432 1 3

Output: Incorrect data

Input:
2
2034 2 2
2056 0 2

Output: 0234

Input:
6
0132 2 2
0321 2 2
3120 2 2
0213 2 2
2103 2 2
1023 2 2

Output: 0123

Input:
3
0235 3 0
0236 3 0
7894 1 0

Output: 0234

Input:
2
1234 3 1
1253 3 1

Output: Incorrect data

Input:
5
3210 0 4
0789 1 0
7189 1 0
7829 1 0
7893 1 0

Output: 0123


Karlsson has visited Lillebror again. They found a box of chocolates and a big whipped cream cake at Lillebror's place. Karlsson immediately suggested to divide the sweets fairly between Lillebror and himself. Specifically, to play together a game he has just invented with the chocolates. The winner will get the cake as a reward.The box of chocolates has the form of a hexagon. It contains 19 cells for the chocolates, some of which contain a chocolate. The players move in turns. During one move it is allowed to eat one or several chocolates that lay in the neighboring cells on one line, parallel to one of the box's sides. The picture below shows the examples of allowed moves and of an unacceptable one. The player who cannot make a move loses.  Karlsson makes the first move as he is Lillebror's guest and not vice versa. The players play optimally. Determine who will get the cake.

If Karlsson gets the cake, print "Karlsson" (without the quotes), otherwise print "Lillebror" (yet again without the quotes).

The input data contains 5 lines, containing 19 words consisting of one symbol. The word "O" means that the cell contains a chocolate and a "." stands for an empty cell. It is guaranteed that the box contains at least one chocolate. See the examples for better understanding.

Input:
  . . .
 . . O .
. . O O .
 . . . .
  . . .

Output: Lillebror

Input:
  . . .
 . . . O
. . . O .
 O . O .
  . O .

Output: Karlsson

Input:
  . . .
 . . . .
. . . . .
 . . O .
  . . .

Output: Karlsson

Input:
  . . .
 . . . .
. . . . .
 O . . .
  . . O

Output: Lillebror

Input:
  . . .
 . O . .
. . . O .
 . O . .
  . . .

Output: Karlsson

Input:
  . O O
 . . O .
. . . . .
 . . . .
  . . .

Output: Lillebror

Input:
  . . O
 O . O .
. . O . .
 . O . .
  O . .

Output: Karlsson

Input:
  . . .
 . . O .
. O . O .
 O . . .
  . . .

Output: Lillebror

Input:
  O O .
 O O . .
. . . . .
 . . . .
  . O .

Output: Lillebror

Input:
  . O O
 . O . O
. O . . .
 . . . .
  . . .

Output: Karlsson

Input:
  . O O
 . O . O
. . . . .
 . . . .
  . . O

Output: Lillebror

Input:
  O . .
 . O O O
. O . . .
 . . . .
  . . .

Output: Karlsson

Input:
  . . .
 O . . O
. . O . .
 . . O .
  . O .

Output: Karlsson

Input:
  . . .
 . O . .
. O O . .
 . . O .
  . O .

Output: Karlsson

Input:
  . . O
 . . . O
. . . O .
 . . O .
  . O .

Output: Karlsson

Input:
  . . .
 . . . .
O . O . .
 O O . .
  O . .

Output: Lillebror

Input:
  . . .
 . . . .
. O . O .
 . O O .
  O . .

Output: Lillebror

Input:
  O . .
 O O . .
. . . . .
 O . O .
  . O .

Output: Karlsson

Input:
  . . .
 . . O O
. . O . O
 . . O .
  . O .

Output: Karlsson

Input:
  . . O
 . O . O
. . O O .
 . . O .
  . . .

Output: Karlsson

Input:
  . . O
 O . O O
O O . . .
 . . . .
  . . .

Output: Lillebror

Input:
  . . .
 . O O .
O . . O .
 . . . O
  . . O

Output: Lillebror

Input:
  . . .
 . . . O
. . . O O
 . . O O
  . O O

Output: Karlsson

Input:
  . . .
 O . . O
. O . O .
 . O O .
  . O .

Output: Lillebror

Input:
  . O .
 . . O .
. O O . .
 O . O .
  . O .

Output: Lillebror

Input:
  O . O
 . . . .
O . O . O
 . . . .
  O . O

Output: Karlsson

Input:
  . . .
 . O O O
. O O . .
 O . . .
  O O .

Output: Karlsson

Input:
  . O O
 O O . O
O O . O .
 . . . .
  . . .

Output: Lillebror

Input:
  . O O
 . O O O
. . O O O
 . . . .
  . . .

Output: Lillebror

Input:
  . . .
 O O O .
O O . O .
 O . O .
  . O .

Output: Karlsson

Input:
  O O O
 . O . O
O O O O .
 . . . .
  . . .

Output: Lillebror

Input:
  . O O
 O . O O
O O . . .
 . . . .
  O O O

Output: Karlsson

Input:
  O . O
 O . O .
O . O . .
 O O . .
  O O O

Output: Karlsson

Input:
  . O O
 . O O O
. . O . .
 O O . .
  O O O

Output: Karlsson

Input:
  . O O
 O O O O
O . O O .
 O O . .
  . . .

Output: Lillebror

Input:
  . O .
 O . . .
O O O O .
 O O O O
  . . O

Output: Lillebror

Input:
  O . O
 . O O O
. . . . O
 O O O O
  . . O

Output: Lillebror

Input:
  . . O
 . O O .
O . O . O
 O O O O
  . . O

Output: Lillebror

Input:
  . . .
 O O O .
. O O O .
 O . O O
  O O O

Output: Karlsson

Input:
  O O O
 . O . O
O O O O .
 . . O .
  O . O

Output: Karlsson

Input:
  O O O
 O O . O
O O . O .
 . . O .
  O . O

Output: Karlsson

Input:
  O O O
 O O O O
O . . . O
 O . . O
  O . .

Output: Karlsson

Input:
  O O O
 O O O O
. O O O .
 . O O .
  . . .

Output: Lillebror

Input:
  O . O
 O O O O
O O . O O
 . O O .
  . . .

Output: Lillebror

Input:
  O O O
 O . . O
O O O O O
 O . . .
  O . .

Output: Lillebror

Input:
  O O O
 . O O .
O O . O O
 O . O .
  O . .

Output: Lillebror

Input:
  O O O
 O . . O
. O O O .
 . . . O
  O O O

Output: Lillebror

Input:
  O O O
 O . . O
O . . . O
 O . . O
  O O O

Output: Lillebror

Input:
  O O O
 O O O O
. O . O O
 O . . .
  O O .

Output: Karlsson

Input:
  O O O
 O O O O
O O O O .
 . . . .
  O O .

Output: Karlsson

Input:
  . . .
 . O O O
O O O O O
 O O O O
  . O .

Output: Karlsson

Input:
  O O O
 . O O O
O . . . O
 O O . O
  . O O

Output: Lillebror

Input:
  O . O
 O O O .
. O O O .
 . O O .
  O O O

Output: Lillebror

Input:
  O O O
 O O O O
. . O . .
 O . . O
  O O O

Output: Lillebror

Input:
  O O O
 O . O .
. . . O O
 O O O O
  O O O

Output: Karlsson

Input:
  O O .
 O . O .
O O O O O
 O O O O
  . . O

Output: Karlsson

Input:
  O O O
 O O O O
O O O O .
 O O O .
  . . .

Output: Karlsson

Input:
  . O O
 O O O O
O O O O O
 O O O .
  . . .

Output: Lillebror

Input:
  O . O
 O O O O
. O . O O
 O O . .
  O O O

Output: Lillebror

Input:
  O O O
 O . O .
O . . O O
 O . O O
  O O O

Output: Lillebror

Input:
  . O .
 O O . O
O . O O O
 O O O O
  O O O

Output: Karlsson

Input:
  O O O
 O O . O
O . O O O
 O . O O
  O O .

Output: Karlsson

Input:
  O O O
 O O . O
. O . O O
 O O . O
  O O O

Output: Lillebror

Input:
  . O O
 O . O O
O O . O O
 . O O O
  O O O

Output: Lillebror

Input:
  O O O
 O O . O
O . O O O
 O O O O
  . O O

Output: Karlsson

Input:
  O O O
 O O O O
O O . O O
 O . O O
  O O .

Output: Karlsson

Input:
  O O O
 O O O O
O O O O O
 O O O O
  . . .

Output: Lillebror

Input:
  O O O
 O O . O
O O . O O
 O . O O
  O O O

Output: Lillebror

Input:
  O O O
 O O O O
O . O O .
 . O O O
  O O O

Output: Lillebror

Input:
  O . O
 O O O O
O O O O O
 . O O .
  O O O

Output: Lillebror

Input:
  O O O
 O . O O
O O O . O
 O O O O
  O O O

Output: Karlsson

Input:
  O O O
 O O O .
O O O O O
 O O O O
  . O O

Output: Karlsson

Input:
  O O O
 O O O .
O O O O O
 O O O O
  O O O

Output: Karlsson

Input:
  O O O
 O O O O
O O O O O
 O O O O
  . O O

Output: Karlsson

Input:
  O O O
 O O O O
O O O O O
 O . O O
  O O O

Output: Karlsson

Input:
  O O O
 O O O O
O O . O O
 O O O O
  O O O

Output: Lillebror

Input:
  O O O
 O O O O
O O O O O
 O O O O
  O O O

Output: Karlsson

Input:
  . . .
 O . . O
. . . . .
 O . . O
  O O O

Output: Karlsson

Input:
  . O O
 O O . O
O . O O .
 O O . O
  . O O

Output: Karlsson

Input:
  . O O
 . O . .
O . O O .
 O O . O
  . . O

Output: Karlsson


A long time ago (probably even in the first book), Nicholas Flamel, a great alchemist and the creator of the Philosopher's Stone, taught Harry Potter three useful spells. The first one allows you to convert a grams of sand into b grams of lead, the second one allows you to convert c grams of lead into d grams of gold and third one allows you to convert e grams of gold into f grams of sand. When Harry told his friends about these spells, Ron Weasley was amazed. After all, if they succeed in turning sand into lead, lead into gold, and then turning part of the gold into sand again and so on, then it will be possible to start with a small amount of sand and get huge amounts of gold! Even an infinite amount of gold! Hermione Granger, by contrast, was skeptical about that idea. She argues that according to the law of conservation of matter getting an infinite amount of matter, even using magic, is impossible. On the contrary, the amount of matter may even decrease during transformation, being converted to magical energy. Though Hermione's theory seems convincing, Ron won't believe her. As far as Ron is concerned, Hermione made up her law of conservation of matter to stop Harry and Ron wasting their time with this nonsense, and to make them go and do homework instead. That's why Ron has already collected a certain amount of sand for the experiments. A quarrel between the friends seems unavoidable...Help Harry to determine which one of his friends is right, and avoid the quarrel after all. To do this you have to figure out whether it is possible to get the amount of gold greater than any preassigned number from some finite amount of sand.

Print "Ron", if it is possible to get an infinitely large amount of gold having a certain finite amount of sand (and not having any gold and lead at all), i.e., Ron is right. Otherwise, print "Hermione".

NoteConsider the first sample. Let's start with the 500 grams of sand. Apply the first spell 5 times and turn the sand into 1000 grams of lead. Then apply the second spell 4 times to get 600 grams of gold. Let’s take 400 grams from the resulting amount of gold turn them back into sand. We get 500 grams of sand and 200 grams of gold. If we apply the same operations to 500 grams of sand again, we can get extra 200 grams of gold every time. Thus, you can get 200, 400, 600 etc. grams of gold, i.e., starting with a finite amount of sand (500 grams), you can get the amount of gold which is greater than any preassigned number.In the forth sample it is impossible to get sand, or lead, or gold, applying the spells.In the fifth sample an infinitely large amount of gold can be obtained by using only the second spell, which allows you to receive 1 gram of gold out of nothing. Note that if such a second spell is available, then the first and the third one do not affect the answer at all.The seventh sample is more interesting. We can also start with a zero amount of sand there. With the aid of the third spell you can get sand out of nothing. We get 10000 grams of sand in this manner. Let's get 100 grams of lead using the first spell 100 times. Then make 1 gram of gold from them. We managed to receive 1 gram of gold, starting with a zero amount of sand! Clearly, in this manner you can get an infinitely large amount of gold.

The first line contains 6 integers a, b, c, d, e, f (0 ≤ a, b, c, d, e, f ≤ 1000).

Ron Hermione Hermione Hermione Ron Hermione Ron

Input: 100 200 250 150 200 250

Output: Ron

Input: 100 50 50 200 200 100

Output: Hermione

Input: 100 10 200 20 300 30

Output: Hermione

Input: 0 0 0 0 0 0

Output: Hermione

Input: 1 1 0 1 1 1

Output: Ron

Input: 1 0 1 2 1 2

Output: Hermione

Input: 100 1 100 1 0 1

Output: Ron

Input: 1 1 2 2 1 1

Output: Hermione

Input: 4 4 1 3 1 4

Output: Ron

Input: 3 3 2 1 4 4

Output: Hermione

Input: 5 1 2 9 1 10

Output: Ron

Input: 63 65 21 41 95 23

Output: Hermione

Input: 913 0 0 0 0 0

Output: Hermione

Input: 0 333 0 0 0 0

Output: Hermione

Input: 842 538 0 0 0 0

Output: Hermione

Input: 0 0 536 0 0 0

Output: Hermione

Input: 324 0 495 0 0 0

Output: Hermione

Input: 0 407 227 0 0 0

Output: Hermione

Input: 635 63 924 0 0 0

Output: Hermione

Input: 0 0 0 493 0 0

Output: Ron

Input: 414 0 0 564 0 0

Output: Ron

Input: 0 143 0 895 0 0

Output: Ron

Input: 276 264 0 875 0 0

Output: Ron

Input: 0 0 532 186 0 0

Output: Hermione

Input: 510 0 692 825 0 0

Output: Hermione

Input: 0 777 910 46 0 0

Output: Ron

Input: 754 329 959 618 0 0

Output: Hermione

Input: 0 0 0 0 416 0

Output: Hermione

Input: 320 0 0 0 526 0

Output: Hermione

Input: 0 149 0 0 6 0

Output: Hermione

Input: 996 13 0 0 111 0

Output: Hermione

Input: 0 0 531 0 688 0

Output: Hermione

Input: 544 0 837 0 498 0

Output: Hermione

Input: 0 54 680 0 988 0

Output: Hermione

Input: 684 986 930 0 555 0

Output: Hermione

Input: 0 0 0 511 534 0

Output: Ron

Input: 594 0 0 819 304 0

Output: Ron

Input: 0 55 0 977 230 0

Output: Ron

Input: 189 291 0 845 97 0

Output: Ron

Input: 0 0 77 302 95 0

Output: Hermione

Input: 247 0 272 232 96 0

Output: Hermione

Input: 0 883 219 748 77 0

Output: Ron

Input: 865 643 599 98 322 0

Output: Hermione

Input: 0 0 0 0 0 699

Output: Hermione

Input: 907 0 0 0 0 99

Output: Hermione

Input: 0 891 0 0 0 529

Output: Hermione

Input: 640 125 0 0 0 849

Output: Hermione

Input: 0 0 698 0 0 702

Output: Hermione

Input: 58 0 483 0 0 470

Output: Hermione

Input: 0 945 924 0 0 355

Output: Hermione

Input: 998 185 209 0 0 554

Output: Hermione

Input: 0 0 0 914 0 428

Output: Ron

Input: 412 0 0 287 0 575

Output: Ron

Input: 0 850 0 509 0 76

Output: Ron

Input: 877 318 0 478 0 782

Output: Ron

Input: 0 0 823 740 0 806

Output: Hermione

Input: 126 0 620 51 0 835

Output: Hermione

Input: 0 17 946 633 0 792

Output: Ron

Input: 296 546 493 22 0 893

Output: Ron

Input: 0 0 0 0 766 813

Output: Hermione

Input: 319 0 0 0 891 271

Output: Hermione

Input: 0 252 0 0 261 576

Output: Hermione

Input: 876 440 0 0 65 362

Output: Hermione

Input: 0 0 580 0 245 808

Output: Hermione

Input: 835 0 116 0 9 552

Output: Hermione

Input: 0 106 748 0 773 840

Output: Hermione

Input: 935 388 453 0 797 235

Output: Hermione

Input: 0 0 0 893 293 289

Output: Ron

Input: 938 0 0 682 55 725

Output: Ron

Input: 0 710 0 532 389 511

Output: Ron

Input: 617 861 0 247 920 902

Output: Ron

Input: 0 0 732 202 68 389

Output: Hermione

Input: 279 0 254 964 449 143

Output: Hermione

Input: 0 746 400 968 853 85

Output: Ron

Input: 565 846 658 828 767 734

Output: Ron

Input: 6 6 1 6 1 6

Output: Ron

Input: 3 6 1 6 3 3

Output: Ron

Input: 6 3 1 3 2 3

Output: Ron

Input: 3 6 2 2 6 3

Output: Hermione

Input: 3 2 2 1 3 3

Output: Hermione

Input: 1 1 1 6 1 1

Output: Ron

Input: 1 3 1 3 3 2

Output: Ron

Input: 6 2 6 6 2 3

Output: Hermione

Input: 2 6 2 1 2 1

Output: Hermione

Input: 2 3 2 1 6 6

Output: Hermione

Input: 2 1 2 1 6 2

Output: Hermione

Input: 6 1 3 1 3 3

Output: Hermione

Input: 1 2 2 3 2 2

Output: Ron

Input: 3 3 2 6 3 6

Output: Ron

Input: 2 1 6 1 2 6

Output: Hermione

Input: 2 3 1 3 1 6

Output: Ron

Input: 6 6 2 3 1 3

Output: Ron

Input: 6 2 6 2 3 1

Output: Hermione

Input: 1 6 6 2 3 2

Output: Ron

Input: 6 3 6 2 6 6

Output: Hermione

Input: 1 3 1 6 6 1

Output: Ron

Input: 1 1 1 1 6 6

Output: Hermione

Input: 2 6 2 2 2 3

Output: Ron

Input: 1 6 1 6 6 3

Output: Ron

Input: 6 6 3 1 3 3

Output: Hermione

Input: 2 6 6 1 2 6

Output: Ron

Input: 3 2 6 6 1 6

Output: Ron

Input: 1 2 3 2 2 3

Output: Ron

Input: 2 6 1 1 1 6

Output: Ron

Input: 1 6 3 6 6 3

Output: Ron

Input: 3 3 3 2 6 2

Output: Hermione

Input: 6 2 3 6 2 2

Output: Hermione

Input: 2 1 2 3 3 2

Output: Hermione

Input: 6 2 1 1 3 6

Output: Hermione

Input: 6 6 6 6 3 2

Output: Hermione

Input: 6 1 1 6 2 3

Output: Ron

Input: 6 1 3 6 1 2

Output: Hermione

Input: 2 1 2 6 6 1

Output: Hermione

Input: 1 2 2 3 2 1

Output: Ron

Input: 2 2 6 6 6 6

Output: Hermione

Input: 31 75 12 62 94 137

Output: Ron

Input: 236 9 184 68 345 332

Output: Hermione

Input: 362 142 107 565 329 608

Output: Ron

Input: 731 859 197 474 370 465

Output: Ron

Input: 452 577 639 31 60 673

Output: Hermione

Input: 821 294 730 941 101 530

Output: Ron

Input: 542 11 820 850 791 738

Output: Hermione

Input: 911 728 910 407 833 594

Output: Hermione

Input: 632 446 352 317 522 451

Output: Hermione


Little Petya has recently started attending a programming club. Naturally he is facing the problem of choosing a programming language. After long considerations he realized that Java is the best choice. The main argument in favor of choosing Java was that it has a very large integer data type, called BigInteger.But having attended several classes of the club, Petya realized that not all tasks require using the BigInteger type. It turned out that in some tasks it is much easier to use small data types. That's why a question arises: "Which integer type to use if one wants to store a positive integer n?"Petya knows only 5 integer types:1) byte occupies 1 byte and allows you to store numbers from  - 128 to 1272) short occupies 2 bytes and allows you to store numbers from  - 32768 to 327673) int occupies 4 bytes and allows you to store numbers from  - 2147483648 to 21474836474) long occupies 8 bytes and allows you to store numbers from  - 9223372036854775808 to 92233720368547758075) BigInteger can store any integer number, but at that it is not a primitive type, and operations with it are much slower.For all the types given above the boundary values are included in the value range.From this list, Petya wants to choose the smallest type that can store a positive integer n. Since BigInteger works much slower, Peter regards it last. Help him.

Print the first type from the list "byte, short, int, long, BigInteger", that can store the natural number n, in accordance with the data given above.

The first line contains a positive number n. It consists of no more than 100 digits and doesn't contain any leading zeros. The number n can't be represented as an empty string. Please, do not use %lld specificator to read or write 64-bit integers in C++. It is preffered to use cout (also you may use %I64d).

Output: byte

Output: short

Output: BigInteger

Output: byte

Output: byte

Output: byte

Output: short

Output: short

Output: int

Output: short

Output: short

Output: int

Output: int

Output: int

Output: int

Output: int

Output: long

Output: long

Output: long

Output: long

Output: long

Output: BigInteger

Output: BigInteger

Output: BigInteger

Output: short

Output: BigInteger

Output: BigInteger

Output: BigInteger

Output: BigInteger

Output: long

Output: BigInteger

Output: BigInteger

Output: BigInteger

Output: BigInteger

Output: BigInteger

Output: BigInteger

Output: BigInteger

Output: BigInteger

Output: BigInteger

Output: BigInteger

Output: BigInteger

Output: BigInteger

Output: BigInteger

Output: BigInteger

Output: BigInteger

Output: BigInteger

Output: BigInteger

Output: BigInteger

Output: BigInteger

Output: BigInteger

Output: BigInteger

Output: BigInteger

Output: BigInteger

Output: BigInteger

Output: BigInteger

Output: BigInteger

Output: BigInteger

Output: BigInteger

Output: BigInteger

Output: BigInteger

Output: BigInteger

Output: BigInteger

Output: BigInteger

Output: BigInteger

Output: BigInteger

Output: BigInteger

Output: BigInteger

Output: BigInteger

Output: BigInteger

Output: BigInteger

Output: byte

Output: long

Output: byte

Output: long

Output: long

Output: long

Output: long

Output: long

Output: int

Output: int

Output: int

Output: int

Output: long

Output: long

Output: long

Output: long

Output: byte

Output: long

Output: short

Output: long


Two chess pieces, a rook and a knight, stand on a standard chessboard 8 × 8 in size. The positions in which they are situated are known. It is guaranteed that none of them beats the other one.Your task is to find the number of ways to place another knight on the board so that none of the three pieces on the board beat another one. A new piece can only be placed on an empty square.

Print a single number which is the required number of ways.

The first input line contains the description of the rook's position on the board. This description is a line which is 2 in length. Its first symbol is a lower-case Latin letter from a to h, and its second symbol is a number from 1 to 8. The second line contains the description of the knight's position in a similar way. It is guaranteed that their positions do not coincide.

Input:
a1
b2

Output: 44

Input:
a8
d4

Output: 38

Input:
a8
f1

Output: 42

Input:
f8
h3

Output: 42

Input:
g8
b7

Output: 42

Input:
h1
g5

Output: 42

Input:
c6
b5

Output: 39

Input:
c1
d2

Output: 42

Input:
g3
h4

Output: 42

Input:
e3
g5

Output: 38

Input:
f8
a3

Output: 40

Input:
a2
h8

Output: 43

Input:
a3
c5

Output: 40

Input:
g1
e6

Output: 39

Input:
e1
a7

Output: 41

Input:
b5
c1

Output: 39

Input:
b2
e1

Output: 43

Input:
h8
g2

Output: 43

Input:
a3
d6

Output: 38

Input:
g6
b7

Output: 39

Input:
c8
e6

Output: 40

Input:
e6
f2

Output: 35

Input:
b6
d8

Output: 41

Input:
a4
d1

Output: 42

Input:
b5
h8

Output: 40

Input:
h6
a1

Output: 42

Input:
c3
a8

Output: 39

Input:
g5
d2

Output: 38

Input:
b6
g7

Output: 39

Input:
h6
a8

Output: 43

Input:
a8
b7

Output: 44

Input:
c8
b2

Output: 41

Input:
e4
c1

Output: 37

Input:
f1
c3

Output: 38

Input:
a3
c8

Output: 41

Input:
e8
b6

Output: 40

Input:
a1
b7

Output: 43

Input:
g2
b7

Output: 40

Input:
e1
d6

Output: 38

Input:
e5
h6

Output: 39


You all know the Dirichlet principle, the point of which is that if n boxes have no less than n + 1 items, that leads to the existence of a box in which there are at least two items.Having heard of that principle, but having not mastered the technique of logical thinking, 8 year olds Stas and Masha invented a game. There are a different boxes and b different items, and each turn a player can either add a new box or a new item. The player, after whose turn the number of ways of putting b items into a boxes becomes no less then a certain given number n, loses. All the boxes and items are considered to be different. Boxes may remain empty.Who loses if both players play optimally and Stas's turn is first?

Output "Stas" if Masha wins. Output "Masha" if Stas wins. In case of a draw, output "Missing".

NoteIn the second example the initial number of ways is equal to 3125.   If Stas increases the number of boxes, he will lose, as Masha may increase the number of boxes once more during her turn. After that any Stas's move will lead to defeat.  But if Stas increases the number of items, then any Masha's move will be losing.

The only input line has three integers a, b, n (1 ≤ a ≤ 10000, 1 ≤ b ≤ 30, 2 ≤ n ≤ 109) — the initial number of the boxes, the number of the items and the number which constrains the number of ways, respectively. Guaranteed that the initial number of ways is strictly less than n.

Input: 2 2 10

Output: Masha

Input: 5 5 16808

Output: Masha

Input: 3 1 4

Output: Stas

Input: 1 4 10

Output: Missing

Input: 1 1 2

Output: Missing

Input: 1 1 3

Output: Masha

Input: 1 5 2

Output: Missing

Input: 5 1 7

Output: Masha

Input: 5 1 24

Output: Stas

Input: 5 1 25

Output: Masha

Input: 5 1 26

Output: Masha

Input: 2 2 5

Output: Stas

Input: 2 2 11

Output: Masha

Input: 2 2 17

Output: Stas

Input: 3 2 27

Output: Stas

Input: 3 2 81

Output: Stas

Input: 3 2 82

Output: Stas

Input: 2 3 10

Output: Stas

Input: 2 3 32

Output: Masha

Input: 2 3 34

Output: Masha

Input: 3 4 243

Output: Stas

Input: 3 4 256

Output: Masha

Input: 3 4 1000

Output: Stas

Input: 3 4 1000000000

Output: Masha

Input: 1 1 60

Output: Stas

Input: 1 2 60

Output: Masha

Input: 1 3 60

Output: Masha

Input: 1 30 60

Output: Missing

Input: 2 1 60

Output: Masha

Input: 2 2 64

Output: Stas

Input: 2 3 64

Output: Masha

Input: 2 4 64

Output: Masha

Input: 2 5 64

Output: Stas

Input: 3 1 64

Output: Masha

Input: 3 2 64

Output: Masha

Input: 3 3 64

Output: Stas

Input: 4 1 64

Output: Stas

Input: 4 2 64

Output: Masha

Input: 5 1 64

Output: Masha

Input: 5 2 64

Output: Stas

Input: 7 2 64

Output: Stas

Input: 8 1 64

Output: Masha

Input: 2 1 536870912

Output: Masha

Input: 1 2 536870912

Output: Masha

Input: 2 2 536870912

Output: Stas

Input: 2 25 536870912

Output: Masha

Input: 2 28 536870912

Output: Stas

Input: 10 1 100

Output: Masha

Input: 20 1 401

Output: Masha

Input: 1 30 1000000000

Output: Missing

Input: 10000 1 1000000000

Output: Masha

Input: 10000 2 1000000000

Output: Stas

Input: 1 16 65536

Output: Missing

Input: 1 16 65537

Output: Masha

Input: 117 1 13689

Output: Masha

Input: 117 1 13688

Output: Stas

Input: 10 8 1000000000

Output: Masha

Input: 9 9 1000000000

Output: Stas

Input: 7 10 1000000000

Output: Stas

Input: 5 6 1524637

Output: Masha

Input: 198 2 1500277

Output: Stas

Input: 1999 1 200000

Output: Stas

Input: 4 5 4096

Output: Masha

Input: 3 17 999999997

Output: Masha

Input: 5 10 1000000000

Output: Stas

Input: 29 2 1000000000

Output: Masha

Input: 1010 1 1000000000

Output: Masha

Input: 1000 2 1000000000

Output: Stas

Input: 25 2 1029355

Output: Stas

Input: 2635 2 1000000000

Output: Masha

Input: 1 20 1000

Output: Missing

Input: 1 15 1998

Output: Missing

Input: 1 29 100000000

Output: Missing

Input: 1 6 64

Output: Missing


You can find anything whatsoever in our Galaxy! A cubical planet goes round an icosahedral star. Let us introduce a system of axes so that the edges of the cubical planet are parallel to the coordinate axes and two opposite vertices lay in the points (0, 0, 0) and (1, 1, 1). Two flies live on the planet. At the moment they are sitting on two different vertices of the cubical planet. Your task is to determine whether they see each other or not. The flies see each other when the vertices they occupy lie on the same face of the cube.

Output "YES" (without quotes) if the flies see each other. Otherwise, output "NO".

The first line contains three space-separated integers (0 or 1) — the coordinates of the first fly, the second line analogously contains the coordinates of the second fly.

Input:
0 0 0
0 1 0

Output: YES

Input:
1 1 0
0 1 0

Output: YES

Input:
0 0 0
1 1 1

Output: No

Output: NO

Input:
0 0 0
1 0 0

Output: YES

Input:
0 0 0
0 1 0

Output: YES

Input:
0 0 0
1 1 0

Output: YES

Input:
0 0 0
0 0 1

Output: YES

Input:
0 0 0
1 0 1

Output: YES

Input:
0 0 0
0 1 1

Output: YES

Input:
0 0 0
1 1 1

Output: No

Output: NO

Input:
1 0 0
0 0 0

Output: YES

Input:
1 0 0
0 1 0

Output: YES

Input:
1 0 0
1 1 0

Output: YES

Input:
1 0 0
0 0 1

Output: YES

Input:
1 0 0
1 0 1

Output: YES

Input:
1 0 0
0 1 1

Output: No

Output: NO

Input:
1 0 0
1 1 1

Output: YES

Input:
0 1 0
0 0 0

Output: YES

Input:
0 1 0
1 0 0

Output: YES

Input:
0 1 0
1 1 0

Output: YES

Input:
0 1 0
0 0 1

Output: YES

Input:
0 1 0
1 0 1

Output: No

Output: NO

Input:
0 1 0
0 1 1

Output: YES

Input:
0 1 0
1 1 1

Output: YES

Input:
1 1 0
0 0 0

Output: YES

Input:
1 1 0
1 0 0

Output: YES

Input:
1 1 0
0 1 0

Output: YES

Input:
1 1 0
0 0 1

Output: No

Output: NO

Input:
1 1 0
1 0 1

Output: YES

Input:
1 1 0
0 1 1

Output: YES

Input:
1 1 0
1 1 1

Output: YES

Input:
0 0 1
0 0 0

Output: YES

Input:
0 0 1
1 0 0

Output: YES

Input:
0 0 1
0 1 0

Output: YES

Input:
0 0 1
1 1 0

Output: No

Output: NO

Input:
0 0 1
1 0 1

Output: YES

Input:
0 0 1
0 1 1

Output: YES

Input:
0 0 1
1 1 1

Output: YES

Input:
1 0 1
0 0 0

Output: YES

Input:
1 0 1
1 0 0

Output: YES

Input:
1 0 1
0 1 0

Output: No

Output: NO

Input:
1 0 1
1 1 0

Output: YES

Input:
1 0 1
0 0 1

Output: YES

Input:
1 0 1
0 1 1

Output: YES

Input:
1 0 1
1 1 1

Output: YES

Input:
0 1 1
0 0 0

Output: YES

Input:
0 1 1
1 0 0

Output: No

Output: NO

Input:
0 1 1
0 1 0

Output: YES

Input:
0 1 1
1 1 0

Output: YES

Input:
0 1 1
0 0 1

Output: YES

Input:
0 1 1
1 0 1

Output: YES

Input:
0 1 1
1 1 1

Output: YES

Input:
1 1 1
0 0 0

Output: No

Output: NO

Input:
1 1 1
1 0 0

Output: YES

Input:
1 1 1
0 1 0

Output: YES

Input:
1 1 1
1 1 0

Output: YES

Input:
1 1 1
0 0 1

Output: YES

Input:
1 1 1
1 0 1

Output: YES

Input:
1 1 1
0 1 1

Output: YES


Petya studies positional notations. He has already learned to add and subtract numbers in the systems of notations with different radices and has moved on to a more complicated action — multiplication. To multiply large numbers one has to learn the multiplication table. Unfortunately, in the second grade students learn only the multiplication table of decimals (and some students even learn it in the first grade). Help Petya make a multiplication table for numbers in the system of notations with the radix k.

Output the multiplication table for the system of notations with the radix k. The table must contain k - 1 rows and k - 1 columns. The element on the crossing of the i-th row and the j-th column is equal to the product of i and j in the system of notations with the radix k. Each line may have any number of spaces between the numbers (the extra spaces in the samples are put for clarity).

The first line contains a single integer k (2 ≤ k ≤ 10) — the radix of the system.

Output:
1 2 3 4 5 6 7 8 9
2 4 6 8 10 12 14 16 18
3 6 9 12 15 18 21 24 27
4 8 12 16 20 24 28 32 36
5 10 15 20 25 30 35 40 45
6 12 18 24 30 36 42 48 54
7 14 21 28 35 42 49 56 63
8 16 24 32 40 48 56 64 72
9 18 27 36 45 54 63 72 81

Output:
1 2 3 4 5 6 7 8 9
2 4 6 8 10 12 14 16 18
3 6 9 12 15 18 21 24 27
4 8 12 16 20 24 28 32 36
5 10 15 20 25 30 35 40 45
6 12 18 24 30 36 42 48 54
7 14 21 28 35 42 49 56 63
8 16 24 32 40 48 56 64 72
9 18 27 36 45 54 63 72 81

Output:
1  2  3  4  5  6  7  8  9
2  4  6  8 10 12 14 16 18
3  6  9 12 15 18 21 24 27
4  8 12 16 20 24 28 32 36
5 10 15 20 25 30 35 40 45
6 12 18 24 30 36 42 48 54
7 14 21 28 35 42 49 56 63
8 16 24 32 40 48 56 64 72
9 18 27 36 45 54 63 72 81

Output:
1  2
2 11

Output:
1 2
2 11

Output:
1 2
2 11

Output:
1 2 3
2 10 12
3 12 21

Output:
1  2  3
2 10 12
3 12 21

Output:
1 2 3
2 10 12
3 12 21

Output:
1 2 3 4
2 4 11 13
3 11 14 22
4 13 22 31

Output:
1 2 3 4
2 4 11 13
3 11 14 22
4 13 22 31

Output:
1  2  3  4
2  4 11 13
3 11 14 22
4 13 22 31

Output:
1 2 3 4 5
2 4 10 12 14
3 10 13 20 23
4 12 20 24 32
5 14 23 32 41

Output:
1 2 3 4 5
2 4 10 12 14
3 10 13 20 23
4 12 20 24 32
5 14 23 32 41

Output:
1  2  3  4  5
2  4 10 12 14
3 10 13 20 23
4 12 20 24 32
5 14 23 32 41

Output:
1 2 3 4 5 6
2 4 6 11 13 15
3 6 12 15 21 24
4 11 15 22 26 33
5 13 21 26 34 42
6 15 24 33 42 51

Output:
1 2 3 4 5 6
2 4 6 11 13 15
3 6 12 15 21 24
4 11 15 22 26 33
5 13 21 26 34 42
6 15 24 33 42 51

Output:
1  2  3  4  5  6
2  4  6 11 13 15
3  6 12 15 21 24
4 11 15 22 26 33
5 13 21 26 34 42
6 15 24 33 42 51

Output:
1  2  3  4  5  6  7
2  4  6 10 12 14 16
3  6 11 14 17 22 25
4 10 14 20 24 30 34
5 12 17 24 31 36 43
6 14 22 30 36 44 52
7 16 25 34 43 52 61

Output:
1 2 3 4 5 6 7
2 4 6 10 12 14 16
3 6 11 14 17 22 25
4 10 14 20 24 30 34
5 12 17 24 31 36 43
6 14 22 30 36 44 52
7 16 25 34 43 52 61

Output:
1 2 3 4 5 6 7
2 4 6 10 12 14 16
3 6 11 14 17 22 25
4 10 14 20 24 30 34
5 12 17 24 31 36 43
6 14 22 30 36 44 52
7 16 25 34 43 52 61

Output:
1 2 3 4 5 6 7 8
2 4 6 8 11 13 15 17
3 6 10 13 16 20 23 26
4 8 13 17 22 26 31 35
5 11 16 22 27 33 38 44
6 13 20 26 33 40 46 53
7 15 23 31 38 46 54 62
8 17 26 35 44 53 62 71

Output:
1  2  3  4  5  6  7  8
2  4  6  8 11 13 15 17
3  6 10 13 16 20 23 26
4  8 13 17 22 26 31 35
5 11 16 22 27 33 38 44
6 13 20 26 33 40 46 53
7 15 23 31 38 46 54 62
8 17 26 35 44 53 62 71

Output:
1 2 3 4 5 6 7 8
2 4 6 8 11 13 15 17
3 6 10 13 16 20 23 26
4 8 13 17 22 26 31 35
5 11 16 22 27 33 38 44
6 13 20 26 33 40 46 53
7 15 23 31 38 46 54 62
8 17 26 35 44 53 62 71


A chessboard n × m in size is given. During the zero minute we repaint all the black squares to the 0 color. During the i-th minute we repaint to the i color the initially black squares that have exactly four corner-adjacent squares painted i - 1 (all such squares are repainted simultaneously). This process continues ad infinitum. You have to figure out how many squares we repainted exactly x times.The upper left square of the board has to be assumed to be always black. Two squares are called corner-adjacent, if they have exactly one common point.

Print how many squares will be painted exactly x times.

The first line contains integers n and m (1 ≤ n, m ≤ 5000). The second line contains integer x (1 ≤ x ≤ 109).

Input:
3 3
1

Output: 4

Input:
3 3
2

Output: 1

Input:
1 1
1

Output: 1

Input:
8 8
8

Output: 0

Input:
9 10
1

Output: 17

Input:
9 9
3

Output: 8

Input:
10 9
4

Output: 5

Input:
1 5000
3

Output: 0

Input:
5000 1
3

Output: 0

Input:
4999 1
7

Output: 0

Input:
1 4999
2309

Output: 0

Input:
1 4999
1000000

Output: 0

Input:
1 1
200

Output: 0

Input:
5000 5000
1000000000

Output: 0

Input:
7 7
777

Output: 0

Input:
126 4125
52

Output: 4045

Input:
1755 2051
1

Output: 3804

Input:
3385 4978
192

Output: 7597

Input:
3663 2904
1149

Output: 1973

Input:
293 2183
60

Output: 2238

Input:
1922 109
41

Output: 1869

Input:
3552 3036
199

Output: 5794

Input:
182 2314
54

Output: 2282

Input:
1812 240
9

Output: 2018

Input:
1595 2881
710

Output: 1638

Input:
4694 685
208

Output: 4549

Input:
2793 4840
901

Output: 4031

Input:
892 3996
288

Output: 3738

Input:
3990 1800
171

Output: 5108

Input:
2089 955
476

Output: 1142

Input:
188 3759
53

Output: 3737

Input:
3287 2915
538

Output: 4052

Input:
2738 718
308

Output: 2226

Input:
837 4874
208

Output: 4881

Input:
991 2301
291

Output: 2130

Input:
2016 4549
433

Output: 4835

Input:
3042 1798
93

Output: 4470

Input:
419 4046
174

Output: 3771

Input:
1444 2646
660

Output: 1452

Input:
2470 4895
421

Output: 5683

Input:
4847 2143
827

Output: 3684

Input:
873 744
42

Output: 1451

Input:
3250 2992
127

Output: 5736

Input:
4275 240
16

Output: 4453

Input:
4035 369
26

Output: 4302

Input:
4339 2062
462

Output: 4555

Input:
4643 3755
1381

Output: 2876

Input:
3595 448
110

Output: 3605

Input:
3899 2141
428

Output: 4330

Input:
4202 3834
1478

Output: 2126

Input:
3154 527
112

Output: 3235

Input:
3458 2220
526

Output: 3576

Input:
3762 3914
1073

Output: 3386

Input:
2714 607
189

Output: 2567

Input:
3432 4788
1203

Output: 3410

Input:
1662 926
452

Output: 782

Input:
4892 712
340

Output: 4246

Input:
3122 1850
201

Output: 4170

Input:
1353 2988
589

Output: 1987

Input:
4583 2774
1206

Output: 2535

Input:
2813 3911
560

Output: 4486

Input:
1043 49
10

Output: 1054

Input:
4273 4835
159

Output: 8474

Input:
2504 973
201

Output: 2675

Input:
2828 4208
912

Output: 3390

Input:
10 10
1

Output: 18

Input:
10 10
2

Output: 14

Input:
10 10
3

Output: 10

Input:
10 10
4

Output: 6

Input:
10 10
5

Output: 2


Not so long ago as a result of combat operations the main Berland place of interest — the magic clock — was damaged. The cannon's balls made several holes in the clock, that's why the residents are concerned about the repair. The magic clock can be represented as an infinite Cartesian plane, where the origin corresponds to the clock center. The clock was painted two colors as is shown in the picture:  The picture shows only the central part of the clock. This coloring naturally extends to infinity.The balls can be taken to be points on the plane. Your task is to find the color of the area, damaged by the given ball.All the points located on the border of one of the areas have to be considered painted black.

Find the required color. All the points between which and the origin of coordinates the distance is integral-value are painted black.

The first and single line contains two integers x and y — the coordinates of the hole made in the clock by the ball. Each of the numbers x and y has an absolute value that does not exceed 1000.

Input: -2 1

Output: white

Input: 2 1

Output: black

Input: 4 3

Output: black

Input: 3 3

Output: black

Input: 4 4

Output: white

Input: -4 4

Output: black

Input: 4 -4

Output: black

Input: -4 -4

Output: white

Input: 0 0

Output: black

Input: 0 1

Output: black

Input: 0 2

Output: black

Input: 0 1000

Output: black

Input: 1000 0

Output: black

Input: -1000 0

Output: black

Input: 0 -1000

Output: black

Input: 1000 -1000

Output: white

Input: 12 5

Output: black

Input: 12 -5

Output: black

Input: -12 -35

Output: black

Input: 20 -21

Output: black

Input: -677 492

Output: white

Input: -673 -270

Output: white

Input: -668 970

Output: black

Input: -220 208

Output: white

Input: -215 -996

Output: black

Input: -211 243

Output: black

Input: -206 -518

Output: white

Input: -201 278

Output: black

Input: -196 -484

Output: black

Input: 902 479

Output: white

Input: -441 572

Output: white

Input: 217 221

Output: white

Input: 875 -129

Output: white

Input: -469 -36

Output: black

Input: 189 -387

Output: white

Input: 847 -294

Output: white

Input: -496 -644

Output: black

Input: -281 -552

Output: white

Input: 377 -902

Output: black

Input: 165 -738

Output: white

Input: 61 -175

Output: black

Input: -42 389

Output: black

Input: -589 952

Output: black

Input: -693 -929

Output: white

Input: -796 -365

Output: white

Input: 658 198

Output: white

Input: 555 319

Output: black

Input: 8 882

Output: black

Input: -96 -556

Output: black

Input: -129 489

Output: black

Input: 207 -224

Output: black

Input: 64 0

Output: black

Input: 17 144

Output: black

Input: 60 -448

Output: black

Input: -399 -40

Output: black

Input: 128 -504

Output: black

Input: 0 72

Output: black

Input: 168 -26

Output: black

Input: 72 -154

Output: black

Input: 117 -44

Output: black

Input: -72 -646

Output: black

Input: 253 -204

Output: black

Input: -40 198

Output: black

Input: -216 -90

Output: black

Input: 15 -8

Output: black

Input: -180 -432

Output: black

Input: 280 342

Output: black

Input: 132 224

Output: black

Input: -192 -256

Output: black

Input: 351 -280

Output: black


The translation from the Berland language into the Birland language is not an easy task. Those languages are very similar: a berlandish word differs from a birlandish word with the same meaning a little: it is spelled (and pronounced) reversely. For example, a Berlandish word code corresponds to a Birlandish word edoc. However, it's easy to make a mistake during the «translation». Vasya translated word s from Berlandish into Birlandish as t. Help him: find out if he translated the word correctly.

If the word t is a word s, written reversely, print YES, otherwise print NO.

The first line contains word s, the second line contains word t. The words consist of lowercase Latin letters. The input data do not consist unnecessary spaces. The words are not empty and their lengths do not exceed 100 symbols.

Input:
code
edoc

Output: YES

Input:
abb
aba

Output: NO

Input:
code
code

Output: NO

Input:
abacaba
abacaba

Output: YES

Input:
q
q

Output: YES

Input:
asrgdfngfnmfgnhweratgjkk
asrgdfngfnmfgnhweratgjkk

Output: NO

Input:
z
a

Output: NO

Input:
asd
dsa

Output: YES

Input:
abcdef
fecdba

Output: NO

Input:
ywjjbirapvskozubvxoemscfwl
gnduubaogtfaiowjizlvjcu

Output: NO

Input:
mfrmqxtzvgaeuleubcmcxcfqyruwzenguhgrmkuhdgnhgtgkdszwqyd
mfxufheiperjnhyczclkmzyhcxntdfskzkzdwzzujdinf

Output: NO

Input:
bnbnemvybqizywlnghlykniaxxxlkhftppbdeqpesrtgkcpoeqowjwhrylpsziiwcldodcoonpimudvrxejjo
tiynnekmlalogyvrgptbinkoqdwzuiyjlrldxhzjmmp

Output: NO

Input:
pwlpubwyhzqvcitemnhvvwkmwcaawjvdiwtoxyhbhbxerlypelevasmelpfqwjk
struuzebbcenziscuoecywugxncdwzyfozhljjyizpqcgkyonyetarcpwkqhuugsqjuixsxptmbnlfupdcfigacdhhrzb

Output: NO

Input:
gdvqjoyxnkypfvdxssgrihnwxkeojmnpdeobpecytkbdwujqfjtxsqspxvxpqioyfagzjxupqqzpgnpnpxcuipweunqch
kkqkiwwasbhezqcfeceyngcyuogrkhqecwsyerdniqiocjehrpkljiljophqhyaiefjpavoom

Output: NO

Input:
umeszdawsvgkjhlqwzents
hxqhdungbylhnikwviuh

Output: NO

Input:
juotpscvyfmgntshcealgbsrwwksgrwnrrbyaqqsxdlzhkbugdyx
ibqvffmfktyipgiopznsqtrtxiijntdbgyy

Output: NO

Input:
zbwueheveouatecaglziqmudxemhrsozmaujrwlqmppzoumxhamwugedikvkblvmxwuofmpafdprbcftew
ulczwrqhctbtbxrhhodwbcxwimncnexosksujlisgclllxokrsbnozthajnnlilyffmsyko

Output: NO

Input:
nkgwuugukzcv
qktnpxedwxpxkrxdvgmfgoxkdfpbzvwsduyiybynbkouonhvmzakeiruhfmvrktghadbfkmwxduoqv

Output: NO

Input:
incenvizhqpcenhjhehvjvgbsnfixbatrrjstxjzhlmdmxijztphxbrldlqwdfimweepkggzcxsrwelodpnryntepioqpvk
dhjbjjftlvnxibkklxquwmzhjfvnmwpapdrslioxisbyhhfymyiaqhlgecpxamqnocizwxniubrmpyubvpenoukhcobkdojlybxd

Output: NO

Input:
w
w

Output: YES

Input:
vz
zv

Output: YES

Input:
ry
yr

Output: YES

Input:
xou
uox

Output: YES

Input:
axg
gax

Output: NO

Input:
zdsl
lsdz

Output: YES

Input:
kudl
ldku

Output: NO

Input:
zzlzwnqlcl
lclqnwzlzz

Output: YES

Input:
vzzgicnzqooejpjzads
sdazjpjeooqzncigzzv

Output: YES

Input:
raqhmvmzuwaykjpyxsykr
xkysrypjkyawuzmvmhqar

Output: NO

Input:
ngedczubzdcqbxksnxuavdjaqtmdwncjnoaicvmodcqvhfezew
wezefhvqcdomvciaonjcnwdmtqajdvauxnskxbqcdzbuzcdegn

Output: YES

Input:
muooqttvrrljcxbroizkymuidvfmhhsjtumksdkcbwwpfqdyvxtrlymofendqvznzlmim
mimlznzvqdnefomylrtxvydqfpwwbckdskmutjshhmfvdiumykziorbxcjlrrvttqooum

Output: YES

Output: YES

Output: NO

Output: NO

Input:
gxoixiecetohtgjgbqzvlaobkhstejxdklghowtvwunnnvauriohuspsdmpzckprwajyxldoyckgjivjpmbfqtszmtocovxwgeh
hegwxvocotmzstqfbmpjvijgkcyodlxyjawrpkczpmdspsuhoiruavnnnuwvtwohglkdxjetshkboalvzqbgjgthoteceixioxg

Output: YES

Input:
sihxuwvmaambplxvjfoskinghzicyfqebjtkysotattkahssumfcgrkheotdxwjckpvapbkaepqrxseyfrwtyaycmrzsrsngkh
hkgnsrszrmcyaytwrfyesxrqpeakbpavpkcjwxdtoehkrgcfmusshakttatosyktjbeqfycizhgniksofjvxlpbmaamvwuxhis

Output: YES

Input:
ycnahksbughnonldzrhkysujmylcgcfuludjvjiahtkyzqvkopzqcnwhltbzfugzojqkjjlggmvnultascmygelkiktmfieok
koeifmtkiklegkmcsatlunvmggkjjlqjozgufzbtlhwncqzpokvqzykthaijvjdulufcgclymjusyyhrzdlnonhgubskhancy

Output: NO

Input:
wbqasaehtkfojruzyhrlgwmtyiovmzyfifslvlemhqheyaelzwnthrenjsbmntwaoryzwfbxmscmypvxlfmzpnkkjlvwvmtz
ztmvwvljkknpzmflxvpymcsmxbfwzyroawtnmbsjnerhtnwzleayehqhmelvlsfifyzmvoiytmwglrhyzurjofktheasaqbw

Output: YES

Input:
imippqurprbhfugngtgifelytadegwrgaefnfhbjjnmzikvjaccotqzemufqieqldgnbmviisgkynzeldlhqxuqphjfmyij
jiymfjhpquxqhldleznykgsiivmbngdlqeiqfumezqtoccajvkizmnjjbhfnfeagrwgedatylefigtgngufhbrpruqppimi

Output: YES

Input:
bikydffiuisckpvzqlteqfhegsagimodb
bdomigasgehfqetlqzvpkcsiuiffdykib

Output: YES


Once Volodya was at the museum and saw a regular chessboard as a museum piece. And there were only four chess pieces on it: two white rooks, a white king and a black king. "Aha, blacks certainly didn't win!", — Volodya said and was right for sure. And your task is to say whether whites had won or not.Pieces on the chessboard are guaranteed to represent a correct position (every piece occupies one cell, no two pieces occupy the same cell and kings cannot take each other). Thus, your task is only to decide whether whites mate blacks. We would remind you that it means that the black king can be taken by one of the opponent's pieces at the moment and also it cannot move to an unbeaten position. A rook moves vertically or horizontally by any number of free cells (assuming there are no other pieces on its path), a king — to the adjacent cells (either by corner or by side). Certainly, pieces cannot leave the board. The black king might be able to take opponent's rooks at his turn (see sample 3).

Output should contain one word: "CHECKMATE" if whites mate blacks, and "OTHER" otherwise.

The input contains 4 space-separated piece positions: positions of the two rooks, the white king and the black king. Each position on 8 × 8 chessboard is denoted by two symbols — ('a' - 'h') and ('1' - '8') — which stand for horizontal and vertical coordinates of the cell occupied by the piece. It is guaranteed, that no two pieces occupy the same cell, and kings cannot take each other.

Input: a6 b4 c8 a8

Output: CHECKMATE

Input: a6 c4 b6 b8

Output: OTHER

Input: a2 b1 a3 a1

Output: OTHER

Input: a5 c5 c2 a1

Output: CHECKMATE

Input: a5 c5 c3 a1

Output: OTHER

Input: c1 c2 d1 f1

Output: OTHER

Input: a1 a2 c4 c2

Output: CHECKMATE

Input: a1 a2 d4 c2

Output: OTHER

Input: a1 a2 b4 c2

Output: OTHER

Input: b2 c2 b3 c1

Output: OTHER

Input: b2 c2 b3 b1

Output: OTHER

Input: b3 a8 c2 a3

Output: CHECKMATE

Input: b3 a8 c4 a3

Output: CHECKMATE

Input: b3 a8 d3 a3

Output: OTHER

Input: d4 e5 a7 a5

Output: CHECKMATE

Input: d4 e5 b7 a5

Output: CHECKMATE

Input: d4 e5 c7 a5

Output: OTHER

Input: h7 h8 d8 a8

Output: OTHER

Input: h7 h8 c7 a8

Output: OTHER

Input: a6 a8 c2 a1

Output: CHECKMATE

Input: a7 b7 d8 a6

Output: CHECKMATE

Input: a5 b5 g2 a8

Output: CHECKMATE

Input: a2 f1 g3 d1

Output: CHECKMATE

Input: b3 a5 g6 a8

Output: CHECKMATE

Input: c6 b2 g6 b4

Output: OTHER

Input: c6 b4 h4 d1

Output: OTHER

Input: d8 b4 f2 c5

Output: OTHER

Input: e1 c8 g5 b3

Output: OTHER

Input: e6 e7 d4 h2

Output: OTHER

Input: f1 a2 c7 d1

Output: CHECKMATE

Input: f6 d5 h5 b6

Output: OTHER

Input: f7 h7 f4 h4

Output: CHECKMATE

Input: f1 h2 h5 c8

Output: OTHER

Input: g5 c1 a3 c2

Output: OTHER

Input: g5 c4 a7 g3

Output: OTHER

Input: g4 e5 h2 e1

Output: OTHER

Input: g8 h5 a6 h3

Output: CHECKMATE

Input: h7 c8 c2 e8

Output: CHECKMATE

Input: h1 g8 b8 h6

Output: CHECKMATE

Input: h2 h4 h8 f5

Output: OTHER

Input: h7 g7 h6 h8

Output: CHECKMATE

Input: h7 g7 g6 g8

Output: OTHER

Input: h7 g7 h6 f7

Output: OTHER

Input: h7 g8 f8 h8

Output: OTHER

Input: h7 g8 h6 h8

Output: OTHER

Input: e8 e7 d8 g8

Output: CHECKMATE

Input: e8 e7 h8 f8

Output: CHECKMATE

Input: d8 d7 h8 f8

Output: CHECKMATE

Input: e8 e7 f8 h8

Output: OTHER

Input: f7 h5 f8 h8

Output: CHECKMATE

Input: a1 a2 h1 e1

Output: CHECKMATE


To celebrate the opening of the Winter Computer School the organizers decided to buy in n liters of cola. However, an unexpected difficulty occurred in the shop: it turned out that cola is sold in bottles 0.5, 1 and 2 liters in volume. At that, there are exactly a bottles 0.5 in volume, b one-liter bottles and c of two-liter ones. The organizers have enough money to buy any amount of cola. What did cause the heated arguments was how many bottles of every kind to buy, as this question is pivotal for the distribution of cola among the participants (and organizers as well).Thus, while the organizers are having the argument, discussing different variants of buying cola, the Winter School can't start. Your task is to count the number of all the possible ways to buy exactly n liters of cola and persuade the organizers that this number is too large, and if they keep on arguing, then the Winter Computer School will have to be organized in summer.All the bottles of cola are considered indistinguishable, i.e. two variants of buying are different from each other only if they differ in the number of bottles of at least one kind.

Print the unique number — the solution to the problem. If it is impossible to buy exactly n liters of cola, print 0.

The first line contains four integers — n, a, b, c (1 ≤ n ≤ 10000, 0 ≤ a, b, c ≤ 5000).

Input: 10 5 5 5

Output: 9

Input: 3 0 0 2

Output: 0

Input: 1 0 0 0

Output: 0

Input: 1 1 0 0

Output: 0

Input: 1 2 0 0

Output: 1

Input: 1 0 1 0

Output: 1

Input: 1 0 2 0

Output: 1

Input: 1 0 0 1

Output: 0

Input: 2 2 2 2

Output: 3

Input: 3 3 2 1

Output: 3

Input: 3 10 10 10

Output: 6

Input: 5 2 1 1

Output: 0

Input: 7 2 2 2

Output: 1

Input: 7 3 0 5

Output: 1

Input: 10 20 10 5

Output: 36

Input: 10 0 8 10

Output: 5

Input: 10 19 15 100

Output: 35

Input: 20 1 2 3

Output: 0

Input: 20 10 20 30

Output: 57

Input: 25 10 5 10

Output: 12

Input: 101 10 0 50

Output: 3

Input: 101 10 10 50

Output: 33

Input: 505 142 321 12

Output: 0

Input: 999 999 899 299

Output: 145000

Input: 5 5000 5000 5000

Output: 12

Input: 10000 5000 5000 5000

Output: 6253751

Input: 10000 0 5000 5000

Output: 2501

Input: 10000 5000 0 5000

Output: 1251

Input: 10000 5000 5000 0

Output: 0

Input: 10000 4534 2345 4231

Output: 2069003

Input: 10000 5000 2500 2500

Output: 1

Input: 1234 645 876 1000

Output: 141636

Input: 8987 4000 2534 4534

Output: 2536267

Input: 10000 2500 2500 2500

Output: 0

Input: 10000 4999 2500 2500

Output: 0

Input: 7777 4444 3333 2222

Output: 1236544

Input: 5643 1524 1423 2111

Output: 146687

Input: 8765 2432 2789 4993

Output: 1697715

Input: 5000 5000 5000 5000

Output: 4691251

Input: 2500 5000 5000 5000

Output: 1565001


Alas, finding one's true love is not easy. Masha has been unsuccessful in that yet. Her friend Dasha told Masha about a way to determine the phone number of one's Prince Charming through arithmancy. The phone number is divined like that. First one needs to write down one's own phone numbers. For example, let's suppose that Masha's phone number is 12345. After that one should write her favorite digit from 0 to 9 under the first digit of her number. That will be the first digit of the needed number. For example, Masha's favorite digit is 9. The second digit is determined as a half sum of the second digit of Masha's number and the already written down first digit from her beloved one's number. In this case the arithmetic average equals to (2 + 9) / 2 = 5.5. Masha can round the number up or down, depending on her wishes. For example, she chooses the digit 5. Having written down the resulting digit under the second digit of her number, Masha moves to finding the third digit in the same way, i.e. finding the half sum the the third digit of her number and the second digit of the new number. The result is (5 + 3) / 2 = 4. In this case the answer is unique. Thus, every i-th digit is determined as an arithmetic average of the i-th digit of Masha's number and the i - 1-th digit of her true love's number. If needed, the digit can be rounded up or down. For example, Masha can get: 12345 95444 Unfortunately, when Masha tried dialing the number, she got disappointed: as it turned out, the number was unavailable or outside the coverage area. But Masha won't give up. Perhaps, she rounded to a wrong digit or chose the first digit badly. That's why she keeps finding more and more new numbers and calling them. Count the number of numbers Masha calls. Masha calls all the possible numbers that can be found by the described means of arithmancy, except for, perhaps, her own one.

Output the single number — the number of phone numbers Masha will dial.

The first line contains nonempty sequence consisting of digits from 0 to 9 — Masha's phone number. The sequence length does not exceed 50.


Today Vasya visited a widely known site and learned that the continuation of his favourite game Codecraft II will appear after exactly k months. He looked at the calendar and learned that at the moment is the month number s. Vasya immediately got interested in what month Codecraft III will appear. Help him understand that.All the twelve months in Vasya's calendar are named using their usual English names: January, February, March, April, May, June, July, August, September, October, November, December.

Print starting from an uppercase letter the name of the month in which the continuation of Codeforces II will appear. The printed name must be contained in the list January, February, March, April, May, June, July, August, September, October, November, December.

The first input line contains the name of the current month. It is guaranteed that it is a proper English name of one of twelve months. The first letter is uppercase, the rest are lowercase. The second line contains integer k (0 ≤ k ≤ 100) — the number of months left till the appearance of Codecraft III.

Input:
November
3

Output: February

Input:
May
24

Output: May

Input:
April
0

Output: April

Input:
September
0

Output: September

Input:
August
0

Output: August

Input:
June
1

Output: July

Input:
July
2

Output: September

Input:
September
3

Output: December

Input:
July
4

Output: November

Input:
August
24

Output: August

Input:
May
48

Output: May

Input:
November
47

Output: October

Input:
December
49

Output: January

Input:
June
99

Output: September

Input:
March
100

Output: July

Input:
December
1

Output: January

Input:
January
11

Output: December

Input:
December
0

Output: December

Input:
January
0

Output: January

Input:
July
77

Output: December

Input:
February
11

Output: January

Input:
February
22

Output: December

Input:
July
33

Output: April

Input:
May
44

Output: January

Input:
June
97

Output: July


Once Vasya needed to transport m goats and m wolves from riverbank to the other as quickly as possible. The boat can hold n animals and Vasya, in addition, he is permitted to put less than n animals in the boat. If in one place (on one of the banks or in the boat) the wolves happen to strictly outnumber the goats, then the wolves eat the goats and Vasya gets upset. When Vasya swims on the boat from one shore to the other, he must take at least one animal to accompany him, otherwise he will get bored and he will, yet again, feel upset. When the boat reaches the bank, first all the animals get off simultaneously, and then the animals chosen by Vasya simultaneously get on the boat. That means that at the moment when the animals that have just arrived have already got off and the animals that are going to leave haven't yet got on, somebody might eat someone. Vasya needs to transport all the animals from one river bank to the other so that nobody eats anyone and Vasya doesn't get upset. What is the minimal number of times he will have to cross the river?

If it is impossible to transport all the animals so that no one got upset, and all the goats survived, print -1. Otherwise print the single number — how many times Vasya will have to cross the river.

NoteThe first sample match to well-known problem for children.

The first line contains two space-separated numbers m and n (1 ≤ m, n ≤ 105) — the number of animals and the boat's capacity.

Input: 3 2

Output: 11

Input: 33 3

Output: -1

Input: 2 3

Output: 3

Input: 100000 100000

Output: 5

Input: 100000 4

Output: 199997

Input: 1 3

Output: 1

Input: 97351 58063

Output: 7

Input: 76652 89696

Output: 3

Input: 2 1

Output: -1

Input: 2 2

Output: 5

Input: 2 4

Output: 1

Input: 39600 21330

Output: 7

Input: 3 1

Output: -1

Input: 3 3

Output: 5

Input: 3 4

Output: 3

Input: 18900 52964

Output: 1

Input: 4 1

Output: -1

Input: 4 2

Output: -1

Input: 4 3

Output: 9

Input: 4 4

Output: 5

Input: 4 5

Output: 3

Input: 5 1

Output: -1

Input: 5 2

Output: -1

Input: 5 3

Output: 11

Input: 5 4

Output: 7

Input: 5 5

Output: 5

Input: 6 6

Output: 5

Input: 6 1

Output: -1

Input: 6 2

Output: -1

Input: 6 3

Output: -1

Input: 6 4

Output: 9

Input: 6 5

Output: 7

Input: 99998 99998

Output: 5

Input: 99998 99999

Output: 3

Input: 99998 100000

Output: 3

Input: 100000 99998

Output: 5

Input: 100000 99999

Output: 5

Input: 1 1

Output: -1

Input: 47208 14997

Output: 13

Input: 32633 78581

Output: 1

Input: 34411 58517

Output: 3

Input: 19836 22101

Output: 3

Input: 5262 85685

Output: 1

Input: 7039 49269

Output: 1

Input: 92464 29205

Output: 13

Input: 77890 92789

Output: 3

Input: 79667 56373

Output: 5

Input: 11840 63975

Output: 1

Input: 25810 46413

Output: 3

Input: 56133 28851

Output: 7

Input: 70104 94938

Output: 3

Input: 427 77376

Output: 1

Input: 14398 59815

Output: 1

Input: 44721 42253

Output: 5

Input: 58692 8339

Output: 29

Input: 89015 90778

Output: 3

Input: 2986 73216

Output: 1

Input: 76450 12277

Output: 25

Input: 70357 77208

Output: 3

Input: 47912 58491

Output: 3

Input: 41819 23422

Output: 7

Input: 35726 4704

Output: 31

Input: 29633 69635

Output: 1

Input: 23540 50918

Output: 1

Input: 1095 32200

Output: 1

Input: 95002 97131

Output: 3

Input: 88909 78414

Output: 5

Input: 99999 3

Output: -1

Input: 100000 1

Output: -1

Input: 1 100000

Output: 1

Input: 2 100000

Output: 1

Input: 1 99999

Output: 1

Input: 2 99999

Output: 1

Input: 41061 60580

Output: 3

Input: 98552 24355

Output: 17

Input: 56043 88130

Output: 3

Input: 13534 68257

Output: 1

Input: 1 2

Output: 1

Input: 100000 5

Output: 199993

Input: 100000 6

Output: 99999

Input: 100000 7

Output: 99997

Input: 100000 8

Output: 66665

Input: 100000 100

Output: 4081

Input: 100000 999

Output: 401

Input: 100000 1000

Output: 401

Input: 100000 77

Output: 5405

Input: 99999 5

Output: 199991

Input: 99999 6

Output: 99997

Input: 99999 7

Output: 99995

Input: 99999 8

Output: 66665

Input: 99999 100

Output: 4081

Input: 99999 999

Output: 401

Input: 99999 1000

Output: 401

Input: 99999 77

Output: 5405

Input: 99999 4

Output: 199995

Input: 100000 3

Output: -1

Input: 10000 5

Output: 19993

Input: 1000 5

Output: 1993

Input: 100 5

Output: 193

Input: 10 5

Output: 13


A triangular number is the number of dots in an equilateral triangle uniformly filled with dots. For example, three dots can be arranged in a triangle; thus three is a triangular number. The n-th triangular number is the number of dots in a triangle with n dots on a side. . You can learn more about these numbers from Wikipedia (http://en.wikipedia.org/wiki/Triangular_number).Your task is to find out if a given integer is a triangular number.

If the given integer is a triangular number output YES, otherwise output NO.

The first line contains the single number n (1 ≤ n ≤ 500) — the given integer.

Output: YES

Output: NO

Output: YES

Output: NO

Output: NO

Output: YES

Output: NO

Output: NO

Output: NO

Output: YES

Output: NO

Output: NO

Output: NO

Output: YES

Output: NO

Output: NO

Output: YES

Output: NO

Output: NO

Output: NO

Output: YES

Output: NO

Output: NO

Output: YES

Output: NO

Output: YES

Output: NO

Output: YES

Output: NO

Output: YES

Output: NO

Output: YES

Output: NO

Output: NO

Output: YES

Output: NO

Output: NO

Output: YES

Output: NO

Output: NO

Output: YES

Output: NO

Output: NO

Output: YES

Output: NO

Output: NO

Output: YES

Output: NO

Output: NO

Output: YES

Output: YES

Output: NO

Output: YES

Output: NO

Output: YES

Output: NO

Output: YES

Output: NO

Output: NO

Output: NO

Output: NO

Output: NO

Output: NO

Output: NO

Output: NO

Output: NO

Output: NO

Output: NO

Output: NO


One day Vasya came across three Berland coins. They didn't have any numbers that's why Vasya didn't understand how their denominations differ. He supposed that if one coin is heavier than the other one, then it should be worth more. Vasya weighed all the three pairs of coins on pan balance scales and told you the results. Find out how the deminations of the coins differ or if Vasya has a mistake in the weighting results. No two coins are equal.

It the results are contradictory, print Impossible. Otherwise, print without spaces the rearrangement of letters «A», «B» and «C» which represent the coins in the increasing order of their weights.

The input data contains the results of all the weighting, one result on each line. It is guaranteed that every coin pair was weighted exactly once. Vasya labelled the coins with letters «A», «B» and «C». Each result is a line that appears as (letter)(> or < sign)(letter). For example, if coin "A" proved lighter than coin "B", the result of the weighting is A<B.

Input:
A>B
C<B
A>C

Output: CBA

Input:
A<B
B>C
C>A

Output: ACB

Input:
A<C
B<A
B>C

Output: Impossible

Input:
A<B
A<C
B>C

Output: ACB

Input:
B>A
C<B
C>A

Output: ACB

Input:
A>B
B>C
C<A

Output: CBA

Input:
A>C
A>B
B<C

Output: BCA

Input:
C<B
B>A
A<C

Output: ACB

Input:
C<B
A>B
C<A

Output: CBA

Input:
C>B
B>A
A<C

Output: ABC

Input:
C<B
B<A
C>A

Output: Impossible

Input:
B<C
C<A
A>B

Output: BCA

Input:
A>B
C<B
C<A

Output: CBA

Input:
B>A
C>B
A>C

Output: Impossible

Input:
B<A
C>B
C>A

Output: BAC

Input:
A<B
C>B
A<C

Output: ABC

Input:
A<B
C<A
B<C

Output: Impossible

Input:
A>C
C<B
B>A

Output: CAB

Input:
C>A
A<B
B>C

Output: ACB

Input:
C>A
C<B
B>A

Output: ACB

Input:
B>C
B>A
A<C

Output: ACB

Input:
C<B
C<A
B<A

Output: CBA

Input:
A<C
A<B
B>C

Output: ACB

Input:
B>A
A>C
B>C

Output: CAB

Input:
B<A
A<C
C<B

Output: Impossible

Input:
A<C
B>C
A>B

Output: Impossible

Input:
B>A
C<A
C>B

Output: Impossible

Input:
A>C
C>B
B<A

Output: BCA

Input:
B<C
B<A
A>C

Output: BCA

Input:
A>B
C>B
A<C

Output: BAC

Input:
C<B
C<A
B<A

Output: CBA

Input:
A<C
A>B
B>C

Output: Impossible

Input:
B>A
B>C
A<C

Output: ACB

Input:
B>C
C<A
B<A

Output: CBA

Input:
C>A
B>A
B>C

Output: ACB

Input:
B<A
B>C
A<C

Output: Impossible

Input:
B<C
A<B
C>A

Output: ABC

Input:
C<B
B>A
A>C

Output: CAB

Input:
A>B
C>A
B<C

Output: BAC

Input:
A>B
B>C
C<A

Output: CBA

Input:
B>C
C>A
A>B

Output: Impossible

Input:
B<A
B>C
C<A

Output: CBA

Input:
C>B
B>A
C>A

Output: ABC

Input:
A>C
A>B
B>C

Output: CBA

Input:
B<C
A>B
A<C

Output: BAC

Input:
C>A
C<B
B>A

Output: ACB

Input:
C>B
A<B
C<A

Output: Impossible

Input:
A<C
C<B
A>B

Output: Impossible

Input:
B>C
A<B
A<C

Output: ACB

Input:
C>A
A<B
C>B

Output: ABC


Uncle Fyodor, Matroskin the Cat and Sharic the Dog live their simple but happy lives in Prostokvashino. Sometimes they receive parcels from Uncle Fyodor’s parents and sometimes from anonymous benefactors, in which case it is hard to determine to which one of them the package has been sent. A photographic rifle is obviously for Sharic who loves hunting and fish is for Matroskin, but for whom was a new video game console meant? Every one of the three friends claimed that the present is for him and nearly quarreled. Uncle Fyodor had an idea how to solve the problem justly: they should suppose that the console was sent to all three of them and play it in turns. Everybody got relieved but then yet another burning problem popped up — who will play first? This time Matroskin came up with a brilliant solution, suggesting the most fair way to find it out: play rock-paper-scissors together. The rules of the game are very simple. On the count of three every player shows a combination with his hand (or paw). The combination corresponds to one of three things: a rock, scissors or paper. Some of the gestures win over some other ones according to well-known rules: the rock breaks the scissors, the scissors cut the paper, and the paper gets wrapped over the stone. Usually there are two players. Yet there are three friends, that’s why they decided to choose the winner like that: If someone shows the gesture that wins over the other two players, then that player wins. Otherwise, another game round is required. Write a program that will determine the winner by the gestures they have shown.

Print "F" (without quotes) if Uncle Fyodor wins. Print "M" if Matroskin wins and "S" if Sharic wins. If it is impossible to find the winner, print "?".

The first input line contains the name of the gesture that Uncle Fyodor showed, the second line shows which gesture Matroskin showed and the third line shows Sharic’s gesture.

Input:
rock
rock
rock

Input:
paper
rock
rock

Output: F

Input:
scissors
rock
rock

Input:
scissors
paper
rock

Input:
paper
paper
rock

Input:
rock
paper
rock

Output: M

Input:
rock
scissors
rock

Input:
paper
scissors
rock

Input:
scissors
scissors
rock

Output: S

Input:
rock
rock
paper

Output: S

Input:
paper
rock
paper

Input:
scissors
rock
paper

Input:
rock
paper
paper

Input:
paper
paper
paper

Input:
scissors
paper
paper

Output: F

Input:
rock
scissors
paper

Input:
paper
scissors
paper

Output: M

Input:
scissors
scissors
paper

Input:
rock
rock
scissors

Input:
paper
rock
scissors

Input:
scissors
rock
scissors

Output: M

Input:
rock
paper
scissors

Input:
paper
paper
scissors

Output: S

Input:
scissors
paper
scissors

Input:
rock
scissors
scissors

Output: F

Input:
paper
scissors
scissors

Input:
scissors
scissors
scissors


Little Petya was given this problem for homework:You are given function  (here  represents the operation of taking the remainder). His task is to count the number of integers x in range [a;b] with property f(x) = x.It is a pity that Petya forgot the order in which the remainders should be taken and wrote down only 4 numbers. Each of 24 possible orders of taking the remainder has equal probability of being chosen. For example, if Petya has numbers 1, 2, 3, 4 then he can take remainders in that order or first take remainder modulo 4, then modulo 2, 3, 1. There also are 22 other permutations of these numbers that represent orders in which remainder can be taken. In this problem 4 numbers wrote down by Petya will be pairwise distinct.Now it is impossible for Petya to complete the task given by teacher but just for fun he decided to find the number of integers  with property that probability that f(x) = x is not less than 31.4159265352718281828459045%. In other words, Petya will pick up the number x if there exist at least 7 permutations of numbers p1, p2, p3, p4, for which f(x) = x.

Output the number of integers in the given range that have the given property.

First line of the input will contain 6 integers, separated by spaces: p1, p2, p3, p4, a, b (1 ≤ p1, p2, p3, p4 ≤ 1000, 0 ≤ a ≤ b ≤ 31415).  It is guaranteed that numbers p1, p2, p3, p4 will be pairwise distinct.

Input: 2 7 1 8 2 8

Output: 0

Input: 20 30 40 50 0 100

Output: 20

Input: 31 41 59 26 17 43

Output: 9

Input: 1 2 3 4 0 0

Output: 1

Input: 1 2 3 4 1 1

Output: 0

Input: 1 2 999 1000 30 40

Output: 0

Input: 17 18 19 20 17 20

Output: 0

Input: 17 18 19 20 16 20

Output: 1

Input: 41 449 328 474 150 709

Output: 0

Input: 467 329 936 440 117 700

Output: 212

Input: 258 811 952 491 931 993

Output: 0

Input: 823 431 359 590 153 899

Output: 206

Input: 292 370 404 698 699 876

Output: 0

Input: 442 705 757 527 868 893

Output: 0

Input: 642 273 18 885 675 788

Output: 0

Input: 291 303 656 660 126 704

Output: 165

Input: 225 862 522 617 630 725

Output: 0

Input: 17 847 715 732 502 778

Output: 0

Input: 41 449 328 474 15724 19169

Output: 0

Input: 467 329 936 440 5705 28145

Output: 0

Input: 258 811 952 491 2995 11942

Output: 0

Input: 823 431 359 590 153 3902

Output: 206

Input: 292 370 404 698 19718 19895

Output: 0

Input: 442 705 757 527 1869 19912

Output: 0

Input: 642 273 18 885 23811 28703

Output: 0

Input: 291 303 656 660 7711 15141

Output: 0

Input: 225 862 522 617 1246 1341

Output: 0

Input: 17 847 715 732 778 27529

Output: 0

Input: 997 998 999 1000 0 31415

Output: 997

Input: 1 2 3 4 0 31415

Output: 1

Input: 541 931 822 948 131 193

Output: 63

Input: 956 800 909 916 89 194

Output: 106

Input: 735 794 942 991 419 490

Output: 72

Input: 818 926 827 575 153 395

Output: 243

Input: 792 858 887 679 179 356

Output: 178

Input: 937 683 742 515 366 373

Output: 8

Input: 616 747 501 875 146 264

Output: 119

Input: 760 773 638 655 111 196

Output: 86

Input: 697 855 997 589 97 192

Output: 96

Input: 998 834 706 722 277 475

Output: 199

Input: 100 101 102 103 10 20

Output: 11


For some experiments little Petya needs a synchrophasotron. He has already got the device, all that's left is to set the fuel supply. Fuel comes through a system of nodes numbered from 1 to n and connected by pipes. Pipes go from every node with smaller number to every node with greater number. Fuel can only flow through pipes in direction from node with smaller number to node with greater number. Any amount of fuel can enter through the first node and the last node is connected directly to the synchrophasotron. It is known that every pipe has three attributes: the minimum amount of fuel that should go through it, the maximum amount of fuel that can possibly go through it and the cost of pipe activation. If cij units of fuel (cij > 0) flow from node i to node j, it will cost aij + cij2 tugriks (aij is the cost of pipe activation), and if fuel doesn't flow through the pipe, it doesn't cost anything. Only integer number of units of fuel can flow through each pipe.Constraints on the minimal and the maximal fuel capacity of a pipe take place always, not only if it is active. You may assume that the pipe is active if and only if the flow through it is strictly greater than zero.Petya doesn't want the pipe system to be overloaded, so he wants to find the minimal amount of fuel, that, having entered the first node, can reach the synchrophasotron. Besides that he wants to impress the sponsors, so the sum of money needed to be paid for fuel to go through each pipe, must be as big as possible.

Output in the first line two space-separated numbers: the minimum possible amount of fuel that can flow into the synchrophasotron, and the maximum possible sum that needs to be paid in order for that amount of fuel to reach synchrophasotron. If there is no amount of fuel that can reach synchrophasotron, output "-1 -1". The amount of fuel which will flow into synchrophasotron is not neccessary positive. It could be equal to zero if the minimum constraint of every pipe is equal to zero.

NoteIn the first test, we can either pass 1 or 2 units of fuel from node 1 to node 2. The minimum possible amount is 1, it costs a12 + 12 = 4.In the second test, you can pass at most 2 units from node 1 to node 2, and at you have to pass at least 3 units from node 2 to node 3. It is impossible.In the third test, the minimum possible amount is 2. You can pass each unit of fuel through two different paths: either 1->2->3->4 or 1->3->4. If you use the first path twice, it will cost a12 + 22 + a23 + 22 + a34 + 22=14. If you use the second path twice, it will cost a13 + 22 + a34 + 22=14. However, if you use each path (allowing one unit of fuel go through pipes 1->2, 2->3, 1->3, and two units go through 3->4) it will cost a12 + 12 + a23 + 12 + a13 + 12 + a34 + 22=15 and it is the maximum possible cost.Also note that since no fuel flows from node 1 to node 4, activation cost for that pipe is not added to the answer.

First line contains integer n (2 ≤ n ≤ 6), which represents the number of nodes. Each of the next n(n - 1) / 2 lines contains five integers s, f, l, h, a that describe pipes — the first node of the pipe, the second node of the pipe, the minimum and the maximum amount of fuel that can flow through the pipe and the the activation cost, respectively. (1 ≤ s < f ≤ n, 0 ≤ l ≤ h ≤ 5, 0 ≤ a ≤ 6). It is guaranteed that for each pair of nodes with distinct numbers there will be exactly one pipe between them described in the input.

Input:
2
1 2 1 2 3

Output: 1 4

Input:
3
1 2 1 2 3
1 3 0 0 0
2 3 3 4 5

Output: -1 -1

Input:
4
1 2 0 2 1
2 3 0 2 1
1 3 0 2 6
1 4 0 0 1
2 4 0 0 0
3 4 2 3 0

Output: 2 15

Input:
3
1 2 0 2 1
1 3 1 2 1
2 3 1 2 1

Output: 2 6

Input:
4
3 4 2 2 6
2 3 1 1 6
1 2 1 3 1
1 4 2 3 4
2 4 0 3 2
1 3 1 2 5

Output: 4 33

Input:
6
1 2 5 5 0
1 3 0 5 0
1 4 0 5 0
1 5 0 5 0
1 6 5 5 0
2 3 0 5 0
2 4 0 5 0
2 5 0 5 0
2 6 5 5 0
3 4 0 5 0
3 5 0 5 0
3 6 5 5 0
4 5 0 5 0
4 6 5 5 0
5 6 5 5 0

Output: 25 225

Input:
4
2 3 1 2 3
2 4 0 2 0
1 3 0 1 6
1 4 0 0 5
3 4 0 2 2
1 2 0 1 3

Output: 1 11

Input:
2
1 2 0 0 6

Output: 0 0

Input:
2
1 2 0 0 2

Output: 0 0

Input:
2
1 2 0 0 5

Output: 0 0

Input:
2
1 2 0 1 5

Output: 0 0

Input:
2
1 2 0 1 0

Output: 0 0

Input:
2
1 2 1 2 0

Output: 1 1

Input:
2
1 2 0 3 2

Output: 0 0

Input:
2
1 2 0 2 6

Output: 0 0

Input:
2
1 2 2 2 5

Output: 2 9

Input:
2
1 2 1 3 1

Output: 1 2

Input:
2
1 2 0 5 1

Output: 0 0

Input:
2
1 2 0 3 4

Output: 0 0

Input:
3
1 2 0 0 3
2 3 0 0 2
1 3 0 0 0

Output: 0 0

Input:
3
1 2 0 0 1
1 3 0 0 3
2 3 0 0 4

Output: 0 0

Input:
3
1 2 0 1 0
2 3 0 0 6
1 3 0 0 0

Output: 0 0

Input:
3
1 3 0 1 2
1 2 0 0 5
2 3 1 1 6

Output: -1 -1

Input:
3
1 2 0 1 3
1 3 1 2 5
2 3 1 2 4

Output: 2 15

Input:
3
1 2 1 2 6
1 3 0 2 4
2 3 0 2 0

Output: 1 8

Input:
3
2 3 0 2 5
1 3 1 2 0
1 2 1 1 2

Output: 2 10

Input:
3
2 3 1 1 5
1 2 0 1 4
1 3 1 2 2

Output: 2 14

Input:
3
1 2 0 4 6
1 3 0 2 2
2 3 1 4 1

Output: 1 9

Input:
3
2 3 1 2 4
1 2 2 2 5
1 3 0 3 5

Output: 2 17

Input:
3
1 2 0 5 3
1 3 2 4 3
2 3 2 3 4

Output: 4 22

Input:
3
2 3 4 5 3
1 3 0 5 2
1 2 1 3 2

Output: -1 -1

Input:
4
1 3 0 0 4
2 4 0 0 5
3 4 0 0 2
2 3 0 0 0
1 2 0 0 1
1 4 0 0 4

Output: 0 0

Input:
4
1 4 0 0 0
1 3 0 0 0
2 4 0 0 6
3 4 0 0 0
1 2 0 0 1
2 3 0 0 3

Output: 0 0

Input:
4
2 4 1 1 5
1 3 0 1 0
1 4 0 0 3
3 4 0 0 0
1 2 1 1 1
2 3 1 1 4

Output: -1 -1

Input:
4
2 3 0 1 6
1 4 1 1 5
1 2 0 1 4
2 4 0 0 0
1 3 0 0 0
3 4 0 1 6

Output: 1 6

Input:
4
2 3 0 2 3
2 4 1 2 1
1 2 0 1 1
1 4 2 2 3
1 3 0 2 3
3 4 0 2 3

Output: 3 11

Input:
4
1 4 1 2 5
3 4 0 1 6
2 4 1 2 4
2 3 0 2 4
1 2 0 2 2
1 3 0 2 6

Output: 2 14

Input:
4
1 3 0 2 1
3 4 3 3 4
2 4 0 3 6
1 4 1 1 0
1 2 1 1 4
2 3 0 1 6

Output: 4 31

Input:
4
3 4 1 2 5
1 3 2 3 6
2 3 1 3 0
1 4 0 1 0
1 2 0 1 1
2 4 0 1 0

Output: -1 -1

Input:
4
3 4 2 4 5
2 3 0 0 1
1 2 1 4 1
1 4 2 4 5
2 4 4 4 5
1 3 0 4 5

Output: 8 65

Input:
4
1 2 0 2 3
1 4 1 2 6
3 4 2 4 4
2 4 4 4 2
1 3 2 4 3
2 3 0 2 3

Output: -1 -1

Input:
4
2 4 2 4 6
2 3 0 2 2
1 4 1 2 4
1 2 3 5 3
1 3 1 4 5
3 4 3 5 0

Output: 6 55

Input:
4
2 4 2 4 2
2 3 2 2 4
1 3 2 5 6
1 2 2 2 1
1 4 1 5 6
3 4 2 2 5

Output: -1 -1

Input:
5
1 5 0 0 3
3 5 0 0 2
1 3 0 0 4
3 4 0 0 0
2 3 0 0 6
1 4 0 0 1
4 5 0 0 1
1 2 0 0 3
2 5 0 0 6
2 4 0 0 4

Output: 0 0

Input:
5
4 5 0 0 4
2 5 0 0 3
1 5 0 0 4
1 2 0 0 3
1 4 0 0 3
1 3 0 0 4
2 4 0 0 5
3 5 0 0 0
2 3 0 0 0
3 4 0 0 3

Output: 0 0

Input:
5
1 3 0 1 0
1 5 0 1 1
3 4 1 1 2
4 5 0 0 1
3 5 0 1 2
2 4 0 1 4
1 4 0 0 6
2 3 1 1 4
1 2 0 0 5
2 5 0 1 0

Output: -1 -1

Input:
5
3 5 1 1 0
2 3 1 1 1
2 4 0 1 1
1 4 1 1 1
1 5 0 0 4
1 3 0 1 5
4 5 0 1 3
2 5 1 1 1
3 4 0 1 6
1 2 0 1 1

Output: -1 -1

Input:
5
2 3 1 2 3
1 5 0 1 5
1 2 0 1 1
2 5 2 2 5
1 3 0 1 1
3 5 0 2 5
4 5 0 1 2
1 4 0 1 3
3 4 2 2 0
2 4 0 2 2

Output: -1 -1

Input:
5
4 5 0 1 0
2 4 2 2 3
3 5 0 1 6
1 3 0 1 6
1 4 1 1 5
1 5 0 0 0
2 3 0 2 6
2 5 2 2 3
1 2 1 1 6
3 4 0 1 0

Output: -1 -1

Input:
5
1 4 0 1 5
2 5 1 1 6
1 3 1 3 3
3 5 0 1 5
1 5 2 3 3
2 3 0 3 2
2 4 2 2 1
1 2 3 3 5
3 4 1 3 4
4 5 2 3 1

Output: 6 52

Input:
5
2 4 0 2 1
3 4 1 3 6
1 2 2 3 0
2 5 0 3 5
4 5 0 3 2
1 5 1 3 5
1 4 2 2 5
1 3 2 3 6
2 3 0 1 2
3 5 0 1 0

Output: 7 57

Input:
5
4 5 1 3 2
1 5 2 3 1
1 3 0 4 0
2 3 3 3 0
3 5 3 3 2
1 4 3 4 2
2 4 1 3 2
2 5 0 3 4
1 2 3 4 0
3 4 0 1 4

Output: -1 -1

Input:
5
2 5 0 3 4
2 4 4 4 5
1 3 3 4 1
2 3 1 4 3
1 2 1 3 1
1 4 0 0 5
4 5 1 4 6
3 4 0 4 4
3 5 0 3 0
1 5 1 3 5

Output: -1 -1

Input:
5
1 3 3 5 6
1 5 0 5 0
3 4 0 0 2
1 2 2 4 0
3 5 3 5 4
4 5 2 3 2
2 5 1 3 0
1 4 0 4 6
2 4 3 4 0
2 3 0 2 1

Output: 7 65

Input:
5
3 4 1 5 5
1 2 4 4 3
2 4 0 4 5
2 3 5 5 4
4 5 4 5 5
1 5 4 5 5
1 3 0 1 1
1 4 2 3 1
2 5 2 5 2
3 5 1 2 1

Output: -1 -1

Input:
6
2 5 0 0 3
1 2 0 0 0
3 6 0 0 3
2 3 0 0 1
1 5 0 0 6
3 4 0 0 3
1 4 0 0 4
1 3 0 0 0
2 6 0 0 6
1 6 0 0 1
4 6 0 0 2
3 5 0 0 6
4 5 0 0 1
5 6 0 0 2
2 4 0 0 3

Output: 0 0

Input:
6
3 5 0 0 1
3 6 0 0 2
1 5 0 0 1
2 3 0 0 3
4 5 0 0 6
1 6 0 0 2
1 3 0 0 5
4 6 0 0 5
5 6 0 0 2
2 5 0 0 3
3 4 0 0 0
2 6 0 0 0
1 4 0 0 4
2 4 0 0 6
1 2 0 0 0

Output: 0 0

Input:
6
1 3 0 1 1
2 5 0 0 5
1 6 0 0 1
4 5 0 1 0
2 6 0 1 5
2 3 0 1 2
5 6 1 1 3
1 4 0 1 2
1 5 0 1 3
1 2 0 0 5
4 6 0 0 5
3 4 0 1 5
2 4 0 1 1
3 5 0 1 5
3 6 0 0 5

Output: 1 13

Input:
6
2 4 0 1 3
3 6 1 1 0
1 6 0 1 6
4 6 0 1 4
1 3 1 1 1
2 6 0 1 4
3 5 0 0 3
3 4 0 1 0
1 5 1 1 1
2 5 1 1 5
4 5 0 0 5
1 4 0 1 6
2 3 0 1 4
5 6 1 1 1
1 2 0 1 4

Output: -1 -1

Input:
6
5 6 2 2 6
2 5 1 2 2
1 4 0 1 3
1 3 2 2 5
3 5 1 2 6
1 6 0 1 5
1 5 0 0 5
4 5 0 1 5
2 4 0 0 5
2 6 0 1 4
3 4 1 1 5
4 6 0 2 3
3 6 0 0 6
2 3 0 0 4
1 2 0 1 1

Output: 3 41

Input:
6
5 6 1 1 6
1 4 1 1 1
1 2 0 0 4
2 6 1 2 3
2 3 0 0 4
1 5 0 0 5
2 5 0 1 4
2 4 0 2 2
3 6 0 2 3
4 6 0 2 4
1 3 0 2 2
1 6 2 2 0
3 4 1 2 3
4 5 0 1 6
3 5 1 1 0

Output: -1 -1

Input:
6
2 6 0 3 3
5 6 0 2 0
1 4 0 2 0
4 5 1 3 2
1 2 0 1 2
1 6 0 3 6
1 3 0 3 5
1 5 1 3 0
2 4 3 3 5
3 5 0 1 3
4 6 1 2 4
3 4 1 1 2
3 6 0 3 4
2 5 0 1 5
2 3 1 1 4

Output: -1 -1

Input:
6
2 4 1 2 3
1 5 1 3 0
4 6 1 3 3
1 4 2 2 0
4 5 2 2 2
3 6 0 2 2
2 5 1 2 4
3 5 2 3 5
1 2 0 2 2
5 6 1 2 5
2 6 3 3 1
1 3 1 2 3
1 6 2 2 6
3 4 1 2 2
2 3 0 3 6

Output: -1 -1

Input:
6
3 6 0 1 0
4 6 2 4 3
2 3 2 3 1
1 4 4 4 3
1 2 2 3 6
5 6 0 2 5
1 6 2 4 3
1 5 0 4 3
4 5 0 4 2
2 4 3 3 6
3 4 3 4 1
3 5 0 4 1
2 6 2 4 0
2 5 1 3 1
1 3 0 2 3

Output: -1 -1

Input:
6
2 4 0 1 1
2 3 0 4 4
1 6 1 4 2
4 5 3 3 3
3 4 1 2 0
1 3 0 2 5
1 2 3 4 1
4 6 4 4 2
2 5 0 2 2
3 6 2 3 2
5 6 0 3 1
1 5 1 4 2
3 5 1 4 5
1 4 0 1 6
2 6 1 3 3

Output: -1 -1

Input:
6
4 6 4 5 2
2 4 1 2 4
5 6 0 1 0
3 5 0 1 2
3 4 1 5 2
2 6 0 4 0
1 2 1 2 4
1 4 0 3 6
1 3 1 3 4
2 5 3 4 4
1 6 0 1 6
2 3 0 4 1
3 6 1 2 4
4 5 1 3 2
1 5 0 4 2

Output: -1 -1

Input:
6
1 3 3 5 5
5 6 0 0 5
1 6 1 1 6
3 5 4 5 6
3 6 0 0 4
4 6 5 5 0
2 6 2 3 1
1 5 0 4 5
4 5 3 3 2
1 2 1 5 5
2 3 3 5 5
2 5 2 2 1
2 4 0 4 1
1 4 4 4 2
3 4 1 1 3

Output: -1 -1

Input:
6
1 2 0 5 0
1 3 0 5 0
1 4 0 5 0
1 5 0 5 0
1 6 0 5 0
2 3 0 5 0
2 4 0 5 0
2 5 0 5 0
2 6 0 5 0
3 4 0 5 0
3 5 0 5 0
3 6 0 5 0
4 5 0 5 0
4 6 0 5 0
5 6 0 5 0

Output: 0 0

Input:
6
3 4 4 5 4
2 4 1 4 1
5 6 0 3 5
1 2 5 5 1
2 5 0 4 3
4 6 0 5 1
4 5 2 3 2
1 6 3 4 6
1 4 1 4 6
2 3 2 4 6
1 5 0 5 5
3 6 0 0 1
2 6 1 2 6
1 3 0 5 2
3 5 1 2 5

Output: 11 141

Input:
6
5 6 0 1 4
1 6 2 5 1
1 4 2 3 6
4 6 3 5 5
3 4 1 2 5
1 5 0 2 6
1 3 0 1 4
4 5 0 1 4
2 3 0 1 3
2 5 0 5 2
1 2 1 4 2
3 6 1 5 0
2 4 1 5 2
3 5 0 3 0
2 6 1 5 2

Output: 8 72

Input:
6
2 4 1 3 1
1 3 4 5 4
2 5 0 1 2
3 4 0 4 5
1 5 2 4 2
1 2 1 5 3
2 3 0 5 1
5 6 1 5 4
2 6 2 4 3
4 5 2 2 4
4 6 1 1 1
1 6 2 4 1
1 4 2 3 5
3 6 2 3 3
3 5 0 4 5

Output: 13 118

Input:
6
4 6 0 1 5
3 4 0 1 0
4 5 0 5 0
2 5 1 4 4
1 4 2 4 6
3 5 1 5 6
2 3 4 4 4
2 6 0 0 4
1 5 1 5 0
2 4 0 1 0
1 3 2 2 0
1 2 2 5 4
3 6 0 5 4
1 6 2 5 1
5 6 1 4 0

Output: 12 133

Input:
6
1 2 1 2 2
1 3 1 3 5
1 4 3 3 3
1 5 1 1 1
1 6 3 5 6
2 3 1 5 5
2 4 3 3 0
2 5 0 1 6
2 6 4 5 5
3 4 2 3 0
3 5 1 2 6
3 6 1 1 2
4 5 0 1 0
4 6 4 4 4
5 6 2 5 5

Output: -1 -1

Input:
6
1 2 0 5 0
1 3 0 5 0
1 4 0 5 0
1 5 0 5 0
1 6 0 5 0
2 3 0 5 0
2 4 0 5 0
2 5 0 5 0
2 6 0 5 0
3 4 0 5 0
3 5 0 5 0
3 6 0 5 0
4 5 0 5 0
4 6 0 5 0
5 6 1 5 0

Output: 1 5

Input:
6
1 2 0 5 0
1 3 0 5 0
1 4 0 5 0
1 5 0 5 0
1 6 0 5 0
2 3 0 5 0
2 4 0 5 0
2 5 0 5 0
2 6 0 5 0
3 4 0 5 0
3 5 0 5 0
3 6 0 5 0
4 5 0 5 0
4 6 0 5 0
5 6 5 5 0

Output: 5 125

Input:
6
1 2 1 5 0
1 3 0 5 0
1 4 0 5 0
1 5 0 5 0
1 6 0 5 0
2 3 0 5 0
2 4 0 5 0
2 5 0 5 0
2 6 0 5 0
3 4 0 5 0
3 5 0 5 0
3 6 0 5 0
4 5 0 5 0
4 6 0 5 0
5 6 0 5 0

Output: 1 5

Input:
6
1 2 5 5 0
1 3 0 5 0
1 4 0 5 0
1 5 0 5 0
1 6 0 5 0
2 3 0 5 0
2 4 0 5 0
2 5 0 5 0
2 6 0 5 0
3 4 0 5 0
3 5 0 5 0
3 6 0 5 0
4 5 0 5 0
4 6 0 5 0
5 6 0 5 0

Output: 5 125

Input:
6
1 2 0 5 0
1 3 0 5 0
1 4 0 5 0
1 5 0 5 0
1 6 5 5 0
2 3 0 5 0
2 4 0 5 0
2 5 0 5 0
2 6 5 5 0
3 4 0 5 0
3 5 0 5 1
3 6 5 5 0
4 5 0 5 0
4 6 5 5 0
5 6 5 5 0

Output: 25 225

Input:
6
1 2 5 5 0
1 3 5 5 0
1 4 4 5 0
1 5 5 5 0
1 6 5 5 3
2 3 0 5 0
2 4 0 5 2
2 5 0 5 0
2 6 0 5 0
3 4 1 5 4
3 5 0 5 0
3 6 0 5 1
4 5 0 5 0
4 6 1 5 0
5 6 0 5 6

Output: 24 223

Input:
6
1 2 0 0 0
1 3 0 0 0
1 4 0 0 0
1 5 0 0 0
1 6 0 0 0
2 3 0 0 0
2 4 0 0 0
2 5 0 0 0
2 6 0 0 0
3 4 0 0 0
3 5 0 0 0
3 6 0 0 0
4 5 0 0 0
4 6 0 0 0
5 6 0 0 0

Output: 0 0

Input:
6
1 2 0 5 6
1 3 0 5 6
1 4 0 5 6
1 5 0 5 6
1 6 0 5 6
2 3 0 5 6
2 4 0 5 6
2 5 0 5 6
2 6 0 5 6
3 4 0 5 6
3 5 0 5 6
3 6 0 5 6
4 5 0 5 6
4 6 0 5 6
5 6 0 5 6

Output: 0 0

Input:
2
1 2 0 0 0

Output: 0 0


Anton and Dasha like to play different games during breaks on checkered paper. By the 11th grade they managed to play all the games of this type and asked Vova the programmer to come up with a new game. Vova suggested to them to play a game under the code name "dot" with the following rules:  On the checkered paper a coordinate system is drawn. A dot is initially put in the position (x, y).  A move is shifting a dot to one of the pre-selected vectors. Also each player can once per game symmetrically reflect a dot relatively to the line y = x.  Anton and Dasha take turns. Anton goes first.  The player after whose move the distance from the dot to the coordinates' origin exceeds d, loses. Help them to determine the winner.

You should print "Anton", if the winner is Anton in case of both players play the game optimally, and "Dasha" otherwise.

NoteIn the first test, Anton goes to the vector (1;2), and Dasha loses. In the second test Dasha with her first move shifts the dot so that its coordinates are (2;3), and Anton loses, as he has the only possible move — to reflect relatively to the line y = x. Dasha will respond to it with the same move and return the dot in position (2;3).

The first line of the input file contains 4 integers x, y, n, d ( - 200 ≤ x, y ≤ 200, 1 ≤ d ≤ 200, 1 ≤ n ≤ 20) — the initial coordinates of the dot, the distance d and the number of vectors. It is guaranteed that the initial dot is at the distance less than d from the origin of the coordinates. The following n lines each contain two non-negative numbers xi and yi (0 ≤ xi, yi ≤ 200) — the coordinates of the i-th vector. It is guaranteed that all the vectors are nonzero and different.

Input:
0 0 2 3
1 1
1 2

Output: Anton

Input:
0 0 2 4
1 1
1 2

Output: Dasha

Input:
0 0 5 100
12 105
15 59
21 1
27 6
27 76

Output: Anton

Input:
0 0 5 100
16 24
29 6
44 24
66 37
102 19

Output: Anton

Input:
0 0 5 100
4 108
5 170
7 30
7 101
21 117

Output: Anton

Input:
0 0 5 100
30 9
53 14
84 7
94 18
121 16

Output: Anton

Input:
0 0 5 100
52 144
55 58
56 103
98 65
134 16

Output: Anton

Input:
0 0 5 100
17 3
42 24
72 22
72 25
120 25

Output: Dasha

Input:
0 0 5 100
21 38
43 42
59 29
69 3
84 52

Output: Anton

Input:
0 0 5 100
2 164
23 107
30 167
46 178
66 148

Output: Dasha

Input:
3 -1 20 200
2 27
12 61
14 76
16 20
19 72
20 22
30 27
39 61
42 44
45 8
46 23
57 13
62 56
64 67
80 30
94 34
94 77
100 36
101 13
107 9

Output: Anton

Input:
3 -1 20 200
1 139
8 76
10 97
25 99
26 147
29 51
48 79
56 164
67 80
71 35
89 90
108 16
108 127
127 54
137 13
140 156
146 104
160 155
164 138
172 102

Output: Anton

Input:
3 -1 20 200
1 28
9 80
20 92
29 82
38 65
42 9
50 65
67 57
71 60
73 51
78 89
86 31
90 39
97 96
104 27
115 49
119 59
125 18
132 37
133 9

Output: Anton

Input:
3 -1 20 200
3 51
6 75
7 105
8 109
12 59
12 90
15 71
17 150
18 161
19 106
23 71
26 68
34 95
36 47
38 29
38 153
41 91
43 128
43 164
44 106

Output: Anton

Input:
3 -1 20 200
19 12
24 121
25 32
28 19
28 87
29 49
32 88
33 70
37 77
54 33
56 27
61 59
67 42
73 15
76 40
80 73
83 39
91 34
91 112
95 95

Output: Anton

Input:
-3 -14 20 200
6 90
7 12
15 24
16 67
26 35
34 63
35 48
36 30
48 28
56 35
59 91
60 34
76 43
77 90
77 95
79 34
87 69
93 6
99 10
99 41

Output: Anton

Input:
-3 -14 20 200
5 54
10 62
20 43
20 79
21 47
32 75
33 48
40 61
44 65
52 7
52 28
55 65
55 67
59 78
68 52
70 20
71 72
76 50
90 100
99 9

Output: Dasha

Input:
-3 -14 20 200
1 60
5 47
10 6
14 17
14 32
34 93
40 9
43 85
44 47
49 59
57 85
68 50
69 93
71 42
71 57
73 5
74 70
83 41
83 83
89 8

Output: Anton

Input:
-3 -14 20 200
14 51
26 54
30 50
38 41
40 68
47 12
50 86
63 4
65 52
67 83
70 88
71 61
79 82
82 53
89 84
90 16
92 79
97 37
100 37
100 93

Output: Dasha

Input:
-3 -14 20 200
11 24
13 8
14 8
15 44
15 54
20 79
24 72
27 7
28 6
30 18
46 34
51 5
64 83
69 48
78 76
79 2
89 43
92 31
94 76
99 64

Output: Anton

Input:
12 -11 20 200
12 147
14 181
14 198
33 51
34 93
43 29
47 44
56 161
66 111
96 119
102 71
117 184
133 69
151 189
152 28
173 27
173 120
176 12
183 1
188 196

Output: Anton

Input:
12 -11 20 200
6 108
14 188
23 60
28 44
35 151
36 82
58 49
65 81
97 100
104 26
114 143
136 156
139 112
142 119
147 184
148 46
149 152
175 178
184 85
187 12

Output: Anton

Input:
12 -11 20 200
11 189
12 108
19 190
21 27
24 193
26 86
26 123
31 180
39 196
107 193
122 46
129 103
131 129
132 135
142 51
157 22
161 27
195 163
198 55
199 64

Output: Anton

Input:
12 -11 20 200
8 176
11 162
25 130
32 124
58 175
59 170
61 98
66 37
78 5
87 150
94 172
99 171
121 11
121 31
124 172
131 71
134 190
162 50
182 99
194 119

Output: Anton

Input:
12 -11 20 200
6 80
12 62
14 15
16 133
41 28
43 47
79 136
90 196
99 151
99 187
119 42
121 11
147 132
149 166
161 102
174 4
182 122
194 50
200 182
200 197

Output: Anton

Input:
0 0 19 27
1 25
11 3
12 38
27 52
35 111
36 51
44 7
45 106
58 104
63 108
75 4
76 84
89 2
89 44
92 23
98 66
111 58
113 9
114 76

Output: Anton

Input:
0 0 15 98
5 14
9 133
10 128
15 140
17 53
33 43
50 15
69 55
74 134
77 100
99 82
100 140
102 12
110 65
128 110

Output: Anton

Input:
0 0 19 34
0 116
6 11
6 32
9 84
14 3
27 85
42 58
46 31
52 104
65 83
66 37
68 130
69 69
78 7
78 23
81 66
90 27
91 39
96 10

Output: Anton

Input:
0 0 17 141
9 30
9 55
11 64
18 37
20 94
23 37
23 140
28 134
36 43
38 77
50 47
54 42
70 32
74 151
85 68
87 53
88 91

Output: Anton

Input:
0 0 17 160
31 75
32 149
49 132
54 98
54 100
57 48
65 20
67 177
72 76
74 25
99 49
105 86
128 116
147 176
156 130
160 26
178 177

Output: Anton

Input:
-100 -100 10 200
0 1
1 0
1 1
31 41
3 4
5 2
1 2
3 3
9 8
10 2

Output: Anton

Input:
-140 -140 2 200
1 0
0 1

Output: Dasha

Input:
-130 -130 20 200
0 1
1 0
1 1
31 41
3 4
5 2
1 2
3 3
9 8
10 2
0 2
0 3
0 4
0 5
0 6
2 0
3 0
4 0
5 0
6 0

Output: Anton

Input:
-133 -133 20 200
1 0
0 1
1 1
2 0
0 2
2 1
1 2
3 0
0 3
3 1
3 2
3 3
2 2
2 3
1 3
4 0
0 4
4 1
1 4
2 4

Output: Anton

Input:
-12 -34 5 200
1 0
2 0
3 1
10 3
11 4

Output: Dasha


Vasya plays The Elder Trolls IV: Oblivon. Oh, those creators of computer games! What they do not come up with! Absolutely unique monsters have been added to the The Elder Trolls IV: Oblivon. One of these monsters is Unkillable Slug. Why it is "Unkillable"? Firstly, because it can be killed with cutting weapon only, so lovers of two-handed amber hammers should find suitable knife themselves. Secondly, it is necessary to make so many cutting strokes to Unkillable Slug. Extremely many. Too many! Vasya has already promoted his character to 80-th level and in order to gain level 81 he was asked to kill Unkillable Slug. The monster has a very interesting shape. It looks like a rectangular parallelepiped with size x × y × z, consisting of undestructable cells 1 × 1 × 1. At one stroke Vasya can cut the Slug along an imaginary grid, i.e. cut with a plane parallel to one of the parallelepiped side. Monster dies when amount of parts it is divided reaches some critical value.All parts of monster do not fall after each cut, they remains exactly on its places. I. e. Vasya can cut several parts with one cut.Vasya wants to know what the maximum number of pieces he can cut the Unkillable Slug into striking him at most k times.Vasya's character uses absolutely thin sword with infinite length.

Output the only number — the answer for the problem. Please, do not use %lld specificator to read or write 64-bit integers in C++. It is preffered to use cout (also you may use %I64d).

NoteIn the first sample Vasya make 3 pairwise perpendicular cuts. He cuts monster on two parts with the first cut, then he divides each part on two with the second cut, and finally he divides each of the 4 parts on two.

The first line of input contains four integer numbers x, y, z, k (1 ≤ x, y, z ≤ 106, 0 ≤ k ≤ 109).

Input: 2 2 2 3

Output: 8

Input: 2 2 2 1

Output: 2

Input: 1 1 1 1

Output: 1

Input: 1 2 3 3

Output: 6

Input: 20 4 5 12

Output: 120

Input: 100 500 100500 1000000000

Output: 5025000000

Input: 2 5 5 9

Output: 50

Input: 11 1 11 11

Output: 42

Input: 100500 5000 500 100000000

Output: 251250000000

Input: 2 2 2 0

Output: 1

Input: 1000000 1000000 1000000 2444441

Output: 540974149875309150

Input: 1000000 1000000 1000000 1000000000

Output: 1000000000000000000

Input: 1000000 1000000 1000000 2999996

Output: 999999000000000000

Input: 1000000 1000000 1000000 2999997

Output: 1000000000000000000

Input: 999999 1000000 999997 999999999

Output: 999996000003000000

Input: 500000 1000000 750000 100000

Output: 37040370459260

Input: 999999 1 999998 1333333

Output: 444445555556

Input: 500000 10000 1000000 29998

Output: 1000100000000

Input: 10000 500000 1000000 29999

Output: 1000200010000

Input: 10000 1000000 500000 29996

Output: 999900000000

Input: 999999 123456 987654 0

Output: 1

Input: 1 1 1 0

Output: 1

Input: 219482 801483 941695 280976

Output: 821595067700400

Input: 808994 288453 204353 580644

Output: 7250580779648149

Input: 428676 64403 677407 626161

Output: 5081000961597840

Input: 559002 326875 150818 157621

Output: 145045169133102

Input: 178008 590076 624581 201286

Output: 302062187173952

Input: 797745 854005 98703 735186

Output: 9996502351557447

Input: 418223 118667 573175 776998

Output: 12857677898465963

Input: 39436 384053 48008 313346

Output: 427693170156640

Input: 661377 149342 523189 353305

Output: 1633415415004970

Input: 781081 414037 495753 892089

Output: 26294515330164544

Input: 402353 679460 969495 930195

Output: 29810031851367496

Input: 593408 709898 624186 915570

Output: 28425961712082871

Input: 1000 988 1000000 3000

Output: 1002820000

Input: 91839 2 3 50

Output: 288

Input: 999900 999990 4 129

Output: 16384

Input: 1024 100000 4 13

Output: 144

Input: 1000000 1000000 1000000 1000000000

Output: 1000000000000000000

Input: 1 1000000 1 1000000000

Output: 1000000

Input: 2 1000 1000000 1000000000

Output: 2000000000

Input: 999999 2 1000000 1000000000

Output: 1999998000000

Input: 1000 1 1 1

Output: 2

Input: 1000 1 1 998

Output: 999

Input: 1000 1 1 1000

Output: 1000

Input: 33334 66667 1000000 100000

Output: 37040370459260

Input: 1 1000000 2 23123

Output: 46246