#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  ;
  long long tw = 0;
  long long w[n], h[n];
  for (long long i = 0; i < n; i++) {
    cin >> w[i] >> h[i];
    tw += w[i];
  }
  long long max1 = *max_element(h, h + n);
  long long max2 = 0;
  for (long long i = 0; i < n; i++) {
    if (h[i] > max2 && h[i] != max1) max2 = h[i];
  }
  long long c = 0;
  for (long long i = 0; i < n; i++) {
    if (h[i] == max1) c++;
  }
  for (long long i = 0; i < n; i++) {
    if (c > 1) {
      cout << (tw - w[i]) * max1 << " ";
    } else {
      if (h[i] != max1) {
        cout << (tw - w[i]) * max1 << " ";
      } else {
        cout << (tw - w[i]) * max2 << " ";
      }
    }
  }
}
int32_t main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int q;
  q = 1;
  while (q--) {
    solve();
    cout << endl;
  }
  return 0;
}
