#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
string toBin(long long a) {
  string res = "";
  while (a) {
    res += char((a & 1) + '0');
    a >>= 1;
  }
  reverse(res.begin(), res.end());
  return res;
}
const int mod = 1e9 + 7;
long long expo(long long base, long long pow) {
  long long ans = 1;
  while (pow != 0) {
    if (pow & 1 == 1) {
      ans = ans * base;
      ans = ans % mod;
    }
    base *= base;
    base %= mod;
    pow /= 2;
  }
  return ans;
}
double pi = 3.141592653589793238462643;
double error = 0.0000001;
const int M = 200001;
long long tot_w = 0;
vector<int> vec;
int wid[M];
int hei[M];
int main() {
  int n;
  scanf("%d", &(n));
  for (int i = 0; i < n; i++) {
    int w, h;
    scanf("%d", &(wid[i]));
    scanf("%d", &(hei[i]));
    tot_w += wid[i];
    vec.push_back(hei[i]);
  }
  sort(vec.begin(), vec.end());
  for (int i = 0; i < n; i++) {
    long long width = tot_w * 1LL - wid[i] * 1LL;
    long long height = 0;
    if (hei[i] == vec[n - 1]) {
      height = vec[n - 2] * 1LL;
    } else {
      height = vec[n - 1] * 1LL;
    }
    long long ans = height * width;
    printf("%lld ", ans);
  }
}
