K. An Incantation Long Remembered
time limit per test
3 seconds
memory limit per test
512 megabytes
input
standard input
output
standard output

You're given a list of abilities as an array of strings $$$s_1, s_2, \dots, s_n$$$. All characters of each ability will be unique to each other. You want to build a spell using these abilities. To make a spell these abilities can be inserted, appended, or prepended to the spell in multiple iterations. For example, let's consider the abilities are abc, def, and pqrt.

  1. "" (empty string)
  2. "abc" (abc is appended/prepended in the empty string)
  3. "adefbc" (def is inserted at index $$$1$$$ of the previous string)
  4. "adefbcpqrt" (pqrt is appended in the previous string)
  5. "pqrtadefbcpqrt" (pqrt is prepended in the previous string)
  6. "pqrtadefabcbcpqrt" (abc is inserted at index $$$7$$$ of the previous string)
  7. $$$\cdots$$$

And so on. The spells can be generated in many iterations. Each spell is valid except for the empty string at iteration $$$1$$$.

Now, given a spell, can you verify whether the spell is valid or not?

Input

The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of the test cases follows.

The first line of each test case contains an integer $$$n$$$ $$$\left(1 \leq n \leq 13\right)$$$ — the number of abilities.

The following $$$n$$$ lines of the test case will contain the ability strings $$$s_i$$$ $$$\left(1 \leq |s_i| \leq 26\right)$$$.

The last line of the test case will contain the spell $$$S$$$ consing of lowercase English letter $$$\left(1 \leq |S| \leq 10^5\right)$$$.

It is guaranteed that the sum of $$$|S|$$$ over all test cases doesn't exceed $$$10^5$$$.

Please note that, in each test case, all the characters of each ability will be unique to each other. In other words, no character appears twice among the abilities.

Output

For each test case, if it is impossible to construct such a spell, print "No".

Otherwise, print "Yes" in the first line. In the second line print the number of iterations required to create the spell using the abilities.

You can output the answer in any case (upper or lower). For example, the strings "yEs", "yes", "Yes", and "YES" will be recognized as positive responses.

Example
Input
2
3
abc
def
pqrt
pqrtadefbcpqrt
3
abc
def
pqrt
pqntadefbcpqrt
Output
Yes
5
No