#include <bits/stdc++.h>
using namespace std;
int n, w[200005], h[200005], wt, b, maxh1, maxh2;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int ww, hh;
    cin >> ww >> hh;
    w[i] = ww;
    h[i] = hh;
    wt += ww;
    if (hh >= maxh1) {
      maxh2 = maxh1;
      maxh1 = hh;
    } else {
      if (hh >= maxh2) maxh2 = hh;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (h[i] == maxh1)
      cout << (wt - w[i]) * (maxh2) << " ";
    else if (h[i] == maxh2)
      cout << (wt - w[i]) * (maxh1) << " ";
    else
      cout << (wt - w[i]) * (maxh1) << " ";
  }
}
