L. Matrix Construction
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output

heiyubai gave repeator a problem.

He gave repeator a matrix of size $$$h \times d$$$ and an array $$$a$$$ of length $$$n$$$.

Let the $$$i$$$-th element of the array be $$$a_i$$$, which means $$$repeator$$$ has $$$a_1$$$ copies of $$$1$$$, $$$a_2$$$ copies of $$$2$$$, ..., $$$a_n$$$ copies of $$$n$$$.

heiyubai requires repeator to fill the matrix with these numbers, with the requirement that no two identical numbers can appear in the same row, and no two identical numbers can appear in the same column.

If it is impossible, output $$$-1$$$. Otherwise, output the matrix. If there are multiple valid solutions, output any one of them.

Input

The first line contains two integers $$$h$$$ and $$$d$$$ $$$(1 \le h, d \le 10^6, 1 \le h \times d \le 10^6)$$$.

The second line contains a single integer $$$n$$$ $$$(1 \le n \le 10^6)$$$

The third line contains n integers $$$a_1, a_2,...,a_n$$$ $$$(0 \le a_i \lt 2 \times 10^6)$$$

Output

If it is impossible, output $$$-1$$$. Otherwise, output the matrix. If there are multiple valid solutions, output any one of them.

Examples
Input
2 4
4
2 2 2 2
Output
1 3 4 2
3 1 2 4
Input
2 4
4
2 2 2 1
Output
-1