import java.util.*;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            int n = scanner.nextInt();
            HashMap<Integer, Integer> hashMap = new HashMap<>();
            int min = Integer.MAX_VALUE;
            for (int i = 1; i <= n; i++) {
                int x = scanner.nextInt();
                int y = scanner.nextInt();
                if (x < min) {
                    min = x;
                    hashMap.put(x, y);
                } else if (x == min) {
                    if (y < hashMap.get(x)) hashMap.put(x, y);
                }
            }
            System.out.println(min + " " + hashMap.get(min));
        }
    }
}