#include<bits/stdc++.h>
using namespace std;

#define ll long long
#define mod 998244353

ll K(ll x,ll y=mod-2){
    ll t=1;
    for (;y;y>>=1,x=x*x%mod)
        if (y&1) t=t*x%mod;
    return t;
}
void U(int &x,ll y){
    x=(x+y)%mod;
}

int n, lim; ll inv2=K(2);

vector<int>G[333];
int f[333][2][333], tmp[2][333], tmq[2][333], sz[333];

void shit(int a[2][333],int b2[2][333]){
    static int b[2][333];
    memset(b,0,sizeof b);
    for (int i=0;i<=lim+2;++i){
        if (i!=0) b[0][i-1]=b2[0][i];
        if (i==0) b[1][1]=b2[0][i];
        if (i!=0) b[1][i+1]=b2[1][i];
    }
    static int sa[2][333], sb[2][333], c[2][333];
    memcpy(sa,a,sizeof sa);
    memcpy(sb,b,sizeof sb);
    memset(c,0,sizeof c);
    for (int i=1;i<=lim+10;++i){
        U(sa[0][i],sa[0][i-1]);
        U(sa[1][i],sa[1][i-1]);
        U(sb[0][i],sb[0][i-1]);
        U(sb[1][i],sb[1][i-1]);
    }
    for (int i=0;i<=lim+2;++i){
        {
            U(c[0][i],(ll)a[0][i]*(sb[0][i]+sb[1][i+1])+(ll)b[0][i]*(sa[0][i-1]+sa[1][i+1]));
        }
        {
            if (i>=2) U(c[1][i],(ll)a[1][i]*(sb[1][i]+sb[0][i-2])+(ll)b[1][i]*(sa[1][i-1]+sa[0][i-2]));
            else if (i>=1) U(c[1][i],(ll)a[1][i]*(sb[1][i])+(ll)b[1][i]*(sa[1][i-1]));
        }
    }
    memcpy(a,c,sizeof c);
}

void dfs(int x,int fff){
    for (auto y:G[x]){
        if (y==fff) continue;
        dfs(y,x);
    }
    memset(tmp,0,sizeof tmp);
    tmp[0][lim]=inv2; // out 0~lim
    tmp[1][1]=inv2; // need 1~lim
    for (auto y:G[x]){
        if (y==fff) continue;
        memcpy(tmq,f[y],sizeof tmq);
        shit(tmp,tmq);
    }
    memcpy(f[x],tmp,sizeof f[x]);
}

ll fuck(){
    memset(f,0,sizeof f);
    dfs(1,0);
    int res=0;
    for (int i=0;i<=lim;++i) U(res,f[1][0][i]);
    return res;
}

int main(){
    cin>>n;
    for (int i=1;i<n;++i){
        int x, y; cin>>x>>y;
        G[x].push_back(y);
        G[y].push_back(x);
    }
    ll las=0, ans=0;
    for (int i=0;i<n;++i){
        lim=i;
        ll res=fuck(), t=(res-las+mod)%mod;
        // printf("-- %d %lld\n",i,t*8ll%mod);
        ans+=t*(i-1+mod)%mod;
        las=res;
    }
    ans+=n*K(K(2,n));
    ans%=mod;
    cout<<ans<<endl;
}

