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