#include <bits/stdc++.h>
using namespace std;
inline void splay(int &v) {
  v = 0;
  char c = 0;
  int p = 1;
  while (c < '0' || c > '9') {
    if (c == '-') p = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    v = (v << 3) + (v << 1) + c - '0';
    c = getchar();
  }
  v *= p;
}
int a[1005][1005];
int p[1000010], cnt, F;
long long t[1005][1005];
int tmp;
bool flag;
int n, m;
long long k;
long long _time;
bool comp(const int &a, const int &b) { return a > b; }
void print(int F) {
  puts("YES");
  int hs = F;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (t[i][j] == _time && hs) {
        printf("%d ", (int)(k / F));
        hs--;
      } else
        printf("0 ");
    }
    printf("\n");
  }
  exit(0);
}
const int fx[] = {0, 1, -1, 0, 0};
const int fy[] = {0, 0, 0, 1, -1};
void dfs(int x, int y) {
  if (cnt >= F) return;
  t[x][y] = _time;
  ++cnt;
  if (cnt >= F) return;
  for (int i = 1; i <= 4; i++) {
    if (t[x + fx[i]][y + fy[i]] < _time && a[x + fx[i]][y + fy[i]] >= tmp) {
      dfs(x + fx[i], y + fy[i]);
    }
  }
}
bool find(long long s) {
  int l = 1, r = n * m + 1;
  while (l != r) {
    int mid = l + r >> 1;
    if (p[mid] > s)
      l = mid + 1;
    else
      r = mid;
  }
  return p[l] == s;
}
int main() {
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      splay(a[i][j]);
      p[++cnt] = a[i][j];
    }
  }
  sort(p + 1, p + cnt + 1, comp);
  int c = n * m;
  for (F = c; F >= 1; F--) {
    if (k % (long long)F == 0) {
      if (k / (long long)F <= (long long)p[F] && find(k / (long long)F)) {
        int minn = _time;
        for (int i = 1; i <= n; i++) {
          for (int j = 1; j <= m; j++) {
            if (t[i][j] <= minn && a[i][j] == k / (long long)F) {
              _time++;
              cnt = 0;
              tmp = k / (long long)F;
              dfs(i, j);
              if (cnt >= F) print(F);
            }
          }
        }
      }
    }
  }
  puts("NO");
}
