#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> w(n);
  int wsum = 0;
  int hmax = 0, imax = 0;
  int hmax2 = 0;
  for (int i = 0; i < n; ++i) {
    int wi, hi;
    cin >> wi >> hi;
    w[i] = wi;
    wsum += wi;
    if (hi > hmax) {
      hmax2 = hmax;
      hmax = hi;
      imax = i;
    } else if (hi > hmax2) {
      hmax2 = hi;
    }
  }
  for (int i = 0; i < n; ++i) {
    int wres = wsum - w[i];
    int hres = (i == imax) ? hmax2 : hmax;
    cout << wres * hres << " ";
  }
  cout << endl;
  return 0;
}
