Problem: Two teams meet in The Game World Championship. Some scientists consider this game to be the most intellectually challenging game in the world. You are given two strings describing the teams' actions in the final battle. Figure out who became the champion.

Input

The input contains two strings of equal length (between 2 and 20 characters, inclusive). Each line describes the actions of one team.

Output

Output "TEAM 1 WINS" if the first team won, "TEAM 2 WINS" if the second team won, and "TIE" if there was a tie.

Examples

Input

[]()[]8&lt;
8&lt;[]()8&lt;


Output

TEAM 2 WINS


Input

8&lt;8&lt;()
[]8&lt;[]


Output

TIE

Solution (in PYTHON):

Solution:
v = dict({'[]':0, '8<':1, '()':2})
def cmp(sa,sb):
  c = 0
  for i in range(0,len(sa),2):
    if sa[i:i+2] == sb[i:i+2]:
      continue
    ia, ib = v[sa[i:i+2]], v[sb[i:i+2]]
    if ia - ib in [-2,1]:
      c += 1
    else:
      c -= 1
  return c

sa = raw_input().strip()
sb = raw_input().strip()
r = cmp(sa,sb)
if r > 0:
  print 'TEAM 1 WINS'
elif r < 0:
  print 'TEAM 2 WINS'
else:
  print 'TIE'