The Jones Trucking Company tracks the location of each of its trucks on a grid similar to an (x, y) plane. The home office is at the location (0, 0). Read the coordinates of truck A and the coordinates of truck B and determine which is closer to the office.

-----Input:-----
The first line of the data set for this problem is an integer representing the number of collections of data that follow. Each collection contains 4 integers: the x-coordinate and then the 
y-coordinate of truck A followed by the x-coordinate and then the  y-coordinate of truck B.

-----Output:-----
All letters are upper case.
The output is to be formatted exactly like that for the sample output given below.

-----Assumptions:-----
The x-coordinate is in the range –20 .. 20. The y-coordinate is in the range –20 .. 20.

-----Discussion:-----
The distance between point #1 with coordinates (x1, y1) and point #2 with coordinates (x2, y2) is:

-----Sample Input:-----
4
3 -2 -5 -3
0 6 1 2
-7 8 4 -1
3 3 -2 2

-----Sample Output:-----
A IS CLOSER
B IS CLOSER
B IS CLOSER
B IS CLOSER

Difficulty: interview

Starter code:

Solutions:
# cook your dish here
try:
 t = int(input())
 for i in range(t):
  ar=list(map(int,input().split()))
  if (ar[0]**2 + ar[1]**2 > ar[2]**2 + ar[3]**2):
   print("B IS CLOSER")
  else:
   print("A IS CLOSER")
  
  
  
except:
 pass
 
 


# cook your dish here
for _ in range(int(input())):
 a,b,c,d=list(map(int,input().split()))
 p=(a*a)+(b*b)
 q=(c*c)+(d*d)
 if p<q:
  print("A IS CLOSER")
 else:
  print("B IS CLOSER")


from math import*
t=int(input())
while(t!=0):
 a,b,c,d=list(map(int,input().split()))
 if sqrt(pow(a,2)+pow(b,2))>sqrt(pow(c,2)+pow(d,2)):
  print('B IS CLOSER')
 else:
  print('A IS CLOSER')
 t-=1



# cook your dish here
for _ in range(int(input())):
 x1,y1,x2,y2=map(int, input().split())
 d1=(x1**2+y1**2)**0.5
 d2=(x2**2+y2**2)**0.5
 if(d1>d2):
  print("B IS CLOSER")
 else:
  print("A IS CLOSER")

import math
n=int(input())
for _ in range(n):
 x=input().split()
 x1=int(x[0])
 y1=int(x[1])
 x2=int(x[2])
 y2=int(x[3])
 d2=math.sqrt((x2**2)+(y2**2))
 d1=math.sqrt((x1**2)+(y1**2))
 if d1<d2:
  print("A IS CLOSER")
 else:
  print("B IS CLOSER")

n=int(input())
for _ in range(n):
 arr=list(map(int,input().split()))
 if (abs(arr[0])+abs(arr[1]))>(abs(arr[2])+abs(arr[3])):
  print("B IS CLOSER")
 else:
  print("A IS CLOSER")


import math
n=int(input())
for _ in range(2*n):
 try:
  a,b,c,d=list(map(int,input().split()))
  if math.sqrt((a**2)+(b**2))>math.sqrt((c**2)+(d**2)):
   print("B IS CLOSER")
  else:
   print("A IS CLOSER")
 except:
  print()


import math
test=int(input())
for i in range(test):
 p1,q1,p2,q2=map(int,input().split())
 if math.sqrt(pow(p1,2)+pow(q1,2))>math.sqrt(pow(p2,2)+pow(q2,2)):
  print("B IS CLOSER")
 else:
  print("A IS CLOSER")

T=int(input())
for _ in range(T):
 X=list(map(int,input().split()))
 x=y=0
 A = (X[0]**2 + X[1]**2)**0.5
 B = (X[2]**2 + X[3]**2)**0.5
 if A>B:
  print("B IS CLOSER")
 else:
  print("A IS CLOSER")

import math
t=int(input())
while(t>0):
 x1,y1,x2,y2=input().split()
 x1=int(x1)
 y1=int(y1)
 x2=int(x2)
 y2=int(y2)
 d1=math.sqrt((x1)**2+(y1)**2)
 d2=math.sqrt((x2)**2+(y2)**2)
 if(d1<d2):
  ans='A'
 else:
  ans='B'
 print(ans,'IS CLOSER')
 t=t-1


from math import sqrt
for t in range(int(input())):
 ax,ay,bx,by=map(int, input().split())
 adist = sqrt(ax**2+ay**2)
 bdist = sqrt(bx**2+by**2)
 if adist>bdist:
  print("B IS CLOSER")
 else:
  print("A IS CLOSER")

