#include <bits/stdc++.h>
using namespace std;
const int INF = INT_MAX;
const long long mod = 1e9 + 7;
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  vector<int> w(n), h(n);
  int mx1 = 0, mx2 = 0, s = 0, no = -1;
  for (int i = 0; i < n; i++) {
    cin >> w[i] >> h[i];
    if (h[i] > mx1) mx1 = h[i], no = i;
    s += w[i];
  }
  for (int i = 0; i < n; i++)
    if (h[i] > mx2 && i != no) mx2 = h[i];
  for (int i = 0; i < n; i++) {
    int hh = mx1;
    if (i == no) hh = mx2;
    cout << (s - w[i]) * hh << ' ';
  }
  return 0;
}
