#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, n, t, p = 0, hPxl, hPxl1, wPxl, Pxl, sum = 0;
  scanf("%d", &n);
  int h[n + 5], w[n + 5];
  for (i = 0; i < n; ++i) {
    scanf("%d %d", &w[i], &h[i]);
    sum += w[i];
  }
  hPxl = *max_element(h, h + n);
  for (i = 0; i < n; ++i) {
    wPxl = sum - w[i];
    if (hPxl == h[i] && p == 0) {
      t = h[i];
      h[i] = 0;
      hPxl1 = *max_element(h, h + n);
      Pxl = wPxl * hPxl1;
      ++p;
    } else {
      Pxl = wPxl * hPxl;
    }
    printf("%d ", Pxl);
  }
  cout << endl;
  return 0;
}
