#include <bits/stdc++.h>
using namespace std;
int n, w[200005] = {}, h[200005] = {};
int h1 = 0, h2 = 0, W = 0, H = 0;
int max1;
long long solve(int x);
int main() {
  long long sum;
  bool now = false;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> w[i] >> h[i];
    W += w[i];
    if (h[i] > h1) {
      h2 = h1;
      h1 = h[i];
      max1 = i;
      now = true;
    }
    if (h[i] <= h1 && !now && h2 < h[i]) {
      h2 = h[i];
    }
    now = false;
  }
  sum = W;
  for (int i = 0; i < n; i++) {
    W = sum;
    cout << solve(i) << " ";
  }
  return 0;
}
long long solve(int x) {
  W -= w[x];
  if (x == max1)
    H = h2;
  else
    H = h1;
  return W * H;
}
