#include <bits/stdc++.h>
using namespace std;
const long long MAX = 2500000000;
const int inf = 123456789;
const double EPS = 1e-9;
const double PI = 2 * asin(1.0);
const long long mod = 1e9 + 7;
int double_cmp(double x, double y = 0, double tol = EPS) {
  return (x <= y + tol) ? (x + tol < y) ? -1 : 0 : 1;
}
int n, m;
long long k;
int matriz[1010][1010];
int saida[1010][1010];
int mx[4] = {1, -1, 0, 0}, my[4] = {0, 0, 1, -1};
map<int, set<pair<int, int> > > loop;
bool ins(int x, int y) { return (x >= 0 && x < n && y >= 0 && y < m); }
bool dfs(int x, int y, int val, int& tot) {
  loop[val].insert(pair<int, int>(x, y));
  tot--;
  if (tot == 0) return true;
  for (int i = 0; i < 4; ++i) {
    int nx = x + mx[i];
    int ny = y + my[i];
    if (ins(nx, ny) && matriz[nx][ny] >= val &&
        loop[val].find(pair<int, int>(nx, ny)) == loop[val].end()) {
      if (dfs(nx, ny, val, tot)) return true;
    }
  }
  return false;
}
void limpar(int x, int y, int val, int& tot) {
  if (tot == 0) return;
  saida[x][y] = val;
  tot--;
  matriz[x][y] = 0;
  for (int i = 0; i < 4; ++i) {
    int nx = x + mx[i];
    int ny = y + my[i];
    if (tot == 0) return;
    if (ins(nx, ny) && matriz[nx][ny] >= val) limpar(nx, ny, val, tot);
  }
}
int main() {
  scanf("%d%d", &n, &m);
  cin >> k;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) scanf("%d", &matriz[i][j]);
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (loop[matriz[i][j]].find(pair<int, int>(i, j)) ==
          loop[matriz[i][j]].end()) {
        if (k % matriz[i][j] == 0) {
          long long to = k / matriz[i][j];
          if (to > n * m) continue;
          int tot = to;
          if (dfs(i, j, matriz[i][j], tot)) {
            printf("YES\n");
            tot = k / matriz[i][j];
            limpar(i, j, matriz[i][j], tot);
            for (int i = 0; i < n; ++i) {
              for (int j = 0; j < m; ++j) printf("%d ", saida[i][j]);
              printf("\n");
            }
            return 0;
          }
        }
      }
    }
  }
  printf("NO\n");
}
