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 java.util.*;
import java.awt.Point;
import java.io.*;
import java.math.BigInteger;

public class A1 
{
    FastScanner in;
    PrintWriter out;

    public void solve() throws IOException 
    {
        String s1 = in.next();
        String s2 = in.next();
        
        int sum1 = 0;
        int sum2 = 0;
        
        for(int i = 0; i < s1.length(); i++)
        {
            int val = 0;
            
            char c = s1.charAt(i);
            
            if(c == ')' || c == '(')
                val = 1;
            else if(c == ']' || c == '[')
                val = 2;
            else if(c == '<' || c == '8')
                val = 3;
            
            sum1 += val;
        }
        
        for(int i = 0; i < s2.length(); i++)
        {
            int val = 0;
            
            char c = s2.charAt(i);
            
            if(c == ')' || c == '(')
                val = 1;
            else if(c == ']' || c == '[')
                val = 2;
            else if(c == '<' || c == '8')
                val = 3;
            
            sum2 += val;
        }
        
        if(sum1 > sum2)
            out.print("TEAM 1 WINS");
        else if(sum1 < sum2)
            out.print("TEAM 2 WINS");
        else
            out.print("TIE");
    }

    public void run() {
        try {
            //in  = new FastScanner(new File("sum.in"));
            //out = new PrintWriter(new File("sum.out"));
            
            in  = new FastScanner();
            out = new PrintWriter(System.out);

            solve();

            out.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    class FastScanner {
        BufferedReader br;
        StringTokenizer st;
        
        FastScanner() {
            
            br = new BufferedReader(new InputStreamReader(System.in));
        
        }

        FastScanner(File f) {
            try {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() 
        {
            return Integer.parseInt(next());
        }
        
        long nextLong() 
        {
            return Long.parseLong(next());
        }
        
        double nextDouble() 
        {
            return Double.parseDouble(next());
        }
        
        int[] nextIntArray(int size) 
        {
            int[] array = new int[size];
            
            for (int i = 0; i < size; i++){
                array[i] = nextInt();
            }
            
            return array;
        }
        
        long[] nextLongArray(int size) 
        {
            long[] array = new long[size];
            
            for (int i = 0; i < size; i++){
                array[i] = nextLong();
            }
            
            return array;
        }
        
        BigInteger nextBigInteger() 
        {
            return new BigInteger(next());
        }
        
        Point nextIntPoint()
        {
            int x = nextInt();
            int y = nextInt();
            return new Point(x, y);
        }
        
        Point[] nextIntPointArray(int size)
        {
            Point[] array = new Point[size];
            
            for (int index = 0; index < size; ++index){
                array[index] = nextIntPoint();
            }
            
            return array;
        }
        
        List<Integer>[] readGraph(int vertexNumber, int edgeNumber, boolean undirected)
        {
            List<Integer>[] graph = new List[vertexNumber];
                    
            for (int index = 0; index < vertexNumber; ++index)
            {
                graph[index] = new ArrayList<Integer>();
            }
                    
            while (edgeNumber-- > 0)
            {
                int from = nextInt() - 1;
                int to   = nextInt() - 1;
                        
                graph[from].add(to);
                if(undirected)
                    graph[to].add(from);
            }
                    
            return graph;
        }
    }

    public static void main(String[] arg) 
    {
        new A1().run();
    }
}

