#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, w[200200], h[200200];
  long long int W = 0, H = 0, H2 = 0, x = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> w[i] >> h[i];
    W += w[i];
    if (h[i] > H) {
      H2 = H;
      H = h[i];
      x = i;
    } else if (H2 < h[i]) {
      H2 = h[i];
    }
  }
  for (int i = 1; i <= n; i++) {
    int q = W - w[i], e;
    if (x != i)
      e = H;
    else
      e = H2;
    cout << q * e << " ";
  }
  return 0;
}
