Chef Hari has got a new obsession now: he has started playing chess (read about it here) and he is liking this game very much. Since Hari has spent several months playing chess with his friends, he has now decided to take part in some chess tournament in Cheftown.

There are currently two tournaments going on in Cheftown and each tournament has its own entry fee. Due to this economical restriction and his budget, Hari can take part in only one tournament.

The entry fee for first tournament is F1 units of money. The structure of tournament is as follows: first there will be group matches and then there will be finals. If Hari reaches in finals and wins it, he'll get R1 units of money. If after reaching in finals, Hari loses, he'll get R2 units of money. If Hari fails to reach in finals, he'll get nothing. The probability of reaching in finals of first tournament for Hari is p1 and probability of winning in finals after reaching is p2.

The entry fee for second tournament is F2 units of money. The structure of tournament is as follows: first there will be group matches and then there will be finals. If Hari reaches in finals, he'll immediately get R3 units of money, otherwise he'll get nothing. If after reaching in finals, Hari wins, he'll get R4 units of money. The probability of reaching in finals of second tournament for Hari is p3 and probability of winning in finals after reaching is p4.

Now, Hari wants to maximise his profit. He wants to know which tournament he should participate in such that his expected profit is maximised. Help Hari in deciding this.

Note:
In the tournaments of Cheftown, the game never ends with a draw. So, either Hari wins a game, or he loses.

-----Input-----

First line of the input contains T, the number of test cases. The description of each test case is as following:

First line of each test case contains 6 integers F1, F2, R1, R2, R3 and R4.

Next line of each test case contains 4 floating point numbers p1, p2, p3 and p4.
Each number has exactly 2 digits after decimal point.

-----Output-----

For each test case, output a single line having "FIRST" if expected profit of first tournament is maximum or "SECOND" if expected profit of second tournament is maximum or "BOTH" if expected profits of both the tournaments is exactly same.

-----Constraints-----
- 1 ≤ T ≤ 100
- 1 ≤ F1, F2, R1, R2, R3, R4 ≤ 100
- 0.00 ≤ p1, p2, p3, p4 ≤ 1.00

-----Subtasks-----
Subtask#1: 30 points
- p1 = p3 and p2 = p4

Subtask#2: 70 points
- All usual constraints.

-----Example-----
Input:
2
30 50 70 10 40 30
0.25 0.10 0.30 0.05
50 36 80 38 65 32
0.55 0.12 0.33 0.54

Output:
FIRST
SECOND

-----Explanation-----

In the first case, the expected profit for first tournament is -26.00 and expected profit for second tournament is -37.55. So, first tournament has better expected profit.

In the second case, the expected profit for first tournament is -26.328 and expected profit for second tournament is -8.8476. So, second tournament has better expected profit.

Difficulty: interview

Starter code:

Solutions:
t=eval(input())
while t>0:
  t=t-1
  f1,f2,r1,r2,r3,r4=list(map(int,input().split()))
  p1,p2,p3,p4=list(map(float,input().split()))
  s1=(1-p1)*(-f1)+(r2-f1)*(1-p2)*p1+p1*p2*(r1-f1)
  s2=(1-p3)*(-f2)+(r3-f2)*(p3)*(1-p4)+p3*p4*(r3+r4-f2)
  if s1>s2:
    print('FIRST')
  elif s1<s2:
    print('SECOND')
  else:
    print('BOTH')
    


t=int(input())
for i in range(0,t):
 f1,f2,r1,r2,r3,r4=list(map(int,input().split()))
 p1,p2,p3,p4=list(map(float,input().split()))
 a1=p1*(r1*p2+r2*(1-p2))-f1
 a2=p3*r3+p3*r4*p4-f2
 if(a1>a2):
  print("FIRST")
 elif(a1<a2):
  print("SECOND")
 else:
  print("BOTH") 

def f():
 f1,f2,r1,r2,r3,r4=list(map(int,input().split()))
 p1,p2,p3,p4=list(map(float,input().split()))
 e1 = p1*(p2*r1 + (1-p2)*r2) - f1
 e2 = p3*(p4*r4 + r3) - f2
 #print e1
 #print e2
 if e1==e2:
  return "BOTH"
 if e1>e2:
  return "FIRST"
 return "SECOND"
t=int(input())
for i in range(t):
 print(f()) 

t=int(input().strip())
while t:
 f1,f2,r1,r2,r3,r4=list(map(int,input().strip().split()))
 p1,p2,p3,p4=list(map(float,input().strip().split()))
 x=p1*(1-p2)*r2+p1*p2*r1-f1
 y=p3*r3+p3*p4*r4-f2
 if x>y:
  print("FIRST")
 elif x<y:
  print("SECOND")
 else:
  print("BOTH")
 t-=1

# cook your code here
t=eval(input())
for i in range(t):
 f1, f2, r1, r2, r3, r4 = list(map(int,input().split()))
 p1, p2, p3, p4 = list(map(float,input().split()))
 x=p1*p2
 y=p1*(1-p2)
 a1=(x*r1+y*r2)-f1
 a2=(r3*p3+r4*p3*p4)-f2
 if a1>a2:print('FIRST')
 elif a2>a1:print('SECOND')
 else:
  print('BOTH')