#include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1.0);
const long double EPS = 1e-9;
const int INF = 1000000000;
const long long INFL = (long long)1000000000 * (long long)1000000000;
const int NULO = -1;
const string INPUT_FILE = "input.txt";
const string OUTPUT_FILE = "output.txt";
template <class T>
inline int CMPF(T X, T Y = 0, T EPS_DIST = EPS) {
  return (X <= Y + EPS_DIST) ? ((X + EPS_DIST < Y) ? -1 : 0) : +1;
}
template <class T>
inline T GCD(T A, T B) {
  return (A < 0) ? GCD(-A, B)
                 : ((B < 0) ? GCD(A, -B) : ((0 == B) ? A : GCD(B, A % B)));
}
template <class T>
inline T LCM(T A, T B) {
  return (A < 0) ? LCM(-A, B) : ((B < 0) ? LCM(A, -B) : (A * (B / GCD(A, B))));
}
template <class T>
inline string TO_STRING(T X) {
  ostringstream oss;
  oss << X;
  oss.flush();
  return oss.str();
}
template <class T>
inline void FIX_MIN(T& B, T A) {
  if (A < B) B = A;
}
template <class T>
inline void FIX_MAX(T& B, T A) {
  if (A > B) B = A;
}
template <class T>
inline T SQR(T X) {
  return X * X;
}
inline bool IS_UPPERCH(char C) { return C >= 'A' && C <= 'Z'; }
inline bool IS_LOWERCH(char C) { return C >= 'a' && C <= 'z'; }
inline bool IS_LETTERCH(char C) { return IS_UPPERCH(C) || IS_LOWERCH(C); }
inline bool IS_DIGITCH(char C) { return C >= '0' && C <= '9'; }
inline char TO_LOWERCH(char C) { return (IS_UPPERCH(C)) ? (C + 32) : C; }
inline char TO_UPPERCH(char C) { return (IS_LOWERCH(C)) ? (C - 32) : C; }
inline int TO_INTS(string S) {
  int value;
  istringstream iss(S);
  iss >> value;
  return value;
}
inline double TO_DOUBLES(string S) {
  double value;
  istringstream iss(S);
  iss >> value;
  return value;
}
const int MAXN = 200000 + 10;
int w[MAXN], h[MAXN], N;
int maxhAv = 0, maxhAp = -1, maxhBv = 0, maxhBp = -1;
int main() {
  scanf("%d", &N);
  int allW = 0;
  for (int i = (int)(0); i < (int)(N); ++i) {
    scanf("%d %d", &w[i], &h[i]);
    allW += w[i];
  }
  for (int i = (int)(0); i < (int)(N); ++i)
    if (h[i] > maxhAv) {
      maxhAv = h[i];
      maxhAp = i;
    }
  for (int i = (int)(0); i < (int)(N); ++i)
    if (h[i] > maxhBv && i != maxhAp) {
      maxhBv = h[i];
      maxhBp = i;
    }
  for (int i = (int)(0); i < (int)(N); ++i) {
    int locW = allW - w[i];
    int locH = (h[i] == maxhAv) ? maxhBv : maxhAv;
    printf("%d ", locW * locH);
  }
  return 0;
}
