Platforms

No attempts yetTime limit2sMemory limit128 MB

Problem

On the planet Olympia, a set of sightseeing platforms hangs motionless at various heights above a river. Each platform is a point in a vertical plane and is described by two coordinates: the x-coordinate is its horizontal distance from the river's source, and the y-coordinate is its height above the water. No platform sits directly above another, so all x-coordinates are distinct.

The platforms are to be reused as launch stations for hang gliders. A glider may fly from one platform to another only when both of the following hold:

  • It may only go to a platform of lower or equal height (the destination's yy is at most the current height).
  • It may never fly against the river's flow: it may only go to a platform farther from the source (a strictly larger x-coordinate).

A route is a sequence of consecutive flights: from one platform to the next, then to the next, and so on. A route is called popular when it makes the greatest possible number of consecutive flights; the individual flight lengths do not matter.

Your task is to determine which platforms belong to at least one popular route.

Input

The first line contains the number of test cases TT.

Each test case begins with a line containing the number of platforms NN (1<N<1234561 < N < 123456). Each of the next NN lines contains two non-negative integers, the x- and y-coordinates of one platform. All x-coordinates within a test case are distinct.

Output

For each test case, print a group of two lines.

The first line contains two integers: the number of flights in a popular route, and the total number of platforms that belong to at least one popular route.

The second line lists, in ascending order and separated by single spaces, the x-coordinates of those platforms.

If no flight is possible at all, the first line is 0 0 and the second line is empty.