#include <bits/stdc++.h>
using namespace std;
int n, m, vis[1002][1002];
int a[1002][1002], c[1002][1002];
long long k;
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, -1, 1};
bool bfs(pair<int, int> meh, int sol) {
  queue<pair<int, int> > q;
  memset(vis, 0, sizeof(vis));
  vis[meh.first][meh.second] = 1;
  q.push(meh);
  int cnt = 1;
  while (!q.empty()) {
    pair<int, int> t = q.front();
    q.pop();
    int first = t.first, second = t.second;
    if (cnt == sol) return 1;
    for (int dir = 0; dir < 4; dir++) {
      int i = first + dx[dir];
      int j = second + dy[dir];
      if (i > 0 && i <= n && j > 0 && j <= m && !vis[i][j]) {
        if (a[i][j] < a[meh.first][meh.second]) continue;
        if (a[i][j] == a[meh.first][meh.second]) c[i][j] = 1;
        vis[i][j] = 1;
        cnt++;
        q.push({i, j});
        if (cnt == sol) return 1;
      }
    }
  }
  return 0;
}
int solve() {
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (c[i][j]) continue;
      long long cnt = k / a[i][j];
      if (k % a[i][j] == 0 && cnt <= m * n) {
        if (bfs({i, j}, cnt)) return a[i][j];
      }
    }
  }
  return -1;
}
int main() {
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) cin >> a[i][j];
  int ans = solve();
  if (ans == -1) {
    cout << "NO";
    return 0;
  }
  cout << "YES\n";
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (vis[i][j])
        cout << ans << " ";
      else
        cout << "0 ";
    }
    cout << "\n";
  }
  return 0;
}
