Problem: We have a grid with H rows and W columns of squares. Snuke is painting these squares in colors 1, 2, ..., N. Here, the following conditions should be satisfied:

* For each i (1 ≤ i ≤ N), there are exactly a_i squares painted in Color i. Here, a_1 + a_2 + ... + a_N = H W.
* For each i (1 ≤ i ≤ N), the squares painted in Color i are 4-connected. That is, every square painted in Color i can be reached from every square painted in Color i by repeatedly traveling to a horizontally or vertically adjacent square painted in Color i.



Find a way to paint the squares so that the conditions are satisfied. It can be shown that a solution always exists.

Constraints

* 1 ≤ H, W ≤ 100
* 1 ≤ N ≤ H W
* a_i ≥ 1
* a_1 + a_2 + ... + a_N = H W

Input

Input is given from Standard Input in the following format:


H W
N
a_1 a_2 ... a_N


Output

Print one way to paint the squares that satisfies the conditions. Output in the following format:


c_{1 1} ... c_{1 W}
:
c_{H 1} ... c_{H W}


Here, c_{i j} is the color of the square at the i-th row from the top and j-th column from the left.

Examples

Input

2 2
3
2 1 1


Output

1 1
2 3


Input

3 5
5
1 2 3 4 5


Output

1 4 4 4 3
2 5 4 5 3
2 5 5 5 3


Input

1 1
1
1


Output

1

Solution (in JAVA):

Solution:
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {

	static class Solver {
		
		int H, W, N, a[], g[][], COL = 0, PUT = 0;
		
		void solve(FastScanner s, PrintWriter out) {
			H = s.nextInt(); W = s.nextInt();
			a = s.nextIntArray(N = s.nextInt());
			g = new int[H][W];
			for(int i = 0; i < H; i++) {
				for(int j = 0; j < W; j++) {
					if((i & 1) == 0) {
						g[i][j] = COL + 1;
					} else {
						g[i][W - j - 1] = COL + 1;
					}
					if(++PUT == a[COL]) {
						PUT = 0; COL++;
					}
				}
			}
			for(int[] gg : g) {
				for(int p : gg)
					out.print(p + " ");
				out.println();
			}
		}
		
	}
	
	public static void main(String[] args) {
		FastScanner s = new FastScanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		
		new Solver().solve(s, out);
		
		out.close();
	}
	
	static class FastScanner {
		
		BufferedReader br; StringTokenizer st;
		FastScanner(InputStream is) {
			br = new BufferedReader(new InputStreamReader(is));
			st = new StringTokenizer("");
		}
		String next() {
			while(!st.hasMoreElements()) {
				try { st = new StringTokenizer(br.readLine()); }
				catch(Exception e) {}
			}
			return st.nextToken();
		}
		
		int nextInt() { return Integer.parseInt(next()); }
		int[] nextIntArray(int N) {
			int[] res = new int[N];
			for(int i = 0; i < N; i++) res[i] = nextInt();
			return res;
		}
		
	}
	
}