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

/**
 *
 * @author oanillar
 */
public class JavaApplication90 {
    public static int com(String cad, String cad1){
        if(cad.equals(cad1))return 0;
        if(cad.equals("8<")&&cad1.equals("[]"))return 1;
        if(cad.equals("[]")&&cad1.equals("()"))return 1;
        if(cad.equals("()")&&cad1.equals("8<"))return 1;
        return -1;
    }
    public static void main(String[] args) throws IOException {
        BufferedReader entrada=new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw=new PrintWriter(new OutputStreamWriter(System.out));
        StringTokenizer st;
        String cad1=entrada.readLine();
        String cad2=entrada.readLine();
        int cont1=0, cont2=0;
        for(int i=2, ant=0;i<=cad1.length();i+=2,ant+=2){
            cont1+=com(cad1.substring(ant, i), cad2.substring(ant, i));
        }
        pw.println(cont1==0?"TIE":cont1>0?"TEAM 1 WINS":"TEAM 2 WINS");
        pw.close();
    }
}