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

public class Great {
    public static void main(String []av) {
        Scanner s = new Scanner(System.in);
        String L = s.nextLine();
        String R = s.nextLine();
        String t1wins = "TEAM 1 WINS";
        String t2wins = "TEAM 2 WINS";
        String tie = "TIE";
        int s1 = 0;
        int s2 = 0;

        for (int i = 0; i < L.length() - 1; i+=2) {
            String t1 = L.substring(i, i+2);
            String t2 = R.substring(i, i+2);
            if (t1.equals(t2)) {
                s1++;
                s2++;
            } else
            if ("8<".equals(t1) && "[]".equals(t2)) {
                s1++;
            } else
            if ("[]".equals(t1) && "()".equals(t2)) {
                s1++;
            } else
            if ("()".equals(t1) && "8<".equals(t2)) {
                s1++;
            } else
                s2++;
        } 
        if (s1 == s2)
            System.out.println(tie);
        else
        if (s1 < s2)
            System.out.println(t2wins);
        else
            System.out.println(t1wins);
    }
}