#include using namespace std; using ll = long long; using P = pair; #define fix(x) fixed << setprecision(x) #define asc(x) x, vector, greater #define rep(i, n) for(ll i = 0; i < n; i++) #define all(x) (x).begin(),(x).end() templatebool chmin(T&a, const T&b){if(a>b){a=b;return 1;}return 0;} templatebool chmax(T&a, const T&b){if(a> n; vector> a(n,vector(5)), x(n,vector(1<<5,0)); vector ma(1<<5, -INFLL), mi(1<<5, INFLL); rep(i,n){ rep(j,5) cin >> a[i][j]; rep(j,1<<5){ rep(k,5) x[i][j] += a[i][k] * (1 - ((j>>k)&1)*2); chmin(mi[j], x[i][j]); chmax(ma[j], x[i][j]); } } rep(i,n){ ll ans = 0; rep(j,1<<5) chmax(ans, abs(x[i][j]-ma[j])); rep(j,1<<5) chmax(ans, abs(x[i][j]-mi[j])); cout << ans << '\n'; } return 0; }