#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, we = 0, m1 = 0, m2 = 0, mi = -1;
  vector<int> w;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    int tmp_w, h;
    cin >> tmp_w >> h;
    w.push_back(tmp_w);
    we += tmp_w;
    if (h > m1) {
      m2 = m1;
      m1 = h;
      mi = i;
    } else if (h > m2)
      m2 = h;
  }
  if (m1 == m2) {
    int z = m1;
    for (int i = 0; i < n; ++i) cout << z * (we - w[i]) << " ";
  } else {
    for (int i = 0; i < n; ++i)
      if (mi != i)
        cout << m1 * (we - w[i]) << " ";
      else
        cout << m2 * (we - w[i]) << " ";
  }
  return 0;
}
