#include <bits/stdc++.h>
using namespace std;
int n, m;
long long k;
long long mat[1010][1010];
bool vis[1010][1010];
bool flag = false;
vector<tuple<long long, int, int> > v;
vector<pair<int, int> > pos;
vector<pair<int, int> > aux;
long long el = 0;
bool vis1[1010][1010];
long long res = 0;
void dfs(int x, int y) {
  if (flag) return;
  if (vis1[x][y]) return;
  vis1[x][y] = true;
  aux.push_back({x, y});
  if (mat[x][y] >= el) {
    pos.push_back({x, y});
    res--;
    if (mat[x][y] == el) vis[x][y] = true;
    if (res == 0) flag = true;
    if (flag) {
      return;
    }
    dfs(x + 1, y);
    dfs(x, y + 1);
    if (x >= 1) dfs(x - 1, y);
    if (y >= 1) dfs(x, y - 1);
  }
  return;
}
int main() {
  scanf("%d %d %lld", &n, &m, &k);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      scanf("%lld", &mat[i][j]);
      v.push_back({mat[i][j], i, j});
    }
  for (int i = 0; i < v.size(); i++) {
    long long x = get<0>(v[i]);
    res = k / x;
    if (!vis[get<1>(v[i])][get<2>(v[i])] && k % x == 0 &&
        (1ll * n * m) >= res) {
      el = x;
      pos.clear();
      aux.clear();
      dfs(get<1>(v[i]), get<2>(v[i]));
      for (pair<int, int> j : aux) vis1[j.first][j.second] = false;
      if (flag) {
        puts("YES");
        memset(mat, 0, sizeof mat);
        for (pair<int, int> j : pos) mat[j.first][j.second] = el;
        for (int j = 0; j < n; j++) {
          for (int k1 = 0; k1 < m; k1++) printf("%lld ", mat[j][k1]);
          printf("\n");
        }
        return 0;
      }
    }
  }
  puts("NO");
  return 0;
}
