#include <bits/stdc++.h>
using namespace std;
const int NMAX = 200000;
int N;
int width[NMAX];
int height[NMAX];
int main() {
  int maxHeight1 = 0, maxHeight2;
  int totalWidth = 0;
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> width[i] >> height[i];
    totalWidth += width[i];
    if (height[i] > maxHeight1) {
      maxHeight2 = maxHeight1;
      maxHeight1 = height[i];
    } else if (height[i] > maxHeight2) {
      maxHeight2 = height[i];
    }
  }
  for (int i = 0; i < N; i++) {
    cout << ((long long)totalWidth - width[i]) *
                (height[i] == maxHeight1 ? maxHeight2 : maxHeight1)
         << " ";
  }
  cout << endl;
  return 0;
}
