#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int sum = 0, w[n], h[n], mi = 0, maxx = 0;
  for (int i = 0; i < n; i++) {
    cin >> w[i] >> h[i];
    sum += w[i];
    if (h[i] > maxx) {
      maxx = h[i];
      mi = i;
    }
  }
  h[mi] = 0;
  int max2 = 0;
  for (int i = 0; i < n; i++) {
    if (h[i] > max2) max2 = h[i];
  }
  for (int i = 0; i < n; i++) {
    if (i == mi) {
      printf("%d ", (sum - w[i]) * max2);
    } else
      printf("%d ", (sum - w[i]) * maxx);
  }
  return 0;
}
