#include <bits/stdc++.h>
using namespace std;
int H[1005][1005], m, n;
long long k;
bool seen[1005][1005];
vector<pair<int, int> > buffer, ba;
int ans[1005][1005];
int hn, cn;
bool comp(pair<int, int> a, pair<int, int> b) {
  return H[a.first][a.second] < H[b.first][b.second];
}
int di[] = {0, 0, 1, -1};
int dj[] = {1, -1, 0, 0};
bool dfs(int first, int second) {
  seen[first][second] = true;
  ba.push_back(make_pair(first, second));
  cn--;
  if (cn == 0) {
    return true;
  }
  for (int t = 0; t < int(4); t++) {
    int i = first + di[t], j = second + dj[t];
    if (i < 0 || i >= m || j < 0 || j >= n) {
      continue;
    }
    if (!seen[i][j] && H[i][j] >= hn) {
      if (dfs(i, j)) {
        return true;
      }
    }
  }
  return false;
}
int main() {
  std::ios_base::sync_with_stdio(false);
  cin >> m >> n >> k;
  for (int i = 0; i < int(m); i++) {
    for (int j = 0; j < int(n); j++) {
      cin >> H[i][j];
      if (k % H[i][j] == 0) {
        buffer.push_back(make_pair(i, j));
      }
    }
  }
  sort((buffer).begin(), (buffer).end(), comp);
  for (int i = 0; i < int(int((buffer).size())); i++) {
    int j = i, h = H[buffer[i].first][buffer[i].second];
    memset(seen, false, sizeof(seen));
    while (j < int((buffer).size()) &&
           H[buffer[j].first][buffer[j].second] == h) {
      hn = h, cn = k / h;
      ba.clear();
      if (dfs(buffer[j].first, buffer[j].second)) {
        cout << "YES\n";
        for (auto first : (ba)) {
          ans[first.first][first.second] = h;
        }
        for (int i = 0; i < int(m); i++) {
          for (int j = 0; j < int(n); j++) {
            cout << ans[i][j] << " ";
          }
          cout << "\n";
        }
        return 0;
      }
      j++;
    }
    i = j - 1;
  }
  cout << "NO\n";
  return 0;
}
