#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, w, h;
  cin >> n;
  long long width = 0, answer, temp;
  int arr[n][2];
  multiset<int> height;
  for (int i = 0; i < n; i++) {
    cin >> w >> h;
    width += w;
    arr[i][0] = w, arr[i][1] = h;
    height.insert(h);
  }
  for (int i = 0; i < n; i++) {
    height.erase(height.find(arr[i][1]));
    answer = width - arr[i][0];
    temp = *height.rbegin();
    answer *= temp;
    cout << answer << " ";
    height.insert(arr[i][1]);
  }
  return 0;
}
