using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using static System.Math;
using static System.Array;
using static AtCoderSolve.Tool;

namespace AtCoderSolve
{
    class Solve
    {
        const int mod = 1000000007;
        const int INF = int.MaxValue / 2;
        const long SINF = long.MaxValue / 2;

        static void Main(string[] args)
        {
            //var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            //Console.SetOut(sw);
            var cin = new Scanner();
            var input = cin.SplitReader();
            int H = input[0];
            int W = input[1];
            int N = int.Parse(Console.ReadLine());
            int[] a = cin.SplitReader();

            int[,] ans = new int[H, W];

            int y = 0;
            int x = 0;
            for(var i = 0; i < N; i++)
            {
                for(var j = 0; j < a[i]; j++)
                {
                    ans[y, x] = i + 1;
                    if (y % 2 == 0)
                    {
                        if (x == W - 1)
                        {
                            y++;
                        }
                        else
                        {
                            x++;
                        }
                    }
                    else
                    {
                        if (x == 0)
                        {
                            y++;
                        }
                        else
                        {
                            x--;
                        }
                    }
                }
            }

            for(var i = 0; i < H; i++)
            {
                for(var j = 0; j < W; j++)
                {
                    Console.Write($"{ans[i, j]} ");
                }
                Console.WriteLine();
            }


            //Console.Out.Flush();
        }


    }

    public class Scanner
    {
        public int[] SplitReader()
        {
            int[] array = Console.ReadLine().Split().Select(int.Parse).ToArray();
            return array;
        }
        public long[] SplitReaderL()
        {
            long[] array = Console.ReadLine().Split().Select(long.Parse).ToArray();
            return array;
        }
    }

    public static class Tool
    {
        static public void Initialize<T>(ref T[] array, T initialvalue)
        {
            for(var i = 0; i < array.Length; i++)
            {
                array[i] = initialvalue;
            }
        }
        static public long ModuloP(long value,long mod)
        {
            long r = value % mod;
            
            if (r * mod < 0)
            {
                r += mod;
            }
            return r;
        }

    }

    struct Pair<T> : IComparable<Pair<T>> where T : IComparable<T>
    {
        public T variable;
        public int index;

        public Pair(T val, int i)
        {
            variable = val;
            index = i;
        }

        public int CompareTo(Pair<T> otherPair)
        {
            return variable.CompareTo(otherPair.variable);
        }

        public int CompareIndex(Pair<T> otherPair)
        {
            return index.CompareTo(otherPair.index);
        }
    }



}






Measured memory_bytes: 13664