#include <bits/stdc++.h>
using namespace std;
int n, m;
long long k;
set<int> se;
bool vis[1010][1010];
bool used[1010][1010];
int num[1010][1010];
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
bool bfs(pair<int, int> st, int cnt) {
  queue<pair<int, int> > que;
  que.push(st);
  memset(vis, false, sizeof(vis));
  vis[st.first][st.second] = true;
  int sum = 1;
  while (!que.empty()) {
    pair<int, int> cur = que.front();
    que.pop();
    int x = cur.first, y = cur.second;
    if (sum == cnt) return true;
    for (int i = 0; i < 4; i++) {
      int nx = x + dx[i];
      int ny = y + dy[i];
      if (nx >= 1 && nx <= n && ny >= 1 && ny <= m && !vis[nx][ny] &&
          num[nx][ny] >= num[st.first][st.second]) {
        if (num[nx][ny] == num[st.first][st.second]) used[nx][ny] = true;
        que.push(pair<int, int>(nx, ny));
        vis[nx][ny] = true;
        sum++;
        if (sum == cnt) return true;
      }
    }
  }
  return false;
}
int solve() {
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (used[i][j]) continue;
      long long cnt = k / num[i][j];
      if (k % num[i][j] == 0 && cnt <= n * m) {
        if (bfs(pair<int, int>(i, j), cnt)) return num[i][j];
      }
    }
  }
  return -1;
}
int main() {
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      scanf("%d", &num[i][j]);
    }
  }
  int ans = solve();
  if (ans == -1)
    puts("NO");
  else {
    puts("YES");
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= m; j++) {
        printf("%d ", vis[i][j] ? ans : 0);
      }
      puts("");
    }
  }
}
