#include <bits/stdc++.h>
using namespace std;
vector<int> w, h, sh;
bool cmp(int a, int b) { return a > b; }
int main() {
  int n;
  cin >> n;
  int W = 0;
  for (int i = 0; i < n; i++) {
    int tw, th;
    cin >> tw >> th;
    W += tw;
    w.push_back(tw);
    h.push_back(th);
    sh.push_back(th);
  }
  sort(sh.begin(), sh.end(), cmp);
  for (int i = 0; i < n; i++) {
    int wi = W - w[i], hi = sh[0];
    if (sh[0] == h[i]) hi = sh[1];
    cout << wi * hi << " ";
  }
  cout << endl;
  return 0;
}
