Problem: The farmer Polycarp has a warehouse with hay, which can be represented as an n × m rectangular table, where n is the number of rows, and m is the number of columns in the table. Each cell of the table contains a haystack. The height in meters of the hay located in the i-th row and the j-th column is equal to an integer ai, j and coincides with the number of cubic meters of hay in the haystack, because all cells have the size of the base 1 × 1. Polycarp has decided to tidy up in the warehouse by removing an arbitrary integer amount of cubic meters of hay from the top of each stack. You can take different amounts of hay from different haystacks. Besides, it is allowed not to touch a stack at all, or, on the contrary, to remove it completely. If a stack is completely removed, the corresponding cell becomes empty and no longer contains the stack.

Polycarp wants the following requirements to hold after the reorganization:

  * the total amount of hay remaining in the warehouse must be equal to k, 
  * the heights of all stacks (i.e., cells containing a non-zero amount of hay) should be the same, 
  * the height of at least one stack must remain the same as it was, 
  * for the stability of the remaining structure all the stacks should form one connected region. 



The two stacks are considered adjacent if they share a side in the table. The area is called connected if from any of the stack in the area you can get to any other stack in this area, moving only to adjacent stacks. In this case two adjacent stacks necessarily belong to the same area.

Help Polycarp complete this challenging task or inform that it is impossible.

Input

The first line of the input contains three integers n, m (1 ≤ n, m ≤ 1000) and k (1 ≤ k ≤ 1018) — the number of rows and columns of the rectangular table where heaps of hay are lain and the required total number cubic meters of hay after the reorganization. 

Then n lines follow, each containing m positive integers ai, j (1 ≤ ai, j ≤ 109), where ai, j is equal to the number of cubic meters of hay making the hay stack on the i-th row and j-th column of the table.

Output

In the first line print "YES" (without quotes), if Polycarpus can perform the reorganisation and "NO" (without quotes) otherwise. If the answer is "YES" (without quotes), then in next n lines print m numbers — the heights of the remaining hay stacks. All the remaining non-zero values should be equal, represent a connected area and at least one of these values shouldn't be altered.

If there are multiple answers, print any of them.

Examples

Input

2 3 35
10 4 9
9 9 7


Output

YES
7 0 7 
7 7 7 


Input

4 4 50
5 9 1 1
5 1 1 5
5 1 5 5
5 5 7 1


Output

YES
5 5 0 0 
5 0 0 5 
5 0 5 5 
5 5 5 0 


Input

2 4 12
1 1 3 1
1 6 2 4


Output

NO

Note

