There are $n$ islands in the world Lotus lives.Each island has a probability $p_i$ and a list consists of some other islands.
Lotus came to island 1 at first.She will repeat the following operations:
1ˇ˘Assume Lotus is in island $x$,there is a probability of $ p_x $ that produces an undirected edge connecting two random islands.The two islands will not be the same, nor will they already be connected by an edge.
2ˇ˘Lotus will leave contentedly if all the islands have been connected.
3ˇ˘Otherwise,she will choose an random island from the current island's list and go there.Her dissatisfied value will be increased by 1.
Lotus wants you to calculate the expected value of her dissatisfied value.
The $p_i$ is given in the prime field of integers modulo $10^9+7$.You should output the answer modulo $10^9+7$,too.
Input
First line a integer $T(0 \leq T \leq 10)$ denoting the number of test cases.
For each test case,first line is an integer $n(1 \leq n \leq 30)$,in the second line there are $n$ integers denoting $p_i$.Each of the next $n$ lines contains an integer $x$ followed by $x$ integers describing the island's list.
It is guaranteed that for each island,its list doesn't contain two same islands,nor do itself.
Output
For each test case,output one line containing a single integer,denoting the answer modulo $10^9+7$.