Distance Duel


Alice and Bob want to go on an adventure. Every day for nn days, they each move in a compass direction by a certain number of kilometres. Your task is to determine who is further from where they started after nn days of movement.

Input Format

The first line contains an integer nn, the number of days.

The next nn lines each contain two strings for Alice and Bob respectively, each with a direction (one of "N", "S", "E", "W") followed by an integer kk, the distance in kilometres.

Output Format

Print "Alice" if Alice is further from the origin, "Bob" if Bob is further, or "Tie" if they are equidistant from the origin.

Constraints

  • 1≤n≤1051 \leq n \leq 10^5
  • 0≤k≤1050 \leq k \leq 10^5

Example 1

Input 1
3
W5 E4
S7 S2
E5 N5
Output 1
Alice

Alice moves 5km west, 7km south and 5km east, so she ends up 7km from the origin. Bob moves 4km east, 2km south and 5km north, so he ends up 5km from the origin.

Example 2

Input 2
5
N8 S0
E3 W7
S12 W4
E14 N2
N2 W6
Output 2
Tie

Comments2


0
SKski

easy porblem

0
SKski

problem

New comment


Log in to join the discussion.