Lamp

No attempts yetTime limit5sMemory limit512 MB

Problem

In the middle of the night, Bitratio switched on the lamp at the entrance of the building where Byteasar lives, and the harsh light now keeps Byteasar awake. The lamp does not shine straight onto his windows, but its light reaches them after reflecting off other windows. Byteasar wonders whether his neighbours suffer the same way, that is, whether the light reaches their windows too. He asks you to write a program that answers this.

Byteasar lives in building BB, which has nn windows. The lamp sits on the wall at the very bottom of this building. Directly opposite, exactly 1010 meters away, stands another building CC with mm windows, whose wall is parallel to the wall of BB.

Light obeys geometric (ray) optics: it travels along straight rays, and whenever a ray strikes a window it is reflected, the angle of reflection equal to the angle of incidence.

Coordinate systems are placed on both walls as follows. On each wall the XX axis is horizontal and the YY axis is vertical; the axes on the two walls point the same way, and the two origins (0,0)(0, 0) face each other. Every window (on either building) is a rectangle with sides parallel to the axes. A ray is reflected only in the interior of a window; on a window's boundary it is absorbed. Within one building, no two windows share any interior point. The lamp lies on the wall of building BB at the point (0,0)(0, 0), which is neither inside nor on the boundary of any window.

Input

The first line contains two integers nn and mm (1n,m6001 \le n, m \le 600), separated by a single space: the number of windows in building BB and in building CC, respectively.

Each of the next nn lines describes one window of building BB. Line i+1i + 1 (for 1in1 \le i \le n) contains four integers x1,ix_{1,i}, y1,iy_{1,i}, x2,ix_{2,i}, y2,iy_{2,i} (1000x1,i<x2,i1000-1000 \le x_{1,i} < x_{2,i} \le 1000, 0y1,i<y2,i10000 \le y_{1,i} < y_{2,i} \le 1000), separated by single spaces: the ii-th window of building BB is the rectangle whose lower-left corner is (x1,i,y1,i)(x_{1,i}, y_{1,i}) and whose upper-right corner is (x2,i,y2,i)(x_{2,i}, y_{2,i}), in meters.

The following mm lines describe the windows of building CC in the same format.

Output

On the first line, print the number of windows of building BB whose interior is struck by at least one ray. It is guaranteed that in every test there is at least one such window (Byteasar's own).

On the second line, print the indices of those windows (windows are numbered from 11) in increasing order, separated by single spaces.