Problem: Even polar bears feel cold when lying on the ice. Therefore, a polar bear Alice is going to make a carpet. The carpet can be viewed as a grid with height h and width w. Then the grid is divided into h × w squares. Alice is going to assign one of k different colors to each square. The colors are numbered from 1 to k. She may choose not to use all of the colors.

However, there are some restrictions. For every two adjacent squares (squares that shares an edge) x and y, there is a color constraint in one of the forms: 

  * color(x) = color(y), or 
  * color(x) ≠ color(y). 



Example of the color constraints:

<image>

Ideally, Alice wants to satisfy all color constraints. But again, life in the Arctic is hard. It is not always possible to satisfy all color constraints. Fortunately, she will still be happy if at least <image> of the color constraints are satisfied. 

If she has 4 colors she can color the carpet in the following way:

<image>

And she is happy because <image> of the color constraints are satisfied, and <image>. Your task is to help her color the carpet.

Input

The first line contains three integers h, w, k (2 ≤ h, w ≤ 1000, 1 ≤ k ≤ w·h).

The next 2h - 1 lines describe the color constraints from top to bottom, left to right. They contain w - 1, w, w - 1, w, ..., w - 1 characters respectively. Each color constraint is represented by a character "E" or "N", where "E" means " = " and "N" means " ≠ ".

The color constraints listed in the order they are depicted on the picture.

Output

If there is a coloring that satisfies at least <image> of the color constraints, print "YES" (without quotes) in the first line. In each of the next h lines, print w integers describing the coloring.

Otherwise, print "NO" (without quotes).

Examples

Input

3 4 4
ENE
NNEE
NEE
ENEN
ENN


Output

YES
1 1 2 2
3 4 1 1
3 3 2 4

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void gn(T &x) {
  char c, sg = 0;
  while (c = getchar(), (c > '9' || c < '0') && c != '-')
    ;
  for ((c == '-' ? sg = 1, c = getchar() : 0), x = 0; c >= '0' && c <= '9';
       c = getchar())
    x = (x << 1) + (x << 3) + c - '0';
  if (sg) x = -x;
}
template <class T>
inline void print(T x) {
  if (x < 0) {
    putchar('-');
    return print(-x);
  }
  if (x < 10) {
    putchar('0' + x);
    return;
  }
  print(x / 10);
  putchar(x % 10 + '0');
}
char s[2222][2222], t[2222][2222];
int ans[2222][2222];
int n, m, k;
int flag;
int st[2222];
int good() {
  puts("YES");
  if (flag)
    for (int i = 0; i < m; i++, puts(""))
      for (int j = 0; j < n; j++, putchar(' ')) print(ans[j][i] + 1);
  else
    for (int i = 0; i < n; i++, puts(""))
      for (int j = 0; j < m; j++, putchar(' ')) print(ans[i][j] + 1);
  exit(0);
}
int bad() {
  puts("NO");
  exit(0);
}
int solve1() {
  int tot = 0, yes = 0;
  for (int i = 0; i < 2 * n - 1; i++) {
    for (int j = 0; s[i][j]; j++) {
      if (s[i][j] == 'E') yes++;
      tot++;
    }
  }
  if (4 * yes < tot * 3) return bad();
  good();
}
int calc(int u, char C) {
  if (C == 'E')
    return u;
  else
    return u ^ 1;
}
void tryout(int u, int v) {
  int res = 0;
  for (int i = 0; i < m; i++) {
    if (!i)
      ans[v][0] = ans[u][0];
    else
      ans[u][i] = calc(ans[u][i - 1], s[u * 2][i - 1]),
      ans[v][i] = calc(ans[v][i - 1], s[v * 2][i - 1]);
    if (calc(ans[u][i], s[u * 2 + 1][i]) == ans[v][i]) res++;
  }
  if (res * 2 < m) {
    for (int i = 0; i < m; i++) ans[v][i] ^= 1;
  }
}
int jiejue() {
  ans[0][0] = 0;
  for (int i = 1; i < m; i++) ans[0][i] = calc(ans[0][i - 1], s[0][i - 1]);
  for (int i = 0; i < n - 1; i++) {
    tryout(i, i + 1);
  }
  return good();
  ;
}
int solve() {
  gn(n);
  gn(m);
  gn(k);
  for (int i = 0; i < 2 * n - 1; i++) scanf("%s", s[i]);
  if (k == 1) return solve1();
  if (n <= m) return jiejue();
  for (int i = 0; i < 2 * n - 1; i += 2) {
    for (int j = 0; j < m - 1; j++) t[j * 2 + 1][i / 2] = s[i][j];
  }
  for (int i = 1; i < 2 * n - 1; i += 2) {
    for (int j = 0; j < m; j++) t[j * 2][i / 2] = s[i][j];
  }
  swap(n, m);
  for (int i = 0; i < n * 2 - 1; i++) {
    t[i][m + (i & 1) - 1] = 0;
    for (int j = 0; t[i][j]; j++) s[i][j] = t[i][j];
    s[i][m + (i & 1) - 1] = 0;
  }
  flag = 1;
  return jiejue();
}
int main() {
  solve();
  return 0;
}