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

/**
 * Created with IntelliJ IDEA.
 * User: Aditya
 * Date: 6/18/14
 * Time: 2:21 PM
 * To change this template use File | Settings | File Templates.
 */
public class game {

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        char[] teamOne = sc.nextLine().toCharArray();
        char[] teamTwo = sc.nextLine().toCharArray();

        int teamTwoCount = 0;
        int teamOneCount = 0;

        for (int i=0;i<teamOne.length;i=i+2){
            if(teamOne[i]=='['&&teamOne[i+1]== ']'){   //paper
                if(teamTwo[i]=='('&&teamTwo[i+1]== ')'){ //rock
                    teamOneCount++;
                }
                else if(teamTwo[i]=='8'&&teamTwo[i+1]== '<'){ //scissors
                    teamTwoCount++;
                }
            }
            else if(teamOne[i]=='('&&teamOne[i+1]== ')'){  //rock
                if(teamTwo[i]=='['&&teamTwo[i+1]== ']') {  //paper
                   teamTwoCount++;
                }
                else if(teamTwo[i]=='8'&&teamTwo[1+1]== '<'){    //scissors
                    teamOneCount++;
                }
            }
            else if(teamOne[i]=='8'&&teamOne[i+1]== '<') {    //scissors
                if(teamTwo[i]=='('&&teamTwo[i+1]== ')'){       //rock
                    teamTwoCount++;
                }
                else if(teamTwo[i]=='['&&teamTwo[i+1]== ']'){    //paper
                   teamOneCount++;
                }
            }
        }

        if(teamOneCount==teamTwoCount){
            System.out.println("TIE");
        }
        else if(teamOneCount>teamTwoCount){
            System.out.println("TEAM ONE WINS");
        }
        else if(teamOneCount<teamTwoCount){
            System.out.println("TEAM TWO WINS");
        }


    }
}
