#include <bits/stdc++.h>
using namespace std;
int n, m;
long long k;
long long num[1005][1005];
int vis[1005][1005];
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
bool intable(int x, int y) {
  if (x >= 0 && x < n && y >= 0 && y < m) return true;
  return false;
}
vector<long long> vec;
int xx[1000005];
int yy[1000005];
bool vis2[1005][1005];
int sum;
void dfs(int x, int y, int pos) {
  if (sum == 0) return;
  sum--;
  vis2[x][y] = 1;
  for (int i = 0; i < 4; i++) {
    int nx = x + dx[i];
    int ny = y + dy[i];
    if (intable(nx, ny) && vis2[nx][ny] == 0 && vis[nx][ny] == pos)
      dfs(nx, ny, pos);
  }
}
int bfs(int x, int y, int pos, int numb, long long t, int &x1, int &y1) {
  vis[x][y] = pos;
  xx[0] = x;
  yy[0] = y;
  int l = 0, r = 1;
  int tnum = 1;
  while (l < r) {
    if (num[xx[l]][yy[l]] == t) {
      x1 = xx[l];
      y1 = yy[l];
    }
    for (int i = 0; i < 4; i++) {
      int nx = xx[l] + dx[i];
      int ny = yy[l] + dy[i];
      if (intable(nx, ny) && vis[nx][ny] == 0 && num[nx][ny] >= t) {
        vis[nx][ny] = pos;
        tnum++;
        xx[r] = nx;
        yy[r] = ny;
        r++;
      }
    }
    l++;
  }
  return tnum;
}
int main() {
  scanf("%d%d%I64d", &n, &m, &k);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      scanf("%I64d", &num[i][j]);
      vec.push_back(num[i][j]);
    }
  }
  sort(vec.begin(), vec.end());
  for (int i = n * m; i >= 1; i--) {
    if (k % i != 0) continue;
    long long t = k / i;
    int pos = lower_bound(vec.begin(), vec.end(), t) - vec.begin();
    int has = n * m - pos;
    if (has >= i) {
      memset(vis, 0, sizeof(vis));
      int tpos = 1;
      int flag = 0;
      for (int j = 0; j < n; j++) {
        for (int w = 0; w < m; w++) {
          if (vis[j][w]) continue;
          if (num[j][w] < t) continue;
          int tx = -1, ty = -1;
          int ttt = bfs(j, w, tpos, i, t, tx, ty);
          has -= ttt;
          if (ttt >= i) {
            if (tx == -1 && ty == -1)
              ;
            else {
              sum = i;
              printf("YES\n");
              dfs(tx, ty, tpos);
              for (int ii = 0; ii < n; ii++) {
                for (int jj = 0; jj < m; jj++) {
                  if (vis2[ii][jj])
                    printf("%I64d ", t);
                  else
                    printf("0 ");
                }
                printf("\n");
              }
              return 0;
            }
          }
          tpos++;
          if (has < i) {
            flag = 1;
            break;
          }
        }
        if (flag) break;
      }
    }
  }
  printf("NO\n");
  return 0;
}
