csu-1007
//小小的 错误却足以致命
#include<stdio.h>
int main()
{
int T, Px, Py, Ax, Ay, Bx, By;
// freopen("in.txt","r",stdin);
// freopen("out.txt","w",stdout);
scanf("%d",&T);
while(T)
{
--T;
scanf("%d%d",&Px, &Py);
scanf("%d%d%d%d",&Ax, &Ay, &Bx, &By);
if((Px < Ax)||(Px > Bx)||(Py < Ay)||(Py > By)) printf("Outside\n");
else if((Px == Ax)||(Px == Bx)||(Py == Ay)||(Py == By)) printf("On\n");
else printf("Inside\n");
}
return 0;
}