#include <bits/stdc++.h>
int mas[200005];
int mas2[200005];
using namespace std;
int main() {
  int n, w, h;
  unsigned long long Width = 0;
  unsigned long long maxHeigt = 0;
  unsigned long long maxHeigt2 = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> w >> h;
    mas[i] = w;
    mas2[i] = h;
    Width += w;
    if (h > maxHeigt) {
      maxHeigt2 = maxHeigt;
      maxHeigt = h;
    } else if (h > maxHeigt2) {
      maxHeigt2 = h;
    }
  }
  unsigned long long sum = 0;
  for (int i = 0; i < n; i++) {
    sum = Width - mas[i];
    if (mas2[i] == maxHeigt) {
      cout << sum * maxHeigt2 << " ";
    } else {
      cout << sum * maxHeigt << " ";
    }
  }
  return 0;
}
