import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Dice2 {
	private static void read() throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		br.readLine();
		String[] line = br.readLine().split(" ");
		long sum = 0;
		for (String s : line) {
			sum += Long.parseLong(s) + 1;
		}
		line = br.readLine().split(" ");
		br.close();
		for (String s : line) {
			sum -= Long.parseLong(s) + 1;
		}
		System.out.println(sum > 0 ? "ALICE" : sum == 0 ? "TIED" : "BOB");
	}

	public static void main(String[] args) throws IOException {
		read();
	}
}
