P6390 [COCI 2007/2008 #4] POKLON

Description

Given $n$ intervals, Mirko wants to construct some intervals such that each later interval is a sub-interval of the previous one, and every number in these intervals is contained in the given intervals.

Input Format

The first line contains an integer $n$. The next $n$ lines each contain two integers $[A,B]$, representing a given interval.

Output Format

The first line contains an integer $k$, which is the number of intervals that can be constructed. The next $k$ lines each contain two integers, in order, representing the constructed intervals.

Explanation/Hint

#### Constraints For $100\%$ of the testdata, it is guaranteed that $1\le n\le 10^5$ and $1\le A