import java.io.*;
import java.util.*;

public class escalator_at implements Runnable {
	BufferedReader in;
	StringTokenizer st;
	PrintWriter out;
	
	class Man implements Comparable<Man> {
		public int t, w, n;
		
		Man (int t, int w, int n) {
			this.t = t;
			this.w = w;
			this.n = n;
		}

		public int compareTo(Man other) {
			return this.w - other.w;
		}
	}
	
	public void solve() throws IOException {
		int n = nextInt();
		Man[] list = new Man[n];
		long[] answer = new long[n];
		for(int i = 0; i < n; ++i) {
			list[i] = new Man(nextInt(), nextInt(), i);
		}
		Arrays.sort(list);
		long lastTime = 0;
		for(int i = 0; i < n; ++i) {
			if (list[i].t * 1L * list[i].w > lastTime) {
				lastTime = list[i].t * 1L * list[i].w;
				answer[list[i].n] = lastTime;
			}
			else {
				answer[list[i].n] = lastTime;
			}
		}
		for(int i = 0; i < n; ++i) {
			out.println(answer[i]);
		}
	}
	
	public void run() {
		try {
			solve();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(89);
		} finally {
			out.close();
		}
	}

	public escalator_at(String name) {
		try {
			in = new BufferedReader(new FileReader(name + ".in"));
			st = new StringTokenizer("");
			out = new PrintWriter(new File(name + ".out"));
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(89);
		}
	}
	public static void main(String[] args) {
		(new Thread(new escalator_at("escalator"))).start();
	}
	
	private String nextToken() throws IOException {
		while(!st.hasMoreTokens()) {
			st = new StringTokenizer(in.readLine());
		}
		return st.nextToken();
	}
	
	private int nextInt() throws NumberFormatException, IOException {
		return Integer.parseInt(nextToken());
	}
}