#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2010;
const long long INF = 1LL << 50;
int n, g[MAXN][MAXN], Min;
int q[MAXN * MAXN], m[MAXN], l, r;
long long d[MAXN];
bool inq[MAXN];
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') f = -1;
  for (; isdigit(ch); ch = getchar()) x = (x << 1) + (x << 3) + (ch ^ 48);
  return x * f;
}
inline void SPFA() {
  int i;
  for (i = 1; i <= n; i++) d[i] = (long long)m[i] * 2 - (long long)2 * Min;
  for (i = 1; i <= n; i++)
    if (inq[i]) d[i] = 0;
  for (i = 1; i <= n; i++) q[++r] = i, inq[i] = true;
  while (l < r) {
    int u = q[++l];
    inq[u] = false;
    for (i = 1; i <= n; i++) {
      if (u == i) continue;
      long long val = i < u ? g[i][u] : g[u][i];
      if (d[u] + val < d[i]) {
        d[i] = d[u] + val;
        if (!inq[i]) q[++r] = i, inq[i] = true;
      }
    }
  }
}
int main() {
  int i, j;
  n = read();
  Min = 1000000000;
  for (i = 1; i <= n; i++) m[i] = 1000000000;
  for (i = 1; i <= n; i++) {
    for (j = i + 1; j <= n; j++) {
      g[i][j] = read();
      Min = min(Min, g[i][j]);
      m[i] = min(m[i], g[i][j]);
      m[j] = min(m[j], g[i][j]);
    }
  }
  for (i = 1; i <= n; i++)
    for (j = i + 1; j <= n; j++) {
      g[i][j] -= Min;
      if (!g[i][j]) inq[i] = inq[j] = true;
    }
  SPFA();
  for (i = 1; i <= n; i++) printf("%I64d\n", d[i] + (long long)Min * (n - 1));
  return 0;
}
