#include <bits/stdc++.h>
using namespace std;
vector<long long int> v;
vector<pair<long long int, long long int> > arr;
long long int fep(long long int x, long long int y, long long int mod) {
  long long int res = 1;
  while (y > 0) {
    if (y & 1) res = (res * x) % mod;
    y = y >> 1;
    x = (x * x) % mod;
  }
  return res % mod;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n, i, m = 1000000007, j, k, x, y, a, b, sm = 0;
  string s;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> x >> y;
    arr.push_back(make_pair(x, y));
    v.push_back(y);
    sm += x;
  }
  sort(v.begin(), v.end());
  for (i = 0; i < n; i++)
    if (arr[i].second == v.back())
      cout << (sm - arr[i].first) * v[n - 2] << " ";
    else
      cout << (sm - arr[i].first) * v.back() << " ";
  return 0;
}
