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;
/*
        0 VS 1 = 0 wins
        1 VS 2 = 1 wins
        2 VS 0 = 2 wins
*/
public class main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        String line1 = sc.nextLine();
        String line2 = sc.nextLine();
        int [] id1 = new int [line1.length()/2];
        int [] id2 = new int [line2.length()/2];
        
        int c1 = 0, c2 = 0;
        for(int i = 0; i < line1.length(); i+=2)
        {
            if(line1.charAt(i) == '(') //stone
            {
                id1[c1] = 0;
                c1++;
            }
            else
            if(line1.charAt(i) == '8') //skissor
            {
                id1[c1] = 1;
                c1++;
            }
            else
            if(line1.charAt(i) == '[') //paper
            {
                id1[c1] = 2;
                c1++;
            }
            ///////////////////////////////////
            if(line2.charAt(i) == '(') //stone
            {
                id2[c2] = 0;
                c2++;
            }
            else
            if(line2.charAt(i) == '8') //skissor
            {
                id2[c2] = 1;
                c2++;
            }
            else
            if(line2.charAt(i) == '[') //paper
            {
                id2[c2] = 2;
                c2++;
            }
        }
        
        int sc1 = 0, sc2 = 0;
        for(int i = 0; i < id1.length; i++)
        {
            if(id1[i] == 0 && id2[i] == 1)
            {
                sc1++;
            }
            else if (id1[i] == 1 && id2[i] == 0)
            {
                sc2++;
            }
            
            if(id1[i] == 1 && id2[i] == 2)
            {
                sc1++;
            }
            else if (id1[i] == 2 && id2[i] == 1)
            {
                sc2++;
            }
            
            if(id1[i] == 2 && id2[i] == 0)
            {
                sc1++;
            }
            else if (id1[i] == 0 && id2[i] == 2)
            {
                sc2++;
            }
        }
        
        if(sc1 > sc2)
        {
            System.out.println("TEAM 1 WINS");
        }
        else if(sc2 > sc1)
        {
            System.out.println("TEAM 2 WINS");
        }
        else
        {
            System.out.println("TIE");
        }
    }

}