#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void red(T &x) {
  x = 0;
  bool fg = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') fg ^= 1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    x = (x << 1) + (x << 3) + (T)(ch ^ 48), ch = getchar();
  if (fg) x = -x;
}
const long long N = 2005;
long long g[N][N], n, mn = LLONG_MAX, st;
long long dis[N];
bool vis[N];
void dij() {
  memset(dis, 0x3f, sizeof(dis));
  memset(vis, 0, sizeof(vis));
  vis[st] = 1;
  for (long long i = 1; i <= n; i++) {
    dis[i] = g[st][i];
    for (long long j = 1; j <= n; j++)
      if (i != j) dis[i] = min(dis[i], 2 * g[i][j]);
  }
  for (long long i = 1; i < n; i++) {
    long long u = 0;
    for (long long i = 1; i <= n; i++)
      if (!vis[i] && (u == 0 || dis[i] < dis[u])) u = i;
    vis[u] = 1;
    for (long long v = 1; v <= n; v++)
      if (!vis[v]) dis[v] = min(dis[v], dis[u] + g[u][v]);
  }
}
int main() {
  red(n);
  for (long long i = 1; i <= n; i++) {
    for (long long j = i + 1; j <= n; j++) {
      red(g[i][j]), g[j][i] = g[i][j];
      if (g[i][j] < mn) {
        mn = g[i][j];
        st = i;
      }
    }
  }
  for (long long i = 1; i <= n; i++)
    for (long long j = i + 1; j <= n; j++) g[i][j] -= mn, g[j][i] -= mn;
  dij();
  for (long long i = 1; i <= n; i++) {
    printf("%lld\n", dis[i] + (n - 1) * mn);
  }
}
