#include <bits/stdc++.h>
#pragma comment(linker, "/stack:32000000")
using namespace std;
int n, m, k, d, w;
int main() {
  int n;
  cin >> n;
  multiset<int> heights;
  int total_summ = 0;
  vector<pair<int, int> > v(n);
  for (int i = 0; i < n; i++) {
    int w, h;
    cin >> w >> h;
    v[i] = (make_pair(w, h));
    heights.insert(h);
    total_summ += w;
  }
  for (int i = 0; i < n; i++) {
    heights.erase(heights.find(v[i].second));
    int t_w = total_summ - v[i].first;
    int t_h = *heights.rbegin();
    heights.insert(v[i].second);
    int ans = t_w * t_h;
    cout << ans << " ";
  }
  return 0;
}
