{"raw_statement":[{"iden":"problem statement","content":"There are $N$ types of beans, one bean of each type. The $i$\\-th type of bean has a deliciousness of $A_i$ and a color of $C_i$. The beans are mixed and can only be distinguished by color.\nYou will choose one color of beans and eat one bean of that color. By selecting the optimal color, maximize the minimum possible deliciousness of the bean you eat."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 2 \\times 10^{5}$\n*   $1 \\leq A_i \\leq 10^{9}$\n*   $1 \\leq C_i \\leq 10^{9}$\n*   All input values are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$\n$A_1$ $C_1$\n$A_2$ $C_2$\n$\\vdots$\n$A_N$ $C_N$"},{"iden":"sample input 1","content":"4\n100 1\n20 5\n30 5\n40 1"},{"iden":"sample output 1","content":"40\n\nNote that beans of the same color cannot be distinguished from each other.\nYou can choose color $1$ or color $5$.\n\n*   There are two types of beans of color $1$, with deliciousness of $100$ and $40$. Thus, the minimum deliciousness when choosing color $1$ is $40$.\n*   There are two types of beans of color $5$, with deliciousness of $20$ and $30$. Thus, the minimum deliciousness when choosing color $5$ is $20$.\n\nTo maximize the minimum deliciousness, you should choose color $1$, so print the minimum deliciousness in that case: $40$."},{"iden":"sample input 2","content":"10\n68 3\n17 2\n99 2\n92 4\n82 4\n10 3\n100 2\n78 1\n3 1\n35 4"},{"iden":"sample output 2","content":"35"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}