#include <bits/stdc++.h>
using namespace std;
template <typename __>
inline void Out(__ a) {
  if (a < 0) a = -a, putchar('-');
  if (a > 9) Out(a / 10);
  putchar(a % 10 + '0');
}
template <typename __>
inline void read(__ &x) {
  char k;
  for (k = getchar(); k < '0' || k > '9'; k = getchar())
    ;
  for (x = 0; '0' <= k; k = getchar()) x = x * 10 + k - '0';
}
const int maxn = 1001;
int n, m;
long long K;
int dat[maxn][maxn];
int vis[maxn][maxn];
bool vis2[maxn][maxn];
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, -1, 1};
int qx[maxn * maxn + 10], qy[maxn * maxn + 10];
bool bfs(int xx, int yy) {
  memset(vis2, 0, sizeof vis2);
  int v = dat[xx][yy];
  int bs = K / v;
  int pos = (xx - 1) * m + yy;
  int s = 1, t = 1;
  qx[1] = xx;
  qy[1] = yy;
  vis[xx][yy] = pos;
  if (bs == 1) return true;
  while (s <= t) {
    int x = qx[s];
    int y = qy[s];
    s++;
    for (int i = 0; i < 4; ++i) {
      int tx = x + dx[i];
      int ty = y + dy[i];
      if (tx >= 1 && tx <= n && ty >= 1 && ty <= m && dat[tx][ty] >= v &&
          vis[tx][ty] != pos) {
        vis[tx][ty] = pos;
        if (dat[tx][ty] == v) vis2[tx][ty] = 1;
        ++t;
        qx[t] = tx;
        qy[t] = ty;
        if (t >= bs) return true;
      }
    }
  }
  return false;
}
int main() {
  read(n);
  read(m);
  read(K);
  vector<pair<int, pair<int, int>>> vec;
  vec.reserve(n * m);
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j)
      read(dat[i][j]), vec.push_back(make_pair(dat[i][j], make_pair(i, j)));
  sort(vec.begin(), vec.end());
  for (auto x : vec) {
    if (vis2[x.second.first][x.second.second]) continue;
    if (K % x.first != 0 || K / x.first > n * m) continue;
    if (bfs(x.second.first, x.second.second)) {
      puts("YES");
      int dd = K / x.first;
      memset(dat, 0, sizeof dat);
      for (int i = 1; i <= dd; ++i) dat[qx[i]][qy[i]] = x.first;
      for (int i = 1; i <= n; ++i) {
        for (int j = 1; j <= m; ++j) Out(dat[i][j]), putchar(' ');
        puts("");
      }
      return 0;
    }
  }
  puts("NO");
}
