#include <bits/stdc++.h>
using namespace std;
const int MAXN = 300111;
int x[MAXN], y[MAXN];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &x[i], &y[i]);
  }
  int k = -1;
  int sum = 0;
  for (int i = 0; i < n; i++) {
    sum += x[i];
    if (k < 0 || y[i] > y[k]) k = i;
  }
  for (int i = 0; i < n; i++) {
    int X = sum - x[i];
    int Y = y[k];
    if (i == k) {
      int k2 = -1;
      for (int j = 0; j < n; j++)
        if (j != i && (k2 < 0 || y[j] > y[k2])) k2 = j;
      Y = y[k2];
    }
    if (i > 0) printf(" ");
    printf("%d", X * Y);
  }
  printf("\n");
  return 0;
}
