#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  pair<int, int> maxi1;
  pair<int, int> maxi2;
  vector<int> ms;
  vector<pair<int, int> > v;
  int sum = 0, a, m;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int f, s;
    cin >> f >> s;
    v.push_back({f, s});
    sum += f;
    ms.push_back(s);
  }
  maxi1.second = -1;
  for (int i = 0; i < ms.size(); i++) {
    if (maxi1.second < ms[i]) {
      maxi1.second = ms[i];
      maxi1.first = i;
    }
  }
  ms[maxi1.first] = -1;
  maxi2.second = -1;
  for (int i = 0; i < ms.size(); i++) {
    if (maxi2.second < ms[i]) {
      maxi2.second = ms[i];
      maxi2.first = i;
    }
  }
  for (int i = 0; i < n; i++) {
    a = sum - v[i].first;
    int m;
    if (i == maxi1.first) {
      m = maxi2.second;
    } else if (i == maxi2.first) {
      m = maxi1.second;
    } else
      m = maxi1.second;
    int r = a * m;
    cout << r << " ";
    a = sum;
  }
  return 0;
}
