#include <bits/stdc++.h>

#define REP(i, n) for(decltype(n) i = 0; i < n; i++)

#define ALL(c)   c.begin(), c.end()
#define SORT(c)  std::sort(ALL(c))
#define RSORT(c) std::sort(ALL(c), std::greater<decltype(c)::value_type>())

using namespace std;
using ll = long long;

const int MOD  = (int)1e9 + 7;
const int INF  = (int)1e9 + 1;
const ll  LINF = (ll)1e18 + 1;

class Pt {
public:
    int x;
    int y;

    constexpr Pt() : x(0), y(0) { }
    constexpr Pt(const int& _x, const int& _y) : x(_x), y(_y) { }

    constexpr Pt(const Pt &obj) : x(obj.x), y(obj.y) { }
    Pt &operator=(const Pt &obj) { x = obj.x; y = obj.y; return *this; }

    std::vector<Pt> getAroundFourPts() const {
        std::vector<Pt> result;
        for(int hwi = -1; hwi <= 1; hwi++) {
            for(int wwi = -1; wwi <= 1; wwi++) {
                if((hwi == 0) ^ (wwi == 0)) {
                    result.emplace_back(x + wwi, y + hwi);
                }
            }
        }
        return result;
    }

    std::vector<Pt> getAroundPts() const {
        std::vector<Pt> result;
        for(int hwi = -1; hwi <= 1; hwi++) {
            for(int wwi = -1; wwi <= 1; wwi++) {
                if(hwi != 0 || wwi != 0) {
                    result.emplace_back(x + wwi, y + hwi);
                }
            }
        }
        return result;
    }

    constexpr bool isWithinRange(const int& w, const int& h) const {
        return 0 <= x && x < w && 0 <= y && y < h;
    }

    constexpr Pt operator +() const {
        return *this;
    }

    constexpr Pt operator -() const {
        return{ -x, -y };
    }

    constexpr Pt operator +(const Pt& other) const {
        return{ x + other.x, y + other.y };
    }

    constexpr Pt operator +=(const Pt& other) {
        x += other.x;  y += other.y;  return *this;
    }

    constexpr Pt operator -(const Pt& other) const {
        return{ x - other.x, y - other.y };
    }

    constexpr Pt operator -=(const Pt& other) {
        x -= other.x;  y -= other.y;  return *this;
    }

    constexpr Pt operator *(int s) const {
        return{ x * s, y * s };
    }

    constexpr Pt operator *=(const Pt& other) {
        x *= other.x;  y *= other.y;  return *this;
    }

    constexpr Pt operator /(int s) const {
        return{ x / s, y / s };
    }

    constexpr Pt operator /=(const Pt& other) {
        x /= other.x;  y /= other.y;  return *this;
    }

    constexpr bool operator ==(const Pt& other) {
        return x == other.x && y == other.y;
    }

    constexpr bool operator !=(const Pt& other) {
        return !(x == other.x && y == other.y);
    }

    friend std::ostream& operator <<(std::ostream& os, const Pt& obj) {
        os << "x : " << obj.x << ", "
           << "y : " << obj.y << std::endl;
        return os;
    }
};

template <typename T>
class MyMat {
public:
    using EleMap = std::map<T, std::vector<Pt>>;

    T* data;
    uint w, h;

    MyMat(const uint& _w, const uint& _h, const T& def_val = 0) :
        w(_w), h(_h) {
        data = new T[h * w]();
        if(def_val != 0) {
            for(uint i = 0; i < w * h; i++) {
                data[i] = def_val;
            }
        }
    }

    MyMat(const uint &_w, const uint &_h, const T*& _data) :
        w(_w), h(_h), data(_data) {}

    ~MyMat() { delete[] data; }

    MyMat(const MyMat &obj) : data(obj.data), w(obj.w), h(obj,h) {}
    MyMat &operator=(const MyMat &obj) { data = obj.data; w = obj.w; h = obj,h; return *this; }

    MyMat clone() {
        T* new_data = new T[h * w];
        for(int i = 0; i < h * w; i++) {
            new_data[i] = data[i];
        }

        return MyMat<T>(w, h, new_data);
    }

    void stdRead() {
        for(uint hi = 0; hi < h; hi++) {
            for(uint wi = 0; wi < w; wi++) {
                std::cin >> data[wi + hi * w];
            }
        }
    }

    template<class... A>
    EleMap searchElements(const A&... keys) const {
        auto key_list = std::initializer_list<T>{keys...};

        EleMap result;
        for(const auto& key : key_list) {
            result.insert(std::make_pair(key, std::vector<Pt>()));
        }

        for(uint hi = 0; hi < h; hi++) {
            for(uint wi = 0; wi < w; wi++) {
                for(const auto& key : key_list) {
                    if(data[wi + hi * w] == key) {
                        result[key].push_back(Pt(wi, hi));
                    }
                }
            }
        }
    }

    T& at(const uint& wi, const uint& hi) const {
        return data[wi + hi * w];
    }

    T& at(const Pt& pt) const {
        return data[pt.x + pt.y * w];
    }

    friend std::ostream& operator <<(std::ostream& os, const MyMat<T>& obj) {
        for(uint hi = 0; hi < obj.h; hi++) {
            for (uint wi = 0; wi < obj.w; wi++) {
                os << obj.data[wi + hi * obj.w] << " ";
            }
            os << std::endl;
        }
        return os;
    }
};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    int H, W, N;
    std::cin >> H >> W >> N;

    std::vector<int> A(N);
    REP(i, N) {
        std::cin >> A[i];
    }

    std::vector<int> accsum(N + 1, 0);
    for(decltype(N) acc_i = 0; acc_i < N; acc_i++) {
        accsum[acc_i + 1] = accsum[acc_i] + A[acc_i];
    }

    MyMat<int> mat(W, H);
    int index = 1;
    REP(i, H) {
        REP(j, W) {
            if(accsum[index] <= (i * W + j)) {
                index++;
            }
            mat.at((i % 2 == 1) ? W - j - 1: j, i) = index;
        }
    }

    REP(i, H) {
        REP(j, W) {
            std::cout << mat.at(j, i) << " ";
        }
        std::cout << std::endl;
    }

    return 0;
}


Measured memory_bytes: 384