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

public class C {

	BufferedReader in;
	StringTokenizer st;
	PrintWriter out;

	String next() throws IOException {
		while (st == null || !st.hasMoreTokens())
			st = new StringTokenizer(in.readLine());
		return st.nextToken();
	}

	int nextInt() throws Exception {
		return Integer.parseInt(next());
	}

	long nextLong() throws Exception {
		return Long.parseLong(next());
	}

	double nextDouble() throws Exception {
		return Double.parseDouble(next());
	}

	void solve() throws Exception {
		String t1 = next();
		int n = t1.length();
		String t2 = next();
		int s1 = 0;
		int s2 = 0;
		for (int i = 0; i < n; i += 2) {
			String p1 = t1.substring(i, i + 2);
			String p2 = t2.substring(i, i + 2);
			if(p1.equals(p2)) continue;
			if(p1.equals("8<")) 
				if(p2.equals("[]")) s1++;
				else s2++;
			
			if(p1.equals("()")) 
				if(p2.equals("[]")) s2++;
				else s1++;
			
			if(p1.equals("[]")) 
				if(p2.equals("8<")) s2++;
				else s1++;
			
		}
	out.println(s1==s2?"TIE":"TEAM "+(s1>s2?"1":"2")+" WINS");
	}

	void run() {
		try {
			Locale.setDefault(Locale.US);
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(new OutputStreamWriter(System.out));
			solve();
			out.close();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	public static void main(String[] args) {
		new C().run();
	}

}