#include <bits/stdc++.h>
using std::vector;
const int MOD = 998244353;
int n, f[500005][2], g[500005][2];
vector<int> e[500005];
inline int mval(int x) { return x >= MOD ? x - MOD : x; }
inline void inc(int &x, int a) { x = mval(x + a); }
inline void dec(int &x, int a) { x = mval(MOD + x - a); }
inline int qpow(int x, int p) {
  int ret = 1;
  while (p) {
    if (p & 1) ret = 1ll * ret * x % MOD;
    p >>= 1, x = 1ll * x * x % MOD;
  }
  return ret;
}
void dfs(int u, int fa) {
  f[u][0] = 1;
  for (int v : e[u])
    if (v != fa) {
      dfs(v, u);
      int t = g[u][1];
      g[u][1] = mval(2ll * g[u][1] * (f[v][0] + f[v][1]) % MOD +
                     2ll * f[u][1] * (g[v][0] + g[v][1]) % MOD);
      inc(g[u][1],
          mval(1ll * g[u][0] * f[v][0] % MOD + 1ll * f[u][0] * g[v][0] % MOD));
      inc(g[u][1], 1ll * f[u][0] * f[v][0] % MOD);
      g[u][0] = mval(1ll * g[u][0] * (f[v][0] + 2ll * f[v][1]) % MOD +
                     1ll * f[u][0] * (g[v][0] + 2ll * g[v][1]) % MOD);
      f[u][1] = mval(2ll * f[u][1] * (f[v][0] + f[v][1]) % MOD +
                     1ll * f[u][0] * f[v][0] % MOD);
      f[u][0] = f[u][0] * (2ll * f[v][1] + f[v][0]) % MOD;
    }
}
int main() {
  scanf("%d", &n);
  for (int i = 1, x, y; i < n; ++i)
    scanf("%d%d", &x, &y), e[x].push_back(y), e[y].push_back(x);
  dfs(1, 0);
  printf("%d\n", 2ll * mval(g[1][0] + g[1][1]) % MOD);
  return 0;
}

### Prompt

Please provide a cpp coded solution to the problem described below:

Let's define rank of undirected graph as rank of its adjacency matrix in R^{n × n}.

Given a tree. Each edge of this tree will be deleted with probability 1/2, all these deletions are independent. Let E be the expected rank of resulting forest. Find E ⋅ 2^{n-1} modulo 998244353 (it is easy to show that E ⋅ 2^{n-1} is an integer).

Input

First line of input contains n (1 ≤ n ≤ 5 ⋅ 10^{5}) — number of vertices.

Next n-1 lines contains two integers u v (1 ≤ u,    v ≤ n;    u ≠ v) — indices of vertices connected by edge.

It is guaranteed that given graph is a tree.

Output

Print one integer — answer to the problem.

Examples

Input

3
1 2
2 3


Output

6


Input

4
1 2
1 3
1 4


Output

14


Input

4
1 2
2 3
3 4


Output

18

### Response

```cpp
#include <bits/stdc++.h>
using std::vector;
const int MOD = 998244353;
int n, f[500005][2], g[500005][2];
vector<int> e[500005];
inline int mval(int x) { return x >= MOD ? x - MOD : x; }
inline void inc(int &x, int a) { x = mval(x + a); }
inline void dec(int &x, int a) { x = mval(MOD + x - a); }
inline int qpow(int x, int p) {
  int ret = 1;
  while (p) {
    if (p & 1) ret = 1ll * ret * x % MOD;
    p >>= 1, x = 1ll * x * x % MOD;
  }
  return ret;
}
void dfs(int u, int fa) {
  f[u][0] = 1;
  for (int v : e[u])
    if (v != fa) {
      dfs(v, u);
      int t = g[u][1];
      g[u][1] = mval(2ll * g[u][1] * (f[v][0] + f[v][1]) % MOD +
                     2ll * f[u][1] * (g[v][0] + g[v][1]) % MOD);
      inc(g[u][1],
          mval(1ll * g[u][0] * f[v][0] % MOD + 1ll * f[u][0] * g[v][0] % MOD));
      inc(g[u][1], 1ll * f[u][0] * f[v][0] % MOD);
      g[u][0] = mval(1ll * g[u][0] * (f[v][0] + 2ll * f[v][1]) % MOD +
                     1ll * f[u][0] * (g[v][0] + 2ll * g[v][1]) % MOD);
      f[u][1] = mval(2ll * f[u][1] * (f[v][0] + f[v][1]) % MOD +
                     1ll * f[u][0] * f[v][0] % MOD);
      f[u][0] = f[u][0] * (2ll * f[v][1] + f[v][0]) % MOD;
    }
}
int main() {
  scanf("%d", &n);
  for (int i = 1, x, y; i < n; ++i)
    scanf("%d%d", &x, &y), e[x].push_back(y), e[y].push_back(x);
  dfs(1, 0);
  printf("%d\n", 2ll * mval(g[1][0] + g[1][1]) % MOD);
  return 0;
}

```