Rikka has n sets S_1,S_2,…,S_n consisting of lowercase English letters. A pattern p_1p_2…p_m of length m is said to match the sets if there exists an index i such that all the following conditions hold: p_1∈S_i, p_2∈S_i+1, …, p_m∈S_i+m−1.
Initially, all sets are empty. Rikka has prepared some operations to make with the sets. Each operation has the form "add character c into set i". Each round, Rikka will choose a random operation with equal probability and apply it. A single operation may be chosen and applied more than once.
Find the expected number of rounds until the pattern p_1p_2…p_m matches the sets.
The first line contains an integer T which denotes the number of test cases (1≤T≤5).
For each test case, the first line contains two integers n and m (1≤m≤n≤30).
The i-th of the following n lines contains a string t_i consisting of lowercase English letters. Each letter t_i,j denotes an operation which adds this letter into set i. Each of these strings is non-empty and contains every possible letter at most once.
The last line of each test case contains the pattern: a string p_1p_2…p_m consisting of lowercase English letters.
For each test case, if the pattern will never match the sets, output "−1". Otherwise, output the integer (p⋅q−1)mod998,244,353, where qp is the expected number of rounds.
For the first sample test case, the expectation is 21⋅1+221⋅2+…=2.