#include<bits/stdc++.h>
using namespace std;
int j[101];
int y[101];
int T[101];
int main(){
int t,jz=0,yz=0,tz=0;
cin>>t;
for(int i=1;i<=t;i++){
cin>>j[i]>>y[i]>>T[i];
jz+=j[i];
yz+=y[i];
tz+=T[i];
}
cout<<jz<<" "<<yz<<" "<<tz<<" "<<jz+yz+tz;
return 0;
}