#include <iostream>
using namespace std;
int main() {
int matriz[3][3] = {{1, 2, 3},
{4, 5, 6},
{7, 8, 9}};
int somaP = 0, somaS = 0;
for(int i = 0; i < 3; i++)
{
somaP += matriz[i][i];
somaS += matriz[i][2-i];
}
cout << somaP << endl << somaS;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CglpbnQgbWF0cml6WzNdWzNdID0ge3sxLCAyLCAzfSwKICAgICAgICAgICAgICAgICAgICAgICAgezQsIDUsIDZ9LAogICAgICAgICAgICAgICAgICAgICAgICB7NywgOCwgOX19OwoJCglpbnQgc29tYVAgPSAwLCBzb21hUyA9IDA7CiAgICAKICAgIGZvcihpbnQgaSA9IDA7IGkgPCAzOyBpKyspCiAgICB7CiAgICAgICAgc29tYVAgKz0gbWF0cml6W2ldW2ldOwogICAgICAgIHNvbWFTICs9IG1hdHJpeltpXVsyLWldOwogICAgfQogICAgCiAgICBjb3V0IDw8IHNvbWFQIDw8IGVuZGwgPDwgc29tYVM7CglyZXR1cm4gMDsKfQ==