Problem hidden
This problem was hidden by Editorial Board member probably because it has incorrect language version or invalid test data, or description of the problem is not clear.

Problem hidden

CR08C4P5 - POKLON

no tags 

Mirko got a set of intervals for his birthday. There are many games he can play with them. In one of them, Mirko must find the longest sequence of distinct intervals such that each interval in the sequence is in the set and that each interval contains the one that follows in the sequence.

Write a program which finds one such longest sequence.

Input

The first line of input contains the integer N (1 ≤ N ≤ 100000), the number of intervals in the set. Each of the following N lines contains two integers A and B describing one interval (1 ≤ A < B ≤ 1000000).

Output

Output the length K of the longest sequence on the first line. Each of the following K lines should contain one element of the sequence, an interval in the same format it was given in the input.

Example

Input:
3 
3 4
2 5
1 6
Output:
3 
1 6
2 5
3 4
Input: 
5
10 30
20 40
30 50
10 60
30 40
Output:
3 
10 60
30 50
30 40 
Input:
6 
1 4
1 5
1 6
1 7
2 5
3 5
Output:
5 
1 7
1 6
1 5
2 5
3 5

Added by:Ahmed Salem [mrtempo]
Date:2016-06-20
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64 GOSU JS-MONKEY
Resource:COCI 2007/2008 #3 (http://hsin.hr/coci/archive/2007_2008/contest4_tasks.pdf)