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