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 JAVA):

Solution:
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.*;

public class Main {public static void main(String[] args) throws Exception {new Solve();}}

class Solve { public Solve() throws Exception {solve();}
    static BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
    static StringTokenizer st = new StringTokenizer("");

    static Scanner sc = new Scanner(System.in);

    void solve() throws Exception {
        String s1 = NS();
        String s2 = NS();
        int sum1 = 0, sum2 = 0;

        for (int i = 0; i < s1.length(); i+= 2) {
            if (s1.charAt(i) == '8' && s2.charAt(i) == '[')
                sum1++;
            if (s1.charAt(i) == '8' && s2.charAt(i) == '(')
                sum2++;
            if (s1.charAt(i) == '[' && s2.charAt(i) == '8')
                sum2++;
            if (s1.charAt(i) == '[' && s2.charAt(i) == '(')
                sum1++;
            if (s1.charAt(i) == '(' && s2.charAt(i) == '8')
                sum1++;
            if (s1.charAt(i) == '(' && s2.charAt(i) == '[')
                sum2++;
        }
        System.out.println(sum1 > sum2 ? "TEAM 1 WINS" : sum1 < sum2 ? "TEAM 2 WINS" : "TIE");
    }



    class Pair {int i, j; public Pair(int a, int b) {
        i = a;
        j = b;}}

    int min(int i1,int i2){return i1<i2?i1:i2;}
    long min(long i1,long i2){return i1<i2?i1:i2;}
    int max(int i1,int i2){return i1>i2?i1:i2;}
    long max(long i1,long i2){return i1>i2?i1:i2;}
    String NS()throws Exception{while(!st.hasMoreTokens())st=new StringTokenizer(stdin.readLine());return st.nextToken();}
    String NLn() throws Exception {return stdin.readLine();}
    int NI()throws Exception{return Integer.parseInt(NS());}
    long NL()throws Exception{return Long.parseLong(NS());}
    double ND()throws Exception{return Double.parseDouble(NS());}
    int abs(int x){return x<0?-x:x;}
    void sortA(int[]a){Arrays.sort(a);}
}