Heritage of the king
In one faraway rectangular country the wise king rules. And he had k sons. Before his death, he bequeathed the territory of his country to his sons. The governor reasoned who among the sons is wiser, and on this basis he will give to each son a certain area of land.
The entire rectangular area of the country has dimensions n × m kilometers and is divided into square regions of size 1 × 1 kilometers. Each son can inherit only a whole number of regions. Also, every son wants to get into the possession the connected part of land (from any cell of his land the son can go to another only along the adjacent cells of his land. The regions are considered to be adjacent if they have a common side).
Help the sons to divide the country according to the will of the king.
Input
First line contains three positive integers n, m and k (1 ≤ n, m ≤ 700, 1 ≤ k ≤ 10000) - the sizes of the country and number of sons.
Second line contains k positive integers a[1]
, a[2]
, ..., a[K]
, where a[i]
is the area that wise king bequeathed to the i-th son. It is guaranteed that a[1]
+ a[2]
+ ...+ a[k]
= n * m.
Output
Print n lines with m numbers in each. The intersection of line number i and column number j must contain the number of the son whom will be given this region (number from 1 to k).