#include <stdio.h>
int main(void) {
int n,gold=0,silver=0,bronze=0,sum=0,i;
for(i=1;i<=n;i++){
int g,s,b;
scanf("%d %d %d",&g
,&s
,&b
); gold+=g;
silver+=s;
bronze+=b;
}
sum=gold+silver+bronze;
printf("%d %d %d %d",gold
,silver
,bronze
,sum
); return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbih2b2lkKSB7CglpbnQgbixnb2xkPTAsc2lsdmVyPTAsYnJvbnplPTAsc3VtPTAsaTsKCXNjYW5mKCIlZCIsJm4pOwoJZm9yKGk9MTtpPD1uO2krKyl7CgkJaW50IGcscyxiOwoJCXNjYW5mKCIlZCAlZCAlZCIsJmcsJnMsJmIpOwoJCWdvbGQrPWc7CgkJc2lsdmVyKz1zOwoJCWJyb256ZSs9YjsKCX0KCXN1bT1nb2xkK3NpbHZlciticm9uemU7CglwcmludGYoIiVkICVkICVkICVkIixnb2xkLHNpbHZlcixicm9uemUsc3VtKTsKCXJldHVybiAwOwp9Cg==