J. XOR-Monge Construction
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output

An $$$n \times m$$$ matrix $$$M$$$ of positive integers is called Anti XOR-Monge if it satisfies the following condition.

  • $$$M_{i,k} \oplus M_{j,l} \gt M_{i,l} \oplus M_{j,k}$$$ holds for all $$$1 \le i \lt j \le n$$$ and $$$1 \le k \lt l \le m$$$.

Here, $$$\oplus$$$ denotes the bitwise XOR operator.

Given two integers $$$n$$$ and $$$m$$$ ($$$2 \le n,m \le 30$$$), construct an $$$n \times m$$$ matrix $$$A$$$ of positive integers that satisfies the following conditions.

  • Each entry of $$$A$$$ contains a distinct positive integer at most $$$2^{61}-1$$$.
  • $$$A$$$ is Anti XOR-Monge.

It can be shown that a solution always exists under the problem's constraints.

Input

The first and only line contains two integers $$$n$$$ and $$$m$$$ ($$$2 \le n,m \le 30$$$).

Output

Output $$$n$$$ lines. On the $$$i$$$-th line, output the $$$i$$$-th row of the constructed matrix $$$A$$$.

Example
Input
3 3
Output
3 5 29
14 24 25
21 26 17
Note

In the example output, the condition is satisfied as follows when $$$i=1$$$, $$$j=2$$$, $$$k=1$$$, $$$l=2$$$.

  • $$$M_{1,1} \oplus M_{2,2} = 3 \oplus 24 = 27$$$;
  • $$$M_{1,2} \oplus M_{2,1} = 5 \oplus 14 = 11$$$;
  • Then, the inequality is satisfied as $$$27 \gt 11$$$.