﻿import std.stdio;

int n;
short[] a;

ulong sumW() {
	ulong sum;
	for (size_t i = 0; i < 2 * n; i += 2)
			sum += a[i];
	return sum;
}

size_t j, k, t;

short maxH() {
	short max;
	for (size_t i = 1; i < 2 * n; i += 2)
			if ((a[i] > max) && (i != j)) {
				max = a[i];
				k = i;
			}

	if (t < 1)
		j = k;

	++t;

	return max;
}

void main() {

	scanf("%d", &n);

	short w, h;
	foreach (i; 0 .. n) {
		scanf("%hd%hd", &w, &h);
		a ~= w,	a ~= h;
	}

	ulong sum = sumW();
	short max1 = maxH();
	short max2 = maxH();

	for (size_t i = 0; i < 2 * n; i += 2)
		if (i != j - 1)
			write((sum - a[i]) * max1, ' ');
		else
			write((sum - a[i]) * max2, ' ');

	putchar('\n');
}