#include <bits/stdc++.h>
using namespace std;
long long H[1111][1111];
bool R[1111][1111];
priority_queue<pair<long long, pair<int, int> > > Q;
inline int pos(int x, int y) { return (x << 10) + y; }
int dsu[1111111], dsz[1111111];
int F(int u) { return dsu[u] == u ? u : (dsu[u] = F(dsu[u])); }
void join(int u, int v) {
  int u0 = F(u), v0 = F(v);
  if (u0 != v0) {
    dsz[u0] += dsz[v0];
    dsz[v0] = 0;
    dsu[v0] = u0;
  }
}
int dx[4] = {0, 0, 1, -1}, dy[4] = {1, -1, 0, 0};
int n, m, ms, needed;
long long k;
void ff(int x, int y) {
  if (needed <= 0 || R[x][y] || F(pos(x, y)) != ms) return;
  needed--;
  R[x][y] = 1;
  for (int i = 0; i < 4; i++) ff(x + dx[i], y + dy[i]);
}
int main() {
  std::ios::sync_with_stdio(false);
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      dsu[pos(i, j)] = pos(i, j);
      dsz[pos(i, j)] = 1;
      cin >> H[i][j];
      Q.push(make_pair(H[i][j], make_pair(i, j)));
    }
  while (Q.size()) {
    auto T = Q.top();
    Q.pop();
    int X = T.second.first, Y = T.second.second;
    for (int i = 0; i < 4; i++) {
      int X1 = X + dx[i], Y1 = Y + dy[i];
      if (H[X1][Y1] >= H[X][Y]) join(pos(X, Y), pos(X1, Y1));
    }
    if (k % T.first == 0)
      if (dsz[F(pos(X, Y))] * T.first >= k) {
        cout << "YES" << endl;
        ms = F(pos(X, Y));
        needed = k / T.first;
        ff(X, Y);
        for (int i = 1; i <= n; i++) {
          for (int j = 1; j <= m; j++)
            cout << (R[i][j] ? T.first : R[i][j]) << " ";
          cout << endl;
        }
        return 0;
      }
  }
  cout << "NO" << endl;
}
