#include <bits/stdc++.h>
using namespace std;
int n, w[200005], h[200005], h1[200005], maxx;
long long s[200005];
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i)
    cin >> w[i] >> h[i], h1[i] = h[i], s[i] = s[i - 1] + w[i];
  sort(h1 + 1, h1 + n + 1);
  for (int i = 1; i <= n; ++i) {
    h[i] == h1[n] ? maxx = h1[n - 1] : maxx = h1[n];
    cout << 1LL * (s[n] - w[i]) * maxx << " ";
  }
  return 0;
}
