#include <bits/stdc++.h>
using namespace std;
const long double pi = acos(-1);
string to_string(bool b) { return b ? "true" : "false"; }
string to_string(const char* s) { return string(s); }
string to_string(string s) { return s; }
string to_string(vector<bool> v) {
  string res;
  for (long long int i = 0; i < v.size(); i++) res += char('0' + v[i]);
  return res;
}
template <size_t S>
string to_string(bitset<S> b) {
  string res;
  for (long long int i = 0; i < b; i++) res += char('0' + b[i]);
  return res;
}
template <class T>
string to_string(T v) {
  bool f = 1;
  string res;
  for (auto x : v) {
    if (!f) res += ' ';
    f = 0;
    res += to_string(x);
  }
  return res;
}
template <class A>
void write(A x) {
  cout << to_string(x);
}
template <class H, class... T>
void write(const H& h, const T&... t) {
  write(h);
  write(t...);
}
void print() { cout << ("\n"); }
template <class H, class... T>
void print(const H& h, const T&... t) {
  write(h);
  if (sizeof...(t)) write(' ');
  print(t...);
}
void DBG() { cerr << "]" << endl; }
template <class H, class... T>
void DBG(H h, T... t) {
  cerr << to_string(h);
  if (sizeof...(t)) cerr << ", ";
  DBG(t...);
}
const long long int N = 2e6;
const long long int mxN = 1e3;
const long long int MOD = 1e9 + 7;
const long long int fx[] = {0, +1, 0, -1};
const long long int fy[] = {-1, 0, +1, 0};
long long int n, m, p[N + 1], ht[N + 1], grid[mxN + 1][mxN + 1],
    ans[mxN + 1][mxN + 1], k, nw[mxN + 1][mxN + 1];
bool safe(long long int i, long long int j) {
  return i >= 0 && i < n && j >= 0 && j < m;
}
long long int hsh(long long int i, long long int j) { return i * m + j; }
long long int find(long long int x) {
  return (x ^ p[x]) ? p[x] = find(p[x]) : x;
}
bool join(long long int a, long long int b) {
  a = find(a), b = find(b);
  if (a == b) return 0;
  if (ht[a] > ht[b]) swap(a, b);
  p[a] = b;
  ht[b] += ht[a];
  return 1;
}
long long int vis[mxN + 1][mxN + 1], rem;
void dfs(long long int i, long long int j, long long int val) {
  vis[i][j] = 1;
  if (rem == 0) return;
  ans[i][j] = val;
  rem--;
  for (long long int k = 0; k < 4; k++) {
    long long int ni = i + fx[k], nj = j + fy[k];
    if (safe(ni, nj) && grid[ni][nj] >= val && !vis[ni][nj]) {
      dfs(ni, nj, val);
    }
  }
}
void solve() {
  cin >> n >> m >> k;
  vector<array<long long int, 3> > v;
  for (long long int i = 0; i < N + 1; i++) {
    p[i] = i;
    ht[i] = 1;
  }
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 0; j < m; j++) {
      long long int x;
      cin >> x;
      grid[i][j] = x;
      v.push_back({x, i, j});
    }
  }
  sort(v.begin(), v.end(), greater<array<long long int, 3> >());
  for (long long int i = 0; i < n * m; i++) {
    for (long long int j = 0; j < 4; j++) {
      long long int ni = v[i][1] + fx[j], nj = v[i][2] + fy[j];
      if (safe(ni, nj) && nw[ni][nj]) {
        join(hsh(v[i][1], v[i][2]), hsh(ni, nj));
      }
    }
    nw[v[i][1]][v[i][2]] = 1;
    if (k % v[i][0] == 0 && ht[find(hsh(v[i][1], v[i][2]))] >= k / v[i][0]) {
      cout << "YES\n";
      rem = k / v[i][0];
      dfs(v[i][1], v[i][2], v[i][0]);
      for (long long int i = 0; i < n; i++) {
        for (long long int j = 0; j < m; j++) {
          cout << ans[i][j] << " ";
        }
        cout << "\n";
      }
      return;
    }
  }
  cout << "NO\n";
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  clock_t time = clock();
  long long int t = 1;
  for (long long int i = 0; i < t; i++) {
    solve();
  }
  double time_taken = ((double)(clock() - time)) / CLOCKS_PER_SEC;
  cerr << "LINE(" << 142 << ") -> ["
       << "time_taken"
       << "]: [",
      DBG(time_taken);
  return 0;
}
