#include <bits/stdc++.h>
using namespace std;
class man {
 public:
  int w, h;
};
int main() {
  int n;
  vector<man> men;
  man man;
  int allw;
  int maxh;
  int maxh1 = 0;
  int size;
  bool maxhstable = false;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> man.w >> man.h;
    if (i == 1) {
      maxh = man.h;
      allw = man.w;
    } else {
      if (man.h > maxh) {
        maxh1 = maxh;
        maxh = man.h;
      } else if (man.h == maxh)
        maxhstable = true;
      else if (!maxh1)
        maxh1 = man.h;
      else if (man.h > maxh1)
        maxh1 = man.h;
      allw += man.w;
    }
    men.push_back(man);
  }
  for (int i = 0; i < men.size(); i++) {
    if ((men[i].h == maxh) && !maxhstable) {
      size = (allw - men[i].w) * maxh1;
    } else {
      size = (allw - men[i].w) * maxh;
    }
    cout << size << ' ';
  }
  return 0;
}
