Call an $m \times n$ matrix of bits harmonious if every cell has an even number of $1$ bits among its neighbors. A cell counts as a neighbor of itself, and its neighbors also include the cells directly above, below, to the left, and to the right of it (whenever those cells exist). So a cell has at most five neighbors, and fewer near an edge or corner.
For example, the following $4 \times 4$ matrix is harmonious:
0 1 0 0
1 1 1 0
0 0 0 1
1 1 0 1
Given $m$ and $n$, produce an $m \times n$ harmonious matrix of bits.
The first line contains an integer $Z$ ($Z \le 40$). Each of the next $Z$ lines contains two space-separated positive integers $m$ and $n$, each at most $40$, describing one instance.
For each instance, output its $m \times n$ matrix, one row per line, with the entries of a row separated by single spaces. Print the instances in order, with no blank line between them.
The all-zero matrix is always harmonious, so an instance can have many harmonious matrices. To make the answer unique, output the lexicographically smallest non-zero harmonious matrix; if the all-zero matrix is the only harmonious matrix, output the all-zero matrix. Compare two matrices by reading their entries in row-major order (top to bottom, and left to right within each row), treating $0$ as smaller than $1$.