#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void read(T& x) {
  int f = 1;
  x = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  x *= f;
}
const int N = 1000 + 5;
const int dx[] = {0, 0, 1, -1};
const int dy[] = {1, -1, 0, 0};
long long n, m, k, T, s;
int a[N][N];
int vis[N][N];
int v[N][N];
queue<pair<int, int> > Q;
int solve(int x, int y) {
  if (v[x][y]) return 0;
  if (k % a[x][y] != 0 || k / a[x][y] > n * m) return 0;
  T++, s = a[x][y];
  long long tot = k / a[x][y];
  while (!Q.empty()) Q.pop();
  Q.push(pair<int, int>(x, y));
  v[x][y] = 1, vis[x][y] = T;
  int cnt = 1;
  if (cnt == tot) return 1;
  while (!Q.empty()) {
    pair<int, int> u = Q.front();
    Q.pop();
    for (int d = 0; d < 4; d++) {
      int tx = u.first + dx[d], ty = u.second + dy[d];
      if (a[tx][ty] < s || vis[tx][ty] == T) continue;
      cnt++;
      Q.push(pair<int, int>(tx, ty));
      if (a[tx][ty] == s) v[tx][ty] = 1;
      vis[tx][ty] = T;
      if (cnt == tot) return 1;
    }
  }
  return 0;
}
int print() {
  printf("YES\n");
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) printf("%d ", vis[i][j] == T ? s : 0);
    printf("\n");
  }
}
int main() {
  read(n), read(m), read(k);
  long long sum = 0;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      read(a[i][j]);
      sum += a[i][j];
    }
  if (sum < k) {
    printf("NO\n");
    return 0;
  }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (solve(i, j)) {
        print();
        return 0;
      }
  printf("NO\n");
  return 0;
}
