#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000 + 5;
const int N = 2000 + 5;
int g[N][N];
long long ans[N];
int top;
bool mark[N];
int in[N];
int a[N][N];
long long pat[N];
long long d[N];
long long val[N];
bool used[N];
struct edge {
  int a, b, c;
  edge(int A = 0, int B = 0, int C = 0) : a(A), b(B), c(C) {}
  bool operator<(const edge& R) const { return c < R.c; }
};
int tope;
edge e[N * N];
void solvefor(int n) {
  for (int i = 1; i <= (int)(n); ++i) d[i] = a[0][i];
  used[0] = 1;
  for (int iter = 1; iter <= (int)(n); ++iter) {
    pair<long long, int> mi((long long)INF, 0);
    for (int i = 1; i <= (int)(n); ++i) {
      if (!used[i]) mi = min(mi, make_pair(d[i], i));
    }
    int v = mi.second;
    used[v] = true;
    for (int j = 1; j <= (int)(n); ++j) {
      if (!used[j] && d[j] > d[v] + a[v][j]) d[j] = d[v] + a[v][j];
    }
  }
  for (int i = 1; i <= (int)(n); ++i) {
    for (int j = 1; j <= (int)(n - i); ++j) {
      e[++tope] = edge(i, i + j, a[i][i + j]);
    }
  }
  sort(e + 1, e + tope + 1);
  for (int i = 1; i <= (int)(n); ++i) val[i] = 2 * INF;
  for (int i = 1; i <= (int)(tope); ++i) {
    int a = e[i].a, b = e[i].b;
    int C = e[i].c;
    val[a] = min(val[a], (long long)C + C);
    val[b] = min(val[b], (long long)C + C);
    val[a] = min(val[a], C + val[b]);
    val[b] = min(val[b], C + val[a]);
  }
  for (int i = 1; i <= (int)(n); ++i) pat[i] = min(val[i], d[i]);
}
void solve() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= (int)(n); ++i) g[i][i] = INF;
  for (int i = 1; i <= (int)(n); ++i) {
    for (int j = 1; j <= (int)(n - i); ++j) {
      scanf("%d", &g[i][i + j]);
      g[i + j][i] = g[i][i + j];
    }
  }
  int mi = INF;
  for (int i = 1; i <= (int)(n); ++i)
    for (int j = 1; j <= (int)(n); ++j) mi = min(mi, g[i][j]);
  long long res = (long long)(n - 1) * mi;
  for (int i = 1; i <= (int)(n); ++i) {
    for (int j = 1; j <= (int)(n); ++j) {
      if (g[i][j] != INF) g[i][j] -= mi;
      if (g[i][j] == 0) {
        mark[i] = true;
        mark[j] = true;
      }
    }
  }
  for (int i = 1; i <= (int)(n); ++i) {
    if (!mark[i]) {
      in[++top] = i;
    }
  }
  a[0][0] = INF;
  for (int i = 1; i <= (int)(top); ++i) {
    for (int j = 1; j <= (int)(top); ++j) {
      a[i][j] = g[in[i]][in[j]];
    }
    a[i][0] = INF;
    for (int j = 1; j <= (int)(n); ++j) {
      if (mark[j]) a[i][0] = min(a[i][0], g[in[i]][j]);
    }
    a[0][i] = a[i][0];
  }
  solvefor(top);
  for (int i = 1; i <= (int)(top); ++i) ans[in[i]] = pat[i];
  for (int i = 1; i <= (int)(n); ++i) {
    printf("%lld\n", ans[i] + res);
  }
}
void testgen() {
  FILE* f = fopen("input.txt", "w");
  srand(time(0));
  fclose(f);
}
int main(int argc, char* argv[]) {
  cout << fixed;
  cout.precision(12);
  solve();
  return 0;
}
