The first line contains an integer T denoting the number of test cases.
For each test case:
The first line contains two integers L and n --- L represents the length of expression string and n represents the number of variables.
The second line contains one string consisting of variables and +, −, ∗, ().
The third line contains n integers, which are the values of xi.
The fourth line contains a integer m denoting the number of query.
The i-th of the following m lines denotes the i-th query, which contains integers t,i1,i2,⋯,it.
It guarantees that:
T∈[1,20], xi∈[−108,108], L∈[1,105], ∑L∈[1,3×105].
n∈[1,104], ∑n∈[1,3×104], ∑t∈[1,107], ∑m∈[0,8×105].