#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, w = 0, h = 0, res = 0;
  scanf("%d", &n);
  int arr1[n][2], arr2[n];
  int maxm[n];
  for (int i = 0; i < n; i++) {
    scanf("%d %d", &arr1[i][0], &arr2[i]);
    w += arr1[i][0];
    arr1[i][1] = arr2[i];
  }
  sort(arr2, arr2 + n);
  for (int i = 0; i < n; i++) {
    h = (arr2[n - 1] == arr1[i][1]) ? arr2[n - 2] : arr2[n - 1];
    res = (w - arr1[i][0]) * h;
    printf("%d ", res);
  }
  return 0;
}
