#include <bits/stdc++.h>
using namespace std;
const double EPS = (double)1e-9;
const double PI = (double)acos(-1.0);
int irand(int lo, int hi) {
  return (((double)rand()) / (RAND_MAX + 1.0)) * (hi - lo + 1) + lo;
}
string toString(long long x) {
  stringstream ss;
  ss << x;
  return ss.str();
}
long long toNumber(string S) {
  long long ret;
  sscanf(S.c_str(), "%lld", &ret);
  return ret;
}
const int INF = (int)2e9;
const long long MOD = (long long)1e9 + 7;
int dat[200005];
int pref[200005], suff[200005];
int main() {
  int n, a, b, summ = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i += 1) {
    scanf("%d %d", dat + i, &b);
    summ += dat[i];
    pref[i] = suff[i] = b;
  }
  for (int i = 2; i <= n; i += 1) pref[i] = max(pref[i], pref[i - 1]);
  for (int i = n - 1; i >= 1; i -= 1) suff[i] = max(suff[i], suff[i + 1]);
  for (int i = 1; i <= n; i += 1)
    printf(
        "%lld%c",
        (long long)(summ - dat[i]) * (long long)max(pref[i - 1], suff[i + 1]),
        " \n"[i == n]);
  return 0;
}
