#include <bits/stdc++.h>
struct person {
  int w, h;
} P[200100];
int Hl[200100], Hr[200100];
int main(void) {
  int n;
  scanf("%d", &n);
  int i, W = 0;
  for (i = 0; i < n; i++) {
    scanf("%d %d", &P[i].w, &P[i].h);
    W += P[i].w;
  }
  for (i = 0; i < n; i++)
    if (!i)
      Hl[i] = P[i].h;
    else
      Hl[i] = (((Hl[i - 1]) > (P[i].h)) ? (Hl[i - 1]) : (P[i].h));
  for (i = n - 1; i >= 0; i--)
    if (i == n - 1)
      Hr[i] = P[i].h;
    else
      Hr[i] = (((Hr[i + 1]) > (P[i].h)) ? (Hr[i + 1]) : (P[i].h));
  for (i = 0; i < n; i++) {
    int W1 = W - P[i].w;
    int h1 = (i > 0) ? Hl[i - 1] : 0;
    int h2 = (i < n - 1) ? Hr[i + 1] : 0;
    int H = (((h1) > (h2)) ? (h1) : (h2));
    printf("%d ", W1 * H);
  }
  return 0;
}
