#include <bits/stdc++.h>
using namespace std;
int a[1200][1200];
bool f[1200][1200];
int g[1200][1200];
vector<int> all;
long long lef, to, k;
int i, j, ALL, n, m, tmp;
void dfs(int i, int j) {
  if (i < 1 || i > n || j < 1 || j > m) return;
  if (a[i][j] < to) return;
  if (f[i][j]) return;
  ALL++;
  if (ALL <= k / to) g[i][j] = tmp;
  f[i][j] = 1;
  dfs(i, j + 1);
  dfs(i, j - 1);
  dfs(i + 1, j);
  dfs(i - 1, j);
}
int main() {
  cin >> n >> m >> k;
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++) {
      scanf("%d", &a[i][j]);
      all.push_back(a[i][j]);
    }
  sort(all.begin(), all.end());
  for (int T = 0; T < all.size(); T++)
    if (!T || all[T] != all[T - 1]) {
      to = all[T];
      lef = all.size() - T;
      if (1LL * to * lef < 1LL * k) continue;
      if (k % to != 0) continue;
      for (i = 1; i <= n; i++)
        for (j = 1; j <= m; j++) f[i][j] = 0, g[i][j] = 0;
      bool can = 0;
      tmp = 0;
      for (i = 1; i <= n; i++)
        for (j = 1; j <= m; j++)
          if (!f[i][j] && a[i][j] == to) {
            ALL = 0;
            tmp++;
            dfs(i, j);
            if (1LL * ALL * to >= k) {
              i = n + 1;
              j = m + 1;
              can = 1;
            }
          }
      if (can == 1) {
        cout << "YES" << endl;
        for (i = 1; i <= n; i++) {
          for (j = 1; j <= m; j++) printf("%d ", (g[i][j] == tmp) ? (to) : 0);
          cout << endl;
        }
        return 0;
      }
    }
  cout << "NO" << endl;
}
