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.io.*;
import java.util.StringTokenizer;

/**
 * Created by pradhang on 4/1/2016.
 */
public class TheGreatGame
{
    /**
     * Scanner class
     *
     * @author gouthamvidyapradhan
     */
    static class MyScanner {
        /**
         * Buffered reader
         */
        private static BufferedReader br = new BufferedReader(
                new InputStreamReader(System.in));

        private static StringTokenizer st;

        /**
         * Read integer
         *
         * @return
         * @throws Exception
         */
        public static int readInt() throws Exception {
            try {
                if (st != null && st.hasMoreTokens()) {
                    return parseInt(st.nextToken());
                }
                String str = br.readLine();
                if (str != null && !str.trim().equals("")) {
                    st = new StringTokenizer(str);
                    return parseInt(st.nextToken());
                }
            } catch (IOException e) {
                close();
                return -1;
            }
            return -1;
        }

        /**
         * Read integer
         *
         * @return
         * @throws Exception
         */
        public static long readLong() throws Exception {
            try {
                if (st != null && st.hasMoreTokens()) {
                    return Long.parseLong(st.nextToken());
                }
                String str = br.readLine();
                if (str != null && !str.trim().equals("")) {
                    st = new StringTokenizer(str);
                    return Long.parseLong(st.nextToken());
                }
            } catch (IOException e) {
                close();
                return -1;
            }
            return -1;
        }

        /**
         * Read line
         * @return
         * @throws Exception
         */
        public static String readLine() throws Exception
        {
            return br.readLine();
        }

        /**
         * Parse to integer
         * @param in
         * @return integer value
         */
        public static int parseInt(String in)
        {
            // Check for a sign.
            int num  = 0, sign = -1, i = 0;
            final int len  = in.length( );
            final char ch  = in.charAt( 0 );
            if ( ch == '-' )
                sign = 1;
            else
                num = '0' - ch;

            // Build the number.
            i+=1;
            while ( i < len )
                num = num*10 + '0' - in.charAt( i++ );
            return sign * num;
        }

        /**
         * Close BufferedReader
         *
         * @throws Exception
         */
        public static void close() throws Exception {
            br.close();
        }
    }

    private static final String SIX = "8<";
    private static final String FOUR = "[]";
    private static final String TWO = "()";
    private static PrintWriter pw = new PrintWriter(new BufferedOutputStream(System.out, 500000));

    /**
     * Main method
     * @param args
     * @throws Exception
     */
    public static void main(String[] args) throws Exception
    {
        String line1 = MyScanner.readLine();
        String line2 = MyScanner.readLine();
        int t1 = 0, t2 = 0;
        t1 = calculate(line1);
        t2 = calculate(line2);
        pw.println((t1 > t2) ? "TEAM 1 WINS" : (t2 > t1)? "TEAM 2 WINS" : "TIE");
        pw.flush();
        pw.close();
        MyScanner.close();
    }

    /**
     * Calculate team score
     * @param line input
     * @return
     */
    private static int calculate(String line)
    {
        int score = 0;
        for(int i = 0, l = line.length(); i < l; i+=2)
        {
            String team1 = line.substring(i, i+2);
            switch (team1)
            {
                case SIX:
                    score+= 6;
                    break;
                case FOUR:
                    score+= 4;
                    break;
                case TWO:
                    score+= 2;
                    break;
            }
        }
        return score;
    }
}
