#include <bits/stdc++.h>
using namespace std;
const int N = 1000 + 5;
int n, m;
long long k;
int a[N][N];
bool vis[N][N];
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
int get(int x, int y) { return x * m + y; }
struct UF {
  int p[N * N], sz[N * N];
  void init(int n) {
    for (int(i) = (0); (i) < (int)(n); (i)++) p[i] = i, sz[i] = 1;
  }
  int find(int x) { return x == p[x] ? x : p[x] = find(p[x]); }
  void merge(int x, int y) {
    x = find(x);
    y = find(y);
    if (x != y) p[y] = x, sz[x] += sz[y];
  }
  int getSize(int x) { return sz[find(x)]; }
} uf;
bool used[N][N];
int sz;
void dfs(int x, int y) {
  if (sz == 0) return;
  used[x][y] = 1;
  --sz;
  for (int(i) = (0); (i) < (int)(4); (i)++) {
    int tx = x + dx[i];
    int ty = y + dy[i];
    if (tx < 0 || tx >= n || ty < 0 || ty >= m) continue;
    if (vis[tx][ty] && !used[tx][ty]) dfs(tx, ty);
  }
}
int main() {
  cin >> n >> m >> k;
  vector<pair<int, pair<int, int> > > vip;
  for (int(i) = (0); (i) < (int)(n); (i)++)
    for (int(j) = (0); (j) < (int)(m); (j)++) {
      cin >> a[i][j];
      vip.push_back(make_pair(a[i][j], make_pair(i, j)));
    }
  sort(vip.rbegin(), vip.rend());
  uf.init(n * m);
  bool f = 0;
  int value, r, c;
  for (int i = 0; i < ((int)(vip).size()); ++i) {
    int x = vip[i].second.first;
    int y = vip[i].second.second;
    vis[x][y] = 1;
    for (int(j) = (0); (j) < (int)(4); (j)++) {
      int tx = x + dx[j];
      int ty = y + dy[j];
      if (tx < 0 || tx >= n || ty < 0 || ty >= m) continue;
      if (vis[tx][ty]) uf.merge(get(x, y), get(tx, ty));
    }
    if (k % a[x][y] == 0LL && (long long)uf.getSize(get(x, y)) >= k / a[x][y]) {
      value = a[x][y];
      r = x;
      c = y;
      f = 1;
      break;
    }
  }
  if (!f) {
    puts("NO");
    return 0;
  }
  puts("YES");
  sz = (int)(k / value);
  dfs(r, c);
  for (int(i) = (0); (i) < (int)(n); (i)++) {
    for (int(j) = (0); (j) < (int)(m); (j)++) {
      if (!used[i][j])
        printf("0 ");
      else
        printf("%d ", value);
    }
    cout << endl;
  }
  return 0;
}
