#include <bits/stdc++.h>
using namespace std;
int w[200001], h[200001], l[200001], r[200001], sum;
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> w[i] >> h[i], sum += w[i];
  l[1] = 0, l[2] = 1;
  for (int i = 3; i <= n; i++) {
    l[i] = l[i - 1];
    if (h[i - 1] > h[l[i - 1]]) l[i] = i - 1;
  }
  r[n] = n + 1, r[n - 1] = n;
  for (int i = n - 2; i >= 1; i--) {
    r[i] = r[i + 1];
    if (h[i + 1] > h[r[i + 1]]) r[i] = i + 1;
  }
  for (int i = 1; i <= n; i++) {
    long long x = sum - w[i];
    long long y = max(h[r[i]], h[l[i]]);
    cout << x * y << " ";
  }
  cout << endl;
}
