Global Positioning System
时间限制:C/C++/Rust/Pascal 3秒,其他语言6秒
空间限制:C/C++/Rust/Pascal 512 M,其他语言1024 M
64bit IO Format: %lld

题目描述

Global Positioning System (GPS) is based on n artificial satellites, where each satellite has a 3D-coordinates (x,y,z). Since the coordinates are always changing, we can hardly know the exact value of the coordinates, even if the satellites are relative static to each other.

To get more information about their coordinate, we still try every effort to do m measurements. For each measurement, we choose the u-th and the v-th satellites, and measure the coordinate difference between them. Specifically, we will get (x_v - x_u, y_v - y_u, z_v - z_u) after the measurement of them. With these m measurement results, we can now know the coordinate difference between any two satellites.

However, lzr010506 has the impression that he has mistaken exactly one measurement result, so there may exist no possible coordinates to match all the measurements for the satellites for now. You need to find out all the measurements results that might be mistaken, so he can try to fix it as soon as possible.

Here a measurement result might be mistaken iff there exist possible coordinates to match all the measurements after modifying the mistaken measurement result to the one other than the original one.

输入描述:

The first line contains two integers n  and m , denoting the number of the satellites that form the GPS and the number of the measurements that we have made.

The following m lines decribe the m measurements. Each of the m lines contains five integers u,v , x,y and z , which means that the measurement result between the u-th and the v-th satellites is (x,y,z).

It is guaranteed that any (unordered) pair of satellites will not be measured more than once, and at least one measurement result might be mistaken.

输出描述:

The first line contains a single integer k, denoting the number of the measurements results that might be mistaken.

The second line contains k integers, denoting the indices of the measurement results that might be mistaken in increasing order.
示例1

输入

复制
3 3
1 2 3 3 3
1 3 1 1 1
2 3 -3 -2 -3

输出

复制
3
1 2 3

说明

In the first sample test case, you can modify the first measurement result to (4,3,4), or modify the second measurement result to (0,1,0), or modify the third measurement result to (-2,-2,-2).
示例2

输入

复制
5 6
1 2 1 1 1
2 3 1 1 1
3 1 -2 -2 -2
1 5 4 4 4
4 5 1 1 1
3 4 2 2 2

输出

复制
3
4 5 6
示例3

输入

复制
3 2
1 2 1 1 1
2 3 1 1 1

输出

复制
2
1 2

说明

In the third sample test case, even if possible coordinates of the satellites already exist, you can still modify any measurement results to keep the existence of possible coordinates.