import std.stdio;
import std.conv, std.array, std.algorithm, std.string;
import std.math, std.random, std.range, std.datetime;
import std.bigint;
import std.container;
string read(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }

void main(){
	int h = read.to!int;
	int w = read.to!int;
	int n = read.to!int;
	int[] as = readln.split.map!(to!int).array;
	
	int[] qs;
	foreach(i, a; as) foreach(j; 0 .. a) qs ~= (i + 1);
	
	foreach(x; 0 .. h){
		int[] ks = qs[w * x .. w * x + w];
		if(x % 2 == 1) ks = ks.reverse;
		ks.map!(to!string).array.join(" ").writeln;
		}
	}