Vacations have arrived and Chef wants to go to his home in ChefLand. There are two types of routes he can take: 
Take a flight from his college to ChefArina which takes X minutes and then take a bus from ChefArina to ChefLand which takes Y minutes. 
Take a direct train from his college to ChefLand which takes Z minutes. 

Which of these two options is faster?

------ Input Format ------ 

- The first line of the input contains a single integer T - the number of test cases. The test cases then follow.
- The first line of the test case contains three space-separated integers X, Y, and Z.

------ Output Format ------ 

For each test case, if Chef takes the train output TRAIN, if Chef takes the plane and the bus output PLANEBUS, if both are equal output EQUAL.

You may print each character of the string in uppercase or lowercase (for example, the strings train, tRAiN, TrAin, and TRAIN will all be treated as identical).

------ Constraints ------ 

$1 ≤ T ≤ 1000$
$1 ≤ X,Y,Z ≤ 10^{9}$

------ subtasks ------ 

Subtask $1$ (100 points): Original constraints

----- Sample Input 1 ------ 
3
10 12 11
3 5 15
9 4 13

----- Sample Output 1 ------ 
TRAIN
PLANEBUS
EQUAL

----- explanation 1 ------ 
- Test Case $1$: It will take $10 + 12 = 22$ minutes to travel using Plane and Bus. The train journey takes $11$ minutes. Since the train is faster, Chef will choose the train.
- Test Case $2$: It will take $3 + 5 = 8$ minutes to travel using Plane and Bus. The train journey takes $15$ minutes. Since the plane and bus are faster, Chef will choose the plane and bus.
- Test Case $3$: It will take $9 + 4 = 13$ minutes to travel using Plane and Bus. The train journey takes $13$ minutes. Since they both are equal, Chef can choose either.

Difficulty: EASY
Tags: Mathematics

Starter code:

Solutions:
for _ in range(int(input())):
	(X, Y, Z) = map(int, input().split())
	if X + Y <= Z:
		if X + Y == Z:
			print('EQUAL')
		else:
			print('PLANEBUS')
	else:
		print('TRAIN')


t = int(input())
for i in range(t):
	(x, y, z) = map(int, input().split())
	if x + y > z:
		print('TRAIN')
	elif x + y < z:
		print('PLANEBUS')
	else:
		print('EQUAL')


t = int(input())
while t:
	t -= 1
	(x, y, z) = map(int, input().split())
	if x + y > z:
		print('TRAIN')
	elif x + y < z:
		print('PLANEBUS')
	else:
		print('EQUAL')


t = int(input())
for i in range(t):
	(a, b, c) = map(int, input().split())
	if a + b < c:
		print('PLANEBUS')
	elif a + b == c:
		print('EQUAL')
	else:
		print('TRAIN')


t = int(input())
for i in range(t):
	(m, n, o) = map(int, input().split())
	if m + n == o:
		print('EQUAL')
	elif m + n < o:
		print('PLANEBUS')
	else:
		print('TRAIN')


for _ in range(int(input())):
	(A, B, C) = map(int, input().split())
	sum = A + B
	if sum > C:
		print('TRAIN')
	elif sum < C:
		print('PLANEBUS')
	else:
		print('EQUAL')


for i in range(int(input())):
	(X, Y, Z) = map(int, input().split())
	sum = X + Y
	if sum > Z:
		print('TRAIN')
	elif sum < Z:
		print('PLANEBUS')
	else:
		print('EQUAL')


for t in range(int(input())):
	(flight, bus, train) = map(int, input().split())
	if flight + bus > train:
		print('TRAIN')
	elif flight + bus < train:
		print('PLANEBUS')
	else:
		print('EQUAL')


for i in range(int(input())):
	(d, w, a) = map(int, input().split())
	sum = d + w
	if sum > a:
		print('TRAIN')
	elif sum < a:
		print('PLANEBUS')
	else:
		print('EQUAL')


T = int(input())
for _ in range(T):
	(X, Y, Z) = map(int, input().split())
	if X + Y == Z:
		print('EQUAL')
	elif X + Y > Z:
		print('TRAIN')
	elif X + Y < Z:
		print('PLANEBUS')


def CVT(x, y, z):
	g = x + y
	if g > z:
		print('TRAIN')
	elif g < z:
		print('PLANEBUS')
	else:
		print('EQUAL')
t = int(input())
for i in range(t):
	(a, b, c) = map(int, input().split())
	ans = CVT(a, b, c)


def code():
	cases = int(input())
	for _ in range(cases):
		(X, Y, Z) = map(int, input().split(' '))
		if X + Y < Z:
			print('PLANEBUS')
		elif Z < X + Y:
			print('TRAIN')
		else:
			print('EQUAL')
code()


T = int(input())
for i in range(T):
	(X, Y, Z) = map(int, input().split())
	planebus = X + Y
	train = Z
	if planebus > train:
		print('TRAIN')
	elif planebus < train:
		print('PLANEBUS')
	else:
		print('EQUAL')


import math

def solution():
	pass
T = int(input())
for _ in range(T):
	(X, Y, Z) = map(int, input().split())
	if X + Y > Z:
		print('TRAIN')
	elif X + Y < Z:
		print('PLANEBUS')
	else:
		print('EQUAL')


for _ in range(int(input())):
	(x, y, z) = map(int, input().split())
	if x + y > z:
		print('TRAIN')
	elif x + y < z:
		print('PLANEBUS')
	elif x + y == z:
		print('EQUAL')


for _ in range(int(input())):
	(p, b, t) = map(int, input().split())
	if p + b > t:
		print('TRAIN')
	elif p + b < t:
		print('PLANEBUS')
	else:
		print('EQUAL')