#include <stdio.h>
#include <stdlib.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[]) {
int a;scanf("%d",&a);
int j;
for(j=0;j<a;j++){
char k;
int x[3],y[4],i;
for(i=0;i<3;i++)
scanf("%d%c%d",&x[i],&k,&y[i]);
double b=0,c=0;
b=(double)(x[1]-x[2])/(double)(y[1]-y[2]);
c=(double)(x[0]-x[1])/(double)(y[0]-y[1]);
if(b==c)
printf("collinear\n");
else if((y[1]-y[2]==0&&y[0]-y[1]==0)||(x[1]-x[2]==0&&x[0]-x[1]==0))
printf("collinear\n");
else
printf("not collinear\n");
}
return 0;
}