[<AutoOpen>]
module Program

open System

let read f = stdin.ReadLine() |> f
let reads f = stdin.ReadLine().Split() |> Array.map f

[<EntryPoint>]
let main _ =
    let [|H;W|] = reads int
    let N = read int
    let AS = reads int

    let data =
        [|
            for i, c in Seq.zip AS (Seq.initInfinite ((+) 1)) do
                for j in 1 .. i do
                    yield c
        |]

    let mutable k = 0
    let ans = Array2D.create H W 0

    for i in 0 .. H - 1 do
        let ix =
            if i % 2 = 0 then
                [|0 .. W - 1|]
            else
                [|W - 1 .. -1 .. 0|]
        for j in ix do
            ans.[i,j] <- data.[k]
            k <- k + 1

    for i in 0 .. H - 1 do
        printfn "%s" (String.Join(" ", ans.[i,*]))

    0