// Online C compiler to run C program online
#include <stdio.h>
int main() {
int n;
scanf ("%d", &n);
int x[n], y[n], z[n];
int i;
for (int i = 0; i < n; i++) {
scanf("%d%d%d",&x[i],&y[i],&z[i]);
}
int xsum, ysum, zsum;
for(i = 0; i < n; i++) {
xsum = xsum + x[i];
ysum = ysum + y[i];
zsum = zsum + z[i];
}
// debug stuff
printf("\n");
printf("%d \n", n);
for (int i = 0; i < n; i++) {
printf("\n");
printf("%d ", x[i]);
}
printf("\n");
for (int i = 0; i < n; i++) {
printf("\n");
printf("%d ", y[i]);
}
printf("\n");
for (int i = 0; i < n; i++) {
printf("\n");
printf("%d ", z[i]);
}
printf("\n");
printf("\n%d", xsum);
printf("\n%d", ysum);
printf("\n%d", zsum);
return 0;
}
Ly8gT25saW5lIEMgY29tcGlsZXIgdG8gcnVuIEMgcHJvZ3JhbSBvbmxpbmUKI2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbigpIHsKICAgIGludCBuOwogICAgc2NhbmYgKCIlZCIsICZuKTsKICAgIGludCB4W25dLCB5W25dLCB6W25dOwogICAgaW50IGk7CiAgICBmb3IgKGludCBpID0gMDsgaSA8IG47IGkrKykgeyAKICAgICAgICBzY2FuZigiJWQlZCVkIiwmeFtpXSwmeVtpXSwmeltpXSk7IAogICAgfQogICAKICAgIGludCB4c3VtLCB5c3VtLCB6c3VtOwogICAgZm9yKGkgPSAwOyBpIDwgbjsgaSsrKSB7CiAgICAgICAgICB4c3VtID0geHN1bSArIHhbaV07CiAgICAgICAgICB5c3VtID0geXN1bSArIHlbaV07CiAgICAgICAgICB6c3VtID0genN1bSArIHpbaV07CiAgICB9CgovLyBkZWJ1ZyBzdHVmZgogICAgcHJpbnRmKCJcbiIpOwogICAgcHJpbnRmKCIlZCBcbiIsIG4pOwoKICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbjsgaSsrKSB7IAogICAgICAgICAgICBwcmludGYoIlxuIik7CiAgICAgICAgICAgIHByaW50ZigiJWQgIiwgeFtpXSk7CiAgICB9IAogICAgcHJpbnRmKCJcbiIpOwogICAgZm9yIChpbnQgaSA9IDA7IGkgPCBuOyBpKyspIHsgCiAgICAgICAgICAgIHByaW50ZigiXG4iKTsKICAgICAgICAgICAgcHJpbnRmKCIlZCAiLCB5W2ldKTsKICAgIH0gCiAgICBwcmludGYoIlxuIik7CiAgICBmb3IgKGludCBpID0gMDsgaSA8IG47IGkrKykgeyAKICAgICAgICAgICAgcHJpbnRmKCJcbiIpOwogICAgICAgICAgICBwcmludGYoIiVkICIsIHpbaV0pOwogICAgfSAKICAgIHByaW50ZigiXG4iKTsKICAgIHByaW50ZigiXG4lZCIsIHhzdW0pOwogICAgcHJpbnRmKCJcbiVkIiwgeXN1bSk7CiAgICBwcmludGYoIlxuJWQiLCB6c3VtKTsKCiAgICByZXR1cm4gMDsKfQ==