#include <bits/stdc++.h>
using namespace std;
const int MAX = 2e5 + 5;
int n;
int w[MAX], h[MAX];
long long sum;
int mx1, mx2;
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> w[i] >> h[i];
    sum += w[i];
    if (h[i] >= mx1) {
      mx2 = mx1;
      mx1 = h[i];
    } else if (h[i] >= mx2) {
      mx2 = h[i];
    }
  }
  for (int i = 0; i < n; ++i) {
    if (h[i] == mx1)
      cout << (sum - w[i]) * mx2 << " ";
    else
      cout << (sum - w[i]) * mx1 << " ";
  }
  return 0;
}
