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

public class escalator_mb {
    static boolean sortCount;

    static class Runner implements Comparable<Runner> {
        int time1;
        long count;
        int index;
        long time;

        Runner(int time1, int count, int index) {
            this.time1 = time1;
            this.count = count;
            this.index = index;

            assert 1 <= time1 && time1 <= 1000000 : "Time1 = " + time1;
            assert 1 <= count && count <= 1000000 : "Count = " + count;
        }

        public int compareTo(Runner that) {
            long v = sortCount ? count - that.count : index - that.index;
            if (v == 0) return 0;
            return v < 0 ? -1 : 1;
        }

    }
    public static void main(String[] args) throws IOException {
        Locale.setDefault(Locale.US);
        BufferedReader in = new BufferedReader(new FileReader("escalator.in"));
        int n = Integer.parseInt(in.readLine());

        assert 1 <= n && n <= 100000;

        Runner[] all = new Runner[n];
        for (int i = 0; i < n; i++) {
            StringTokenizer st = new StringTokenizer(in.readLine());
            all[i] = new Runner(Integer.parseInt(st.nextToken()), Integer.parseInt(st.nextToken()), i);
        }        
        in.close();

        sortCount = true;
        Arrays.sort(all);
        for (int i = 1; i < n; i++) {
            assert (all[i - 1].count != all[i].count);
        }

        all[0].time = all[0].time1 * all[0].count;
        for (int i = 1; i < n; i++) {
            all[i].time = Math.max(all[i].time1 * all[i].count, all[i - 1].time);
        }

        sortCount = false;
        Arrays.sort(all);
        
        PrintWriter out = new PrintWriter("escalator.out");
        for (Runner r : all) {
            out.println(r.time);
        }
        out.close();
    }
}