#include <bits/stdc++.h>
using namespace std;
struct Info {
  int x, y;
  long long int val;
} info[2100 * 2100];
int tot = 0;
bool cmp(Info a, Info b) { return a.val > b.val; }
int f[2100 * 2100], size[2100 * 2100];
int n, m;
long long int K;
long long int mp[2100][2100];
int id(int x, int y) { return (x - 1) * m + y; }
bool inMap(int x, int y) {
  if (x < 1 || x > n || y < 1 || y > m) return false;
  return true;
}
int findSet(int x) {
  if (f[x] == x) return x;
  return f[x] = findSet(f[x]);
}
void Merge(int x, int y) {
  int rootx = findSet(x), rooty = findSet(y);
  if (rootx == rooty) return;
  f[rootx] = rooty;
  size[rooty] += size[rootx];
}
int xx[] = {1, -1, 0, 0}, yy[] = {0, 0, 1, -1};
int output[2100][2100];
bool vis[2100][2100];
pair<int, int> q[2100 * 2100];
bool vis2[2100][2100];
void print(int sx, int sy, int val) {
  int tot = 0;
  int h = 0, t = 1;
  q[h] = make_pair(sx, sy);
  vis[sx][sy] = true;
  long long int need = K / (long long int)val;
  while (h < t) {
    pair<int, int> now = q[h++];
    if (tot < need) tot++, output[now.first][now.second] = val;
    for (int dir = 0; dir < 4; dir++) {
      int newx = now.first + xx[dir], newy = now.second + yy[dir];
      if (!inMap(newx, newy)) continue;
      if (!vis2[newx][newy]) continue;
      if (vis[newx][newy]) continue;
      q[t++] = make_pair(newx, newy);
      vis[newx][newy] = true;
    }
  }
}
int main() {
  scanf("%d%d%I64d", &n, &m, &K);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      scanf("%d", &mp[i][j]), info[++tot].x = i, info[tot].y = j,
                              info[tot].val = mp[i][j];
  sort(info + 1, info + tot + 1, cmp);
  for (int i = 1; i <= tot; i++) f[i] = i, size[i] = 1;
  bool flag = false;
  for (int i = 1; i <= tot; i++) {
    vis2[info[i].x][info[i].y] = true;
    for (int dir = 0; dir < 4; dir++) {
      int newx = info[i].x + xx[dir], newy = info[i].y + yy[dir];
      if (!inMap(newx, newy)) continue;
      if (!vis2[newx][newy]) continue;
      Merge(id(info[i].x, info[i].y), id(newx, newy));
    }
    int rootx = findSet(id(info[i].x, info[i].y));
    if (K % info[i].val == 0 && info[i].val * (long long int)size[rootx] >= K) {
      flag = true;
      print(info[i].x, info[i].y, info[i].val);
      break;
    }
  }
  if (flag) {
    printf("YES\n");
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= m; j++) printf("%d ", output[i][j]);
      printf("\n");
    }
  } else
    printf("NO\n");
  return 0;
}
