#include <bits/stdc++.h>
using namespace std;
vector<long long> tree(800005);
vector<long long> h(200005);
vector<long long> w(200005);
long long query(long long node, long long start, long long end, long long l,
                long long r) {
  if (r < start || end < l) {
    return 0;
  }
  if (l <= start && end <= r) {
    return tree[node];
  }
  long long mid = (start + end) / 2;
  long long p1 = query(2 * node, start, mid, l, r);
  long long p2 = query(2 * node + 1, mid + 1, end, l, r);
  return (max(p1, p2));
}
void build(long long node, long long start, long long end) {
  if (start == end) {
    tree[node] = h[start];
  } else {
    long long mid = (start + end) / 2;
    build(2 * node, start, mid);
    build(2 * node + 1, mid + 1, end);
    tree[node] = max(tree[2 * node], tree[2 * node + 1]);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long n;
  long long sum = 0;
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> w[i] >> h[i];
    sum += w[i];
  }
  build(1, 1, n);
  for (long long i = 1; i <= n; i++) {
    long long x;
    if (i == 1) x = query(1, 1, n, 2, n);
    if (i == n)
      x = query(1, 1, n, 1, n - 1);
    else {
      long long x1 = query(1, 1, n, 1, i - 1);
      x = max(x1, query(1, 1, n, i + 1, n));
    }
    cout << (sum - w[i]) * (x) << " ";
  }
  return 0;
}
