#include <bits/stdc++.h>
using namespace std;
const int maxn = 2 * 1e5 + 100;
pair<long long, long long> a[maxn];
long long maxs[2];
long long sum, n;
int main() {
  cin >> n;
  for (long long y = 0; y < n; y++) {
    long long i, j;
    cin >> i >> j;
    a[y] = pair<long long, long long>(i, j);
    sum += i;
    if (j > maxs[0]) {
      maxs[0] = j;
      maxs[1] = y;
    }
  }
  for (long long y = 0; y < n; y++) {
    long long p = 0;
    if (maxs[1] != y)
      p = maxs[0];
    else {
      for (long long i = 0; i < n; i++) {
        if (i != y) p = max(p, a[i].second);
      }
    }
    cout << (sum - a[y].first) * p << ' ';
  }
}
