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.*;
import	java.util.*;
public	class	Main{
	static	boolean[][]H,V,M;
	static	void	output(PrintWriter	out,int	n,int	m){
		int	x=-1,y;
		for(out.println("YES");n>++x;out.println())
			for(y=0;m>y;out.print((M[x][y++]?2:1)+" "));
	}
	static	boolean	oneColorFill(int	n,int	m){
		int	s=0,x=0,y;
		for(;n>x;++x)	for(y=0;m>y;++y)
			s+=(n-1>x&&V[x][y]?1:0)+(m-1>y&&H[x][y]?1:0);
		return	n*(m-1)+(n-1)*m>=s<<2;
	}
	static	void	HFirstFill(int	n,int	m){
		int	s,x=0,y=m-1;
		for(;0<y--;M[0][y]=H[0][y]^M[0][1+y]);
		while(n>++x){
			for(y=m-1,s=M[x-1][y]^V[x-1][y]^M[x][y]?2:0;0<y--;s+=M[x-1][y]^V[x-1][y]^(M[x][y]=H[x][y]^M[x][1+y])?2:0);
			if(m<s)	for(;m>++y;M[x][y]=!M[x][y]);
		}
	}
	static	void	VFirstFill(int	n,int	m){
		int	s,x=n-1,y=0;
		for(;0<x--;M[x][0]=V[x][0]^M[1+x][0]);
		while(m>++y){
			for(x=n-1,s=M[x][y-1]^H[x][y-1]^M[x][y]?2:0;0<x--;s+=M[x][y-1]^H[x][y-1]^(M[x][y]=V[x][y]^M[1+x][y])?2:0);
			if(n<s)	for(;n>++x;M[x][y]=!M[x][y]);
		}
	}
	public	static	void	main(String[]args){
		String	z;
		ScanReader	in=new	ScanReader(System.in);
		int	n=in.nextInt(),m=in.nextInt(),q=in.nextInt(),i=0,j;
		H=new	boolean[n][m-1];V=new	boolean[n-1][m];
		for(M=new	boolean[n][m];n-1>i;++i){
			for(z=in.next(),j=-1;m-1>++j;H[i][j]='E'!=z.codePointAt(j));
			for(z=in.next(),j=-1;m>++j;V[i][j]='E'!=z.codePointAt(j));
		}
		for(z=in.next(),j=-1;m-1>++j;H[i][j]='E'!=z.codePointAt(j));
		PrintWriter	out=new	PrintWriter(System.out);
		if(2>q)	if(oneColorFill(n,m))	output(out,n,m);else	out.print("NO");
		else{if(n<m)	HFirstFill(n,m);else	VFirstFill(n,m);output(out,n,m);}
		out.close();
	}
}
class	ScanReader{
	private	final	StreamTokenizer	st;
	public	ScanReader(Reader	in){
		if(null==in)	throw	new	NullPointerException();
		st=new	StreamTokenizer(new	BufferedReader(in));
	}
	public	ScanReader(InputStream	in){
		this(null!=in?new	InputStreamReader(in):null);
	}
	public	boolean	hasNext(){
		int	ttype=0;
		try{ttype=st.nextToken();}
		catch(IOException	e){throw	new	RuntimeException(e);}
		return	StreamTokenizer.TT_EOF!=ttype;
	}
	public	String	next(){
		if(!hasNext())	throw	new	NoSuchElementException();
		return	st.sval;
	}
	public	int	nextInt(){
		if(!hasNext())	throw	new	NoSuchElementException();
		return	(int)st.nval;
	}
}