#include <iostream> using namespace std; int main() { int n; cin>>n; int a,b,c; int g=0,h=0,j=0; int s; for(int i=0;i<n;i++){ cin>>a>>b>>c; g+=a; h+=b; j+=c; } s=g+h+j; cout<<g<<" "<<h<<" "<<j<<" "<<s; return 0; }