#include <bits/stdc++.h>
using namespace std;
int w[1000000], h[1000000];
set<pair<int, int> > s;
int main() {
  int n;
  cin >> n;
  long long a = 0;
  for (int i = 0; i < n; i++) {
    cin >> w[i] >> h[i];
    a += w[i];
    s.insert(make_pair(-h[i], i));
  }
  for (int i = 0; i < n; i++) {
    s.erase(make_pair(-h[i], i));
    cout << (a - w[i]) * (-s.begin()->first) << endl;
    s.insert(make_pair(-h[i], i));
  }
  return 0;
}
