#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int SIZE = 1e6 + 10;
long long K;
int V, dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int d[SIZE], a[1111][1111], p[1111][1111], nn[SIZE], n, m, an[1111][1111];
int find(int x) {
  if (d[x] == x) return x;
  return d[x] = find(d[x]);
}
void uu(int x, int y) {
  x = find(x);
  y = find(y);
  if (x != y) nn[y] += nn[x], d[x] = y;
}
void f(int x, int y, int g, int& r) {
  if (!r || x < 0 || x >= n || y < 0 || y >= m || an[x][y]) return;
  if (find(p[x][y]) != g) return;
  an[x][y] = V;
  r--;
  for (int i = 0; i < (4); ++i) {
    f(x + dx[i], y + dy[i], g, r);
  }
}
int main() {
  scanf("%d%d", &(n), &(m));
  cin >> K;
  int id = 0;
  vector<pair<int, pair<int, int> > > pp;
  for (int i = 0; i < (n); ++i)
    for (int j = 0; j < (m); ++j) {
      scanf("%d", &(a[i][j]));
      if (a[i][j] == K) {
        an[i][j] = K;
        puts("YES");
        for (int ii = 0; ii < (n); ++ii)
          for (int jj = 0; jj < (m); ++jj)
            printf("%d%c", an[ii][jj], jj == m - 1 ? '\n' : ' ');
        return 0;
      }
      d[id] = id;
      nn[id] = 1;
      pp.push_back(make_pair(a[i][j], make_pair(i, j)));
      p[i][j] = id++;
    }
  sort((pp).begin(), (pp).end());
  reverse((pp).begin(), (pp).end());
  for (int i = 0; i < (((int)(pp).size())); ++i) {
    int x = pp[i].second.first, y = pp[i].second.second;
    int v = pp[i].first;
    for (int j = 0; j < (4); ++j) {
      int nx = x + dx[j], ny = y + dy[j];
      int me = p[x][y];
      if (nx < 0 || nx >= n || ny < 0 || ny >= m) continue;
      if (a[x][y] <= a[nx][ny]) uu(p[x][y], p[nx][ny]);
      if (K % v == 0 && nn[find(me)] >= K / v) {
        puts("YES");
        int r = K / v;
        V = v;
        f(x, y, find(me), r);
        for (int ii = 0; ii < (n); ++ii)
          for (int jj = 0; jj < (m); ++jj)
            printf("%d%c", an[ii][jj], jj == m - 1 ? '\n' : ' ');
        return 0;
      }
    }
  }
  puts("NO");
  return 0;
}
