#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000 + 10;
int h[maxn][maxn];
int ans[maxn][maxn];
struct Node {
  int r, c;
  bool operator<(const Node &rhs) const { return h[r][c] < h[rhs.r][rhs.c]; }
};
Node a[maxn * maxn];
int fa[maxn * maxn], cnt[maxn * maxn];
int find(int x) { return x == fa[x] ? x : fa[x] = find(fa[x]); }
int n, m;
int ID(int i, int j) { return i * m + j; }
bool vis[maxn][maxn];
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, -1, 0, 1};
long long num, v, sum;
void dfs(int r, int c) {
  if (sum == num) return;
  ans[r][c] = v;
  if (++sum == num) return;
  for (int d = 0; d < 4; d++) {
    int nr = r + dx[d], nc = c + dy[d];
    if (0 <= nr && nr < n && 0 <= nc && nc < m && vis[nr][nc] &&
        ans[nr][nc] == 0)
      dfs(nr, nc);
  }
}
int main() {
  long long k;
  scanf("%d%d%I64d", &n, &m, &k);
  int N = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      scanf("%d", &h[i][j]);
      a[N++] = (Node){i, j};
    }
  sort(a, a + N);
  for (int i = 0; i < N; i++) {
    fa[i] = i;
    cnt[i] = 1;
  }
  bool ok = false;
  for (int i = N - 1; i >= 0; i--) {
    int r = a[i].r, c = a[i].c;
    if (h[r][c] == 0) break;
    int nr, nc, id = ID(r, c), tid, fu, fv;
    for (int d = 0; d < 4; d++) {
      nr = r + dx[d];
      nc = c + dy[d];
      if (0 <= nr && nr < n && 0 <= nc && nc < m && vis[nr][nc]) {
        tid = ID(nr, nc);
        fu = find(id);
        fv = find(tid);
        if (fu != fv) {
          fa[fu] = fv;
          cnt[fv] += cnt[fu];
        }
      }
    }
    vis[r][c] = true;
    if (k % h[r][c] == 0) {
      fu = find(id);
      num = k / h[r][c];
      if (cnt[fu] >= num) {
        v = h[r][c];
        sum = 0;
        dfs(r, c);
        ok = true;
        break;
      }
    }
  }
  if (ok) {
    printf("YES\n");
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m - 1; j++) printf("%d ", ans[i][j]);
      printf("%d\n", ans[i][m - 1]);
    }
  } else
    printf("NO\n");
  return 0;
}
