#include <bits/stdc++.h>
using namespace std;
struct size {
  int w, h;
};
vector<size> friends;
int main() {
  int n;
  int maxh = 0, maxh1 = 0, width = 0, maxw = 0, mesto;
  cin >> n;
  friends.resize(n);
  for (int i = 0; i < n; i++) {
    cin >> friends[i].w;
    cin >> friends[i].h;
    maxw += friends[i].w;
    if (friends[i].h > maxh) {
      maxh1 = maxh;
      maxh = friends[i].h;
      continue;
    }
    if (friends[i].h == maxh) {
      maxh1 = maxh;
    }
    if (friends[i].h < maxh && friends[i].h > maxh1) {
      maxh1 = friends[i].h;
    }
  }
  if (maxh1 == 0) {
    maxh1 = maxh;
  }
  for (int j = 0; j < n; j++) {
    if (friends[j].h == maxh) {
      cout << (maxw - friends[j].w) * maxh1 << " ";
      continue;
    }
    cout << (maxw - friends[j].w) * maxh << " ";
  }
  return 0;
}
