#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e3 + 5;
int dsu[MAXN * MAXN];
bool vis[MAXN][MAXN];
int fin[MAXN][MAXN];
int ans[MAXN][MAXN];
long long sz[MAXN * MAXN];
int n, m;
long long counter = 0, counter2 = 0;
int value;
int findRoot(int idx) {
  if (idx == dsu[idx]) return idx;
  return dsu[idx] = findRoot(dsu[idx]);
}
bool valid(int x, int y) {
  if (x >= 1 and x <= n and y >= 1 and y <= m) return true;
  return false;
}
void DFS(int x, int y) {
  vis[x][y] = true;
  if (counter < counter2) ans[x][y] = value, counter++;
  if (valid(x - 1, y) and !vis[x - 1][y] and fin[x - 1][y]) DFS(x - 1, y);
  if (valid(x + 1, y) and !vis[x + 1][y] and fin[x + 1][y]) DFS(x + 1, y);
  if (valid(x, y - 1) and !vis[x][y - 1] and fin[x][y - 1]) DFS(x, y - 1);
  if (valid(x, y + 1) and !vis[x][y + 1] and fin[x][y + 1]) DFS(x, y + 1);
}
int main() {
  cin >> n >> m;
  long long k;
  cin >> k;
  vector<pair<int, int> > v;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      int x;
      scanf("%d", &x);
      v.push_back(make_pair(x, (i - 1) * m + j));
      fin[i][j] = 0;
    }
  for (int i = 1; i <= n * m; i++) dsu[i] = i, sz[i] = 1;
  sort(v.rbegin(), v.rend());
  for (int i = 0; i < (int)v.size(); i++) {
    int val = v[i].second;
    int row = ceil(1.0 * val / m);
    int col = val % m;
    if (col == 0) col = m;
    if (valid(row + 1, col) and fin[row + 1][col]) {
      int root = findRoot(row * m + col);
      if (root != val) dsu[root] = val, sz[val] += sz[root];
    }
    if (valid(row - 1, col) and fin[row - 1][col]) {
      int root = findRoot((row - 2) * m + col);
      if (root != val) dsu[root] = val, sz[val] += sz[root];
    }
    if (valid(row, col - 1) and fin[row][col - 1]) {
      int root = findRoot((row - 1) * m + col - 1);
      if (root != val) dsu[root] = val, sz[val] += sz[root];
    }
    if (valid(row, col + 1) and fin[row][col + 1]) {
      int root = findRoot((row - 1) * m + col + 1);
      if (root != val) dsu[root] = val, sz[val] += sz[root];
    }
    fin[row][col] = v[i].first;
    long long t = 1LL * v[i].first;
    if (k % t == 0 and sz[val] >= k / t) {
      printf("YES\n");
      counter = 0;
      counter2 = k / t;
      value = v[i].first;
      DFS(row, col);
      for (int z = 1; z <= n; z++)
        for (int zz = 1; zz <= m; zz++) {
          if (zz != m)
            printf("%d ", ans[z][zz]);
          else
            printf("%d\n", ans[z][zz]);
        }
      return 0;
    }
  }
  printf("NO\n");
  return 0;
}
