#include <bits/stdc++.h>
using namespace std;
long long int n, m, need, visit[1001][1001], a[1001][1001], size[1001][1001],
    came[1001][1001];
vector<pair<long long int, pair<long long int, long long int> > > v;
pair<long long int, long long int> par[1001][1001];
int valid(long long int x, long long int y) {
  return x >= 1 && x <= n && y >= 1 && y <= m;
}
pair<long long int, long long int> find(long long int x, long long int y) {
  if (par[x][y] == make_pair(x, y)) return make_pair(x, y);
  return par[x][y] = find(par[x][y].first, par[x][y].second);
}
void dfs(long long int x, long long int y) {
  if (need <= 0) return;
  visit[x][y] = 1;
  need--;
  if (valid(x + 1, y) && !visit[x + 1][y] && came[x + 1][y]) dfs(x + 1, y);
  if (valid(x - 1, y) && !visit[x - 1][y] && came[x - 1][y]) dfs(x - 1, y);
  if (valid(x, y + 1) && !visit[x][y + 1] && came[x][y + 1]) dfs(x, y + 1);
  if (valid(x, y - 1) && !visit[x][y - 1] && came[x][y - 1]) dfs(x, y - 1);
}
int main() {
  ios::sync_with_stdio(false);
  ;
  long long int i, j, k, x, y, xp, yp, xp1, yp1, f, val;
  cin >> n >> m >> k;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      cin >> a[i][j];
      v.push_back(make_pair(a[i][j], make_pair(i, j)));
    }
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      par[i][j] = make_pair(i, j);
      size[i][j] = 1;
    }
  }
  sort(v.begin(), v.end());
  reverse(v.begin(), v.end());
  f = 0;
  for (i = 0; i < v.size(); i++) {
    x = v[i].second.first;
    y = v[i].second.second;
    val = v[i].first;
    if (came[x + 1][y] && valid(x + 1, y)) {
      xp = find(x, y).first;
      yp = find(x, y).second;
      xp1 = find(x + 1, y).first;
      yp1 = find(x + 1, y).second;
      if (make_pair(xp, yp) != make_pair(xp1, yp1)) {
        par[xp][yp].first = xp1;
        par[xp][yp].second = yp1;
        size[xp1][yp1] += size[xp][yp];
      }
    }
    if (came[x - 1][y] && valid(x - 1, y)) {
      xp = find(x, y).first;
      yp = find(x, y).second;
      xp1 = find(x - 1, y).first;
      yp1 = find(x - 1, y).second;
      if (make_pair(xp, yp) != make_pair(xp1, yp1)) {
        par[xp][yp].first = xp1;
        par[xp][yp].second = yp1;
        size[xp1][yp1] += size[xp][yp];
      }
    }
    if (came[x][y + 1] && valid(x, y + 1)) {
      xp = find(x, y).first;
      yp = find(x, y).second;
      xp1 = find(x, y + 1).first;
      yp1 = find(x, y + 1).second;
      if (make_pair(xp, yp) != make_pair(xp1, yp1)) {
        par[xp][yp].first = xp1;
        par[xp][yp].second = yp1;
        size[xp1][yp1] += size[xp][yp];
      }
    }
    if (came[x][y - 1] && valid(x, y - 1)) {
      xp = find(x, y).first;
      yp = find(x, y).second;
      xp1 = find(x, y - 1).first;
      yp1 = find(x, y - 1).second;
      if (make_pair(xp, yp) != make_pair(xp1, yp1)) {
        par[xp][yp].first = xp1;
        par[xp][yp].second = yp1;
        size[xp1][yp1] += size[xp][yp];
      }
    }
    came[x][y] = 1;
    xp = find(x, y).first;
    yp = find(x, y).second;
    if (size[xp][yp] >= k / val && k % val == 0) {
      cout << "YES"
           << "\n";
      need = k / val;
      dfs(x, y);
      f = 1;
      break;
    }
  }
  if (!f) {
    cout << "NO"
         << "\n";
    return 0;
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      if (visit[i][j])
        cout << val << " ";
      else
        cout << "0"
             << " ";
    }
    cout << "\n";
  }
  return 0;
}
