#include <bits/stdc++.h>
using namespace std;
const long long Maxn = 2019;
const long double pi = acos(-1);
const long long mod = 998244353;
template <class T>
ostream &operator<<(ostream &out, vector<T> &A) {
  for (auto x : A) out << x << " ";
  return out;
}
int32_t main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, sum = 0, max_f = 0, max_s = 0, indx;
  cin >> n;
  vector<long long> A(n), B(n);
  for (long long i = 0; i < n; i++) {
    cin >> A[i] >> B[i];
    sum += A[i];
  }
  for (long long i = 0; i < n; i++)
    if (max_f < B[i]) {
      max_f = B[i];
      indx = i;
    }
  for (long long i = 0; i < n; i++) {
    if (B[i] == max_f and indx == i) continue;
    max_s = max(max_s, B[i]);
  }
  for (long long i = 0; i < n; i++) {
    long long x = sum - A[i], y = max_f;
    if (B[i] == max_f and indx == i) y = max_s;
    cout << x * y << " ";
  }
  return 0;
}
