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

/**
 *
 * @author gEoRgE-PC
 */
public class TheGreatGame {
    public static void main(String[] args) throws IOException {
        InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);
        String linea=br.readLine();
        while(linea!=null){
            linea=linea.trim();
            int x=0, y=0;
            String linea2=br.readLine().trim();
            String temp1="";
            String temp2="";
            for (int i=0; i<linea.length(); i++){
                temp1+=linea.charAt(i);
                temp2+=linea2.charAt(i);
                if ( (i+1)%2==0){
                    String valor1=calculo(temp1);
                    String valor2=calculo(temp2);
                    if (valor1.equals("papel")&& valor2.equals("piedra"))
                        x+=1;
                    else if(valor1.equals("papel")&& valor2.equals("tijera"))
                        y+=1;
                    else if(valor1.equals("piedra")&& valor2.equals("tijera"))
                        x+=1;
                    else if(valor1.equals("piedra")&& valor2.equals("papel"))
                        y+=1;
                    else if(valor1.equals("tijera")&&valor2.equals("papel"))
                        x+=1;
                    else if(valor1.equals("tijera")&&valor2.equals("piedra"))
                        y+=1;
                    temp1="";
                    temp2="";
                }
            }
            if (x>y){
                System.out.println("TEAM 1 WINS");
            }
            else if (y>x){
                System.out.println("TEAM 2 WINS");
            }
            else{
                System.out.println("TIE");
            }
            linea=br.readLine();
        }
    }
    public static String calculo(String temp){
        if (temp.equals("[]"))
            return "papel";
        else if(temp.equals("()"))
            return "piedra";
        else
            return "tijera";
    }
}