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

public class Project_01 {

	public static void main(String[] args) {
		
		try {
			//System.setIn(new FileInputStream("input.txt"));
			
			Scanner sc = new Scanner(System.in);
			
			String s1 = sc.next();
			String s2 = sc.next();
			
//			System.out.println(s1);
//			System.out.println(s2);
			
			int t = s1.length()/2;
			
//			System.out.println(t);
			
			
			char a;
			char b;
			int an = 0;
			int bn = 0;
			
			int index = 0;
					
			for(int i=0; i<t; i++) {
				
				a = s1.charAt(index);
				b = s2.charAt(index);
				
//				System.out.println(a);
//				System.out.println(b);
				
//				System.out.println(isEqual(a, "[]"));
				
				if((a == '[' && b== '[') || (a == '(' && b== '(') || (a == '8' && b== '8')) {
					index += 2;
					continue;
				}
				
				if((a == '[' && b== '8') || (a == '(' && b== '[') || (a == '8' && b== '(')) {
					bn++;
				} else if((a == '8' && b== '[') || (a == '[' && b== '(') || (a == '(' && b== '8')) {
					an++;
				}
				
				index += 2;
			}
			
			
			if(an == bn) {
				System.out.println("TIE");
			} else if(an > bn) {
				System.out.println("TEAM 1 WINS");
			} else {
				System.out.println("TEAM 2 WINS");
			}
			
			
			
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		
		
		
	}

}