#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e15;
const int maxn = 2000 + 5;
int n;
long long base;
map<int, vector<pair<int, int>>> edge;
long long dp[maxn];
int main() {
  scanf("%d", &n);
  base = inf;
  for (int x = 1; x <= n; x++) {
    for (int y = x + 1; y <= n; y++) {
      int val;
      scanf("%d", &val);
      edge[val].push_back({x, y});
      base = min(base, (long long)val);
    }
  }
  for (int x = 1; x <= n; x++) dp[x] = inf;
  for (auto t : edge) {
    long long val = t.first - base;
    vector<pair<int, int>> vec = t.second;
    for (auto t : vec) {
      int x = t.first, y = t.second;
      if (val == 0) dp[x] = dp[y] = 0;
      dp[x] = min(dp[x], dp[y] + val);
      dp[y] = min(dp[y], dp[x] + val);
      dp[x] = min(dp[x], val * 2);
      dp[y] = min(dp[y], val * 2);
    }
  }
  long long add = base * (n - 1);
  for (int i = 1; i <= n; i++) printf("%lld\n", dp[i] + add);
}