# cook your dish here
t = int(input())
for i in range(t):
 x1, y1, x2, y2 = [int(i) for i in input().split()]
 if x1**2 + y1**2 < x2**2 + y2**2:
  print('A IS CLOSER')
 else:
  print('B IS CLOSER')

for _ in range(int(input())):
 x1,y1,x2,y2=map(int,input().split())
 A=(x1**2+y1**2)**(1/2)
 B=(x2**2+y2**2)**(1/2)
 if A<B:
  print("A IS CLOSER")
 else:
  print("B IS CLOSER")

t=int(input())
for _ in range(t):
 a=list(map(int,input().split()))
 d1=pow(pow(a[0],2)+pow(a[1],2),0.5)
 d2=pow(pow(a[2],2)+pow(a[3],2),0.5)
 if(d1>d2):
  print("B IS CLOSER")
 else:
  print("A IS CLOSER")


# cook your dish here
t = int(input())
while(t):
 li = [int(i) for i in input().split()]
 d1 = pow((pow(li[0],2)+pow(li[1],2)),0.5)
 d2 = pow((pow(li[2],2)+pow(li[3],2)),0.5)
 if(d1 > d2):
  print("B IS CLOSER")
 else:
  print("A IS CLOSER")
 t -= 1

# cook your dish here
import math
t=int(input())
for i in range(t):
 x1,y1,x2,y2=map(int,input().split())
 #print(math.sqrt(pow(x1,2)+pow(y1,2)))
 # print(math.sqrt(pow(x2,2)+pow(y2,2)))
 if math.sqrt(pow(x1,2)+pow(y1,2))>math.sqrt(pow(x2,2)+pow(y2,2)):
  print("B IS CLOSER")
 else:
  print("A IS CLOSER")

# cook your dish here
t = int(input())
while(t):
 li = [int(i) for i in input().split()]
 x1 = li[0]
 y1 = li[1]
 x2 = li[2]
 y2 = li[3]
 d1 = pow((pow(x1,2) + pow(y1,2)),0.5)
 d2 = pow((pow(x2,2) + pow(y2,2)),0.5)
 if d1 < d2:
  print("A IS CLOSER")
 else:
  print("B IS CLOSER")
 t -= 1

t = int(input())
for i in range(0,t):
 x,y,x1,y1=list(map(int,input().split()))
 w = (((x-0)**2+(y-0)**2)**(1/2))
 e = (((x1-0)**2+(y1-0)**2)**(1/2))
 if w>e:
  print("B IS CLOSER")
 else:
  print("A IS CLOSER")


# cook your dish here
t=int(input())
for i in range(0,t):
 x1,x2,x3,x4=list(map(int,input().split()))
 z=(x1*x1)+(x2*x2)
 z1=(x3*x3)+(x4*x4)
 if(z>z1):
  print("B IS CLOSER")
 else:
  print("A IS CLOSER")


import math
try:
 t = int(input())
 
 while(t):
  l = [int(x) for x in input().split()]
  geta = math.sqrt( l[0]*l[0] + l[1]*l[1] )
  getb = math.sqrt( l[2]*l[2] + l[3]*l[3] )
  if(geta<getb):
   print("A IS CLOSER")
  else:
   print("B IS CLOSER")
  t -= 1

except:
 pass

import math
for _ in range(int(input())):
 # a = input()
 x1, y1, x2, y2 = list(map(int, input().split()))
 if(math.sqrt(pow(x1, 2)+pow(y1, 2)) < math.sqrt(pow(x2, 2)+pow(y2, 2))):
  print("A IS CLOSER")
 else:
  print("B IS CLOSER")

import math
for _ in range(int(input())):
 x1,y1,x2,y2 = map(int,input().split())
 dis1 = math.sqrt(pow(x1-0,2) + pow(y1-0,2))
 dis2 = math.sqrt(pow(x2-0,2) + pow(y2-0,2))
 if dis1 > dis2:
  print('B IS CLOSER')
 else:
  print('A IS CLOSER')

# cook your dish here
# cook your code here

t = int(input())

while(t):
 
 l1 = list(map(int,input().split(" ")))
 res = 0
 a=l1[0]*l1[0] + l1[1]*l1[1]
 b=l1[2]*l1[2] + l1[3]*l1[3]
 if(a>b):
  print("B IS CLOSER")
 else:
  print("A IS CLOSER")
 
 t-=1

t = int(input())
for x in range(t):
 a = [int(x) for x in input().split()]
 d1 = (a[0]**2 + a[1]**2)**0.5
 d2 = (a[2] ** 2 + a[2] ** 2) ** 0.5

 if d1 < d2:
  print("A IS CLOSER")
 else:
  print("B IS CLOSER")