#include <bits/stdc++.h>
using namespace std;
int dir1[8][2] = {1, 2, 2, 1, 2, -1, 1, -2, -1, 2, -2, 1, -1, -2, -2, -1};
int dir2[4][2] = {1, 0, 0, 1, -1, 0, 0, -1};
int dir3[8][2] = {1, 0, 0, 1, -1, 0, 0, -1, 1, 1, 1, -1, -1, 1, -1, -1};
int gcd(int x, int y) { return y == 0 ? x : gcd(y, x % y); }
bool isPrime(int x) {
  if (x == 1)
    return false;
  else if (x == 2)
    return true;
  for (int i = 2; i <= sqrt(x * 1.0); ++i) {
    if (x % i == 0) return false;
  }
  return true;
}
int sqr(int x) { return x * x; }
int sum[200005], he[200005], h[200005];
int vis[1200];
int main() {
  int n;
  while (~scanf("%d%*c", &n)) {
    memset(sum, 0, sizeof(sum));
    memset(he, 0, sizeof(he));
    memset(vis, 0, sizeof(vis));
    int x, y;
    int maxn = -1;
    for (int i = 1; i <= n; ++i) {
      scanf("%d %d", &x, &y);
      sum[i] = sum[i - 1] + x;
      he[i] = y;
      h[i] = he[i];
      vis[y]++;
      maxn = max(maxn, y);
    }
    sort(h + 1, h + 1 + n);
    vector<int> vt;
    vt.clear();
    for (int i = 1; i <= n; ++i) {
      int height;
      int width = sum[n] - sum[i] + sum[i - 1] - sum[0];
      if (he[i] == maxn && vis[maxn] > 1 || he[i] < maxn)
        height = maxn;
      else
        height = h[n - 1];
      int area = width * height;
      vt.push_back(area);
    }
    for (int i = 0; i < vt.size(); ++i) cout << vt[i] << " ";
    cout << endl;
  }
  return 0;
}
