#include <iostream>
using namespace std;
int main() {
int n, mat[4][4];
cin >> n;
for (int i = 1; i <= n; ++i) {
for (int j = 1; j <= n; ++j) {
cin >> mat[i][j];
}
}
int win = 0;
for (int i = 1; i <= n; ++i) {
if (mat[i][1] == mat[i][2] && mat[i][2] == mat[i][3]) {
if (mat[i][1] == 1) {
win = 1;
cout << "jucatorul X";
break;
} else if (mat[i][1] == 0) {
win = 1;
cout << "jucatorul 0";
break;
}
}
if (mat[1][1] == mat[2][1] && mat[2][1] == mat[3][1]) {
if (mat[i][1] == 1) {
win = 1;
cout << "jucatorul X";
break;
} else if (mat[i][1] == 0) {
win = 1;
cout << "jucatorul 0";
break;
}
}
if (mat[1][2] == mat[2][2] && mat[2][2] == mat[3][2]) {
if (mat[i][2] == 1) {
win = 1;
cout << "jucatorul X";
break;
} else if (mat[i][2] == 0) {
win = 1;
cout << "jucatorul 0";
break;
}
}
if (mat[1][3] == mat[2][3] && mat[2][3] == mat[3][3]) {
if (mat[i][3] == 1) {
win = 1;
cout << "jucatorul X";
break;
} else if (mat[i][3] == 0) {
win = 1;
cout << "jucatorul 0";
break;
}
}
if (mat[1][1] == mat[2][2] && mat[2][2] == mat[3][3]) {
if (mat[1][1] == 1) {
win = 1;
cout << "jucatorul X";
break;
} else if (mat[1][1] == 0) {
win = 1;
cout << "jucatorul 0";
break;
}
}
if (mat[1][3] == mat[2][2] && mat[i][2] == mat[3][1]) {
if (mat[1][3] == 1) {
win = 1;
cout << "jucatorul X";
break;
} else if (mat[1][3] == 0) {
win = 1;
cout << "jucatorul 0";
break;
}
}
}
if (win == 0) {
int cont = 0;
for (int i = 1; i <= n; ++i) {
for (int j = 1; j <= n; ++j) {
if (mat[i][j] == 2) {
++cont;
}
}
}
if (cont >= 1) {
cout << "continua";
return 0;
} else {
cout << "egal";
return 0;
}
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CglpbnQgbiwg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