#include <bits/stdc++.h>
using namespace std;
long long n, i, w[200005], h[200005];
int main() {
  cin >> n;
  long long sum = 0;
  for (i = 0; i <= n - 1; i++) {
    cin >> w[i] >> h[i];
    sum += w[i];
  }
  int max = h[0], smax = -1;
  for (i = 1; i <= n - 1; i++) {
    if (max < h[i]) max = h[i];
  }
  int count = 0;
  for (i = 0; i <= n - 1; i++) {
    if (h[i] == max) count++;
    if (smax < h[i] && h[i] < max) smax = h[i];
  }
  for (i = 0; i <= n - 1; i++) {
    int height;
    if (count == 1 && h[i] == max) {
      height = smax;
    } else
      height = max;
    cout << (sum - w[i]) * height << " ";
  }
  return 0;
}
