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


public class TheGreatGame {

    public TheGreatGame() {
        leer();
    }

    public static void main(String[] args) {
        new TheGreatGame();

    }
    public void leer(){
        Scanner s = new Scanner(System.in);
        String team1=s.nextLine();
        String team2=s.nextLine();
        evaluar(team1,team2);
        s.close();
    }
    public void evaluar(String team1,String team2){
        int puntaje1=0,puntaje2=0;
        for (int i = 0; i < team1.length(); i=i+2) {
            if(team1.charAt(i)==team2.charAt(i)){
                
            }else if(team1.charAt(i)=='['){
                if(team2.charAt(i)=='(')puntaje1=puntaje1+1;
                if(team2.charAt(i)=='8')puntaje2=puntaje2+1;
            }else if(team1.charAt(i)=='('){
                if(team2.charAt(i)=='[')puntaje2=puntaje2+1;
                if(team2.charAt(i)=='8')puntaje1=puntaje1+1;
            }else if(team1.charAt(i)=='8'){
                if(team2.charAt(i)=='[')puntaje1=puntaje1+1;
                if(team2.charAt(i)=='(')puntaje2=puntaje2+1;
            }
        }
        validar(puntaje1, puntaje2);
    }
    public void validar(int puntaje1,int puntaje2){
        if(puntaje1>puntaje2){
            System.out.println("TEAM 1 WINS");
        }else if(puntaje1<puntaje2){
            System.out.println("TEAM 2 WINS");
        }else{
            System.out.println("TIE");
        }
    }
}