Alicia has her birthday today. She organized a party at a nearby hotel. She invited ‘N’ number of guests. Alicia made some cookies for her party. All the guests can arrive at different times of the day for the party. A log register is maintained by the hotel management. The register consists of guest’s entry and exit times which were provided by the guests beforehand. For welcoming the guests with the handmade cookies the receptionist has to be present at the hotel’s counter. As there is a shortage of staff in it, the hotel wants to know the time intervals for which the receptionist has to be present on the counter without any overlaps so that receptionist can attend to all the guests and can also help with other tasks at the hotel for the party.
Input:
The first line contains a single integer n( 1<=n<=10000)- the number of guests.
Then next n lines contain pair of two numbers denoting the entry and exit time of the guests respectively.
Output:
Print the intervals in increasing order of entry times.
Explanation of test case: Since intervals (1,3) and (2,6) overlap, merge them into (1,6).