Exactly One Point

아직 제출이 없습니다시간 제한2초메모리 제한512 MB

문제

There are nn segments on a line. You should place some points onto this line so that:

  • every point is contained in at least one segment,
  • every segment contains exactly one point.

입력

The first line contains an integer nn (1n2000001 \le n \le 200000) --- the number of segments.

Each of the next nn lines contains two integers L_iL\_i and R_iR\_i (L_i<R_iL\_i < R\_i) --- the endpoints of the ii-th segment.

For convenience, all endpoints of all segments are even numbers from 00 to 4n24n - 2.

출력

If it's impossible to place points in a required way, output "-1".

Otherwise, in the first line output an integer mm --- the number of points that should be placed onto the line.

In the next line, output mm distinct integers from 00 to 4n24n - 2 --- the coordinates of the points.

You don't have to minimize the number of points. If there are several possible solutions, output any of them.