#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
long long POW(long long a, long long b, long long MMM = MOD) {
  long long ret = 1;
  for (; b; b >>= 1, a = (a * a) % MMM)
    if (b & 1) ret = (ret * a) % MMM;
  return ret;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) {
  if (a == 0 || b == 0) return a + b;
  return a * (b / gcd(a, b));
}
int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};
int ddx[] = {0, 0, 1, 1, 1, -1, -1, -1}, ddy[] = {1, -1, 1, 0, -1, 1, 0, -1};
map<long long, vector<int> > M;
int n, m;
long long k;
long long a[1000][1000], ans[1000][1000];
int parent[1000000];
int find(int a) {
  if (parent[a] < 0) return a;
  return parent[a] = find(parent[a]);
}
void merge(int a, int b) {
  a = find(a), b = find(b);
  if (a != b) {
    parent[a] += parent[b];
    parent[b] = a;
  }
}
inline int sz(int z) { return -parent[find(z)]; }
int main() {
  memset(parent, -1, sizeof(parent));
  ;
  scanf("%d%d%lld", &n, &m, &k);
  for (int(i) = (0); (i) <= (n - 1); (i) += (1))
    for (int(j) = (0); (j) <= (m - 1); (j) += (1)) {
      scanf("%lld", &a[i][j]);
      M[a[i][j]].push_back(i * m + j);
    }
  auto it = M.end();
  while (1) {
    it--;
    for (int z : it->second) {
      int x = z / m, y = z % m;
      for (int(i) = (0); (i) <= (3); (i) += (1)) {
        int nx = x + dx[i], ny = y + dy[i];
        if (nx >= 0 && nx < n && ny >= 0 && ny < m && a[nx][ny] >= a[x][y])
          merge(z, nx * m + ny);
      }
      if (k % it->first == 0 && sz(z) >= k / it->first) {
        puts("YES");
        long long r = it->first, rem = k / it->first - 1;
        ans[x][y] = r;
        queue<pair<int, int> > q;
        q.push(make_pair(x, y));
        while (!q.empty()) {
          int xx, yy;
          tie(xx, yy) = q.front();
          q.pop();
          for (int(i) = (0); (i) <= (3); (i) += (1)) {
            int nxx = xx + dx[i], nyy = yy + dy[i];
            if (nxx >= 0 && nxx < n && nyy >= 0 && nyy < m && !ans[nxx][nyy] &&
                a[nxx][nyy] >= r && rem > 0) {
              rem--;
              ans[nxx][nyy] = r;
              q.push(make_pair(nxx, nyy));
            }
          }
        }
        for (int(i) = (0); (i) <= (n - 1); (i) += (1)) {
          for (int(j) = (0); (j) <= (m - 1); (j) += (1))
            printf("%lld ", ans[i][j]);
          puts("");
        }
        return 0;
      }
    }
    if (it == M.begin()) break;
  }
  puts("NO");
}
