import java.util.;
public class Main {
public static void main(String args[]) {
Scanner input=new Scanner(System.in);
int t;
t=input.nextInt();
while(t>0) {
int a,b,c;
int N,n;
a=input.nextInt();
b=input.nextInt();
c=input.nextInt();
int root=((bb)-(4ac));
int roots=(int)Math.sqrt(root);
int x1,x2;
x1=-b-roots;
x2=-b+roots;
if(root<0) {
System.out.println(“IMAGINARY”);
}
else if(x1==x2) {
System.out.println("REAL AND EQUAL");
System.out.println(x1/2 +" "+ x2/2);
}
else if(x1!=x2) {
System.out.println("REAL AND DISTINCT");
System.out.println(x1/2 +" "+ x2/2);
}
t--;
}
}
}