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
()[][]()()[][]()8<8<
8<[]()()()8<[][]()()
 []8<[]()()()[]
8<[]8<()8<()8<
 8<()8<[]
()[][]()
 ()
[]
 8<8<8<
[]()8<
 []8<[]8<[]()
8<[]8<8<[]8<
 []8<8<[]
[]8<()[]
 8<8<8<[]
[][][][]
 []
[]
 ()[]()()
()()[]()
 ()[][]8<
8<()8<()
 8<()8<8<8<8<()8<
[]()()8<()[][][]
 []
()
 ()
8<
 ()
()
 []8<
8<()
 8<
[]
 8<8<()
[]8<[]
 [][]()[]
[]8<8<[]
 8<()()()8<8<
[]8<()()[][]
 ()()()()8<()()()8<
()[][][]8<()[][][]
 [][]8<8<8<8<
8<[][]()8<()
 []()[]8<
8<[]()8<
 ()[]()()8<[]8<[]
()()()8<8<()8<[]
 8<()()[]()[]
8<8<8<8<[][]
 ()[]()()()
[]()[][]8<
 []()()()8<[]8<[]
[][]8<[]()[][][]
 [][]8<[][]8<[]()()()
()()[][]8<[]()8<[][]
 []8<()()()()8<8<8<[]
()()[][][]8<[]()8<8<
 8<
8<
 []()
()()

TEAM 2 WINS TEAM 2 WINS TIE TEAM 2 WINS TIE TIE TEAM 2 WINS TEAM 1 WINS TIE TIE TIE TIE TEAM 1 WINS TEAM 1 WINS TIE TEAM 2 WINS TEAM 1 WINS TIE TIE TEAM 1 WINS TEAM 2 WINS TEAM 2 WINS TEAM 2 WINS TEAM 1 WINS TIE TEAM 2 WINS TEAM 2 WINS TEAM 1 WINS TEAM 2 WINS TIE TEAM 1 WINS
import sun.misc.Compare;

import java.io.*;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.*;
import java.util.Calendar.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;

import static java.math.BigInteger.*;

public class Main {

    double tBeg;
    PrintWriter err;

    void run(){
        //        try {
        //            br = new BufferedReader(new InputStreamReader(System.in));
        //            out = new PrintWriter(new OutputStreamWriter(System.out));
        //            br = new BufferedReader(new FileReader("input.txt"));
        //            out = new PrintWriter(new FileWriter("output.txt"));


        boolean oj = System.getProperty("ONLINE_JUDGE") != null;
        Locale.setDefault(Locale.US);
        //oj = true;
        try{
            err = new PrintWriter(new OutputStreamWriter(System.err));
            if( oj ){
                br = new BufferedReader(new InputStreamReader(System.in));
                out = new PrintWriter(new OutputStreamWriter(System.out));
            }
            else{
                br  = new BufferedReader(new FileReader("input.txt" ));
                //                br  = new BufferedReader(new FileReader("C:/inp.txt" ));
                out = new PrintWriter   (new FileWriter("output.txt"));
            }
        }catch(Exception e){
            MLE();
        }
        tBeg = System.currentTimeMillis();
        solve();
        if( !oj )out.println( "TIME: " + (System.currentTimeMillis() - tBeg ) / 1e3 );
        exit(0);
    }

    void exit( int val ){
        out.close();
        System.exit(val);
    }

    StringTokenizer st;
    BufferedReader br;
    PrintWriter out;

    String readLine(){
        try {
            return br.readLine();
        } catch (IOException e) {
            return null;
        }
    }

    String next(){
        while( st==null || !st.hasMoreElements() )
            st = new StringTokenizer(readLine());
        return st.nextToken();
    }

    int nextInt(){ return Integer.parseInt(next()); }
    long nextLong(){ return Long.parseLong(next()); }
    double nextDouble(){ return Double.parseDouble(next()); }

    void MLE(){
        int[][] arr = new int[1024*1024][]; for( int i = 0; i < 1024*1024; ++i ) arr[i] = new int[1024*1024];
    }

    void TLE(){
        for(;;);
    }

    public static void main(String[] args) {
        new Main().run();

        //        new Thread(null, new Runnable() {
        //            public void run() {
        //                try {
        //                    new Main().run();
        //                } catch (Exception e) {
        //                    int[][] arr = new int[1024*1024][]; for( int i = 0; i < 1024*1024; ++i ) arr[i] = new int[1024*1024];
        //                }
        //            }
        //        }, "LOLOL", 200 * (1<<20)).start();
    }
    ////////////////////////////////////////////////////////////////


    Integer[] f(){
        char[] s = next().toCharArray();
        Integer[] ans = new Integer[s.length/2];
        for( int i = 0; i < s.length; i += 2 ){
            if     ( s[i] == '[' ) ans[i/2] = 0;
            else if( s[i] == '8' ) ans[i/2] = 1;
            else if( s[i] == '(' ) ans[i/2] = 2;
            else MLE();
        }
        return ans;
    }

    boolean fun( int a, int b ){
        return
            a == 0 && b == 1 ||
            a == 1 && b == 2 ||
            a == 2 && b == 0;
    }

    void solve(){
        Integer[] a = f();
        Integer[] b = f();
        int cntA = 0;
        int cntB = 0;
        for( int i = 0; i < a.length; ++i ){
            if     ( fun( a[i], b[i] ) ) ++cntA;
            else if( fun( b[i], a[i] ) ) ++cntB;
        }
        if     ( cntA > cntB ) out.println( "TEAM 2 WINS" );
        else if( cntA > cntB ) out.println( "TEAM 1 WINS" );
        else out.println( "TIE" );
    }


}
