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