#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k = 0, l = 0, h1 = 0;
  cin >> n;
  int a[n][2];
  for (int i = 1; i <= n; i++) {
    cin >> a[i][0];
    cin >> a[i][1];
    k += a[i][0];
    if (a[i][1] > l) {
      h1 = l;
      l = a[i][1];
    } else if (a[i][1] > h1) {
      h1 = a[i][1];
    }
  }
  for (int i = 1; i <= n; i++) {
    if (a[i][1] != l)
      cout << (k - a[i][0]) * l << " ";
    else
      cout << (k - a[i][0]) * h1 << " ";
  }
}
