#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
int head[500002], tot, n;
long long f[500002][2], g[500002][2];
inline long long rd() {
  long long x = 0;
  char c = getchar();
  bool f = 0;
  while (!isdigit(c)) {
    if (c == '-') f = 1;
    c = getchar();
  }
  while (isdigit(c)) {
    x = (x << 1) + (x << 3) + (c ^ 48);
    c = getchar();
  }
  return f ? -x : x;
}
inline void MOD(long long &x) { x = x >= mod ? x - mod : x; }
inline long long power(long long x, long long y) {
  long long ans = 1;
  while (y) {
    if (y & 1) ans = ans * x % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return ans;
}
struct edge {
  int n, to;
} e[500002 << 1];
inline void add(int u, int v) {
  e[++tot].n = head[u];
  e[tot].to = v;
  head[u] = tot;
}
void dfs(int u, int fa) {
  g[u][0] = 1;
  for (int i = head[u]; i; i = e[i].n)
    if (e[i].to != fa) {
      int v = e[i].to;
      dfs(v, u);
      long long f1 = 0, f0 = 0, g0 = 0, g1 = 0;
      MOD(f1 += g[u][0] * g[v][0] % mod);
      MOD(f1 += f[u][0] * g[v][0] % mod);
      MOD(f1 += g[u][0] * f[v][0] % mod);
      MOD(g1 += g[u][0] * g[v][0] % mod);
      MOD(f1 += f[u][1] * g[v][1] % mod);
      MOD(f1 += f[v][1] * g[u][1] % mod);
      MOD(g1 += g[v][1] * g[u][1] % mod);
      MOD(f1 += f[u][1] * g[v][0] % mod);
      MOD(f1 += f[v][0] * g[u][1] % mod);
      MOD(g1 += g[v][0] * g[u][1] % mod);
      MOD(f0 += f[u][0] * g[v][1] % mod);
      MOD(f0 += f[v][1] * g[u][0] % mod);
      MOD(g0 += g[u][0] * g[v][1] % mod);
      MOD(f0 += f[u][0] * g[v][0] % mod);
      MOD(f0 += f[v][0] * g[u][0] % mod);
      MOD(f0 += f[u][0] * g[v][1] % mod);
      MOD(f0 += f[v][1] * g[u][0] % mod);
      MOD(g0 += g[u][0] * g[v][0] % mod);
      MOD(g0 += g[u][0] * g[v][1] % mod);
      MOD(f1 += f[u][1] * g[v][0] % mod);
      MOD(f1 += f[v][0] * g[u][1] % mod);
      MOD(f1 += f[u][1] * g[v][1] % mod);
      MOD(f1 += f[v][1] * g[u][1] % mod);
      MOD(g1 += g[u][1] * g[v][0] % mod);
      MOD(g1 += g[u][1] * g[v][1] % mod);
      f[u][1] = f1;
      f[u][0] = f0;
      g[u][1] = g1;
      g[u][0] = g0;
    }
}
int main() {
  n = rd();
  int u, v;
  for (int i = 1; i < n; ++i) {
    u = rd();
    v = rd();
    add(u, v);
    add(v, u);
  }
  dfs(1, 0);
  cout << (f[1][1] + f[1][0]) * 2 % mod;
  return 0;
}

### Prompt

Generate a cpp solution to the following problem:

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 namespace std;
const int mod = 998244353;
int head[500002], tot, n;
long long f[500002][2], g[500002][2];
inline long long rd() {
  long long x = 0;
  char c = getchar();
  bool f = 0;
  while (!isdigit(c)) {
    if (c == '-') f = 1;
    c = getchar();
  }
  while (isdigit(c)) {
    x = (x << 1) + (x << 3) + (c ^ 48);
    c = getchar();
  }
  return f ? -x : x;
}
inline void MOD(long long &x) { x = x >= mod ? x - mod : x; }
inline long long power(long long x, long long y) {
  long long ans = 1;
  while (y) {
    if (y & 1) ans = ans * x % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return ans;
}
struct edge {
  int n, to;
} e[500002 << 1];
inline void add(int u, int v) {
  e[++tot].n = head[u];
  e[tot].to = v;
  head[u] = tot;
}
void dfs(int u, int fa) {
  g[u][0] = 1;
  for (int i = head[u]; i; i = e[i].n)
    if (e[i].to != fa) {
      int v = e[i].to;
      dfs(v, u);
      long long f1 = 0, f0 = 0, g0 = 0, g1 = 0;
      MOD(f1 += g[u][0] * g[v][0] % mod);
      MOD(f1 += f[u][0] * g[v][0] % mod);
      MOD(f1 += g[u][0] * f[v][0] % mod);
      MOD(g1 += g[u][0] * g[v][0] % mod);
      MOD(f1 += f[u][1] * g[v][1] % mod);
      MOD(f1 += f[v][1] * g[u][1] % mod);
      MOD(g1 += g[v][1] * g[u][1] % mod);
      MOD(f1 += f[u][1] * g[v][0] % mod);
      MOD(f1 += f[v][0] * g[u][1] % mod);
      MOD(g1 += g[v][0] * g[u][1] % mod);
      MOD(f0 += f[u][0] * g[v][1] % mod);
      MOD(f0 += f[v][1] * g[u][0] % mod);
      MOD(g0 += g[u][0] * g[v][1] % mod);
      MOD(f0 += f[u][0] * g[v][0] % mod);
      MOD(f0 += f[v][0] * g[u][0] % mod);
      MOD(f0 += f[u][0] * g[v][1] % mod);
      MOD(f0 += f[v][1] * g[u][0] % mod);
      MOD(g0 += g[u][0] * g[v][0] % mod);
      MOD(g0 += g[u][0] * g[v][1] % mod);
      MOD(f1 += f[u][1] * g[v][0] % mod);
      MOD(f1 += f[v][0] * g[u][1] % mod);
      MOD(f1 += f[u][1] * g[v][1] % mod);
      MOD(f1 += f[v][1] * g[u][1] % mod);
      MOD(g1 += g[u][1] * g[v][0] % mod);
      MOD(g1 += g[u][1] * g[v][1] % mod);
      f[u][1] = f1;
      f[u][0] = f0;
      g[u][1] = g1;
      g[u][0] = g0;
    }
}
int main() {
  n = rd();
  int u, v;
  for (int i = 1; i < n; ++i) {
    u = rd();
    v = rd();
    add(u, v);
    add(v, u);
  }
  dfs(1, 0);
  cout << (f[1][1] + f[1][0]) * 2 % mod;
  return 0;
}

```