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 JAVA):

Solution:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class D1 {	
	BufferedReader reader;
    StringTokenizer tokenizer;
    PrintWriter out;
        
	public void solve() throws IOException {				
		int H = nextInt();
		int W = nextInt();
		int K = nextInt();
		
		boolean isFlip = K > 1 && W < H;
		if( isFlip) {
			int tmp = W; W = H; H = tmp;		
		}
		
		boolean[][] cH = new boolean[H][W-1];
		boolean[][] cV = new boolean[H-1][W];
		
		if( isFlip) {
			for(int i = 0; i < 2*W-1; i++)
				if( i % 2 == 0 ){
					for(int j = 0; j < H-1; j++)
						cV[j][i/2] = (char) reader.read() == 'E';
					reader.readLine();
				}
				else{
					for(int j = 0; j < H; j++)
						cH[j][i/2] = (char) reader.read() == 'E';
					reader.readLine();
				}
		}
		else{			
			for(int i = 0; i < 2*H-1; i++)
				if( i % 2 == 0 ){
					for(int j = 0; j < W-1; j++)
						cH[i/2][j] = (char) reader.read() == 'E';
					reader.readLine();
				}
				else{
					for(int j = 0; j < W; j++)
						cV[i/2][j] = (char) reader.read() == 'E';
					reader.readLine();
				}
		}
		
		

		
//		for(int i = 0; i < cH.length; i++){
//			for(int j = 0; j < cH[0].length; j++)
//				out.print( cH[i][j]? 'E': 'N' );
//			out.println();
//		}
//		out.println("----");
//		for(int i = 0; i < cV.length; i++){
//			for(int j = 0; j < cV[0].length; j++)
//				out.print( cV[i][j]? 'E': 'N' );
//			out.println();
//		}
		
		if( K == 1 ){
			int total = 0;
			for(int i = 0; i < cH.length; i++)
				for(int j = 0; j < cH[0].length; j++)
					if( cH[i][j] ) total++;
			
			for(int i = 0; i < cV.length; i++)
				for(int j = 0; j < cV[0].length; j++)
					if( cV[i][j] ) total++;
			
			if( ((double)total)/( (H-1)*W + (W-1)*H ) >= 3.0/4 ){
				out.println("YES");
				for(int i = 0; i < H; i++){
					for(int j = 0; j < W; j++)
						out.print(1 + " ");
					out.println();
				}
			}
			else{
				out.println("NO");
			}
			return;
		}
		
		out.println("YES");
		
		int[][] answer = new int[H][W];
		for(int i = 0; i < H; i++){
			answer[i][0] = 1;
			for(int j = 0; j < cH[0].length; j++){
				answer[i][j+1] = cH[i][j]? answer[i][j]: 3-answer[i][j];
			}
			
			if( i > 0 ){
				int correct = 0;
				for(int j = 0; j < W; j++){
					if( cV[i-1][j] && answer[i][j] == answer[i-1][j] )
						correct++;
					if( !cV[i-1][j] && answer[i][j] != answer[i-1][j] )
						correct++;
				}
				
				if( correct < W/2+W%2 ){
					for(int j = 0; j < W; j++)
						answer[i][j] = 3-answer[i][j];
				}
			}			
		}
		
		if( isFlip) {
			for(int j = 0; j < W; j++){
				for(int i = 0; i < H; i++)				
					out.print(answer[i][j] + " ");
				out.println();
			}
		}
		else{
			for(int i = 0; i < H; i++){
				for(int j = 0; j < W; j++)
					out.print(answer[i][j] + " ");
				out.println();
			}
		}
	}
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		new D1().run();
	}
	
	public void run() {
        try {
            reader = new BufferedReader(new InputStreamReader(System.in));
            tokenizer = null;
            out = new PrintWriter(System.out);
            solve();
            reader.close();
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    String nextToken() throws IOException {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
    }

}