#include <bits/stdc++.h>
using namespace std;
const int maxn = (int)1e5 + 7;
const int INF = (int)1e9 + 7;
long long n, m, k;
long long a[maxn * 2], b[maxn * 2];
long long x, y, z, sum, mx, mx1;
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i] >> b[i];
    sum += a[i];
    if (mx < b[i]) {
      mx1 = mx;
      y = x;
      mx = b[i];
      x = i;
    } else if (mx1 < b[i]) {
      mx1 = b[i];
      y = i;
    }
  }
  for (int i = 1; i <= n; ++i) {
    if (i == x) {
      cout << (sum - a[i]) * mx1 << " ";
    } else {
      cout << (sum - a[i]) * mx << " ";
    }
  }
}
