#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
int w[maxn], h[maxn], f[maxn], n, wid;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> w[i] >> h[i];
    f[i] = h[i];
    wid += w[i];
  }
  sort(h + 1, h + 1 + n);
  for (int i = 1; i <= n; i++) {
    wid -= w[i];
    if (f[i] == h[n])
      cout << wid * h[n - 1] << ' ';
    else
      cout << wid * h[n] << ' ';
    wid += w[i];
  }
  cout << endl;
}
