/*
* A. Gain with Pain | SRBD Code Contest - 2024 (Round 1)
* Author: Sohom Sahaun | @sohomsahaun | CF: sahaun
*/
#include <bits/stdc++.h>
using namespace std;
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);
using ll = long long;
const int types[] = {2, 2, 2, 1, 3};
int main() {
FAST;
int tc = 1, ti;
cin >> tc;
for (ti = 1; ti <= tc; ++ti) {
int n, i, j;
cin >> n;
bool f = 1;
for (i = 0; i < n; ++i) {
vector<int> m(5), q(5), r(5);
for (j = 0; j < 5; ++j) {
cin >> m[j] >> q[j] >> r[j];
if (m[j] != types[j]) f = 0;
if (q[j] != 3) f = 0;
if (r[j] != 10) f = 0;
}
}
cout << (f ? "Consistent" : "Inconsistent") << "\n";
}
return 0;
}
LyoKICogIEEuIEdhaW4gd2l0aCBQYWluIHwgU1JCRCBDb2RlIENvbnRlc3QgLSAyMDI0IChSb3VuZCAxKQogKiAgQXV0aG9yOiBTb2hvbSBTYWhhdW4gfCBAc29ob21zYWhhdW4gfCBDRjogc2FoYXVuCiAqLwogCiNpbmNsdWRlIDxiaXRzL3N0ZGMrKy5oPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKI2RlZmluZSBGQVNUIGlvc19iYXNlOjpzeW5jX3dpdGhfc3RkaW8oZmFsc2UpO2Npbi50aWUoTlVMTCk7CnVzaW5nIGxsID0gbG9uZyBsb25nOwoKY29uc3QgaW50IHR5cGVzW10gPSB7MiwgMiwgMiwgMSwgM307CgppbnQgbWFpbigpIHsKICBGQVNUOwogIAogIGludCB0YyA9IDEsIHRpOwogIGNpbiA+PiB0YzsKCiAgZm9yICh0aSA9IDE7IHRpIDw9IHRjOyArK3RpKSB7CiAgICBpbnQgbiwgaSwgajsKICAgIGNpbiA+PiBuOwoKICAgIGJvb2wgZiA9IDE7CiAgICBmb3IgKGkgPSAwOyBpIDwgbjsgKytpKSB7CiAgICAgIHZlY3RvcjxpbnQ+IG0oNSksIHEoNSksIHIoNSk7CiAgICAgIGZvciAoaiA9IDA7IGogPCA1OyArK2opIHsKICAgICAgICBjaW4gPj4gbVtqXSA+PiBxW2pdID4+IHJbal07CiAgICAgICAgaWYgKG1bal0gIT0gdHlwZXNbal0pIGYgPSAwOwogICAgICAgIGlmIChxW2pdICE9IDMpIGYgPSAwOwogICAgICAgIGlmIChyW2pdICE9IDEwKSBmID0gMDsKICAgICAgfQogICAgfQoKICAgIGNvdXQgPDwgKGYgPyAiQ29uc2lzdGVudCIgOiAiSW5jb25zaXN0ZW50IikgPDwgIlxuIjsKICB9CgogIHJldHVybiAwOwp9