#include <bits/stdc++.h>
using namespace std;
const int N = (int)5e5 + 123, inf = 1e9, mod = 998244353;
const long long INF = 1e18;
vector<int> g[N];
pair<long long, long long> dp[N][2];
int n;
void add(long long &x, long long y) { x = (x + y) % mod; }
void dfs(int v, int pr) {
  dp[v][0] = {0, 1};
  for (auto to : g[v]) {
    if (to == pr) continue;
    dfs(to, v);
    pair<long long, long long> A, B;
    A = B = {0, 0};
    for (int i = 0; i < 2; i++)
      for (int j = 0; j < 2; j++)
        for (int q = 0; q < 2; q++) {
          long long cur = dp[v][i].second * dp[to][j].first +
                          dp[v][i].first * dp[to][j].second;
          if (i == 0 && j == 0 && q == 1) {
            add(B.first, cur + dp[v][i].second * dp[to][j].second);
            add(B.second, dp[v][i].second * dp[to][j].second);
          } else if (i == 0) {
            add(A.first, cur);
            add(A.second, dp[v][i].second * dp[to][j].second);
          } else {
            add(B.first, cur);
            add(B.second, dp[v][i].second * dp[to][j].second);
          }
        }
    dp[v][0] = A;
    dp[v][1] = B;
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int v, u;
    scanf("%d%d", &v, &u);
    g[v].push_back(u);
    g[u].push_back(v);
  }
  dfs(1, 1);
  printf("%lld", 2 * (dp[1][0].first + dp[1][1].first) % 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 N = (int)5e5 + 123, inf = 1e9, mod = 998244353;
const long long INF = 1e18;
vector<int> g[N];
pair<long long, long long> dp[N][2];
int n;
void add(long long &x, long long y) { x = (x + y) % mod; }
void dfs(int v, int pr) {
  dp[v][0] = {0, 1};
  for (auto to : g[v]) {
    if (to == pr) continue;
    dfs(to, v);
    pair<long long, long long> A, B;
    A = B = {0, 0};
    for (int i = 0; i < 2; i++)
      for (int j = 0; j < 2; j++)
        for (int q = 0; q < 2; q++) {
          long long cur = dp[v][i].second * dp[to][j].first +
                          dp[v][i].first * dp[to][j].second;
          if (i == 0 && j == 0 && q == 1) {
            add(B.first, cur + dp[v][i].second * dp[to][j].second);
            add(B.second, dp[v][i].second * dp[to][j].second);
          } else if (i == 0) {
            add(A.first, cur);
            add(A.second, dp[v][i].second * dp[to][j].second);
          } else {
            add(B.first, cur);
            add(B.second, dp[v][i].second * dp[to][j].second);
          }
        }
    dp[v][0] = A;
    dp[v][1] = B;
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int v, u;
    scanf("%d%d", &v, &u);
    g[v].push_back(u);
    g[u].push_back(v);
  }
  dfs(1, 1);
  printf("%lld", 2 * (dp[1][0].first + dp[1][1].first) % mod);
  return 0;
}

```