#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 10;
int dp1[MAXN], dp2[MAXN], a[MAXN], b[MAXN];
int main() {
  ios::sync_with_stdio(false);
  int n, sum = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i] >> b[i], sum += a[i];
  for (int i = 1; i <= n; i++) dp1[i] = max(dp1[i - 1], b[i]);
  for (int i = n; i > 0; i--) dp2[i] = max(dp2[i + 1], b[i]);
  for (int i = 1; i <= n; i++) {
    int W = sum - a[i];
    int H = max(dp1[i - 1], dp2[i + 1]);
    cout << W * H << " ";
  }
  return 0;
}
