K - White and Black

Languages: C, C++, Java, Python, Kotlin, C#
Time & Memory limits: (details)

You are given $n$ sets with $k$ different numbers each. Every pair of sets are different (i.e., there is at least one number that is in one set which is not in the other set). Every set must be colored either white or black in such a way that it is possible to solve the following puzzle:

One person secretly chooses one of the sets and reveals its color and $k - 1$ arbitrary numbers from this set. Another person must use this information to guess which is the missing number. Notice that the second person knows the color and the content of every set in advance.

The problem is to determine if there exists a way to color the sets such that the puzzle has a solution independently of the actions from the first person (i.e., the second person can always determine the missing number).

Input

The first line has two integers: $n$ and $k$ $(1 \le n \le 100, 1 \le k \le 10)$, the number of sets and total numbers per set.

Each of the following $n$ lines has $k$ numbers $v_i$ $(1 \le v_i \le 100)$, the elements of each set.

Output

On the first line, if there exists a solution, print the word $\texttt{"Yes"}$ (without quotes); otherwise print the word $\texttt{"No"}$ (without quotes).

If there is a solution, print a string on the second line with $n$ characters where the $i$-th character is 'W' if the set $i$ should be colored in white and 'B' if it should be colored in black. Any valid solution will be accepted.

Sample test(s)

Input
2 3 1 2 3 2 3 4
Output
Yes WB
Input
2 3 1 2 3 3 4 5
Output
Yes WW
Input
3 3 1 2 3 2 3 4 3 4 1
Output
No