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.*;

public class A {

    int win(char a, char b) {
        if (a == '[' && b == '(') {
            return 1;
        }
        if (a == '(' && b == '8') {
            return 1;
        }
        if (a == '8' && b == '[') {
            return 1;
        }
        return 0;
    }

    void solve() throws IOException {
        in = new InputReader("__std");
        out = new OutputWriter("__std");

        char[] a = in.readToken().toCharArray();
        char[] b = in.readToken().toCharArray();
        int n = a.length;
        int ca = 0;
        int cb = 0;
        for (int i = 0; i < n; i += 2) {
            ca += win(a[i], b[i]);
            cb += win(b[i], a[i]);
        }
        out.println(ca > cb ? "TEAM 1 WINS" : ca == cb ? "TIE" : "TEAM 2 WINS");

        exit();
    }

    void exit() {
        //System.err.println((System.currentTimeMillis() - startTime) + " ms");
        out.close();
        System.exit(0);
    }

    InputReader in;
    OutputWriter out;

    //long startTime = System.currentTimeMillis();

    public static void main(String[] args) throws IOException {
        new A().solve();
    }

    class InputReader {

        private InputStream stream;

        private byte[] buffer = new byte[1024];
        private int pos, len;

        private int cur;

        private StringBuilder sb = new StringBuilder(32);

        InputReader(String name) throws IOException {
            if (name.equals("__std")) {
                stream = System.in;
            } else {
                stream = new FileInputStream(name);
            }
            cur = read();
        }

        private int read() throws IOException {
            if (len == -1) {
                throw new EOFException();
            }
            if (pos >= len) {
                pos = 0;
                len = stream.read(buffer);
                if (len == -1) return -1;
            }
            return buffer[pos++];
        }

        char readChar() throws IOException {
            if (cur == -1) {
                throw new EOFException();
            }
            char res = (char) cur;
            cur = read();
            return res;
        }

        int readInt() throws IOException {
            if (cur == -1) {
                throw new EOFException();
            }
            while (whitespace()) {
                cur = read();
            }
            if (cur == -1) {
                throw new EOFException();
            }
            int sign = 1;
            if (cur == '-') {
                sign = -1;
                cur = read();
            }
            int res = 0;
            while (!whitespace()) {
                if (cur < '0' || cur > '9') {
                    throw new NumberFormatException();
                }
                res *= 10;
                res += cur - '0';
                cur = read();
            }
            return res * sign;
        }

        long readLong() throws IOException {
            if (cur == -1) {
                throw new EOFException();
            }
            return Long.parseLong(readToken());
        }

        double readDouble() throws IOException {
            if (cur == -1) {
                throw new EOFException();
            }
            return Double.parseDouble(readToken());
        }

        String readLine() throws IOException {
            if (cur == -1) {
                throw new EOFException();
            }
            sb.setLength(0);
            while (cur != -1 && cur != '\r' && cur != '\n') {
                sb.append((char) cur);
                cur = read();
            }
            if (cur == '\r') {
                cur = read();
            }
            if (cur == '\n') {
                cur = read();
            }
            return sb.toString();
        }

        String readToken() throws IOException {
            if (cur == -1) {
                throw new EOFException();
            }
            while (whitespace()) {
                cur = read();
            }
            if (cur == -1) {
                throw new EOFException();
            }
            sb.setLength(0);
            while (!whitespace()) {
                sb.append((char) cur);
                cur = read();
            }
            return sb.toString();
        }

        boolean whitespace() {
            return cur == ' ' || cur == '\t' || cur == '\r' || cur == '\n' || cur == -1;
        }

        boolean eof() {
            return cur == -1;
        }
    }

    class OutputWriter {

        private PrintWriter writer;

        OutputWriter(String name) throws IOException {
            if (name.equals("__std")) {
                writer = new PrintWriter(System.out);
            } else {
                writer = new PrintWriter(name);
            }
        }

        void print(String format, Object ... args) {
            writer.print(new Formatter(Locale.US).format(format, args));
        }

        void println(String format, Object ... args) {
            writer.println(new Formatter(Locale.US).format(format, args));
        }

        void print(Object value) {
            writer.print(value);
        }

        void println(Object value) {
            writer.println(value);
        }

        void println() {
            writer.println();
        }

        void close() {
            writer.close();
        }
    }
}
