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.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;

public class Task409A {

    public static void main(String... args) throws NumberFormatException,
            IOException {
        Solution.main(System.in, System.out);
    }

    static class Scanner {

        private final BufferedReader br;
        private String[] cache;
        private int cacheIndex;

        Scanner(InputStream is) {
            br = new BufferedReader(new InputStreamReader(is));
            cache = new String[0];
            cacheIndex = 0;
        }

        int nextInt() throws IOException {
            if (cacheIndex >= cache.length) {
                cache = br.readLine().split(" ");
                cacheIndex = 0;
            }
            return Integer.parseInt(cache[cacheIndex++]);
        }

        int nextInt(int radix) throws IOException {
            if (cacheIndex >= cache.length) {
                cache = br.readLine().split(" ");
                cacheIndex = 0;
            }
            return Integer.parseInt(cache[cacheIndex++], radix);
        }

        long nextLong() throws IOException {
            if (cacheIndex >= cache.length) {
                cache = br.readLine().split(" ");
                cacheIndex = 0;
            }
            return Long.parseLong(cache[cacheIndex++]);
        }

        double nextDouble() throws IOException {
            if (cacheIndex >= cache.length) {
                cache = br.readLine().split(" ");
                cacheIndex = 0;
            }
            return Double.parseDouble(cache[cacheIndex++]);
        }

        String next() throws IOException {
            if (cacheIndex >= cache.length) {
                cache = br.readLine().split(" ");
                cacheIndex = 0;
            }
            return cache[cacheIndex++];
        }

        void close() throws IOException {
            br.close();
        }

    }

    static class Solution {

        public static void main(InputStream is, OutputStream os)
                throws NumberFormatException, IOException {
            PrintWriter pw = new PrintWriter(os);
            Scanner sc = new Scanner(is);

            String n = sc.next();
            String m = sc.next();

            int winA = 0;
            int winB = 0;

            for (int i = 0; 2 * i < n.length(); i++) {
                if (n.substring(2 * i, 2 * i + 2).equals("[]") &&
                    m.substring(2 * i, 2 * i + 2).equals("()")) {
                    winA++;
                }
                if (n.substring(2 * i, 2 * i + 2).equals("()") &&
                    m.substring(2 * i, 2 * i + 2).equals("[]")) {
                    winB++;
                }
                if (n.substring(2 * i, 2 * i + 2).equals("[]") &&
                    m.substring(2 * i, 2 * i + 2).equals("8<")) {
                    winB++;
                }
                if (n.substring(2 * i, 2 * i + 2).equals("8<") &&
                    m.substring(2 * i, 2 * i + 2).equals("[]")) {
                    winA++;
                }
                if (n.substring(2 * i, 2 * i + 2).equals("8<") &&
                    m.substring(2 * i, 2 * i + 2).equals("()")) {
                    winB++;
                }
                if (n.substring(2 * i, 2 * i + 2).equals("()") &&
                    m.substring(2 * i, 2 * i + 2).equals("8<")) {
                    winA++;
                }
            }

            if (winA > winB) {
                pw.println("TEAM 1 WINS");
            }
            if (winA == winB) {
                pw.println("TIE");
            }
            if (winA < winB) {
                pw.println("TEAM 2 WINS");
            }

            pw.flush();
            sc.close();
        }
    }

}