import std.algorithm,
       std.string,
       std.array,
       std.range,
       std.stdio,
       std.conv;

void main() {
  int[] hw = readln.chomp.split.to!(int[]);
  int h = hw[0],
      w = hw[1];
  int n = readln.chomp.to!int;
  int[] ai = readln.chomp.split.to!(int[]);

  ulong[] tmp;

  foreach (i, a; ai) {
    foreach (j; a.iota) {
      tmp ~= i + 1;
    }
  }

  ulong[][] ans;

  foreach (i; h.iota) {
    auto t = tmp[(i*w)..((i+1)*w)];
    if (i && 2) {
      reverse(t);
    }
    writeln(t.to!(string[]).join(" "));
  }
}
