#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 5;
int sum = 0, w[MAXN], h[MAXN];
int maxh = 0, maxhindex = -1, maxh2;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> w[i] >> h[i];
    sum += w[i];
    if (h[i] >= maxh) {
      maxh = h[i];
      maxhindex = i;
    }
  }
  maxh2 = 0;
  for (int i = 0; i < n; ++i)
    if (i != maxhindex) maxh2 = max(maxh2, h[i]);
  for (int i = 0; i < n; ++i) {
    cout << (long long)(sum - w[i]) *
                (long long)((i == maxhindex) ? maxh2 : maxh)
         << ' ';
  }
  cout << "\n";
}
