#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  int sum_w = 0;
  int max_h[] = {0, 0};
  vector<pair<int, int>> friends(t);
  for (int i = 0; i < t; i++) {
    int w, h;
    cin >> w >> h;
    sum_w += w;
    if (h > max_h[0]) {
      max_h[1] = max_h[0];
      max_h[0] = h;
    } else if (h > max_h[1]) {
      max_h[1] = h;
    }
    friends[i] = {w, h};
  }
  for (pair<int, int> f : friends) {
    if (f.second != max_h[0])
      cout << (sum_w - f.first) * max_h[0] << " ";
    else
      cout << (sum_w - f.first) * max_h[1] << " ";
  }
  return 0;
}
