#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000 + 5;
int n, m, cnt;
long long lim;
int l[maxn * maxn];
int par[maxn * maxn], vis[maxn][maxn];
vector<pair<int, int> > vec;
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, -1, 1};
struct point {
  int x, y;
  int val;
  bool operator<(const point &p) const { return val > p.val; }
} atlas[maxn * maxn];
int findp(int x) {
  if (par[x] == x) return x;
  return par[x] = findp(par[x]);
}
void dfs(int x, int y) {
  if (vis[x][y] == 0) return;
  vis[x][y] = 0;
  vec.push_back(make_pair(x, y));
  for (int i = 0; i < 4; i++) {
    int nx = x + dx[i];
    int ny = y + dy[i];
    if (nx < 0 || nx >= n || ny < 0 || ny >= m) continue;
    if (vis[nx][ny]) dfs(nx, ny);
  }
}
void solve() {
  long long res = -1;
  int lo = 0;
  int a, b;
  for (int i = 0; i < n * m; i++) {
    int x = atlas[i].x;
    int y = atlas[i].y;
    vis[x][y] = 1;
    for (int j = 0; j < 4; j++) {
      int nx = x + dx[j];
      int ny = y + dy[j];
      if (nx < 0 || nx >= n || ny < 0 || ny >= m) continue;
      if (vis[nx][ny] == 0) continue;
      a = findp(x * m + y);
      b = findp(nx * m + ny);
      if (b != a) {
        par[b] = a;
        l[a] += l[b];
      }
    }
    if (lim % atlas[i].val == 0 && l[x * m + y] >= lim / atlas[i].val) {
      dfs(x, y);
      res = atlas[i].val;
      lo = lim / atlas[i].val;
      break;
    }
  }
  if (res == -1) {
    printf("NO\n");
    return;
  } else
    printf("YES\n");
  memset(vis, 0, sizeof(vis));
  for (int i = 0; i < lo; i++) {
    int x = vec[i].first, y = vec[i].second;
    vis[x][y] = 1;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (vis[i][j])
        printf("%d", res);
      else
        printf("%d", 0);
      printf("%c", j == m - 1 ? '\n' : ' ');
    }
  }
}
void init() {
  scanf("%d%d%I64d", &n, &m, &lim);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      int tmp;
      scanf("%d", &tmp);
      atlas[i * m + j].x = i;
      atlas[i * m + j].y = j;
      atlas[i * m + j].val = tmp;
    }
  }
  sort(atlas, atlas + n * m);
  for (int i = 0; i < n * m; i++) {
    par[i] = i;
    l[i] = 1;
  }
}
int main() {
  init();
  solve();
  return 0;
}
