#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long ar[n][2];
  long long x, y;
  for (long long i = 0; i < n; i++) {
    cin >> x >> y;
    ar[i][0] = x;
    ar[i][1] = y;
  }
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    ans += ar[i][0];
  }
  long long firstMaximum = INT_MIN;
  for (long long i = 0; i < n; i++) {
    firstMaximum = max(firstMaximum, ar[i][1]);
  }
  long long c = 0;
  for (long long i = 0; i < n; i++) {
    if (firstMaximum == ar[i][1]) c++;
  }
  long long secondMaximum = INT_MIN;
  for (long long i = 0; i < n; i++) {
    if (secondMaximum < ar[i][1] && ar[i][1] != firstMaximum) {
      secondMaximum = ar[i][1];
    }
  }
  long long sum = 0;
  for (long long i = 0; i < n; i++) {
    if (ar[i][1] == firstMaximum && secondMaximum != INT_MIN && c == 1) {
      sum = (ans - ar[i][0]) * secondMaximum;
    } else {
      sum = (ans - ar[i][0]) * firstMaximum;
    }
    cout << sum << " ";
  }
}
