#include <bits/stdc++.h>
using namespace std;
long long K = 1;
int main() {
  int W = 0, H1 = 0, H2 = 0, n, i;
  vector<pair<int, int> > v;
  scanf("%d", &n);
  v.resize(n);
  for (i = 0; i < n; i++) {
    scanf("%d%d", &v[i].first, &v[i].second);
    W += v[i].first;
    if (v[i].second >= H1) {
      H2 = H1;
      H1 = v[i].second;
    } else if (v[i].second > H2) {
      H2 = v[i].second;
    }
  }
  for (i = 0; i < n; i++) {
    if (v[i].second == H1)
      printf("%d ", (W - v[i].first) * H2);
    else
      printf("%d ", (W - v[i].first) * H1);
  }
  return 0;
}
