#include <bits/stdc++.h>
using namespace std;
long long n;
long long a[200005];
long long w[200005], h[200005];
long long mx_1, mx_2;
long long sum;
int in;
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> w[i] >> h[i];
    sum += w[i];
    if (h[i] > mx_1) {
      mx_1 = h[i];
      in = i;
    }
  }
  for (int i = 0; i < n; ++i) {
    if (i == in) continue;
    if (mx_2 < h[i]) mx_2 = h[i];
  }
  for (int i = 0; i < n; ++i)
    cout << (sum - w[i]) * (h[i] == mx_1 ? mx_2 : mx_1) << ' ';
}
