#include <bits/stdc++.h>
using namespace std;
int a[200000], b[200000], n, ii;
long long sum, h, w, mx, max2;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
    if (b[i] >= mx) {
      mx = b[i];
      ii = i;
    }
    sum += a[i];
  }
  for (int i = 0; i < n; i++) {
    if (i != ii && b[i] == mx) {
      max2 = mx;
      break;
    }
    if (max2 < b[i] && mx > b[i]) max2 = b[i];
  }
  for (int i = 0; i < n; i++) {
    if (b[i] == mx)
      h = max2;
    else
      h = mx;
    w = sum - a[i];
    cout << h * w << " ";
  }
}
