#include <bits/stdc++.h>
using namespace std;
const int N = 1010;
const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, 1, -1};
int a[N][N];
int cnt[N][N];
int fa[N * N];
bool valid[N][N];
bool vis[N][N], choose[N][N];
int n, m;
long long K;
int find(int x) { return fa[x] < 0 ? x : fa[x] = find(fa[x]); }
void construct(int tx, int ty, int h, int root) {
  long long need = K / h;
  memset(vis, false, sizeof vis);
  memset(choose, false, sizeof choose);
  queue<int> q;
  q.push(tx);
  q.push(ty);
  vis[tx][ty] = true;
  int cnt = 0;
  while (!q.empty()) {
    int x = q.front();
    q.pop();
    int y = q.front();
    q.pop();
    choose[x][y] = true;
    cnt++;
    if (cnt == need) {
      break;
    }
    for (int d = 0; d < 4; ++d) {
      int nx = x + dx[d], ny = y + dy[d];
      if (nx >= 0 && nx < n && ny >= 0 && ny < m && valid[nx][ny]) {
        if (!vis[nx][ny]) {
          q.push(nx);
          q.push(ny);
          vis[nx][ny] = true;
        }
      }
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (choose[i][j]) {
        a[i][j] = h;
      } else {
        a[i][j] = 0;
      }
    }
  }
  cout << "YES" << endl;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      cout << a[i][j] << ' ';
    }
    cout << endl;
  }
}
void solve() {
  vector<pair<int, pair<int, int> > > heights;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      cin >> a[i][j];
      heights.push_back(make_pair(a[i][j], make_pair(i, j)));
    }
  }
  sort(heights.begin(), heights.end());
  reverse(heights.begin(), heights.end());
  for (int i = 0; i < n * m; ++i) {
    fa[i] = -1;
  }
  memset(valid, false, sizeof valid);
  for (const auto &p : heights) {
    int h = p.first;
    int x = p.second.first, y = p.second.second;
    valid[x][y] = true;
    for (int d = 0; d < 4; ++d) {
      int nx = x + dx[d], ny = y + dy[d];
      if (nx >= 0 && nx < n && ny >= 0 && ny < m && valid[nx][ny]) {
        int f = find(x * m + y);
        int g = find(nx * m + ny);
        if (f != g) {
          if (-fa[f] > -fa[g]) {
            swap(f, g);
          }
          fa[g] += fa[f];
          fa[f] = g;
        }
      }
    }
    if (K % h == 0) {
      long long need = K / h;
      int root = find(x * m + y);
      if (-fa[root] >= need) {
        construct(x, y, h, root);
        return;
      }
    }
  }
  cout << "NO" << endl;
}
int main() {
  while (cin >> n >> m >> K) {
    solve();
  }
}
