Time limit
1s
Memory limit
128 MB
Each student has three straight sticks. After all sticks are thrown onto the floor, each student may remove at most one of their own sticks. Determine whether the sticks left on the floor can be made pairwise non-intersecting. Removing a stick does not change the position of any other stick.
In the first illustration, three students have sticks ①②③, ④⑤⑥, and ⑦⑧⑨. If sticks ②, ④, and ⑧ are removed, the remaining six sticks do not intersect one another.

In the second illustration, two students' sticks are placed so that no matter which one stick each student removes, at least two of the remaining sticks still intersect.

You are given the coordinates of both endpoints of every stick on the floor. Decide whether it is possible to remove at most one stick from each student's three sticks so that all remaining sticks are pairwise non-intersecting, and if so, output the numbers of sticks to remove.
The first line contains an integer N, the number of students. N is between 2 and 1,000 inclusive.
Each of the next 3N lines contains four integers X1, Y1, X2, Y2, separated by spaces. They are the coordinates of the two endpoints (X1, Y1) and (X2, Y2) of one stick. Each integer is between -10,000 and 10,000 inclusive.
The sticks are numbered 1 through 3N in input order. For each i with 1 <= i <= N, the consecutive stick numbers 3i-2, 3i-1, and 3i are the three sticks owned by the i-th student.
The input always satisfies all of the following conditions.
If it is impossible to remove sticks so that the remaining sticks are pairwise non-intersecting, print -1 on the first line.
Otherwise, print K on the first line, the number of removed sticks. K must satisfy 0 <= K <= N and does not have to be minimum. On the second line, print the numbers of the K removed sticks in increasing order, separated by spaces. If K is 0, do not print a second line.
If there are multiple valid answers, print any one of them.