#include <bits/stdc++.h>
using namespace std;
void print() {
  int n;
  cin >> n;
  long long h[n], w[n], sum = 0;
  priority_queue<int> ms;
  for (int i = 0; i < n; i++) {
    cin >> w[i] >> h[i];
    ms.push(h[i]);
    sum += w[i];
  }
  bool flag = false;
  for (int i = 0; i < n; i++) {
    if (ms.top() == h[i]) {
      flag = true;
      ms.pop();
    }
    cout << ((sum - w[i]) * (ms.top())) << " ";
    if (flag) {
      ms.push(h[i]);
      flag = false;
    }
  }
}
int main() {
  int t;
  t = 1;
  while (t) {
    --t;
    print();
  }
}