In the first sample non-zero values make up a connected area, their values do not exceed the initial heights of hay stacks. All the non-zero values equal 7, and their number is 5, so the total volume of the remaining hay equals the required value k = 7·5 = 35. At that the stack that is on the second line and third row remained unaltered.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
struct Poll {
  long long x, y;
  bool operator<(const Poll &T) const {
    if (x == T.x) return (y < T.y);
    return (x < T.x);
  }
};
struct Matrix {
  long long d[4][4];
  long long mod;
  Matrix operator*(const Matrix &A) const {
    Matrix ans;
    ans.mod = mod;
    for (long long i = 0; i <= 3; i++)
      for (long long j = 0; j <= 3; j++) ans.d[i][j] = 0;
    for (long long i = 0; i <= 3; i++) {
      for (long long j = 0; j <= 3; j++) {
        for (long long k = 0; k <= 3; k++) {
          ans.d[i][j] += (A.d[i][k] * d[k][j]);
          ans.d[i][j] %= mod;
        }
      }
    }
    return ans;
  }
  Matrix operator^(const long long n) const {
    Matrix ans;
    ans.mod = mod;
    for (long long i = 0; i <= 3; i++)
      for (long long j = 0; j <= 3; j++) ans.d[i][j] = d[i][j];
    if (n == 1) return ans;
    Matrix t = ans ^ (n / 2);
    if (n % 2 == 0) return (t * t);
    return (t * t * ans);
  }
};
double INF = 1e100;
double EPS = 1e-7;
struct PT {
  double x, y;
  PT() {}
  PT(double x, double y) : x(x), y(y) {}
  PT(const PT &p) : x(p.x), y(p.y) {}
  PT operator-(const PT &p) { return PT(x - p.x, y - p.y); }
  PT operator+(const PT &p) { return PT(x + p.x, y + p.y); }
  PT operator*(double c) { return PT(x * c, y * c); }
  PT operator/(double c) { return PT(x / c, y / c); }
  bool operator==(const PT &p) { return x == p.x && y == p.y; }
  bool operator!=(const PT &p) { return x != p.x || y != p.y; }
};
double dot(PT p, PT q) { return p.x * q.x + p.y * q.y; }
double dist2(PT p, PT q) { return dot(p - q, p - q); }
double cross(PT p, PT q) { return p.x * q.y - p.y * q.x; }
ostream &operator<<(ostream &os, const PT &p) {
  os << "(" << p.x << "," << p.y << ")";
}
PT RotateCCW90(PT p) { return PT(-p.y, p.x); }
PT RotateCW90(PT p) { return PT(p.y, -p.x); }
PT RotateCCW(PT p, double t) {
  return PT(p.x * cos(t) - p.y * sin(t), p.x * sin(t) + p.y * cos(t));
}
PT RotateCCW90(PT origin, PT pt) {
  pt = pt - origin;
  pt = RotateCCW90(pt);
  pt = pt + origin;
  return pt;
}
bool isSquare(PT pt1, PT pt2, PT pt3, PT pt4) {
  PT center = pt1 + pt2 + pt3 + pt4;
  center = center * 0.25;
  if (center == pt1) return false;
  PT pt = RotateCCW90(center, pt1);
  if (pt != pt2 && pt != pt3 && pt != pt4) return false;
  pt = RotateCCW90(center, pt);
  if (pt != pt2 && pt != pt3 && pt != pt4) return false;
  pt = RotateCCW90(center, pt);
  if (pt != pt2 && pt != pt3 && pt != pt4) return false;
  return true;
}
bool isRectangle(PT pt1, PT pt2, PT pt3, PT pt4) {
  PT center = pt1 + pt2 + pt3 + pt4;
  center = center * 0.25;
  if (center == pt1) return false;
  if (pt1 + pt2 == (center * 2.0) && pt3 + pt4 == (center * 2.0) &&
      dist2(pt1, pt2) == dist2(pt3, pt4))
    return true;
  if (pt1 + pt3 == (center * 2.0) && pt2 + pt4 == (center * 2.0) &&
      dist2(pt1, pt3) == dist2(pt2, pt4))
    return true;
  if (pt1 + pt4 == (center * 2.0) && pt2 + pt3 == (center * 2.0) &&
      dist2(pt1, pt4) == dist2(pt3, pt2))
    return true;
  return false;
}
double area(PT a, PT b, PT c) {
  PT ab = b - a, ac = c - a;
  return 0.5 * (abs(cross(ab, ac)));
}
PT ProjectPollLine(PT a, PT b, PT c) {
  return a + (b - a) * dot(c - a, b - a) / dot(b - a, b - a);
}
PT ProjectPollSegment(PT a, PT b, PT c) {
  double r = dot(b - a, b - a);
  if (fabs(r) < EPS) return a;
  r = dot(c - a, b - a) / r;
  if (r < 0) return a;
  if (r > 1) return b;
  return a + (b - a) * r;
}
double DistancePollPlane(double x, double y, double z, double a, double b,
                         double c, double d) {
  return fabs(a * x + b * y + c * z - d) / sqrt(a * a + b * b + c * c);
}
bool LinesParallel(PT a, PT b, PT c, PT d) {
  return fabs(cross(b - a, c - d)) < EPS;
}
bool LinesCollinear(PT a, PT b, PT c, PT d) {
  return LinesParallel(a, b, c, d) && fabs(cross(a - c, d - c)) < EPS;
}
bool Segmentsllersect(PT a, PT b, PT c, PT d) {
  if (cross(d - a, b - a) * cross(c - a, b - a) > 0) return false;
  if (cross(a - c, d - c) * cross(b - c, d - c) > 0) return false;
  return true;
}
PT ComputeLinellersection(PT a, PT b, PT c, PT d) {
  b = b - a;
  d = c - d;
  c = c - a;
  if (dot(b, b) < EPS) return a;
  if (dot(d, d) < EPS) return c;
  return a + b * cross(c, d) / cross(b, d);
}
PT ComputeCircleCenter(PT a, PT b, PT c) {
  b = (a + b) / 2;
  c = (a + c) / 2;
  return ComputeLinellersection(b, b + RotateCW90(a - b), c,
                                c + RotateCW90(a - c));
}
bool PollInPolygon(const vector<PT> &p, PT q) {
  bool c = 0;
  for (long long i = 0; i < p.size(); i++) {
    long long j = (i + 1) % p.size();
    if ((p[i].y <= q.y && q.y < p[j].y || p[j].y <= q.y && q.y < p[i].y) &&
        q.x < p[i].x + (p[j].x - p[i].x) * (q.y - p[i].y) / (p[j].y - p[i].y))
      c = !c;
  }
  return c;
}
bool PollOnPolygon(const vector<PT> &p, PT q) {
  for (long long i = 0; i < p.size(); i++)
    if (dist2(ProjectPollSegment(p[i], p[(i + 1) % p.size()], q), q) < EPS)
      return true;
  return false;
}
vector<PT> CircleLinellersection(PT a, PT b, PT c, double r) {
  vector<PT> ret;
  PT d = b - a;
  double D = cross(a - c, b - c);
  double e = r * r * dot(d, d) - D * D;
  if (e < 0) return ret;
  e = sqrt(e);
  ret.push_back(c + PT(D * d.y + (d.y >= 0 ? 1 : -1) * d.x * e,
                       -D * d.x + fabs(d.y) * e) /
                        dot(d, d));
  if (e > 0)
    ret.push_back(c + PT(D * d.y - (d.y >= 0 ? 1 : -1) * d.x * e,
                         -D * d.x - fabs(d.y) * e) /
                          dot(d, d));
  return ret;
}
vector<PT> CircleCirclellersection(PT a, PT b, double r, double R) {
  vector<PT> ret;
  double d = sqrt(dist2(a, b));
  if (d > r + R || d + min(r, R) < max(r, R)) return ret;
  double x = (d * d - R * R + r * r) / (2 * d);
  double y = sqrt(r * r - x * x);
  PT v = (b - a) / d;
  ret.push_back(a + v * x + RotateCCW90(v) * y);
  if (y > 0) ret.push_back(a + v * x - RotateCCW90(v) * y);
  return ret;
}
double dist(double xa, double ya, double xb, double yb) {
  xa -= xb;
  ya -= yb;
  return sqrt(xa * xa + ya * ya);
}
double angle(double ox, double oy, double ax, double ay, double bx, double by) {
  double a, b, c, alpha;
  a = dist(ax, ay, bx, by);
  b = dist(ox, oy, ax, ay);
  c = dist(ox, oy, bx, by);
  alpha = acos((a * a - b * b - c * c) / (-2.0 * b * c));
  return alpha;
}
pair<long long, long long> cha[1011][1011];
long long K;
long long a[1011][1011], n, m, t[1000011], ans[1011][1011], sl[1011][1011];
long long hi[4] = {0, 0, 1, -1};
long long hj[4] = {1, -1, 0, 0};
bool check(long long x, long long y) {
  return (x >= 1 && y >= 1 && x <= n && y <= m);
}
pair<long long, long long> getroot(pair<long long, long long> x) {
  if (cha[x.first][x.second] == x) return x;
  return cha[x.first][x.second] = getroot(cha[x.first][x.second]);
}
queue<pair<long long, long long> > q;
vector<pair<long long, long long> > f[1000011];
void bfs(pair<long long, long long> u, long long x) {
  q.push(u);
  long long sl = 1;
  pair<long long, long long> v;
  pair<long long, long long> u1 = u;
  ans[u.first][u.second] = K / x;
  while (sl < x) {
    u = q.front();
    for (long long i = 0; i <= 3; i++) {
      v.first = u.first + hi[i];
      v.second = u.second + hj[i];
      if (check(v.first, v.second) && !ans[v.first][v.second] &&
          a[v.first][v.second] >= K / x) {
        q.push(v);
        ans[v.first][v.second] = K / x;
        sl++;
        if (sl == x) return;
      }
    }
    q.pop();
  }
}
vector<long long> vt;
bool mark[1011][1011];
map<long long, long long> fx;
int main() {
  scanf("%I64d %I64d %I64d", &n, &m, &K);
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= m; j++) {
      scanf("%I64d", &a[i][j]);
      vt.push_back(a[i][j]);
    }
  }
  sort(vt.begin(), vt.end());
  vt.resize(distance(vt.begin(), unique(vt.begin(), vt.end())));
  for (long long i = 0; i <= (long long)vt.size() - 1; i++) {
    fx[vt[i]] = i;
    t[i] = vt[i];
  }
  for (long long i = 1; i <= n; i++)
    for (long long j = 1; j <= m; j++)
      f[fx[a[i][j]]].push_back(pair<long long, long long>(i, j));
  for (long long i = 1; i <= n; i++)
    for (long long j = 1; j <= m; j++) {
      cha[i][j] = pair<long long, long long>(i, j);
      sl[i][j] = 1;
    }
  pair<long long, long long> v;
  bool ok = 0;
  for (long long i = (long long)vt.size() - 1; i >= 0; i--) {
    for (long long j = 0; j <= (long long)f[i].size() - 1; j++) {
      long long x = f[i][j].first;
      long long y = f[i][j].second;
      v = pair<long long, long long>(x, y);
      if (K % a[x][y] == 0 && sl[v.first][v.second] >= K / a[x][y]) {
        ok = true;
        break;
      }
      mark[x][y] = 1;
      for (long long k = 0; k <= 3; k++) {
        long long x1 = x + hi[k];
        long long y1 = y + hj[k];
        if (check(x1, y1) && mark[x1][y1]) {
          pair<long long, long long> u =
              getroot(pair<long long, long long>(x1, y1));
          if (u != v) {
            cha[u.first][u.second] = v;
            sl[v.first][v.second] += sl[u.first][u.second];
          }
          if (K % a[x][y] == 0 && sl[v.first][v.second] >= K / a[x][y]) {
            ok = true;
          }
        }
        if (ok) break;
      }
      if (ok) break;
    }
    if (ok) break;
  }
  if (!ok) {
    cout << "NO";
    return 0;
  }
  cout << "YES" << endl;
  bfs(v, K / a[v.first][v.second]);
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= m; j++) printf("%I64d ", ans[i][j]);
    puts("");
  }
  return 0;
}