#include <iostream>
using namespace std;
const int MAX_SIZE = 3;
int main() {
int player0 = 0, playerX = 0;
int matrix[MAX_SIZE][MAX_SIZE], notComplete = 0;
for (int i = 0; i < MAX_SIZE; ++i) {
for (int j = 0; j < MAX_SIZE; ++j) {
cin >> matrix[i][j];
if (j == MAX_SIZE - 1) {
if (matrix[i][j] == 0 && matrix[i][j - 1] == 0 && matrix[i][j - 2] == 0) {
++player0;
} else if (matrix[i][j] == 1 && matrix[i][j - 1] == 1 && matrix[i][j - 2] == 1) {
++playerX;
}
if (i == MAX_SIZE - 1) {
if (matrix[i][j] == 0 && matrix[i - 1][j - 1] == 0 && matrix[i - 2][j - 2] == 0) {
++player0;
} else if (matrix[i][j] == 1 && matrix[i - 1][j - 1] == 1 && matrix[i - 2][j - 2] == 1) {
++playerX;
}
}
} else if (i == MAX_SIZE - 1) {
if (matrix[i][j] == 0 && matrix[i - 1][j] == 0 && matrix[i - 2][j] == 0) {
++player0;
} else if (matrix[i][j] == 1 && matrix[i - 1][j] == 1 && matrix[i - 2][j] == 1) {
++playerX;
}
if (j == 0) {
if (matrix[i][j] == 0 && matrix[i - 1][j + 1] == 0 && matrix[i - 2][j + 2] == 0) {
++player0;
} else if (matrix[i][j] == 1 && matrix[i - 1][j + 1] == 1 && matrix[i - 2][j + 2] == 1) {
++playerX;
}
}
}
if (matrix[i][j] == 2) {
notComplete = 1;
}
}
}
if (player0 != playerX) {
cout << "Jucătorul ";
if (player0 > playerX) {
cout << 0;
} else {
cout << 1;
}
} else if (notComplete) {
cout << "Continuă";
} else {
cout << "Egal";
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKY29uc3QgaW50IE1BWF9TSVpFID0gMzsKCmludCBtYWluKCkgewogICAgaW50IHBsYXllcjAgPSAwLCBwbGF5ZXJYID0gMDsKICAgIGludCBtYXRyaXhbTUFYX1NJWkVdW01BWF9TSVpFXSwgbm90Q29tcGxldGUgPSAwOwogICAgZm9yIChpbnQgaSA9IDA7IGkgPCBNQVhfU0laRTsgKytpKSB7CiAgICAgICAgZm9yIChpbnQgaiA9IDA7IGogPCBNQVhfU0laRTsgKytqKSB7CiAgICAgICAgICAgIGNpbiA+PiBtYXRyaXhbaV1bal07CiAgICAgICAgICAgIGlmIChqID09IE1BWF9TSVpFIC0gMSkgewogICAgICAgICAgICAgICAgaWYgKG1hdHJpeFtpXVtqXSA9PSAwICYmIG1hdHJpeFtpXVtqIC0gMV0gPT0gMCAmJiBtYXRyaXhbaV1baiAtIDJdID09IDApIHsKICAgICAgICAgICAgICAgICAgICArK3BsYXllcjA7IAogICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtYXRyaXhbaV1bal0gPT0gMSAmJiBtYXRyaXhbaV1baiAtIDFdID09IDEgJiYgbWF0cml4W2ldW2ogLSAyXSA9PSAxKSB7CiAgICAgICAgICAgICAgICAgICAgKytwbGF5ZXJYOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgaWYgKGkgPT0gTUFYX1NJWkUgLSAxKSB7CiAgICAgICAgICAgICAgICAgICAgaWYgKG1hdHJpeFtpXVtqXSA9PSAwICYmIG1hdHJpeFtpIC0gMV1baiAtIDFdID09IDAgJiYgbWF0cml4W2kgLSAyXVtqIC0gMl0gPT0gMCkgewogICAgICAgICAgICAgICAgICAgICAgICArK3BsYXllcjA7CiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtYXRyaXhbaV1bal0gPT0gMSAmJiBtYXRyaXhbaSAtIDFdW2ogLSAxXSA9PSAxICYmIG1hdHJpeFtpIC0gMl1baiAtIDJdID09IDEpIHsKICAgICAgICAgICAgICAgICAgICAgICAgKytwbGF5ZXJYOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSBlbHNlIGlmIChpID09IE1BWF9TSVpFIC0gMSkgewogICAgICAgICAgICAgICAgaWYgKG1hdHJpeFtpXVtqXSA9PSAwICYmIG1hdHJpeFtpIC0gMV1bal0gPT0gMCAmJiBtYXRyaXhbaSAtIDJdW2pdID09IDApIHsKICAgICAgICAgICAgICAgICAgICArK3BsYXllcjA7IAogICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtYXRyaXhbaV1bal0gPT0gMSAmJiBtYXRyaXhbaSAtIDFdW2pdID09IDEgJiYgbWF0cml4W2kgLSAyXVtqXSA9PSAxKSB7CiAgICAgICAgICAgICAgICAgICAgKytwbGF5ZXJYOwogICAgICAgICAgICAgICAgfSAKICAgICAgICAgICAgICAgIGlmIChqID09IDApIHsKICAgICAgICAgICAgICAgICAgICBpZiAobWF0cml4W2ldW2pdID09IDAgJiYgbWF0cml4W2kgLSAxXVtqICsgMV0gPT0gMCAmJiBtYXRyaXhbaSAtIDJdW2ogKyAyXSA9PSAwKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICsrcGxheWVyMDsKICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1hdHJpeFtpXVtqXSA9PSAxICYmIG1hdHJpeFtpIC0gMV1baiArIDFdID09IDEgJiYgbWF0cml4W2kgLSAyXVtqICsgMl0gPT0gMSkgewogICAgICAgICAgICAgICAgICAgICAgICArK3BsYXllclg7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIGlmIChtYXRyaXhbaV1bal0gPT0gMikgewogICAgICAgICAgICAgICAgbm90Q29tcGxldGUgPSAxOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQogICAgaWYgKHBsYXllcjAgIT0gcGxheWVyWCkgewogICAgICAgIGNvdXQgPDwgIkp1Y8SDdG9ydWwgIjsKICAgICAgICBpZiAocGxheWVyMCA+IHBsYXllclgpIHsKICAgICAgICAgICAgY291dCA8PCAwOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIGNvdXQgPDwgMTsKICAgICAgICB9CiAgICB9IGVsc2UgaWYgKG5vdENvbXBsZXRlKSB7CiAgICAgICAgY291dCA8PCAiQ29udGludcSDIjsgICAgICAgIAogICAgfSBlbHNlIHsKICAgICAgICBjb3V0IDw8ICJFZ2FsIjsKICAgIH0KICAgIHJldHVybiAwOwp9