use std::fmt::{Debug, Display};
use std::io::{self, Read};
use std::ops::DerefMut;
use std::str::{self, FromStr};


fn solve(h: usize, w: usize, a: Vec<usize>) -> Vec<Vec<usize>> {
    let mut rows = vec![];
    let mut a = a.into_iter().rev().collect::<Vec<_>>();
    let mut i = 1;
    let mut r = a.pop().unwrap();
    for y in 0..h {
        let mut row = vec![];
        if y % 2 == 0 {
            for x in (0..w).rev() {
                while r == 0 {
                    i += 1;
                    r = a.pop().unwrap();
                }
                row.push(i);
                r -= 1;
            }
            row = row.into_iter().rev().collect();
        } else {
            for x in 0..w {
                while r == 0 {
                    i += 1;
                    r = a.pop().unwrap();
                }
                row.push(i);
                r -= 1;
            }
        }
        rows.push(row);
    }
    rows
}


fn main() {
    let stdin = io::stdin();
    let mut sc = Scanner::new(stdin.lock().bytes());
    let (h, w, n) = (sc.next(), sc.next(), sc.next());
    for row in solve(h, w, sc.vec(n)) {
        for (i, x) in row.iter().enumerate() {
            if i > 0 {
                print!(" ");
            }
            print!("{}", x);
        }
        println!("");
    }
}


struct Scanner<R: Read> {
    buf: Vec<u8>,
    bytes: io::Bytes<R>,
}

#[allow(dead_code)]
impl<R: Read> Scanner<R> {
    fn new(bytes: io::Bytes<R>) -> Self {
        Scanner {
            buf: Vec::with_capacity(256),
            bytes: bytes,
        }
    }

    fn next<T: FromStr>(&mut self) -> T
    where
        <T as FromStr>::Err: Debug,
    {
        self.buf.clear();
        for c in self.bytes
            .by_ref()
            .map(|c| c.unwrap())
            .skip_while(|&c| c == ' ' as u8 || c == '\n' as u8)
            .take_while(|&c| !(c == ' ' as u8 || c == '\n' as u8))
        {
            self.buf.push(c);
        }
        str::from_utf8(&self.buf).unwrap().parse().unwrap()
    }

    fn vec<T: FromStr>(&mut self, n: usize) -> Vec<T>
    where
        <T as FromStr>::Err: Debug,
    {
        (0..n).map(|_| self.next()).collect()
    }

    fn pairs<A: FromStr, B: FromStr>(&mut self, n: usize) -> Vec<(A, B)>
    where
        <A as FromStr>::Err: Debug,
        <B as FromStr>::Err: Debug,
    {
        (0..n).map(|_| (self.next(), self.next())).collect()
    }

    fn trios<A: FromStr, B: FromStr, C: FromStr>(&mut self, n: usize) -> Vec<(A, B, C)>
    where
        <A as FromStr>::Err: Debug,
        <B as FromStr>::Err: Debug,
        <C as FromStr>::Err: Debug,
    {
        (0..n)
            .map(|_| (self.next(), self.next(), self.next()))
            .collect()
    }

    fn mat<T: FromStr>(&mut self, m: usize, n: usize) -> Vec<Vec<T>>
    where
        <T as FromStr>::Err: Debug,
    {
        (0..n).map(|_| self.vec(m)).collect()
    }
}


#[allow(dead_code)]
fn print_foreach<T: Display>(answer: &[T]) {
    for x in answer {
        println!("{}", x);
    }
}


#[allow(dead_code)]
fn print_yn(answer: bool, yes: &str, no: &str) {
    println!("{}", if answer { yes } else { no });
}


#[allow(dead_code)]
fn print_or<T: Display>(answer: &Option<T>, or: &T) {
    match *answer {
        Some(ref x) => println!("{}", x),
        None => println!("{}", or),
    }
}


Measured memory_bytes: 4352