题目描述
Problem Description
A directed graph with the following properties is called a Chain Graph:
- For distinct vertices $i,\ j,\ k$, if there are edges $i \rightarrow j$ and $j \rightarrow k$, then there is also an edge $i \rightarrow k$.
- When viewed as an undirected graph, it does not contain self-loops or multiple edges.
You are given a complete graph with $ N $ vertices consisting of undirected edges. The vertices are numbered from $ 1 $ to $ N $. Initially, $ N-1 $ edges are painted red and form a tree. The $ i $-th red edge connects vertices $ A_i $ and $ B_i $. The remaining edges are white.
You will perform the following operations sequentially to determine the color and direction of the edges in the graph:
- Paint each white edge either red or blue.
- Assign directions to all red and blue edges.
Find the number of possible graphs after these operations such that the graphs consisting of only red edges and only blue edges are both Chain Graphs, modulo $ 998244353 $.
Input Format
The input is given from the standard input in the following format:
$ N $ $ A_1 $ $ B_1 $ $\vdots$ $ A_{N-1} $ $ B_{N-1} $
Output Format
Output the answer.
Sample Input and Output
Sample Input #1
3
1 2
2 3
Sample Output #1
10
Sample Input #2
5
1 2
1 3
2 4
5 2
Sample Output #2
1304
Sample Input #3
10
1 2
1 3
4 2
2 5
3 6
6 7
8 7
9 5
5 10
Sample Output #3
793075136
Notes/Hints
Constraints
- All inputs are integers.
- $1 \le N \le 100$
- $1 \le A_i, B_i \le N$
- The graph formed by the red edges is a tree.
Sample Explanation 1
The following two graphs are examples of possible graphs: ![[MATH0]](https://img.atcoder.jp/utpc2021/d-2.png)
Sample Explanation 2
The following graph is considered: 
Sample Explanation 3
Output the answer modulo $ 998244353 $.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分