#include <bits/stdc++.h>
using namespace std;
const int maxN = 1000030;
long long k, a[maxN];
int N, n, m, p[maxN];
bool on[maxN];
vector<int> G[maxN];
bool cmp(int u, int v) { return a[u] > a[v]; }
namespace DS {
int fa[maxN], sz[maxN];
int root(int x) {
  if (fa[x] == x) return x;
  return fa[x] = root(fa[x]);
}
void Union(int a, int b) {
  if (on[b] == 0) return;
  int u = root(a), v = root(b);
  if (u != v) {
    G[a].push_back(b);
    G[b].push_back(a);
    if (sz[u] < sz[v]) swap(u, v);
    fa[v] = u;
    sz[u] += sz[v];
  }
}
}  // namespace DS
int need;
void dfs(int u, int fa) {
  if (need <= 0) return;
  need--, on[u] = 1;
  for (int v : G[u])
    if (v != fa) {
      dfs(v, u);
    }
}
int main() {
  cin >> n >> m >> k;
  N = n * m;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    on[i] = 0;
    p[i] = i;
  }
  sort(p, p + N, cmp);
  for (int i = 0; i < N; i++)
    if (a[p[i]] > 0) {
      int x = p[i];
      on[x] = 1;
      DS::fa[x] = x, DS::sz[x] = 1;
      if (x - m >= 0) DS::Union(x, x - m);
      if (x + m < N) DS::Union(x, x + m);
      if ((x + 1) % m != 0) DS::Union(x, x + 1);
      if (x % m != 0) DS::Union(x, x - 1);
      if (k % a[x] != 0) continue;
      int cnt = DS::sz[DS::root(x)];
      if (k / a[x] > (long long)cnt) continue;
      need = (int)(k / a[x]);
      memset(on, 0, sizeof(on));
      dfs(x, -1);
      puts("YES");
      for (int i = 0, t = 0; i < n; i++) {
        for (int j = 0; j < m; j++, t++) {
          if (on[t])
            cout << a[x] << " ";
          else
            cout << "0 ";
        }
        cout << endl;
      }
      return 0;
    }
  puts("NO");
}
