#include <bits/stdc++.h>
using namespace std;
const long long dx[] = {0, 1, 0, -1};
const long long dy[] = {1, 0, -1, 0};
vector<pair<long long, long long> > cell, S;
long long a[1001][1001], n, m, ans[1001][1001], k;
bool vis[1001][1001];
bool valid(long long x, long long y) {
  return x > 0 && y > 0 && x <= n && y <= m;
}
bool cmp(pair<long long, long long> x, pair<long long, long long> y) {
  return a[x.first][x.second] < a[y.first][y.second];
}
void dfs(long long x, long long y, vector<pair<long long, long long> > &S,
         long long value) {
  if (vis[x][y]) return;
  vis[x][y] = true;
  S.push_back(pair<long long, long long>(x, y));
  if (S.size() >= k / value) return;
  for (long long i = 0; i < 4; i++) {
    long long u = x + dx[i], v = y + dy[i];
    if (valid(u, v) && a[u][v] >= value) {
      dfs(u, v, S, value);
      if (S.size() >= k / value) return;
    }
  }
}
void print(long long value, const vector<pair<long long, long long> > &S) {
  memset(ans, 0, sizeof(ans));
  for (long long i = 0; i < k / value; i++) {
    long long x = S[i].first, y = S[i].second;
    ans[x][y] = value;
  }
  puts("YES");
  for (long long u = 1; u <= n; u++) {
    for (long long v = 1; v <= m; v++) cout << ans[u][v] << ' ';
    cout << '\n';
  }
}
int main() {
  cin >> n >> m >> k;
  for (long long i = 1; i <= n; i++)
    for (long long j = 1; j <= m; j++) {
      cin >> a[i][j];
      if (k % a[i][j] == 0 && k / a[i][j] <= n * m)
        cell.push_back(pair<long long, long long>(i, j));
    }
  sort(cell.begin(), cell.end(), cmp);
  for (long long i = 0, j; i < (long long)cell.size(); i = j) {
    long long value = a[cell[i].first][cell[i].second];
    memset(vis, false, sizeof(vis));
    for (j = i; j < (long long)cell.size(); j++) {
      long long x = cell[j].first, y = cell[j].second;
      if (a[x][y] != value) break;
      if (!vis[x][y]) {
        S.clear();
        dfs(x, y, S, value);
        if (S.size() >= k / value) {
          print(value, S);
          return 0;
        }
      }
    }
  }
  puts("NO");
  return 0;
}
