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.
The first line contains 6 integers *a*, *b*, *c*, *d*, *e*, *f* (0 ≤ *a*, *b*, *c*, *d*, *e*, *f* ≤ 1000).
Consider 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.
100 200 250 150 200 250
Ron
100 50 50 200 200 100
Hermione
100 10 200 20 300 30
Hermione
0 0 0 0 0 0
Hermione
1 1 0 1 1 1
Ron
1 0 1 2 1 2
Hermione
100 1 100 1 0 1
Ron
1 1 2 2 1 1
Hermione
4 4 1 3 1 4
Ron
3 3 2 1 4 4
Hermione
5 1 2 9 1 10
Ron
63 65 21 41 95 23
Hermione
913 0 0 0 0 0
Hermione
0 333 0 0 0 0
Hermione
842 538 0 0 0 0
Hermione
0 0 536 0 0 0
Hermione
324 0 495 0 0 0
Hermione
0 407 227 0 0 0
Hermione
635 63 924 0 0 0
Hermione
0 0 0 493 0 0
Ron
414 0 0 564 0 0
Ron
0 143 0 895 0 0
Ron
276 264 0 875 0 0
Ron
0 0 532 186 0 0
Hermione
510 0 692 825 0 0
Hermione
0 777 910 46 0 0
Ron
754 329 959 618 0 0
Hermione
0 0 0 0 416 0
Hermione
320 0 0 0 526 0
Hermione
0 149 0 0 6 0
Hermione
996 13 0 0 111 0
Hermione
0 0 531 0 688 0
Hermione
544 0 837 0 498 0
Hermione
0 54 680 0 988 0
Hermione
684 986 930 0 555 0
Hermione
0 0 0 511 534 0
Ron
594 0 0 819 304 0
Ron
0 55 0 977 230 0
Ron
189 291 0 845 97 0
Ron
0 0 77 302 95 0
Hermione
247 0 272 232 96 0
Hermione
0 883 219 748 77 0
Ron
865 643 599 98 322 0
Hermione
0 0 0 0 0 699
Hermione
907 0 0 0 0 99
Hermione
0 891 0 0 0 529
Hermione
640 125 0 0 0 849
Hermione
0 0 698 0 0 702
Hermione
58 0 483 0 0 470
Hermione
0 945 924 0 0 355
Hermione
998 185 209 0 0 554
Hermione
0 0 0 914 0 428
Ron
412 0 0 287 0 575
Ron
0 850 0 509 0 76
Ron
877 318 0 478 0 782
Ron
0 0 823 740 0 806
Hermione
126 0 620 51 0 835
Hermione
0 17 946 633 0 792
Ron
296 546 493 22 0 893
Ron
0 0 0 0 766 813
Hermione
319 0 0 0 891 271
Hermione
0 252 0 0 261 576
Hermione
876 440 0 0 65 362
Hermione
0 0 580 0 245 808
Hermione
835 0 116 0 9 552
Hermione
0 106 748 0 773 840
Hermione
935 388 453 0 797 235
Hermione
0 0 0 893 293 289
Ron
938 0 0 682 55 725
Ron
0 710 0 532 389 511
Ron
617 861 0 247 920 902
Ron
0 0 732 202 68 389
Hermione
279 0 254 964 449 143
Hermione
0 746 400 968 853 85
Ron
565 846 658 828 767 734
Ron
6 6 1 6 1 6
Ron
3 6 1 6 3 3
Ron
6 3 1 3 2 3
Ron
3 6 2 2 6 3
Hermione
3 2 2 1 3 3
Hermione
1 1 1 6 1 1
Ron
1 3 1 3 3 2
Ron
6 2 6 6 2 3
Hermione
2 6 2 1 2 1
Hermione
2 3 2 1 6 6
Hermione
2 1 2 1 6 2
Hermione
6 1 3 1 3 3
Hermione
1 2 2 3 2 2
Ron
3 3 2 6 3 6
Ron
2 1 6 1 2 6
Hermione
2 3 1 3 1 6
Ron
6 6 2 3 1 3
Ron
6 2 6 2 3 1
Hermione
1 6 6 2 3 2
Ron
6 3 6 2 6 6
Hermione
1 3 1 6 6 1
Ron
1 1 1 1 6 6
Hermione
2 6 2 2 2 3
Ron
1 6 1 6 6 3
Ron
6 6 3 1 3 3
Hermione
2 6 6 1 2 6
Ron
3 2 6 6 1 6
Ron
1 2 3 2 2 3
Ron
2 6 1 1 1 6
Ron
1 6 3 6 6 3
Ron
3 3 3 2 6 2
Hermione
6 2 3 6 2 2
Hermione
2 1 2 3 3 2
Hermione
6 2 1 1 3 6
Hermione
6 6 6 6 3 2
Hermione
6 1 1 6 2 3
Ron
6 1 3 6 1 2
Hermione
2 1 2 6 6 1
Hermione
1 2 2 3 2 1
Ron
2 2 6 6 6 6
Hermione
31 75 12 62 94 137
Ron
236 9 184 68 345 332
Hermione
362 142 107 565 329 608
Ron
731 859 197 474 370 465
Ron
452 577 639 31 60 673
Hermione
821 294 730 941 101 530
Ron
542 11 820 850 791 738
Hermione
911 728 910 407 833 594
Hermione
632 446 352 317 522 451
Hermione
import math


def solve(c1: int, c2: int, c3: int, c4: int, c5: int, c6: int):
    if c2 * c4 * c6 == 0 and c1 * c3 * c5 == 0:
        pass

    return "Ron" if c2 * c4 * c6 > c1 * c3 * c5 else 'Hermione'


def main():
    # inp_str = input()
    inp_str = "100 200 250 150 200 250"

    inp = list(map(int, inp_str.split(" ")))

    res = solve(*inp)
    print(res)


if __name__ == '__main__':
    main()

# 100 50 50 200 200 100 = Hermione
# 100 10 200 20 300 30 = Hermione
# 100 200 250 150 200 250 = Ron
