#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> h;
  vector<int> w;
  long long int wsum = 0;
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> b >> a;
    h.push_back(a);
    wsum += b;
    w.push_back(b);
  }
  long long int dp[n];
  int max = 0;
  for (int i = 0; i < n; i++) {
    dp[i] = h[i];
  }
  sort(h.begin(), h.end());
  max = h[n - 1];
  for (int i = 0; i < n; i++) {
    if (dp[i] == max) {
      dp[i] = h[n - 2];
    } else {
      dp[i] = max;
    }
    dp[i] = dp[i] * (wsum - w[i]);
  }
  for (int i = 0; i < n; i++) {
    cout << dp[i] << " ";
  }
}
