#include <bits/stdc++.h>
using namespace std;
pair<long long, long long> a[200010];
long long dp[200010][2];
long long dp1[200010][2];
int main() {
  long long n;
  scanf("%lld", &n);
  long long sum = 0, sum1 = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%lld %lld", &a[i].first, &a[i].second);
    sum += a[i].first;
    sum1 += a[i].second;
    dp[i][0] = max(dp[i - 1][0], a[i].first);
    dp1[i][0] = max(dp1[i - 1][0], a[i].second);
  }
  for (int i = n; i >= 1; i--) {
    dp[i][1] = max(dp[i + 1][1], a[i].first);
    dp1[i][1] = max(dp1[i + 1][1], a[i].second);
  }
  for (int i = 1; i <= n; i++) {
    printf("%lld ", (sum - a[i].first) * max(dp1[i - 1][0], dp1[i + 1][1]));
  }
}
