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

public class TheGreatGame {

	public static void main(String[] args) {
		
		TheGreatGame tgg = new TheGreatGame();
		tgg.go();

	}
	
	public void go(){
		Scanner sc = new Scanner(System.in);
		String p1 = sc.nextLine();
		String p2 = sc.nextLine();
		
		int[] pts = new int[2];
		pts[0] = 0;
		pts[1] = 0;
		
		for(int i=0; i<p1.length()/2; i++){
			int pos = i*2;
			char p1c = p1.charAt(pos);
			char p2c = p2.charAt(pos);
			
			if(rps(p1c, p2c) != 0)
				pts[rps(p1c, p2c)-1]++;
			
		}
		
		if(pts[0] == pts[1]){
			System.out.println("TIE");
		}
		
		else if(pts[0] > pts[1]){
			System.out.println("TEAM 1 WINS");
		}
		
		else{
			System.out.println("TEAM 2 WINS");
		}
		
	}
	
	public int rps(char p1c, char p2c){
		
		if(p1c == p2c){
			return 0;
		}
		
		if(p1c == '8' && p2c == '['){
			return 1;
		}
		
		if(p1c == '[' && p2c == '8'){
			return 2;
		}
		
		if(p1c == '8' && p2c == '('){
			return 2;
		}
		
		if(p1c == '(' && p2c == '8'){
			return 1;
		}
		
		if(p1c == '(' && p2c == '['){
			return 2;
		}
		
		if(p1c == '[' && p2c == '('){
			return 1;
		}
		
		return 0;
	}

}