#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <ctime>
#include <map>

#define inf 0x3f3f3f3f
#define Inf 0x3FFFFFFFFFFFFFFFLL
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define Rep(i, n) for (int i = 1; i <= (n); ++i)
#define clr(x, a) memset(x, (a), sizeof x)
using namespace std;
typedef long long ll;
ll const mod = 998244353;
int const N = 305;
int const M = 100010;
struct Edges {
  int u, next;
} e[M];
int p[N], idx;
void init() { clr(p, 0xff); idx = 0; }
void addedge(int u, int v) { e[idx].u = v, e[idx].next = p[u], p[u] = idx++; }

ll powMod(ll a, ll b, ll c) {
  ll ret = 1 % c;
  for (; b; a = a * a % c, b >>= 1)
    if(b & 1) ret = ret * a % c;
  return ret;
}
ll ext_gcd(ll a, ll b, ll &x, ll &y) {
  ll t, ret;
  if (!b) {
    x = 1, y = 0;
    return a;
  }
  ret = ext_gcd(b, a % b, x, y);
  t = x, x = y, y = t - a / b * y;
  return ret;
}
// (b / a) % c
ll inv(ll a, ll b, ll c) {
  ll x, y;
  ext_gcd(a, c, x, y);
  return (1LL * x * b % c + c) % c;
}
ll f[N][N + N];
void dfs(int u, int pre, int r) {
  for (int i = p[u]; ~i; i = e[i].next) {
    int v = e[i].u; if (v == pre) continue;
    dfs(v, u, r);
  }
  for (int x = -r; x <= r; ++x) {
    if (x == r) {
      ll s = 1;      
      for (int i = p[u]; ~i; i = e[i].next) {
        int v = e[i].u; if (v == pre) continue;
        ll t = f[v][N + r] - f[v][N - r - 1];
        s *= t; s %= mod;
      }
      f[u][N + x] = f[u][N + x - 1] + s;
      f[u][N + x] %= mod; if (f[u][N + x] < 0) f[u][N + x] += mod;
    } else {
      int mx, mi, dmx, dmi;
      if (x >= 0) {
        mx = x + 1, mi = 1 - mx;
        dmx = mx - 1, dmi = mi;
      } else {
        mx = -x - 1, mi = -mx;
        dmx = mx, dmi = mi + 1;
      }
      ll s = 1, d = 1; if (dmi > dmx) d = 0;
      for (int i = p[u]; ~i; i = e[i].next) {
        int v = e[i].u; if (v == pre) continue;
        ll t = f[v][N + mx] - f[v][N + mi - 1];
        s *= t; s %= mod;
        t = f[v][N + dmx] - f[v][N + dmi - 1];
        d *= t; d %= mod;
      }
      f[u][N + x] = f[u][N + x - 1] + s - d;
      f[u][N + x] %= mod; if (f[u][N + x] < 0) f[u][N + x] += mod;
    }
  }
}

int main() {
  init();
  int n; scanf("%d", &n);
  rep(i, n - 1) {
    int x, y; scanf("%d %d", &x, &y);
    addedge(x, y); addedge(y, x);
  }
  ll bz = powMod(2, n, mod);
  ll ans = 0;
  for (int r = 1; r < n; ++r) {
    clr(f, 0);
    dfs(1, -1, r);
    ll t = f[1][N + r] - f[1][N - 1];
    ans += bz - t; if (ans >= mod) ans -= mod;
  }
  ans = inv(bz, ans, mod);
  printf("%lld\n", ans);
  return 0;
}

