polycarp study Berland State University soon exam he pass exactly n examsfor exam know day a_i day opportunity pass exam b_i day second opportunity pass exam a_i b_i Polycarp pass exam day for exam Polycarp choose day pass exam he pass n examspolycarp wants pass exam soon possible Print minimum index day Polycarp pass n exam print 1 pass exam