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.*;
import java.util.*;
import java.util.Map.Entry;

public class A {

    void run() throws IOException {
        char[] a = nl().toCharArray();
        char[] b = nl().toCharArray();
        int n = a.length;
        int d = 0;
        for (int i = 0; i < n; i += 2) {
            if (a[i] != b[i]) {
                if (a[i] == '8') {
                    if (b[i] == '[') {
                        d++;
                    } else {
                        d--;
                    }
                }
                if (a[i] == '[') {
                    if (b[i] == '(') {
                        d++;
                    } else {
                        d--;
                    }
                }
                if (a[i] == '(') {
                    if (b[i] == '8') {
                        d++;
                    } else {
                        d--;
                    }
                }
            }
        }
        if (d == 0) {
            pw.println("TIE");
        } else if (d > 0) {
            pw.println("TEAM 1 WINS");
        } else {
            pw.println("TEAM 2 WINS");
        }

    }

    int[][] nm(int a_len, int a_hei) throws IOException {
        int[][] _a = new int[a_len][a_hei];
        for (int i = 0; i < a_len; i++)
            for (int j = 0; j < a_hei; j++)
                _a[i][j] = ni();
        return _a;
    }

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

    boolean hasNext() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            String line = br.readLine();
            if (line == null) {
                return false;
            }
            st = new StringTokenizer(line);
        }
        return true;
    }

    int[] na(int a_len) throws IOException {
        int[] _a = new int[a_len];
        for (int i = 0; i < a_len; i++)
            _a[i] = ni();
        return _a;
    }

    int ni() throws IOException {
        return Integer.parseInt(next());
    }

    long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    String nl() throws IOException {
        return br.readLine();
    }

    void tr(String debug) {
        if (!OJ)
            pw.println(" " + debug);
    }

    static PrintWriter pw;
    static BufferedReader br;
    static StringTokenizer st;
    static boolean OJ;

    public static void main(String[] args) throws IOException {
        long timeout = System.currentTimeMillis();
        OJ = System.getProperty("ONLINE_JUDGE") != null;
        pw = new PrintWriter(System.out);
        br = new BufferedReader(OJ ? new InputStreamReader(System.in) : new FileReader(new File("A.txt")));
        while (br.ready())
            new A().run();
        if (!OJ) {
            pw.println();
            pw.println("----------------------------------");
            pw.println(System.currentTimeMillis() - timeout);
        }
        // new A().stress();
        br.close();
        pw.close();
    }

}