Festival of Colors
While traveling through South America, our heroes visited the country of Colorovia, where the Paint Festival was in full swing. As part of the festivities, the locals organized a race track competition at the stadium, which was painted in a variety of colors beforehand. During this painting process, N painters participated, each using a unique color. Each painter was assigned a specific segment of the race track to paint. However, since the painting was done sequentially, some sections of the track ended up being repainted. After some consideration, Kotyhoroshko discovered an order for the painters that resulted in the maximum number of different colors visible on the track once the painting was complete.
Your task is to find the same optimal order.
Input
The first line contains an integer N (1 ≤ N ≤ 300). The following N lines each contain two integers separated by a space. On the i-th line, the integers L_{i} and R_{i} (–10^9 ≤ L_{i} < R_{i} ≤ 10^9) are given, where L_{i} is the starting coordinate of the i-th segment to be painted, and R_{i} is the ending coordinate of the i-th segment to be painted.
Output
The first line should output the maximum number of colors that will be visible on the track with the optimal painting order.
The second line should contain N numbers — the i-th number indicates which segment should be painted i-th to achieve the optimal result.
Segments are numbered starting from one, in the order they are provided in the input file.
Note. If there are multiple solutions, you may output any of them.