#include <bits/stdc++.h>
using namespace std;
class Solution {
 public:
  void solve(std::istream& in, std::ostream& out) {
    int n;
    in >> n;
    vector<int> w(n), h(n);
    for (int i = 0; i < n; ++i) in >> w[i] >> h[i];
    int s = accumulate((w).begin(), (w).end(), 0);
    auto it = max_element((h).begin(), (h).end());
    auto mi = distance(h.begin(), it);
    int m = *it;
    h.erase(it);
    int m2 = *max_element((h).begin(), (h).end());
    for (int i = 0; i < n; ++i) {
      int H = i == mi ? m2 : m;
      out << (s - w[i]) * H << " ";
    }
    out << endl;
  }
};
void solve(std::istream& in, std::ostream& out) {
  out << std::setprecision(12);
  Solution solution;
  solution.solve(in, out);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  istream& in = cin;
  ostream& out = cout;
  solve(in, out);
  return 0;
}
