local h, w = io.read("*n", "*n")
local n = io.read("*n")
local m = {}
for i = 1, h * w do m[i] = 0 end
local cur = 1
local mfl = math.floor
for i = 1, n do
  local cnt = io.read("*n")
  for j = cur, cur + cnt - 1 do
    local iw = (j - 1) % w
    local ih = mfl((j - 1) / w)
    if ih % 2 == 0 then
      m[ih * w + iw + 1] = i
    else
      m[ih * w + w - iw] = i
    end
  end
  cur = cur + cnt
end
for ih = 0, h - 1 do
  for iw = 1, w do
    io.write(m[ih * w + iw])
    io.write(iw == w and "\n" or " ")
  end
end
