#include <bits/stdc++.h>
using namespace std;
long long int w[200002], h[200002];
long long int wSum[200002], hMaxF[200002], hMaxB[200002];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> w[i] >> h[i];
  for (int i = 1; i <= n; ++i) wSum[i] = wSum[i - 1] + w[i];
  for (int i = 1; i <= n; ++i) hMaxF[i] = max(hMaxF[i - 1], h[i]);
  for (int i = n; i >= 1; --i) hMaxB[i] = max(hMaxB[i + 1], h[i]);
  for (int i = 1; i <= n; ++i)
    cout << ((wSum[i - 1] + wSum[n] - wSum[i]) *
             (max(hMaxF[i - 1], hMaxB[i + 1])))
         << " ";
  cout << endl;
  return 0;
}
