After finishing his chemistry lab early, David is experimenting with a mysterious solution that his teacher gave him.
In particular, David wants to find the number of hydronium ions in the solution, which he knows to be a positive integer. To do so, he has asked his teacher for ~N~ acid-base indicators to test the solution with. While conducting the experiments, the ~i~th indicator tells David with certainty that the number is between ~L_i~ and ~R_i~, inclusive.
David would like you to figure out the minimum and maximum possible number of hydronium ions the solution can have, or that no number works because someone has mislabeled the indicators.
The first line will contain an integer, ~N~ ~(1 \le N \le 10 ^ 5)~.
The next ~N~ lines will each contain two space-separated integers, ~L_i~ and ~R_i~ ~(1 \le L_i \le R_i \le 10 ^ 9)~.
Output one line containing two space-separated integers, the minimum and maximum possible number of hydronium ions the solution can have. If there are no possible numbers, output
2 1 6 2 6