#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 10;
const int P = 998244353;
inline int Mod(int x) { return x + ((x >> 31) & P); }
int power(int x, int k) {
  int res = 1;
  while (k) {
    if (k & 1) res = (long long)res * x % P;
    x = (long long)x * x % P;
    k >>= 1;
  }
  return res;
}
int n;
vector<int> e[N];
int f[N][2], g[N][2];
void dfs(int x, int fx) {
  f[x][1] = f[x][0] = 0;
  g[x][1] = 0;
  g[x][0] = 1;
  for (int y : e[x])
    if (y != fx) {
      dfs(y, x);
      int a = 0, b = 0;
      a = Mod((long long)f[x][0] * Mod(g[y][0] + g[y][1] - P) % P +
              (long long)g[x][0] * Mod(f[y][1] + f[y][0] - P) % P - P);
      b = Mod((long long)f[x][1] * Mod(g[y][0] + g[y][1] - P) % P +
              (long long)g[x][1] * Mod(f[y][1] + f[y][0] - P) % P - P);
      a = Mod(a +
              Mod((long long)f[x][0] * g[y][1] % P +
                  (long long)g[x][0] * f[y][1] % P - P) -
              P);
      ;
      b = Mod(b +
              Mod((long long)f[x][1] * Mod(g[y][0] + g[y][1] - P) % P +
                  (long long)g[x][1] * Mod(f[y][1] + f[y][0] - P) % P - P) -
              P);
      b = Mod(b +
              Mod((long long)f[x][0] * g[y][0] % P +
                  (long long)g[x][0] * f[y][0] % P - P) -
              P);
      b = Mod(b + (long long)g[x][0] * g[y][0] % P - P);
      f[x][0] = a;
      f[x][1] = b;
      a = 0;
      b = 0;
      a = Mod((long long)g[x][0] * Mod(g[y][0] + g[y][1] - P) % P +
              (long long)g[x][0] * g[y][1] % P - P);
      b = Mod((long long)g[x][1] * Mod(g[y][0] + g[y][1] - P) % P +
              (long long)g[x][1] * Mod(g[y][0] + g[y][1] - P) % P - P);
      b = Mod(b + (long long)g[x][0] * g[y][0] % P - P);
      g[x][0] = a;
      g[x][1] = b;
    }
}
int main() {
  ios ::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1, x, y; i <= n - 1; ++i) {
    cin >> x >> y;
    e[x].emplace_back(y);
    e[y].emplace_back(x);
  }
  dfs(1, 0);
  int ans = Mod(f[1][1] + f[1][0] - P);
  ans = Mod(ans + ans - P);
  cout << ans << endl;
  return 0;
}

### Prompt

Create a solution in CPP for 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 N = 5e5 + 10;
const int P = 998244353;
inline int Mod(int x) { return x + ((x >> 31) & P); }
int power(int x, int k) {
  int res = 1;
  while (k) {
    if (k & 1) res = (long long)res * x % P;
    x = (long long)x * x % P;
    k >>= 1;
  }
  return res;
}
int n;
vector<int> e[N];
int f[N][2], g[N][2];
void dfs(int x, int fx) {
  f[x][1] = f[x][0] = 0;
  g[x][1] = 0;
  g[x][0] = 1;
  for (int y : e[x])
    if (y != fx) {
      dfs(y, x);
      int a = 0, b = 0;
      a = Mod((long long)f[x][0] * Mod(g[y][0] + g[y][1] - P) % P +
              (long long)g[x][0] * Mod(f[y][1] + f[y][0] - P) % P - P);
      b = Mod((long long)f[x][1] * Mod(g[y][0] + g[y][1] - P) % P +
              (long long)g[x][1] * Mod(f[y][1] + f[y][0] - P) % P - P);
      a = Mod(a +
              Mod((long long)f[x][0] * g[y][1] % P +
                  (long long)g[x][0] * f[y][1] % P - P) -
              P);
      ;
      b = Mod(b +
              Mod((long long)f[x][1] * Mod(g[y][0] + g[y][1] - P) % P +
                  (long long)g[x][1] * Mod(f[y][1] + f[y][0] - P) % P - P) -
              P);
      b = Mod(b +
              Mod((long long)f[x][0] * g[y][0] % P +
                  (long long)g[x][0] * f[y][0] % P - P) -
              P);
      b = Mod(b + (long long)g[x][0] * g[y][0] % P - P);
      f[x][0] = a;
      f[x][1] = b;
      a = 0;
      b = 0;
      a = Mod((long long)g[x][0] * Mod(g[y][0] + g[y][1] - P) % P +
              (long long)g[x][0] * g[y][1] % P - P);
      b = Mod((long long)g[x][1] * Mod(g[y][0] + g[y][1] - P) % P +
              (long long)g[x][1] * Mod(g[y][0] + g[y][1] - P) % P - P);
      b = Mod(b + (long long)g[x][0] * g[y][0] % P - P);
      g[x][0] = a;
      g[x][1] = b;
    }
}
int main() {
  ios ::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1, x, y; i <= n - 1; ++i) {
    cin >> x >> y;
    e[x].emplace_back(y);
    e[y].emplace_back(x);
  }
  dfs(1, 0);
  int ans = Mod(f[1][1] + f[1][0] - P);
  ans = Mod(ans + ans - P);
  cout << ans << endl;
  return 0;
}

```