#include <bits/stdc++.h>
using namespace std;
template <class T>
T modpower(T a, T b, T MOD) {
  T ans = 1;
  while (b != 0) {
    if (b % 2 == 1) ans = (ans * a) % MOD;
    a = (a * a) % MOD;
    b /= 2;
  }
  return ans;
}
void init() {
  int n, w, h, W = 0, i;
  cin >> n;
  vector<pair<int, int> > V;
  for (i = 0; i < n; i++) {
    cin >> w >> h;
    V.push_back(make_pair(h, w));
    W += w;
  }
  int h1 = V[0].first, h2 = V[1].first;
  if (h2 > h1) swap(h1, h2);
  for (i = 2; i < n; i++) {
    if (V[i].first >= h1) {
      h2 = h1;
      h1 = V[i].first;
    } else if (V[i].first > h2) {
      h2 = V[i].first;
    }
  }
  for (i = 0; i < n; i++) {
    if (V[i].first == h1) {
      cout << h2 * (W - V[i].second) << " ";
    } else
      cout << h1 * (W - V[i].second) << " ";
  }
}
int main() {
  clock_t time1 = clock();
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  init();
  clock_t time2 = clock();
  cerr << "Time: " << (double)(time2 - time1) / CLOCKS_PER_SEC * 100000
       << " seconds" << endl;
  return 0;
}
