#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#include <bits/stdc++.h>
#define owo(i,a, b) for(int i=(a);i<(b); ++i)
#define uwu(i,a, b) for(int i=(a)-1; i>=(b); --i)
#define senpai push_back
#define ttgl pair<int, int>
#define ayaya cout<<"ayaya~"<<endl
 
using namespace std;
using ll = long long;
using ld = long double;
ll MOD = 998244353;
const ll root = 3;
ll binpow(ll a,ll b){ll res=1;while(b){if(b&1)res=(res*a)%MOD;a=(a*a)%MOD;b>>=1;}return res;}
ll modInv(ll a){return binpow(a, MOD-2);}
const int INF = 0x3f3f3f3f;
const int NINF = 0xc0c0c0c0;
const ll INFLL = 0x3f3f3f3f3f3f3f3f;
const ll NINFLL = 0xc0c0c0c0c0c0c0c0;
const int mxN = 303;
int n;
vector<int> adj[mxN];
ll dpup[mxN][mxN];
ll dpdown[mxN][mxN];
ll sv[mxN][2];
ll ways[mxN];
int sz[mxN];
ll p2[mxN];
ll f[mxN];
void calcstuff(int u, int p) {
    for(int v: adj[u]) {
        if(v^p) {
            calcstuff(v, u);
            sz[u] += sz[v];
        }
    }
    sz[u]++;
}
void dfs(int u, int p, int x) {
    if(adj[u].size()==1 && p!=-1) {
        dpup[u][x] = 1;
        dpdown[u][0] = 1;
        return;
    }
    for(int v: adj[u]) {
        if(v^p) {
            dfs(v, u, x);
        }
    }
    //try calcing dpdown[u]
    memset(sv, 0, sizeof(sv));
    owo(i, 0, x+2) {
        sv[i][0] = 1;
    }
    for(int v: adj[u]) {
        if(v^p) {
            ll curr = 0;
            uwu(j, x+1, 0) {
                curr = (curr + dpdown[v][j] + dpup[v][j+2])%MOD;
                sv[j+1][1] = (sv[j+1][1] * curr + (sv[j+1][0]-sv[j+1][1]+ MOD) * dpdown[v][j])%MOD;
                sv[j+1][0] = (sv[j+1][0] * curr)%MOD;
            }
        }
    }
    owo(i, 1, x+2) {
        dpdown[u][i] = sv[i][1];
    }
    dpdown[u][0] = 1;
    //calc dpup[u], this is very hard :(
    memset(sv, 0, sizeof(sv));
    owo(i, 0, x) {
        sv[i][0] = 1;
    }
    for(int v: adj[u]) {
        if(v^p) {
            ll curr = 0;
            //cout<<u<<" "<<v<<" ord\n";
            uwu(j, x+2, 1) {
                curr = (curr + dpup[v][j] + dpdown[v][j-1])%MOD;
                sv[j-1][1] = (sv[j-1][1] * curr + (sv[j-1][0] - sv[j-1][1] + MOD) * dpup[v][j])%MOD;
                sv[j-1][0] = (sv[j-1][0] * curr)%MOD;
            }
        }
    }
    owo(i, 0, x+1) {
        dpup[u][i] = sv[i][1];
    }
    for(int v: adj[u]) {
        if(v^p) {
            ways[u] = (ways[u] * p2[sz[v]] + dpdown[u][0] * ways[v])%MOD;
            dpdown[u][0] = (dpdown[u][0] * (p2[sz[v]] - ways[v] + MOD))%MOD;
        }
    }
    dpup[u][x] = dpdown[u][x+1];
    dpdown[u][x+1] = 0;
    ways[u] = (ways[u] * 2LL + dpup[u][0])%MOD;
    if(p==-1) {
        owo(j, 1, x+1) {
            ways[u] = (ways[u] + dpup[u][j])%MOD;
        }
    }
    /*cout<<u<<" "<<x<<" ---------------------------------------------\n";
    owo(i, 0, x+1) {
        cout<<dpup[u][i]<<" ";
    }
    cout<<"\n";
    owo(i, 0, x+1) {
        cout<<dpdown[u][i]<<" ";
    }
    cout<<"\n";
    cout<<ways[u]<<"\n";*/
}
void solve() {
    cin>>n;
    owo(i, 0, n-1) {
        int a, b;
        cin>>a>>b;
        a--; b--;
        adj[a].senpai(b);
        adj[b].senpai(a);
    }
    calcstuff(0, -1);
    ll res = n-1;
    owo(i, 1, n+1) {
        memset(ways, 0, sizeof(ways));
        memset(dpup, 0, sizeof(dpup));
        memset(dpdown, 0, sizeof(dpdown));
        dfs(0, -1, i);
        f[i] = ways[0];
    }
    owo(i, 1, n) {
        //cout<<i<<" "<<f[i]<<"\n";
        res = (res + (f[i] - f[i+1] + MOD)*(ll)i)%MOD;
    }
    res = (res * modInv(p2[n]))%MOD;
    cout<<res<<"\n";
    
}
int main() {
    //freopen("file.in", "r", stdin);
    //freopen("file.out", "w", stdout);
    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
    cin.tie(0)->sync_with_stdio(0);
    p2[0] = 1;
    owo(i, 1, mxN) {
        p2[i] = (p2[i-1]*2LL)%MOD;
    }
    int T = 1;
    owo(tc, 1, T+1) {
        solve();
    }
    return 0;
}