#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int maxn = 1e6 + 15;
const int dir[4][2] = {0, 1, 1, 0, 0, -1, -1, 0};
long long a[1005][1005], ans[1005][1005];
long long par[maxn], size[maxn];
bool vis[1005][1005];
long long cnt, n, m, k;
struct Node {
  int x, y, h;
  bool operator<(const Node& rhs) const { return h > rhs.h; }
} node[maxn];
long long find(long long x) {
  if (par[x] == x) return x;
  return par[x] = find(par[x]);
}
void unite(long long x, long long y) {
  x = find(x), y = find(y);
  if (x == y) return;
  par[x] = y;
  size[y] += size[x];
  size[x] = 0;
}
long long getSize(long long x) {
  x = find(x);
  return size[x];
}
void dfs(long long x, long long y, long long h) {
  if (cnt == k / h) return;
  vis[x][y] = true;
  ans[x][y] = h;
  cnt++;
  for (int i = 0; i < 4; i++) {
    long long nx = x + dir[i][0];
    long long ny = y + dir[i][1];
    if (nx < 0 || ny < 0 || nx >= n || ny >= m || vis[nx][ny] || a[nx][ny] < h)
      continue;
    dfs(nx, ny, h);
  }
}
int main() {
  scanf("%I64d %I64d %I64d", &n, &m, &k);
  cnt = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      scanf("%I64d", a[i] + j);
      node[cnt].x = i;
      node[cnt].y = j;
      node[cnt++].h = a[i][j];
    }
  bool flag = false;
  memset(vis, false, sizeof vis);
  for (int i = 0; i < n * m; i++) {
    par[i] = i;
    size[i] = 1;
  }
  sort(node, node + cnt);
  for (int i = 0; i < cnt; i++) {
    long long x = node[i].x;
    long long y = node[i].y;
    long long h = node[i].h;
    long long id = x * m + y;
    for (int j = 0; j < 4; j++) {
      long long nx = x + dir[j][0];
      long long ny = y + dir[j][1];
      if (nx < 0 || ny < 0 || nx >= n || ny >= m || !vis[nx][ny]) continue;
      long long nid = nx * m + ny;
      unite(nid, id);
    }
    vis[x][y] = true;
    if (k % h == 0 && getSize(id) >= k / h) {
      memset(ans, 0, sizeof ans);
      cnt = 0;
      memset(vis, false, sizeof vis);
      dfs(x, y, h);
      flag = true;
      break;
    }
  }
  if (!flag)
    printf("NO\n");
  else {
    printf("YES\n");
    for (int i = 0; i < n; i++)
      for (int j = 0; j < m; j++)
        printf("%I64d%c", ans[i][j], " \n"[j == m - 1]);
  }
  return 0;
}
