• محدودیت زمان: ۱ ثانیه
  • محدودیت حافظه: ۲۵۶ مگابایت

Gunnar and Emma play a lot of board games at home, so they own many dice that are not normal 6-sided dice. For example they own a die that has 1010 sides with numbers 47,48,...,5647, 48, ..., 56 on it.

There has been a big storm in Stockholm, so Gunnar and Emma have been stuck at home without electricity for a couple of hours. They have finished playing all the games they have, so they came up with a new one.

Each player has 22 dice which he or she rolls. The player with a bigger sum wins. If both sums are the same, the game ends in a tie.

Given the description of Gunnar’s and Emma’s dice, which player has higher chances of winning?

All of their dice have the following property: each die contains numbers a,a+1,...,ba, a + 1, ..., b, where aa and bb are the lowest and highest numbers respectively on the die. Each number appears exactly on one side, so the die has ba+1b - a + 1 sides.

ورودی

The first line contains four integers a1,b1,a2,b2a_1, b_1, a_2, b_2 that describe Gunnar’s dice. Dice number ii contains numbers ai,ai+1,...,bia_i, a_i + 1, ..., b_i on its sides. You may assume that 1aibi1001 \le ai \le bi \le 100 . You can further assume that each die has at least four sides, so ai+3bia_i + 3 \le b_i .

The second line contains the description of Emma’s dice in the same format.

خروجی

Output the name of the player that has higher probability of winning. Output "Tie" if both players have same probability of winning.

مثال

ورودی نمونه ۱

1 4 1 4
1 6 1 6
Plain text

خروجی نمونه ۱

Emma
Plain text

ورودی نمونه ۲

1 8 1 8
1 10 2 5
Plain text

خروجی نمونه ۲

Tie
Plain text

ورودی نمونه ۳

2 5 2 7
1 5 2 5
Plain text

خروجی نمونه ۳

Gunnar
Plain text

ارسال پاسخ برای این سؤال
فایلی انتخاب نشده است.