#include <bits/stdc++.h>
using namespace std;
const int maxn = 1010;
const int maxn2 = maxn * maxn;
int pa[maxn2];
int num[maxn2];
int a[maxn2];
int order[maxn2];
int ans[maxn2];
pair<int, int> h_sort[maxn2];
int parent(int l) {
  if (pa[l] != l) pa[l] = parent(pa[l]);
  return pa[l];
}
int n, m;
bool check(int x, int y) { return x >= 0 && x < n && y >= 0 && y < m; }
int dx[] = {0, 1, 0, -1};
int dy[] = {-1, 0, 1, 0};
void combine(int l) {
  int x = l / m, y = l % m;
  for (int i = 0; i < 4; i++) {
    int xx = dx[i] + x, yy = dy[i] + y;
    int nl = xx * m + yy;
    if (check(xx, yy) && order[nl] > order[l]) {
      int p = parent(nl);
      if (p == l) continue;
      pa[p] = l;
      num[l] += num[p];
    }
  }
}
int dfs(int l, int num, int h) {
  if (ans[l] != 0 || num == 0) return num;
  ans[l] = h;
  num--;
  int x = l / m, y = l % m;
  for (int i = 0; i < 4; i++) {
    int xx = x + dx[i], yy = y + dy[i];
    if (check(xx, yy) && a[xx * m + yy] >= h) {
      num = dfs(xx * m + yy, num, h);
    }
  }
  return num;
}
int main() {
  long long k;
  while (scanf("%d%d%I64d", &n, &m, &k) == 3) {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        int l = i * m + j;
        num[l] = 1;
        ans[l] = 0;
        pa[l] = l;
        scanf("%d", &a[l]);
        h_sort[l].first = a[l];
        h_sort[l].second = l;
      }
    }
    sort(h_sort, h_sort + m * n);
    for (int i = m * n - 1; i >= 0; i--) order[h_sort[i].second] = i;
    bool can = false;
    for (int i = m * n - 1; i >= 0; i--) {
      int l = h_sort[i].second, h = h_sort[i].first;
      combine(l);
      if (((long long)num[l]) * h >= k && k % h == 0) {
        dfs(l, k / h, h);
        can = true;
        break;
      }
    }
    if (!can) {
      printf("NO\n");
      continue;
    }
    printf("YES\n");
    for (int i = 0; i < n; i++) {
      int l = i * m;
      printf("%d", ans[l]);
      for (int j = 1; j < m; j++) printf(" %d", ans[l + j]);
      putchar('\n');
    }
  }
  return 0;
}
