#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 10;
struct node {
  int x, y;
  long long num;
  node() : x(0), y(0), num(0) {}
  node(int x1, int y1, long long num1) : x(x1), y(y1), num(num1) {}
} a[MAXN];
int dx[4] = {0, 0, 1, -1};
int dy[4] = {1, -1, 0, 0};
int cnt = 0;
int n, m;
long long k;
bool mkv[1005][1005] = {0};
long long g[1005][1005] = {0};
int par[MAXN] = {0};
long long arr[MAXN] = {0};
bool cmp(node a, node b) { return a.num > b.num; }
int fi(int x) { return (par[x] == x ? x : par[x] = fi(par[x])); }
void u(int x, int y) {
  x = fi(x);
  y = fi(y);
  if (x != y) {
    par[x] = y;
    arr[y] += arr[x];
    arr[x] = 0;
  }
}
void bfs(int pos) {
  long long temp = (k + 0.5) / a[pos].num;
  int x = a[pos].x;
  int y = a[pos].y;
  memset(mkv, 0, sizeof(mkv));
  mkv[x][y] = 1;
  queue<node> q;
  q.push(a[pos]);
  while (!q.empty()) {
    node u = q.front();
    q.pop();
    for (int i = 0; i < 4; i++) {
      int x1 = u.x + dx[i];
      int y1 = u.y + dy[i];
      if (x1 >= 1 && x1 <= n && y1 >= 1 && y1 <= m && g[x1][y1] >= g[x][y] &&
          !mkv[x1][y1]) {
        mkv[x1][y1] = 1;
        temp--;
        if (temp == 1) {
          return;
        }
        q.push(node(x1, y1, 0));
      }
    }
  }
  return;
}
int main() {
  int ok = 0;
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; ++j) {
      a[cnt].x = i;
      a[cnt].y = j;
      cin >> a[cnt].num;
      g[i][j] = a[cnt].num;
      cnt++;
    }
  }
  sort(a, a + cnt, cmp);
  for (int i = 0; i < MAXN; i++) {
    par[i] = i;
    arr[i] = 1;
  }
  for (int i = 0; i < cnt; i++) {
    mkv[a[i].x][a[i].y] = 1;
    if (a[i].num == k) {
      memset(mkv, 0, sizeof(mkv));
      cout << "YES" << endl;
      mkv[a[i].x][a[i].y] = 1;
      for (int k = 1; k <= n; ++k) {
        for (int j = 1; j <= m; ++j) {
          if (mkv[k][j]) {
            cout << a[i].num << ' ';
          } else {
            cout << 0 << ' ';
          }
        }
        cout << endl;
      }
      return 0;
    }
    for (int j = 0; j < 4; ++j) {
      int x1 = a[i].x + dx[j];
      int y1 = a[i].y + dy[j];
      if (x1 >= 1 && x1 <= n && y1 >= 1 && y1 <= m && mkv[x1][y1]) {
        u((x1 - 1) * m + y1, (a[i].x - 1) * m + a[i].y);
        if (k % a[i].num == 0) {
          int fa = par[(a[i].x - 1) * m + a[i].y];
          if (arr[fa] * a[i].num >= k) {
            ok = 1;
            cout << "YES" << endl;
            bfs(i);
            for (int u = 1; u <= n; ++u) {
              for (int j = 1; j <= m; ++j) {
                if (mkv[u][j]) {
                  cout << a[i].num << ' ';
                } else {
                  cout << 0 << ' ';
                }
              }
              cout << endl;
            }
            return 0;
          }
        }
      }
    }
  }
  cout << "NO" << endl;
  return 0;
}
