#include <bits/stdc++.h>
using namespace std;
long long ans, w[int(2 * 1e5 + 10)], h[int(2 * 1e5 + 10)], sum = 0;
multiset<long long> heights;
int n;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    scanf("%I64d %I64d", &w[i], &h[i]);
    sum += w[i];
    heights.insert(h[i]);
  }
  for (int i = 0; i < n; i++) {
    ans = 0;
    multiset<long long>::reverse_iterator rit;
    multiset<long long>::iterator it;
    it = heights.lower_bound(h[i]);
    heights.erase(it);
    rit = heights.rbegin();
    sum -= w[i];
    ans = sum * (*rit);
    heights.insert(h[i]);
    sum += w[i];
    printf("%I64d ", ans);
  }
  return 0;
}
