#include <bits/stdc++.h>
#include <cmath>
#include <cstddef>
#include <functional>
#include <iostream>
#include <string>
#include <type_traits>

// lib/vector2.hpp
#ifndef VECTOR2_HPP
#define VECTOR2_HPP


/*
usage:

tools::vector2<int>(6, 5) // => (6, 5)
*/

namespace tools {
  template <typename T>
  class vector2 {
  public:
    T x;
    T y;

    vector2() :
      vector2(T(), T()) {
    }

    vector2(const T& x, const T& y) :
      x(x),
      y(y) {
    }

    double norm() const {
      return std::sqrt(this->squaredNorm());
    }

    T squaredNorm() const {
      return this->inner_product(*this);
    }

    template <typename CHECK = T, typename std::enable_if<std::is_same<CHECK, double>::value, std::nullptr_t>::type = nullptr>
    double normalize() const {
      return *this / this->norm();
    }

    vector2<T> operator+() const {
      return *this;
    }

    vector2<T> operator-() const {
      return vector2<T>(-this->x, -this->y);
    }

    friend vector2<T> operator+(const vector2<T>& lhs, const vector2<T>& rhs) {
      return vector2<T>(lhs.x + rhs.x, lhs.y + rhs.y);
    }

    friend vector2<T> operator-(const vector2<T>& lhs, const vector2<T>& rhs) {
      return vector2<T>(lhs.x - rhs.x, lhs.y - rhs.y);
    }

    template <typename T2, typename std::enable_if<!std::is_same<T2, vector2<T>>::value, std::nullptr_t>::type = nullptr>
    friend vector2<T> operator*(const vector2<T>& lhs, const T2& rhs) {
      return vector2<T>(lhs.x * rhs, lhs.y * rhs);
    }
    template <typename T2, typename std::enable_if<!std::is_same<T2, vector2<T>>::value, std::nullptr_t>::type = nullptr>
    friend vector2<T> operator*(const T2& lhs, const vector2<T>& rhs) {
      return vector2<T>(lhs * rhs.x, lhs * rhs.y);
    }

    template <typename T2, typename std::enable_if<!std::is_same<T2, vector2<T>>::value, std::nullptr_t>::type = nullptr>
    friend vector2<T> operator/(const vector2<T>& lhs, const T2& rhs) {
      return vector2<T>(lhs.x / rhs, lhs.y / rhs);
    }

    T inner_product(const vector2<T>& other) const {
      return this->x * other.x + this->y * other.y;
    }

    vector2<T>& operator+=(const vector2<T>& other) {
      return *this = *this + other;
    }

    vector2<T>& operator-=(const vector2<T>& other) {
      return *this = *this - other;
    }

    friend bool operator==(const vector2<T>& lhs, const vector2<T>& rhs) {
      return lhs.x == rhs.x && lhs.y == rhs.y;
    }

    friend bool operator!=(const vector2<T>& lhs, const vector2<T>& rhs) {
      return lhs.x != rhs.x || lhs.y != rhs.y;
    }
  };
}

namespace std {
  template <typename T>
  string to_string(const tools::vector2<T>& f) {
    return '(' + to_string(f.x) + ", " + to_string(f.y) + ')';
  }

  template <typename T>
  struct hash<tools::vector2<T>> {
    typedef std::size_t result_type;
    typedef tools::vector2<T> argument_type;
    std::size_t operator()(const tools::vector2<T>& key) const {
      static const std::hash<T> hash = std::hash<T>();
      std::size_t result = 17;
      result = 31 * result + hash(key.x);
      result = 31 * result + hash(key.y);
      return result;
    }
  };
}

template <typename T>
std::ostream& operator<<(std::ostream& os, const tools::vector2<T>& self) {
  return os << std::to_string(self);
}

#endif

// main.cpp

tools::vector2<std::int_fast64_t> next(const tools::vector2<std::int_fast64_t>& v, const std::int_fast64_t W) {
  static tools::vector2<std::int_fast64_t> left(-1, 0);
  static tools::vector2<std::int_fast64_t> right(1, 0);
  static tools::vector2<std::int_fast64_t> down(0, 1);
  return v + (v.y % 2 == 0 ? (v.x < W - 1 ? right : down) : (0 < v.x ? left : down));
}

int main() {
  std::int_fast64_t H, W, N;
  std::cin >> H >> W >> N;
  std::vector<std::int_fast64_t> a;
  a.reserve(N);
  std::copy_n(std::istream_iterator<std::int_fast64_t>(std::cin), N, std::back_inserter(a));

  std::vector<std::vector<std::int_fast64_t>> c(H, std::vector<std::int_fast64_t>(W));
  tools::vector2<std::int_fast64_t> cursor(0, 0);
  for (std::int_fast64_t i = 0; i < N; ++i) {
    for (std::int_fast64_t j = 0; j < a[i]; ++j) {
      c[cursor.y][cursor.x] = i + 1;
      cursor = next(cursor, W);
    }
  }

  for (std::int_fast64_t y = 0; y < H; ++y) {
    std::string delimiter = "";
    for (std::int_fast64_t x = 0; x < W; ++x) {
      std::cout << delimiter << c[y][x];
      delimiter = " ";
    }
    std::cout << std::endl;
  }
  return 0;
}

Measured memory_bytes: 512