#include <bits/stdc++.h>
using namespace std;
const int N = 200200;
int n;
pair<int, int> a[N];
int mx1;
int mx2;
int tot;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int(i) = 1; (i) <= (n); (i)++) {
    cin >> a[i].first >> a[i].second;
    if (a[mx1].second < a[i].second) {
      mx2 = mx1;
      mx1 = i;
    } else if (a[mx1].second == a[i].second)
      mx2 = i;
    else {
      if (a[mx2].second < a[i].second) mx2 = i;
    }
    tot += a[i].first;
  }
  for (int i = 1; i <= n; i++) {
    if (i == mx1)
      cout << (tot - a[i].first) * a[mx2].second << " ";
    else
      cout << (tot - a[i].first) * a[mx1].second << " ";
  }
  return 0;
}
