#include <bits/stdc++.h>
using namespace std;
#define N 120
int ir,ic,grid[N][N];
bool vis[N][N];

int dr[] = {1 , -1 , 0 , 0};
int dc[] = {0 , 0 , 1 , -1};

bool inside(int r , int c) {
    return r >= 0 && r < ir && c >= 0 && c < ic;
}

void color(int r , int c , int elm) {
    if (!inside(r , c)) return;
    if (vis[r][c]) return;
}

int main() {
    scanf("%d%d" , &ir , &ic);
    int n; scanf("%d" , &n);
    vector<int> colour(n + 1); colour[0] = -1;
    for (int i = 1 ; i <= n ; i++)
        scanf("%d" , &colour[i]);
    vector<int> v = colour;
    int r = 0, c = 0, colourIn = 0;
    bool entered = false;
    for (int colourIn = 1 ; colourIn <= n ; colourIn++) {
        while (v[colourIn]--) {
            if (!entered) {
                if (c == ic - 1) {
                    grid[r][c] = colourIn;
                    r++;
                    entered = true;
                    continue;
                }
                grid[r][c] = colourIn;
                c++;
            } else {
                if (c == 0) {
                    grid[r][c] = colourIn;
                    r++;
                    entered = false;
                    continue;
                }
                grid[r][c] = colourIn;
                c--;
            }
        }
    }
    for (int r = 0 ; r < ir ; r++) {
        for (int c = 0 ; c < ic ; c++) {
            printf("%d" , grid[r][c]);
            printf(c == ic - 1 ? "\n" : " ");
        }
    }
}