#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  vector<pair<int, int>> v(n);
  int W = 0, H = 0, H2 = 0;
  for (auto& i : v) {
    cin >> i.first >> i.second;
    W += i.first;
    if (i.second > H) {
      H2 = H;
      H = i.second;
    } else if (i.second > H2)
      H2 = i.second;
  }
  for (int i = 0; i < n; ++i) {
    cout << (W - v[i].first) * (v[i].second == H ? H2 : H) << " ";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  solve();
}
