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 AA implements Runnable {
    
    final String[] a1 = { "8<", "[]", "()", "8<", "[]", "()", "8<", "[]", "()" };
    final String[] a2 = { "8<", "8<", "8<", "[]", "[]", "[]", "()", "()", "()" };
    final int[] points = {  0,   -1,   1,    1,    0,    -1,    -1,   1,   0   };
    
    private void solve() throws IOException {
        String s1 = nextToken(), s2 = nextToken();
        int dif = 0;
        for (int i = 0; i < s1.length(); i += 2) {
            String f = s1.substring(i, i + 2), s = s2.substring(i, i + 2);
            for (int j = 0; j < 9; j++)
                if (f.equals(a1[j]) && s.equals(a2[j]))
                    dif += points[j];
        }
        if (dif == 0) 
            System.out.println("TIE");
        else
            System.out.println(dif > 0 ? "TEAM 1 WINS" : "TEAM 2 WINS");
    }
    
    public static void main(String[] args) {
        new AA().run();
    }
    
    BufferedReader reader;
    StringTokenizer tokenizer;
    PrintWriter writer;
    
    public void run() {
        try {
            String file = "";
			file = "console";
            if (file.equals("console")) {
                reader = new BufferedReader(new InputStreamReader(System.in));
                writer = new PrintWriter(System.out);
            } else if (file.equals("")) {
                reader = new BufferedReader(new FileReader(new File("input.txt")));
                writer = new PrintWriter(new File("output.txt"));
            } else {
                reader = new BufferedReader(new FileReader(new File(file + ".in")));
                writer = new PrintWriter(new File(file + ".out"));
            }
            solve();
            writer.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(261);
        }
    }
    
    void halt() {
        writer.close();
        System.exit(0);
    }
    
    void print(Object... objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0) writer.print(' ');
            writer.print(objects[i]);
        }
    }
    
    void println(Object... objects) {
        print(objects);
        writer.println();
    }
    
    String nextLine() throws IOException {
        return reader.readLine();
    }
    
    String nextToken() throws IOException {
        while (tokenizer == null || !tokenizer.hasMoreTokens())
            tokenizer = new StringTokenizer(nextLine());
        return tokenizer.nextToken();
    }
    
    int nextInt() throws NumberFormatException, IOException {
        return Integer.parseInt(nextToken());
    }
    
    long nextLong() throws NumberFormatException, IOException {
        return Long.parseLong(nextToken());
    }
    
    double nextDouble() throws NumberFormatException, IOException {
        return Double.parseDouble(nextToken());
    }
}