#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 4;
int p[maxn], a[1003][1003], num[maxn], n, m, vis[1003][1003];
int dir[4][2] = {0, -1, 0, 1, 1, 0, -1, 0};
long long k;
struct node {
  int h, x, y;
};
node po[maxn];
int cmp(node u, node v) { return u.h > v.h; }
int findset(int x) {
  if (x == p[x]) return x;
  return p[x] = findset(p[x]);
}
void same(int x, int y) {
  int fx = findset(x), fy = findset(y);
  if (fx != fy) {
    p[fx] = fy;
    num[fy] += num[fx];
    num[fx] = 0;
  }
}
int print(node r) {
  memset(vis, 0, sizeof(vis));
  node temp;
  int nu = 1;
  queue<node> qu;
  qu.push(r);
  vis[r.x][r.y] = 1;
  while (!qu.empty()) {
    node to = qu.front();
    qu.pop();
    for (int i = 0; i < 4; i++) {
      int px = to.x + dir[i][0], py = to.y + dir[i][1];
      if (px < 1 || px > n || py < 1 || py > m) continue;
      if (a[px][py] >= r.h && nu < k / r.h && vis[px][py] == 0) {
        temp.h = a[px][py];
        temp.x = px;
        temp.y = py;
        qu.push(temp);
        vis[px][py] = 1;
        nu++;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (vis[i][j]) {
        printf("%d ", r.h);
      } else
        printf("0 ");
    }
    printf("\n");
  }
}
int main() {
  int cnt = 1;
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      scanf("%d", &a[i][j]);
      po[cnt].h = a[i][j];
      po[cnt].x = i;
      po[cnt].y = j;
      cnt++;
    }
  }
  for (int i = 1; i < maxn; i++) {
    p[i] = i;
    num[i] = 1;
  }
  sort(po + 1, po + cnt + 1, cmp);
  for (int i = 1; i < cnt; i++) {
    for (int j = 0; j < 4; j++) {
      int fx = po[i].x + dir[j][0], fy = po[i].y + dir[j][1];
      if (fx <= 0 || fx > n || fy <= 0 || fy > m) continue;
      if (a[fx][fy] >= po[i].h) {
        same((fx - 1) * m + fy, (po[i].x - 1) * m + po[i].y);
      }
    }
    if (k % po[i].h == 0) {
      int fa = findset((po[i].x - 1) * m + po[i].y);
      long long s = (long long)num[fa] * (long long)po[i].h;
      if (s >= k) {
        cout << "YES"
             << "\n";
        print(po[i]);
        return 0;
      }
    }
  }
  printf("NO\n");
  return 0;
}
