#include<bits/stdc++.h>
#include<algorithm>
#include <assert.h>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>

#define ll long long
#define sl(n) scanf("%lld", &n)
#define sf(n) scanf("%lf", &n)
#define si(n) scanf("%d", &n)
#define ss(n) scanf("%s", n)
#define pii pair <int, int>
#define pll pair <long long, long long >
#define plp pair <int, pll >
#define pb push_back
using namespace std;
#define rep(a,b,c) for(int a=b;a<=c;a++)
#define ll long long 
#define sum(a,b) a=a+b
#define repn(a,b,c) for(int a = b ; a>=c ; a--)
#define mem(a, b) memset(a, (b), sizeof(a))

int  grid[101][101];

int R,C;

int vis[101][101];

int cnt ;

int lol ;

ll a[101*101];


int main(){

    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);


    cin>>R>>C;

    ll n;
    cin>>n;

    rep(i,1,n) cin>>a[i];

    int dex = 1;



    rep(i,1,R){
      if(i % 2 == 1){
        rep(j,1,C){
          grid[i][j] = dex;
          a[dex]--;
          if(a[dex] == 0){
            dex++;
          }
        }
      }else if(i % 2 == 0){
        repn(j,C,1){
          grid[i][j] = dex;
          a[dex]--;
          if(a[dex] == 0){
            dex++;
          }
        }
      }
    }


    rep(i,1,R){
      rep(j,1,C){
        cout<<grid[i][j]<<" ";
      }
      cout<<endl;
    }

    return 0;
}