#include <bits/stdc++.h>
using namespace std;
const int N = 1010;
int n, m;
long long k;
int a[N][N];
int comp[N * N], size[N * N];
vector<pair<int, pair<int, int>>> v;
bool u[N][N], u1[N][N], b[N][N], f;
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, -1, 1};
int cnt;
int get(int x) {
  if (comp[x] == x) return x;
  return comp[x] = get(comp[x]);
}
void join(int x, int y) {
  x = get(x);
  y = get(y);
  if (x != y) {
    if (size[x] < size[y]) swap(x, y);
    comp[y] = x;
    size[x] += size[y];
  }
}
void go(int val, int x, int y) {
  if (u[x][y]) return;
  u[x][y] = true;
  for (int d = 0; d < 4; ++d) {
    int cx = x + dx[d], cy = y + dy[d];
    if (cx >= 0 && cx < n && cy >= 0 && cy < m && a[cx][cy] >= val) {
      join(x * m + y, cx * m + cy);
      int sz = size[get(x * m + y)];
      if (1LL * sz * val >= k) f = true;
      if (!f) go(val, cx, cy);
    }
  }
}
void go1(int val, int x, int y) {
  if (u1[x][y]) return;
  u1[x][y] = true;
  if (cnt == 0) return;
  b[x][y] = true;
  --cnt;
  for (int d = 0; d < 4; ++d) {
    int cx = x + dx[d], cy = y + dy[d];
    if (cx >= 0 && cx < n && cy >= 0 && cy < m && a[cx][cy] >= val)
      go1(val, cx, cy);
  }
}
int main() {
  scanf("%d%d%I64d", &n, &m, &k);
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j) scanf("%d", &a[i][j]);
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j)
      if (a[i][j] == k) {
        puts("YES");
        for (int ii = 0; ii < n; ++ii) {
          for (int jj = 0; jj < m; ++jj)
            printf("%d ", i != ii || j != jj ? 0 : a[i][j]);
          printf("\n");
        }
        return 0;
      }
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j) {
      comp[i * m + j] = i * m + j;
      size[i * m + j] = 1;
      if (k % a[i][j] == 0) v.push_back({a[i][j], {i, j}});
    }
  sort(v.begin(), v.end());
  reverse(v.begin(), v.end());
  for (auto x : v) {
    go(x.first, x.second.first, x.second.second);
    if (f) {
      cnt = k / x.first;
      go1(x.first, x.second.first, x.second.second);
      puts("YES");
      for (int i = 0; i < n; ++i) {
        for (int j = 0; j < m; ++j) printf("%d ", b[i][j] ? x.first : 0);
        printf("\n");
      }
      break;
    }
  }
  if (!f) puts("NO");
  return 0;
}
