#include <bits/stdc++.h>
using namespace std;
const int maxn = 1005;
int a[maxn][maxn];
int f[maxn][maxn];
int vis[maxn][maxn];
int b[4] = {1, -1, 0, 0};
int c[4] = {0, 0, 1, -1};
int fa[maxn * maxn];
int to[maxn][maxn];
int size[maxn * maxn];
int root(int p) {
  if (fa[p] == -1 || fa[p] == p) return fa[p] = p;
  return fa[p] = root(fa[p]);
}
void merg(int a, int b) {
  if (root(a) != root(b)) {
    size[root(b)] += size[root(a)];
    fa[root(a)] = root(b);
  }
}
int u[maxn], v[maxn];
struct pi {
  int x;
  int y;
  int p;
} pp[maxn * maxn];
int cmp(pi a, pi b) { return a.p > b.p; }
int flag;
long long s;
void dfs(int x, int y, int q, long long k) {
  s += q;
  f[x][y] = q;
  vis[x][y] = 1;
  if (s == k) {
    flag = 1;
    return;
  }
  for (int i = 0; i < 4; i++) {
    int x1 = b[i] + x;
    int y1 = c[i] + y;
    if (!vis[x1][y1] && a[x1][y1] >= q) {
      dfs(x1, y1, q, k);
      if (flag) return;
    }
  }
}
int main() {
  int i, j, n, m;
  long long k;
  cin >> n >> m >> k;
  int tot = 0;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      scanf("%d", &a[i][j]);
      pp[tot].x = i;
      pp[tot].y = j;
      pp[tot].p = a[i][j];
      tot++;
      to[i][j] = -1;
    }
  }
  memset(u, -1, sizeof(u));
  memset(v, -1, sizeof(v));
  for (i = 0; i < tot; i++) {
    fa[i] = -1;
    size[i] = 1;
  }
  sort(pp, pp + tot, cmp);
  for (i = 0; i < tot; i++) {
    for (j = 0; j < 4; j++) {
      int x = pp[i].x + b[j];
      int y = pp[i].y + c[j];
      if (x > 0 && x <= n && y > 0 && y <= m && to[x][y] != -1) {
        merg(i, to[x][y]);
      }
    }
    to[pp[i].x][pp[i].y] = i;
    int p = size[root(i)];
    if (pp[i].p != 0 && k % pp[i].p == 0 && k / pp[i].p <= p) {
      printf("YES\n");
      dfs(pp[i].x, pp[i].y, pp[i].p, k);
      for (i = 1; i <= n; i++) {
        for (j = 1; j <= m; j++) {
          printf("%d ", f[i][j]);
        }
        printf("\n");
      }
      return 0;
    }
  }
  printf("NO\n");
}
