#include<iostream>
#include<string>
using namespace std;
int main() {
int n;
cin >> n;
string* results = new string[n];
for (int i = 0; i < n; i++) {
int x, y, lx, ly, rx, ry;
cin >> x >> y;
cin >> lx >> ly >> rx >> ry;
//不在矩形内的情况
if (x < lx || x > rx || y < ly || y > ry) {
results[i] = "Outside";
}
//在矩形边上的情况
else if ((x >= lx && x <= rx && (y == ly || y == ry)) || (y >= ly && y <= ry && (x == lx || x == rx))) {
results[i] = "On";
}
//在矩形内部的情况
else {
results[i] = "Inside";
}
}
for (int i = 0; i < n; i++) {
cout << results[i] << endl;
}
return 0;
}
08-13
08-13