Fake Scoreboard

Time limit2sMemory limit128 MB

Problem

As you may know, after the award ceremony of SWERC it is customary to publish a complete scoreboard with detailed information on the submissions and the verdicts received. However, because of a buggy contest management system, most of the relevant data are not being recorded today. Such a state of affairs clearly fails to meet the high standards we are committed to, so the judges have resolved to make up the rest of the data from whatever shreds of information are left, hoping the contestants are unable to tell the difference. To make our lives even simpler, we kindly ask you to provide a solution for us; otherwise today's scoreboard will remain forever veiled in mystery (even the fake one).

By the end of the contest we will know the number $T$ of teams, the number $P$ of problems, and the number of accepted submissions by each team. From the number and colour of the balloons floating around the premises we will also be able to infer how many teams solved each problem. Your task is to figure out which teams solved which problems.

Our counting skills are not up to par, so your program must be able to detect when the collected data cannot correspond to any scoreboard at all (the first case of the sample input is such an instance). Otherwise you should output a possible solution, given as a sequence of $T$ strings of $P$ characters each. Teams and problems are assigned distinct integers, from $1$ to $T$ and from $1$ to $P$ respectively. For team number $i$ ($1 \le i \le T$), write a string over the alphabet {N, Y} whose $j$-th ($1 \le j \le P$) character is Y if team $i$ got problem $j$ accepted, and N otherwise.

For example, the following three strings form a solution to the second case of the sample input, where the scores of three teams are $2$, $1$, $2$ and the counts of accepted submissions for three problems are $1$, $2$, $2$:

NYY
NNY
YYN

There is at least one other solution, namely

NYY
NYN
YNY

When several solutions are possible, output the one giving rise to the lexicographically smallest string when the $T$ rows are concatenated in order. In the example above we prefer the first solution, since NYYNNYYYN comes before NYYNYNYNY in lexicographical order. (A string $S$ comes before $S'$ in lexicographical order if, at the first position where they differ, $S$ has N and $S'$ has Y.)

Input

The input contains several test cases. Each test case consists of three lines:

  • The first line has two space-separated integers $T$ and $P$ ($1 \le T, P \le 80$), the number of teams and the number of problems.
  • The second line has $T$ space-separated integers, each between $0$ and $90$ inclusive; the $i$-th is the number of problems solved by team $i$.
  • The third line has $P$ space-separated integers, each between $0$ and $90$ inclusive; the $j$-th is the number of teams that solved problem $j$.

Consecutive test cases are separated by a blank line. The input ends with a line containing 0 0.

Output

For each test case, if the data admits a scoreboard, print $T$ lines of $P$ characters each: the lexicographically smallest valid scoreboard as described above. Otherwise print a single line containing Impossible. Print a blank line between the outputs of consecutive test cases.