#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int w[n], h[n], he[n];
  int wsum = 0;
  for (int i = 0; i < n; i++) {
    cin >> w[i] >> h[i];
    wsum += w[i];
    he[i] = h[i];
  }
  sort(he, he + n);
  for (int i = 0; i < n; i++) {
    if (h[i] == he[n - 1]) {
      cout << he[n - 2] * (wsum - w[i]) << " ";
    } else {
      cout << he[n - 1] * (wsum - w[i]) << " ";
    }
  }
  cout << '\n';
}
