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.
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?
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.
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.
23abcdefpqrtpqrtadefbcpqrt3abcdefpqrtpqntadefbcpqrt
Yes 5 No