Connecting Rectangles

Time limit1sMemory limit128 MB

Problem

Several points are given on a plane. The points are numbered from 1 through N, and each number appears on exactly two points. For any number, the two points with that number can be used as opposite corners of an axis-aligned rectangle. This rectangle is called a connecting rectangle.

Choose some numbers and draw their connecting rectangles. The chosen rectangles must be completely separated from one another. Rectangles that overlap are not allowed, and rectangles that only touch along an edge or at a corner are also not allowed. A rectangle contained inside another rectangle is not allowed either.

Choosing the connecting rectangle with number i earns i points. Write a program that chooses connecting rectangles satisfying these conditions while maximizing the total score.

Input

The first line contains the number of pairs N. Each of the next N lines gives the two points for one number, in order from 1 through N, as x1 y1 x2 y2.

N is at most 50. Every coordinate is a positive integer not greater than 1000. The two points with the same number are not on the same vertical line or the same horizontal line.

Output

Print the number of selected pairs on the first line. On the second line, print the selected connecting-rectangle numbers in increasing order, separated by spaces.