#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<long long> ans(n), h(n), w(n), h_aux(n);
  long long cum_wid = 0;
  for (int i = 0; i < n; i++) cin >> w[i] >> h[i];
  for (int i = 0; i < n; i++) cum_wid += w[i];
  h_aux = h;
  sort(h_aux.begin(), h_aux.end());
  long long max_h = h_aux[n - 1];
  long long s_max_h = h_aux[n - 2];
  for (long long i = 0; i < n; i++) {
    if (h[i] == max_h) {
      ans[i] = (cum_wid - w[i]) * s_max_h;
    } else {
      ans[i] = (cum_wid - w[i]) * max_h;
    }
  }
  for (int i = 0; i < n; i++) cout << ans[i] << " ";
  return 0;
}
