var gets = (function(){
  function f(s){return new g(s);}
  function g(s){this._s=s.trim().split("\n");this._y=0;}
  g.prototype.a = function(f){
    var s = this._s, y = this._y, r;
    if(typeof s[y] === "string")s[y]=s[y].split(" ").reverse();
    r = s[y].pop();
    if(!s[y].length)this._y++;
    return f?r:+r;
  }
  g.prototype.l = function(f){
    var s=this._s[this._y++].split(" ");return f?s:s.map(a=>+a);
  }
  g.prototype.m = function(n,f){
    var r=this._s.slice(this._y,this._y+n).map(a=>a.split(" "));
    this._y += n;
    return f?r:r.map(a=>+a);
  }
  g.prototype.r = function(n,f){
    var r = this._s.slice(this._y,this._y+n);
    this._y += n;
    return f?r:r.map(a=>+a);
  }
  return f;
})();
var o=gets(require("fs").readFileSync("/dev/stdin","utf8"));

console.log(main());
function main(){
  var h = o.a();
  var w = o.a();
  var n = o.a();
  var a = o.l();
  var x = 0, y = 0, z = 1;
  var ans = Array(h).fill(0).map(a=>[]);
  for(var i = 1; i <= n; i++){
    for(var j = 0; j < a[i-1]; j++){
      ans[y][x] = i;
      if(z === 1 && y === h-1){
        x++;
        z = -1;
      }else if(z === -1 && y === 0){
        x++;
        z = 1;
      }else{
        y += z;
      }
    }
  }
  return ans.map(a=>a.join(" ")).join("\n");
}