#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
const double eps = 1e-7;
const double pi = acos(-1.0);
const long long INF = (long long)2e9 + 1;
const long long LINF = (long long)8e18;
const long long inf = (long long)2e9 + 1;
const long long linf = (long long)8e18;
const long long MM = (long long)1e9 + 7;
int solve();
void gen();
int main() {
  solve();
  return 0;
}
const int dd = 1e3 + 7;
int A[dd][dd];
int T[dd][dd];
map<int, vector<pair<int, int> > > M;
int n, m;
bool ok(int x, int y) { return x >= 0 && x < n && y >= 0 && y < m; }
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, 1, 0, -1};
int p[dd * dd], r[dd * dd];
int get(int v) { return v == p[v] ? v : p[v] = get(p[v]); }
void un(int a, int b) {
  a = get(a), b = get(b);
  if (a != b) {
    if (r[b] > r[a]) swap(a, b);
    p[b] = a;
    r[a] += r[b];
  }
}
long long k;
int j = 0;
long long O[dd][dd];
void out(int x, int y, long long k) {
  if (j == 0) return;
  O[x][y] = k;
  j--;
  for (int gg = 0; gg < (int)4; gg++) {
    int nx = x + dx[gg];
    int ny = y + dy[gg];
    if (ok(nx, ny) && T[nx][ny] && !O[nx][ny]) out(nx, ny, k);
  }
}
int solve() {
  cin >> n >> m >> k;
  for (int i = 0; i < (int)n; i++) {
    for (int j = 0; j < (int)m; j++) {
      scanf("%d", &A[i][j]);
      M[A[i][j]].push_back(make_pair(i, j));
    }
  }
  for (int i = 0; i < (int)n; i++)
    for (int j = 0; j < (int)m; j++) p[i * m + j] = i * m + j, r[i * m + j] = 1;
  int cnt = 0;
  int cntC = 0;
  for (auto it = M.rbegin(); it != M.rend(); it++) {
    for (auto c : it->second) {
      int x, y;
      tie(x, y) = c;
      T[x][y] = 1;
      cntC++;
      cnt++;
      for (int gg = 0; gg < (int)4; gg++) {
        int nx = x + dx[gg];
        int ny = y + dy[gg];
        if (ok(nx, ny) && T[nx][ny]) {
          if (get(x * m + y) != get(nx * m + ny)) {
            un(x * m + y, nx * m + ny);
            cnt--;
          }
        }
      }
      long long t = it->first;
      if (k % t) continue;
      if (k / t <= r[get(x * m + y)]) {
        j = k / t;
        out(x, y, t);
        puts("YES");
        for (int i = 0; i < (int)n; i++) {
          for (int j = 0; j < (int)m; j++) {
            printf("%d ", O[i][j]);
          }
          printf("\n");
        }
        return 0;
      }
    }
  }
  puts("NO");
  return 0;
}
