#include <bits/stdc++.h>
using namespace std;
int dx[5], dy[5];
int dem = 0;
int n, m, p[2000000], fr[2000000], check[2000000];
long long k;
long long res;
int res2;
bool ex = false;
typedef struct {
  long long data;
  int id;
} ii;
ii a[1000010];
typedef struct {
  int x, y;
} xy;
xy findxy(int k) {
  xy res;
  res.x = (k - 1) / n + 1;
  res.y = (k - 1) % n + 1;
  return res;
}
int findpos(int i, int j) { return (i - 1) * n + j; }
void input() {
  cin >> m >> n >> k;
  for (int i = 1; i <= m; i++)
    for (int j = 1; j <= n; j++) {
      int t = findpos(i, j);
      cin >> a[t].data;
      a[t].id = t;
    }
}
int findset(int u) {
  int res;
  if (p[u] < 0)
    res = u;
  else {
    res = findset(p[u]);
    p[u] = res;
  }
  return res;
}
void Union(int r, int s) {
  int x = p[r] + p[s];
  if (p[r] > p[s]) {
    p[r] = s;
    p[s] = x;
  } else {
    p[s] = r;
    p[r] = x;
  }
}
bool cmp(ii a, ii b) { return a.data > b.data; }
void visit(int x, int y) {
  if (ex == true) return;
  check[findpos(x, y)] = 1;
  dem++;
  if (dem == k / res) {
    ex = true;
    return;
  }
  if (x + 1 <= m and check[findpos(x + 1, y)] == 0 and
      fr[findpos(x + 1, y)] == 1)
    visit(x + 1, y);
  if (x - 1 >= 1 and check[findpos(x - 1, y)] == 0 and
      fr[findpos(x - 1, y)] == 1)
    visit(x - 1, y);
  if (y + 1 <= n and check[findpos(x, y + 1)] == 0 and
      fr[findpos(x, y + 1)] == 1)
    visit(x, y + 1);
  if (y - 1 >= 1 and check[findpos(x, y - 1)] == 0 and
      fr[findpos(x, y - 1)] == 1)
    visit(x, y - 1);
}
void solve() {
  for (int i = 1; i <= m * n; i++) p[i] = -1;
  sort(a + 1, a + (1 + m * n), cmp);
  dx[1] = 0;
  dx[2] = 0;
  dx[3] = -1;
  dx[4] = 1;
  dy[1] = -1;
  dy[2] = 1;
  dy[3] = 0;
  dy[4] = 0;
  bool ok = false;
  for (int i = 1; i <= m * n; i++) {
    int id = a[i].id;
    xy tmp = findxy(id);
    fr[id] = 1;
    xy t;
    for (int u = 1; u <= 4; u++) {
      t.x = tmp.x + dx[u];
      t.y = tmp.y + dy[u];
      if (t.x > 0 and t.x <= m and t.y > 0 and t.y <= n) {
        int id2 = findpos(t.x, t.y);
        if (fr[id2] == 1) {
          int pp = findset(id), qq = findset(id2);
          if (pp != qq) Union(pp, qq);
        }
      }
    }
    int pp = findset(id);
    if (k / a[i].data <= -p[pp] and k % a[i].data == 0) {
      ok = true;
      res = a[i].data;
      res2 = id;
      break;
    }
  }
  if (ok == false)
    cout << "NO";
  else {
    cout << "YES\n";
    xy tmp = findxy(res2);
    dem = 0;
    visit(tmp.x, tmp.y);
    for (int i = 1; i <= m; i++) {
      for (int j = 1; j <= n; j++)
        if (check[findpos(i, j)] == 1)
          cout << res << " ";
        else
          cout << "0 ";
      cout << endl;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  input();
  solve();
  return 0;
}
