409_A. The Great Game
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
```python
"""
Codeforces April Fools Contest 2014 Problem A

Author  : chaotic_iak
Language: Python 3.3.4
"""

class InputHandlerObject(object):
    inputs = []

    def getInput(self, n = 0):
        res = ""
        inputs = self.inputs
        if not inputs: inputs.extend(input().split(" "))
        if n == 0:
            res = inputs[:]
            inputs[:] = []
        while n > len(inputs):
            inputs.extend(input().split(" "))
        if n > 0:
            res = inputs[:n]
            inputs[:n] = []
        return res
InputHandler = InputHandlerObject()
g = InputHandler.getInput

############################## SOLUTION ##############################
plays = ["()", "[]", "8<"]

x = input()
y = input()
w = 0
for i in range(0, len(x)//2):
    m = plays.index(x[2*i:2*i+2])
    n = plays.index(y[2*i:2*i+2])
    if m == n+1 or m == n-2: w += 1
    if m == n+2 or m == n-1: w -= 1

if w > 0:
    print("TEAM 1 WINS")
if w == 0:
    print("TIE")
if w < 0:
    print("TEAM 2 WINS")
```