Junha at the Internet Lounge

Given N people each using a lounge over a fixed interval and always taking the lowest-numbered free seat, find the minimum number of seats so nobody waits, and the usage count of each seat.

Medium6SortingHeapGreedySimulationInterviewNo attempts yetTime limit1sMemory limit128 MB

Problem

Junha serves in the Republic of Korea Navy and walks to the base internet lounge every day to solve problems. Lately too many soldiers show up and there are not enough computers. Junha talked a senior soldier who is about to be discharged into filing a request, the unit accepted it, and it will add more computers. The seats are not used equally often, so the unit plans to install faster computers at the busier ones.

The budget does not stretch to one computer per person. Junha found instead that every person always uses the lounge during one fixed time interval.

The computer seats are numbered 1, 2, 3, and so on. When a person enters the lounge, that person takes the free seat with the smallest number. A seat becomes free the moment its user finishes, so someone entering later can take that seat.

Find the smallest number of computers that lets everybody use the lounge without waiting, and, when that many seats are installed, how many people use each seat.

Input

The first line contains the number of people NN. (1N100000)(1 \le N \le 100\,000)

Each of the next NN lines contains the start time PP and the finish time QQ of one person, separated by a space. (0P<Q1000000)(0 \le P \lt Q \le 1\,000\,000)

All 2N2N times in the input are distinct. No two people share a start time or a finish time, and no start time equals another person's finish time.

Output

On the first line print the smallest number of computers XX that lets nobody wait.

On the second line print, for seat 1 through seat XX in order, how many people used that seat, separated by spaces.