I. Initial Ideas
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Before we start telling this magnificent tale, we need a few definitions:

  • We say that a vector $$$\mathcal{P}$$$ is a permutation if each of the 26 letters of the alphabet appears in exactly one position of $$$\mathcal{P}$$$. For example, the vector $$$\mathcal{A} = (D, F, C, O, I, L, S, W, V, X, H, K, A, T, Q, M, R, Y, Z, J, B, E, U, N, G, P)$$$ is a permutation, while the vector $$$\mathcal{B} = (A, F, C, O, I, L, S, W, V, X, H, K, A, T, Q, M, R, Y, Z, J, B, E, U, N, G, A)$$$ is not, as the letter 'A' appears multiple times.
  • Let $$$L$$$ be the $$$\ell$$$-th letter of the alphabet and $$$\mathcal{P}$$$ a permutation. Then, we define $$$\mathcal{P}(L)$$$ as the $$$\ell$$$-th letter of $$$\mathcal{P}$$$. Using the example from the previous item, $$$\mathcal{A}$$$(D) $$$=$$$ O, because D is the fourth letter of the alphabet and O is the fourth letter in $$$\mathcal{A}$$$. Similarly, given a text $$$T$$$ and a permutation $$$\mathcal{P}$$$, we define $$$\mathcal{P}(T)$$$ as the resulting text obtained by applying $$$\mathcal{P}$$$ to each letter in $$$T$$$. For example, $$$\mathcal{A}$$$(EU AMO AC) $$$=$$$ IB DAQ DC.
  • Given a set of words $$$U$$$, we say that a text $$$T \in U*$$$ if $$$T$$$ contains only words from $$$U$$$. For instance, if $$$U = \{AC, SIM, CORRETO\}$$$, then the text SIM SIM AC belongs to $$$U*$$$, while the text AC WA AC does not.

Now we shall tell the story of the origin of competitive programming among humans. Legend has it that thousands of years ago, in ancient Nlogonia, the god Rárada constantly invented new problems and algorithms to solve them, sharing these ideas among the gods. It is known that the gods used very few words when communicating with each other, more specifically, the deities only used words from the set $$$U =$$$ {AC, AMOR, BRASILEIRO, CAVALO, MARATONUSP, OSSO, OVO, PATA, RARADA, TLE, VOO}; do not question why they chose these words, and, yes, the gods from Nlogonia spoke portuguese. Among these gods was Promethilio, who, amazed by these new ideas, believed that this knowledge should be passed on to humans. However, fearing that humans would become too powerful, he didn't convey exactly the same message as Rárada. Every time Promethilio heard a phrase $$$T \in U*$$$ from Rárada, he would choose a permutation $$$\mathcal{P}$$$ and send the text $$$\mathcal{P}(T)$$$ to the hero Morethor (perhaps you've heard of him in another question). Morethor would then transcribe the phrase $$$\mathcal{P}(T)$$$ onto stone tablets with the aim of disseminating these ideas and preserving competitive programming knowledge forever.

Otávio, the archaeologist, has found a stone tablet with a text $$$S$$$ and is extremely excited about the possibility of having discovered one of the ancient tablets written by Morethor containing Rárada's foundational ideas. He now needs your help to decide whether he has truly found a historical relic or just an ordinary text.

Input

The input consists of two lines. The first line contains an integer $$$N$$$. The second line contains the text $$$S$$$ written on the tablet. The text contains exactly $$$N$$$ words and $$$1 \leq |S| \leq 10^6$$$, meaning the text has between 1 and 1000000 characters. All characters are uppercase letters or whitespace. All words are separated by exactly one space.

Output

If there exists a text $$$T \in U*$$$ and a permutation $$$\mathcal{P}$$$ such that $$$\mathcal{P}(T) = S$$$, the output should consist of two lines: the first line should print "Y", and the second line should contain the permutation $$$\mathcal{P}$$$ in the format "$$$\mathcal{P}[1]\mathcal{P}[2] ... \mathcal{P}[26]$$$". If for any text $$$T \in U*$$$ and any permutation $$$\mathcal{P}$$$ we have $$$\mathcal{P}(T) \neq S$$$, then the output should be a single line containing "N".

Examples
Input
3
NBSBUPOVTQ PWP BD
Output
Y
BCDEFGHIJKLMNOPQRSTUVWXYZA
Input
2
BD CMOR
Output
N
Input
6
PSDETVXTSQ DHQS SDSDRD QEEQ ADKD DG
Output
Y
DPGRXBCFTIJVHLQAMSEKNOUWYZ
Input
2
OSSO PATA
Output
Y
ABCDEFGHIJKLMNOPQRSTUVWXYZ
Note

In the first test case, the phrase spoken by Rárada was MARATONUSP OVO AC. In the second test case, there is no permutation that would lead a phrase spoken by Rárada to the input text. In the third test case, the phrase spoken by Rárada was BRASILEIRO AMOR RARADA OSSO PATA AC.

For the positive cases, note that multiple permutations could be accepted as an answer.