#include <bits/stdc++.h>
using namespace std;
vector<pair<long, pair<long, long> > > q;
bool visited[1100][1100] = {};
long long N = 10001100, remain, n, m, k, p[10001100], sz[10001100],
          a[1100][1100], val, d[4][2] = {{-1, 0}, {1, 0}, {0, 1}, {0, -1}};
long long getRoot(long long v) {
  if (p[v] == v) return v;
  return p[v] = getRoot(p[v]);
}
void merge(long long u, long long v) {
  if (getRoot(u) == getRoot(v)) return;
  sz[getRoot(v)] += sz[getRoot(u)];
  sz[getRoot(u)] = 0;
  p[getRoot(u)] = getRoot(v);
}
void dfs(long long i, long long j) {
  if (remain <= 0 || a[i][j] < val) return;
  visited[i][j] = true;
  remain--;
  for (long long k = 0; k < 4; k++) {
    long long ii = i + d[k][0], jj = j + d[k][1];
    if (ii < 0 || ii >= n || jj < 0 || jj >= m || visited[ii][jj]) continue;
    dfs(ii, jj);
  }
}
long long getSize(long long u) { return sz[getRoot(u)]; }
int main() {
  cin >> n >> m >> k;
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < m; j++) {
      cin >> a[i][j];
      q.push_back(make_pair(a[i][j], make_pair(i, j)));
    }
  for (long long i = 0; i < N; i++) {
    sz[i] = 1;
    p[i] = i;
  }
  sort(q.begin(), q.end());
  reverse(q.begin(), q.end());
  for (vector<pair<long, pair<long, long> > >::iterator it = q.begin();
       it != q.end(); it++) {
    long long i = it->second.first, j = it->second.second;
    val = it->first;
    visited[i][j] = true;
    for (long long w = 0; w < 4; w++) {
      long long ii = i + d[w][0], jj = j + d[w][1];
      if (ii < 0 || ii >= n || jj < 0 || jj >= m || !visited[ii][jj]) continue;
      merge(1000 * i + j, 1000 * ii + jj);
    }
    if (k % val == 0 && sz[getRoot(1000 * i + j)] >= k / val) {
      for (long long w = 0; w < n; w++)
        for (long long ww = 0; ww < m; ww++) visited[w][ww] = false;
      remain = k / val;
      dfs(i, j);
      cout << "YES"
           << "\n";
      for (i = 0; i < n; i++)
        for (j = 0; j < m; j++)
          cout << (visited[i][j] ? val : 0) << (j == m - 1 ? "\n" : " ");
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
