#include <bits/stdc++.h>
using namespace std;
void read_file(bool outToFile = true) {}
int n, m;
int A[1000 + 9][1000 + 9];
long long K, sum;
int mrk = 0, to;
int vis[1000 + 9][1000 + 9] = {0};
int di[] = {1, 0, -1, 0};
int dj[] = {0, 1, 0, -1};
set<int> usedAs[1000 + 9][1000 + 9];
bool valid(int i, int j) { return 0 <= i && i < n && 0 <= j && j < m; }
bool flood(int i, int j) {
  if (!valid(i, j) || vis[i][j] == mrk || A[i][j] < to) return false;
  sum -= to;
  vis[i][j] = mrk;
  usedAs[i][j].insert(to);
  if (sum == 0) return true;
  for (int d = 0; d < 4; d++)
    if (flood(i + di[d], j + dj[d])) return true;
  return false;
}
int main() {
  read_file();
  while (scanf("%d %d\n", &n, &m) != EOF) {
    scanf("%lld", &K);
    for (int i = 0; i < n; i++)
      for (int j = 0; j < m; j++) scanf("%d", &A[i][j]), usedAs[i][j].clear();
    bool done = false;
    memset(vis, 0, sizeof vis);
    for (int i = 0; i < n && !done; i++) {
      for (int j = 0; j < m && !done; j++) {
        if (K % A[i][j] == 0 && K / A[i][j] <= n * m) {
          if (usedAs[i][j].count(A[i][j])) continue;
          mrk++;
          to = A[i][j];
          sum = K;
          if (flood(i, j)) done = true;
        }
      }
    }
    if (!done) {
      printf("NO\n");
      continue;
    }
    printf("YES\n");
    for (int i = 0; i < n; i++)
      for (int j = 0; j < m; j++) A[i][j] = vis[i][j] == mrk ? to : 0;
    for (int i = 0; i < n; i++)
      for (int j = 0; j < m; j++) printf("%d%c", A[i][j], " \n"[j == m - 1]);
  }
}
