#include<bits/stdc++.h> using namespace std; int main(){ int n,a,b,c; int jin=0,yin=0,tong=0; cin>>n; for(int i=0;i<n;i++){ cin>>a; cin>>b; cin>>c; jin+=a; yin+=b; tong+=c; } cout<<jin<<" "<<yin<<" "<<tong<<" "<<jin+yin+tong; return 0; }