#include <bits/stdc++.h>
using namespace std;
const int N = 1100;
int a[N][N];
int s[N * N];
int q[N][N];
int mark[N][N];
int n, m;
int ww, judgetimes;
long long k, sum;
long long w;
void dfs2(int x, int y) {
  if (x < 0 || y < 0 || x >= n || y >= m || q[x][y] != judgetimes) return;
  q[x][y] = 0;
  if (sum != k) {
    sum += w;
    mark[x][y] = 1;
  } else
    mark[x][y] = 0;
  dfs2(x + 1, y);
  dfs2(x - 1, y);
  dfs2(x, y - 1);
  dfs2(x, y + 1);
}
void print(int x, int y) {
  puts("YES");
  sum = 0;
  dfs2(x, y);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      printf("%d%c", mark[i][j] ? (int)w : 0, " \n"[j == m - 1]);
}
int dfs(int x, int y) {
  if (x < 0 || y < 0 || x >= n || y >= m || q[x][y] == judgetimes ||
      a[x][y] < w)
    return 0;
  int s = 1;
  q[x][y] = judgetimes;
  s += dfs(x + 1, y) + dfs(x - 1, y) + dfs(x, y - 1) + dfs(x, y + 1);
  return s;
}
int judge(int x) {
  judgetimes++;
  w = x;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (q[i][j] != judgetimes && a[i][j] == w) {
        if (dfs(i, j) * w >= k) {
          print(i, j);
          return 1;
        }
      }
  return 0;
}
int main() {
  while (~scanf("%d%d", &n, &m)) {
    cin >> k;
    judgetimes = 0;
    memset(q, 0, sizeof(q));
    memset(mark, 0, sizeof(mark));
    for (int i = 0; i < n; i++)
      for (int j = 0; j < m; j++) {
        scanf("%d", &a[i][j]);
        s[i * m + j] = a[i][j];
      }
    sort(s, s + n * m);
    ww = n * m;
    int last = 0;
    int flg = 0;
    for (int i = 0; i < ww; i++) {
      if (s[i] == last) continue;
      last = s[i];
      long long tmp = s[i];
      tmp *= ww - i;
      if (tmp < k) continue;
      if (k % s[i] != 0) continue;
      if (judge(s[i])) {
        flg = 1;
        break;
      }
    }
    if (!flg) puts("NO");
  }
  return 0;
}
