#include <iostream>
//#include <cstdlib>
using namespace std;
int main() {
int evenSize;
cin >> evenSize;
int currentEl, firstHalfSum = 0, secondHalfSum = 0;
for (int line = 1; line <= evenSize; ++line) {
for (int col = 1; col <= evenSize; ++col) {
cin >> currentEl;
if (col <= evenSize / 2) {
firstHalfSum += currentEl;
} else {
secondHalfSum += currentEl;
}
}
}
if (firstHalfSum > secondHalfSum) {
cout << "Prima jumatate\n";
} else {
cout << "A doua jumatate\n";
}
int sumDifference = firstHalfSum - secondHalfSum;
if (sumDifference < 0) {
sumDifference = -sumDifference;
}
cout << sumDifference;
//cout << abs(firstHalfSum - secondHalfSum);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgovLyNpbmNsdWRlIDxjc3RkbGliPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CiAgICBpbnQgZXZlblNpemU7CiAgICBjaW4gPj4gZXZlblNpemU7CiAgICBpbnQgY3VycmVudEVsLCBmaXJzdEhhbGZTdW0gPSAwLCBzZWNvbmRIYWxmU3VtID0gMDsKICAgIGZvciAoaW50IGxpbmUgPSAxOyBsaW5lIDw9IGV2ZW5TaXplOyArK2xpbmUpIHsKICAgICAgICBmb3IgKGludCBjb2wgPSAxOyBjb2wgPD0gZXZlblNpemU7ICsrY29sKSB7CiAgICAgICAgICAgIGNpbiA+PiBjdXJyZW50RWw7CiAgICAgICAgICAgIGlmIChjb2wgPD0gZXZlblNpemUgLyAyKSB7CiAgICAgICAgICAgICAgICBmaXJzdEhhbGZTdW0gKz0gY3VycmVudEVsOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgc2Vjb25kSGFsZlN1bSArPSBjdXJyZW50RWw7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9CiAgICBpZiAoZmlyc3RIYWxmU3VtID4gc2Vjb25kSGFsZlN1bSkgewogICAgICAgIGNvdXQgPDwgIlByaW1hIGp1bWF0YXRlXG4iOwogICAgfSBlbHNlIHsKICAg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