#include <bits/stdc++.h>
using namespace std;
long long int powmod(long long int a, int b, int n) {
  long long int rm = 1;
  while (b) {
    if (b % 2) {
      rm = (rm * a) % n;
    }
    a = (a * a) % n;
    b /= 2;
  }
  return rm;
}
int sum = 0, w[int(2e5 + 10)], h[int(2e5 + 10)], ldp[int(2e5 + 10)] = {0},
    rdp[int(2e5 + 10)] = {0}, n;
int main() {
  cin >> n;
  for (int i = int(1); i <= (int)n; i++) cin >> w[i] >> h[i];
  for (int i = int(1); i <= (int)n; i++) sum += w[i];
  ldp[1] = h[1];
  for (int i = int(1); i <= (int)n; i++)
    if (i > 1) ldp[i] = max(ldp[i - 1], h[i]);
  rdp[n] = h[n];
  for (int i = n - 1; i >= 1; i--) rdp[i] = max(h[i], rdp[i + 1]);
  int ans = 0;
  for (int i = 1; i <= n; ++i) {
    ans = (sum - w[i]) * max(ldp[i - 1], rdp[i + 1]);
    cout << ans << " ";
  }
  return 0;
}
