The 2014 Nordic Collegiate Programming Contest

#### Start

2014-10-04 09:00 UTC

## The 2014 Nordic Collegiate Programming Contest

#### End

2014-10-04 14:00 UTC
The end is near!
Contest is over.
Not yet started.
Contest is starting in -1530 days 9:29:10

5:00:00

0:00:00

# Problem DDice Game

Photo by JD Hancock

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 $10$ sides with numbers $47, 48, \ldots , 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 2 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, \dots , b$, where $a$ and $b$ are the lowest and highest numbers respectively on the die. Each number appears exactly on one side, so the die has $b-a+1$ sides.

## Input

The first line contains four integers $a_1, b_1, a_2, b_2$ that describe Gunnar’s dice. Die number $i$ contains numbers $a_ i, a_ i + 1, \dots , b_ i$ on its sides. You may assume that $1\le a_ i \le b_ i \le 100$. You can further assume that each die has at least four sides, so $a_ i + 3\le b_ i$.

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

## Output

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

Sample Input 1 Sample Output 1
1 4 1 4
1 6 1 6

Emma

Sample Input 2 Sample Output 2
1 8 1 8
1 10 2 5

Tie

Sample Input 3 Sample Output 3
2 5 2 7
1 5 2 5

Gunnar