Mog studies the burrows of two flying squirrels. The ground is an grid. Each cell has coordinates . Two cells share a face if they differ by in exactly one coordinate and agree in the other two coordinates.
The first squirrel starts at , and the second starts at . The starting cells are distinct. Each squirrel's burrow must satisfy all of the following conditions.
A burrow consisting of one cell is allowed. The two burrows must not share a cell.
Determine whether every cell can belong to exactly one of the two burrows. If it is possible, construct one such partition.
The input is given from Standard Input in the following format:
For each test case, if no valid partition exists, print NO on one line.
Otherwise, first print YES on one line. Then print lines containing integers each. Process in order, and for each , process in order. The -th integer on the corresponding line must be if cell belongs to the first burrow, or if it belongs to the second burrow.
is the number of test cases. Each case is given in the following format:
are the grid dimensions, and is the starting cell of squirrel .
12The printed partition must satisfy every condition. If there are multiple solutions, print any of them.
| 3 | 60 | No additional constraints. |