#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long t = 1;
  while (t--) {
    long long n;
    cin >> n;
    long long w[n], h[n];
    long long max = 0, sMax = 0, sumW = 0;
    for (long long i = 0; i < n; i++) {
      cin >> w[i] >> h[i];
      sumW += w[i];
      if (h[i] > max) {
        sMax = max;
        max = h[i];
      } else if (h[i] > sMax) {
        sMax = h[i];
      }
    }
    long long maxPixel = sumW * max;
    for (long long i = 0; i < n; i++) {
      long long height = h[i] == max ? sMax : max;
      long long width = sumW - w[i];
      cout << height * width << " ";
    }
    cout << "\n";
  }
  return 0;
}
