Haven't you ever thought that an ordinary flat keyboard is boring, and you can come up with something more interesting?
A little boy named Kevin came up with a keyboard with $$$n$$$ unusual keys. Each key $$$i$$$ initially contains a sequence of letters: $$$L_{i, 1}, L_{i, 2}, \ldots, L_{i, |L_{i}|}$$$. Some letters in this sequence can be equal. Each letter is one of the first $$$e$$$ lowercase English letters.
Every time key $$$i$$$ is pressed, the first letter of its sequence is typed and immediately moved to the end of the sequence. Thus, the first time key $$$i$$$ is pressed, letter $$$L_{i, 1}$$$ is typed, and the sequence becomes $$$L_{i, 2}, \ldots, L_{i, |L_{i}|}, L_{i, 1}$$$. The second time key $$$i$$$ is pressed, letter $$$L_{i, 2}$$$ is typed, and the sequence becomes $$$L_{i, 3}, \ldots, L_{i, |L_{i}|}, L_{i, 1}, L_{i, 2}$$$, and so on.
For example, suppose that key $$$1$$$ contains the sequence 'a', 'b', 'a', and key $$$2$$$ contains the sequence 'c', 'd'. Then, if you press keys $$$2, 1, 2, 2, 1, 1, 1, 2$$$ in this order, the string "cadcbaad" will be typed.
Help Kevin understand how useful his keyboard is, and find the shortest possible string consisting of the first $$$e$$$ lowercase English letters that cannot be typed with such a keyboard from the given initial state.
The first line contains two integers $$$n$$$ and $$$e$$$, denoting the number of keys and the size of the alphabet ($$$1 \le n \le 100$$$; $$$2 \le e \le 26$$$).
The $$$i$$$-th of the following $$$n$$$ lines consists of characters $$$L_{i,1}, L_{i,2}, \ldots, L_{i, |L_i|}$$$, denoting the sequence of letters key $$$i$$$ initially contains ($$$1 \le |L_{i}| \le 10$$$). Every character is one of the first $$$e$$$ lowercase English letters.
Print the shortest possible string, consisting of the first $$$e$$$ lowercase English letters, that can not be typed using Kevin's keyboard from the initial state. If there are multiple shortest strings, print any of them.
If any string can be typed, print a single string "NO" instead.
1 26win
f
3 3abcbcacab
aa
4 2aabbbabab
NO
In the first test, the only strings that can be typed with Kevin's keyboard are prefixes of "winwinwinwin...". Since you can not start the string with any letter other than 'w', any lowercase English letter except 'w' is a correct answer.
In the second test, "bb" and "cc" are other possible answers.