#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:66777216")
#pragma hdrstop
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> w(n), h(n);
  int sum = 0;
  int indmax = -1, indmax2 = -1;
  int mmax = 0, mmax2 = 0;
  for (int i = 0; i < n; i++) {
    cin >> w[i] >> h[i];
    sum += w[i];
    if (mmax < h[i]) {
      mmax2 = mmax;
      indmax2 = indmax;
      mmax = h[i];
      indmax = i;
    } else if (mmax2 < h[i]) {
      mmax2 = h[i];
      indmax2 = i;
    }
  }
  for (int i = 0; i < n; i++) {
    if (i == indmax) {
      cout << (sum - w[i]) * mmax2 << ' ';
    } else {
      cout << (sum - w[i]) * mmax << ' ';
    }
  }
  return 0;
}
