The first line contains a single integer $T$ ($1 \le T \le 5$), indicating the number of test cases. Then $T$ test cases follows.
The first line of each test case contains a single integer $n$ ($1 \le n \le 10^5$,$\sum n \le 2\times 10^6$), indicating the number of Trie nodes.
Lines through the second to the $n$-th ($n-1$ lines in total) describe Ken's Trie. The $i$-th line contains an integer $u$ $(1 \le u < i)$ and a lowercase latin letter $c$, which means that the father of node $i$ is node $u$ and the character on that edge is $c$. It is guaranteed that for each node, letters on edges connecting the node and its children are distinct.
The next line contains a single integer $m$ $(1 \le m \le 10^5,\sum m \le 2\times 10^6)$, indicating the number of operations.
The next $m$ lines describe all the operations. Each line describle one operation, and it is formatted in one of the two following formats, depends on the kind of it:
$\qquad \cdot$ "$1\ k\ x_{1}\ x_2\ \ldots \ x_k$'' - attach a new mark to the node set $\{x_1, x_2, \ldots, x_k\}$, where all the $x_i$ are distinct.
$\qquad \cdot$ "$2\ x$'' - query for how many mark properties node $x$ can match.