#include <bits/stdc++.h>
using namespace std;
double pi = acos(-1);
const int N = 1100000;
vector<pair<int, pair<int, int> > > arr;
int board[1100][1100];
int pos[1100][1100];
int size[N];
int par[N];
bool visit[1100][1100];
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
int n, m;
long long k;
int cnt;
bool flag;
int find(int u) {
  if (u == par[u])
    return u;
  else
    return par[u] = find(par[u]);
}
int merge(int u, int v) {
  u = find(u), v = find(v);
  if (u == v) return -1;
  par[u] = v;
  size[v] += size[u];
  return size[v];
}
void dfs(int x, int y, int val) {
  if (cnt <= 0) return;
  cnt--;
  visit[x][y] = true;
  board[x][y] = val;
  int nx, ny;
  for (int j = 0; j < 4; j++) {
    nx = x + dx[j];
    ny = y + dy[j];
    if (nx >= 0 && nx < n && ny >= 0 && ny < m) {
      if (board[nx][ny] >= val && !visit[nx][ny]) {
        dfs(nx, ny, val);
      }
    }
  }
}
int main() {
  cin >> n >> m >> k;
  for (int i = 0; i < n * m; i++) {
    par[i] = i;
    size[i] = 1;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> board[i][j];
      arr.push_back(make_pair(board[i][j], make_pair(i, j)));
    }
  }
  sort(arr.begin(), arr.end());
  for (int i = arr.size() - 1; i >= 0; i--) {
    int x = arr[i].second.first;
    int y = arr[i].second.second;
    pos[x][y] = i;
  }
  for (int i = arr.size() - 1; i >= 0; i--) {
    int x = arr[i].second.first;
    int y = arr[i].second.second;
    visit[x][y] = true;
    if (k % arr[i].first == 0 && k / arr[i].first == 1) {
      cnt = k / arr[i].first;
      memset(visit, false, sizeof(visit));
      dfs(x, y, arr[i].first);
      flag = true;
      break;
    }
    int nx, ny;
    for (int j = 0; j < 4; j++) {
      nx = x + dx[j];
      ny = y + dy[j];
      if (nx >= 0 && nx < n && ny >= 0 && ny < m) {
        if (board[nx][ny] >= arr[i].first) {
          int s = merge(i, pos[nx][ny]);
          if (k % arr[i].first == 0 && k / arr[i].first <= s) {
            cnt = k / arr[i].first;
            memset(visit, false, sizeof(visit));
            dfs(x, y, arr[i].first);
            flag = true;
            break;
          }
        }
      }
    }
    if (flag) break;
  }
  if (flag) {
    cout << "YES\n";
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        if (!visit[i][j])
          cout << "0 ";
        else
          cout << board[i][j] << " ";
      }
      cout << "\n";
    }
  } else
    cout << "NO";
  return 0;
}
