G. Color Contagion
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
I love the lotus because while growing from mud, it is unstained.
— Zhou Dunyi, On the Love of the Lotus

TN was gifted a tree of $$$n$$$ vertices with the root in the vertex $$$1$$$. A tree is a connected undirected graph without cycles.

Initially, the root has already been colored, and he wanted to color all the vertices using the operation below.

During one operation, TN can choose one uncolored vertex whose parent has already been colored and color it.

It can be shown that after $$$n-1$$$ operations, all the vertices will be colored.

Let $$$p_i$$$ be the chosen vertex of the $$$i$$$-th operation. If TN can color all vertices in this way, then the array $$$p$$$ is called Valid.

Count the number of different Valid arrays modulo $$$998244353$$$.

Input

The first line contains a single integer $$$t$$$ $$$(1 \leq t \leq 10 ^ 4)$$$, denoting the number of test cases.

The first line of each test case contains a single integer $$$n$$$ $$$(1 \leq n \leq 10 ^ 5)$$$.

The $$$i$$$-th of the next $$$n-1$$$ lines contains two integers $$$u_i$$$, $$$v_i$$$ $$$(1 \leq u_i, v_i \leq n)$$$, denoting the indices of vertices connected by the $$$i$$$-th edge.

It's guaranteed that the sum of $$$n$$$ over all test cases doesn't exceed $$$2 \times 10 ^ 5$$$.

Output

For each test case, output a single integer, denoting the number of different Valid arrays modulo $$$998244353$$$.

Example
Input
4
3
1 2
1 3
4
1 2
2 3
3 4
1
6
1 2
1 3
2 4
2 5
3 6
Output
2
1
1
20
Note

In the first test case, there are two arrays that satisfy the condition: $$$p_1 = \{2, 3\}, p_2 = \{3, 2\}$$$, which means TN can color the vertex $$$2$$$ at first and then color the vertex $$$3$$$, or he can color the vertex $$$3$$$ at first and then color the vertex $$$2$$$.

Case 1Case 2Case 3

In the second test case, it can be shown that only one array satisfies the condition: $$$p=\{2,3,4\}$$$, which means TN can color the vertex $$$2$$$ at first, then color the vertex $$$3$$$, and at last, color the vertex $$$4$$$.

In the third test case, note that the empty array is also Valid.

Case 4