#include // clang-format off using namespace std; using ll=long long; using ull=unsigned long long; using pll=pair; const ll INF=4e18; void print0(){}; template void print0(H h,T... t){cout<void print(H h,T... t){print0(h);if(sizeof...(T)>0)print0(" ");print(t...);} void perr0(){}; template void perr0(H h,T... t){cerr<void perr(H h,T... t){perr0(h);if(sizeof...(T)>0)perr0(" ");perr(t...);} void ioinit() { cout< maxs; ll N; cin >> N; vector cofs(N); for (ll i = 0; i < N; i++) { coffee c; cin >> c.a >> c.b >> c.c >> c.d >> c.e; cofs[i] = c; } for (ll bin = 0; bin < 32; bin++) { coffee base; for (ll j = 0; j < 5; j++) { ll x = 0; if ((bin >> j) & 1) { x = 1001001001001001; } if (j == 0) base.a = x; if (j == 1) base.b = x; if (j == 2) base.c = x; if (j == 3) base.d = x; if (j == 4) base.e = x; } pll mx = {-1, -1}; for (ll i = 0; i < N; i++) { coffee c = cofs[i]; ll diff = abs(base.a - c.a) + abs(base.b - c.b) + abs(base.c - c.c) + abs(base.d - c.d) + abs(base.e - c.e); pll cur = {diff, i}; mx = max(cur, mx); } maxs.push_back(mx.second); } for (ll i = 0; i < N; i++) { ll ans = 0; for (auto j : maxs) { coffee c = cofs[i]; coffee d = cofs[j]; ll diff = abs(d.a - c.a) + abs(d.b - c.b) + abs(d.c - c.c) + abs(d.d - c.d) + abs(d.e - c.e); ans = max(diff, ans); } print(ans); } return 0; }