#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n;
  cin >> n;
  int w[n], h[n], k[n];
  int sumW = 0;
  for (int i = 0; i < n; i++) {
    cin >> w[i] >> h[i];
    sumW += w[i];
    k[i] = h[i];
  }
  sort(k, k + n);
  int h1 = k[n - 1], h2 = k[n - 2];
  int W, H;
  for (int i = 0; i < n; i++) {
    W = sumW - w[i];
    if (h[i] != h1)
      H = h1;
    else
      H = h2;
    cout << W * H << " ";
  }
  cout << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(0);
  solve();
  return 0;
}
