#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;

#define SIZE(x) int((x).size())
#define REP(i,c) for(auto &i : c)
#define pb push_back
#define eb emplace_back
typedef long long i64;
typedef unsigned long long u64;
const double EPS = 1e-12;
const int INF = 999999999;
typedef vector<int> VI;
typedef vector<string> VS;

const int M=998244353;

const int MAXN=305;

int n;
VI g[MAXN];

int radius;

template <class T>
struct DpResult {
    vector<T> a;
    vector<T> sum;
    int l=INF,r=-INF;

    void Init(int maxi) {
        a=vector<T>(maxi+1,0);
    }

    T& operator[](int i) {
        l=min(l,i);
        r=max(r,i);
        return a[i];
    }

    const T operator[](int i) const {
        return a[i];
    }

    void Build() {
        assert(l<INF);
        sum.resize(r-l+2);
        sum[0]=0;
        for(int i=l;i<=r;i++) {
            sum[i-l+1]=(sum[i-l]+a[i])%M;
        }
    }

    T Sum(int ql,int qr) {
        ql=max(ql,l);
        qr=min(qr,r);
        if(ql>qr) return 0;
        T res=(sum[qr-l+1]-sum[ql-l])%M;
        if(res<0) res+=M;
        return res;
    }
};

// dp[i,j]: subtree at node i.
// - dist(i, the farthest uncovered node) = j. 0<=j<radius
DpResult<int> dp[MAXN];

// dp2[i,j]: subtree at node i:
// - all nodes in subtree are covered.
// - dist(i, the farthest covered node above i) = j. 0<=j<=radius
DpResult<int> dp2[MAXN];

int f[MAXN];

int cur;
DpResult<int> tmp[2];
DpResult<int> tmp2[2];

void Go(int u,int pu) {
    REP(v,g[u]) {
        if(v==pu) continue;
        Go(v,u);
    }

    cur=0;
    tmp[cur].Init(radius);
    tmp2[cur].Init(radius);
    tmp[cur][0]=1;
    tmp2[cur][radius]=1;
    tmp[cur].Build();
    tmp2[cur].Build();

    REP(v,g[u]) {
        if(v==pu) continue;
        int pre=cur;
        cur^=1;
        tmp[cur].Init(radius);
        tmp2[cur].Init(radius);

        for(int i=dp[v].l;i<=min(dp[v].r,radius-1);++i) {
            int &res=tmp[cur][i+1];
            res=((i64)dp[v][i]*tmp[pre].Sum(0,i)+res)%M;
            res=((i64)dp[v][i]*tmp2[pre].Sum(0,i)+res)%M;
        }
        for(int i=tmp[pre].l;i<=tmp[pre].r;++i) {
            int &res=tmp[cur][i];
            res=((i64)tmp[pre][i]*dp[v].Sum(0,i-1)+res)%M;
            res=((i64)tmp[pre][i]*dp2[v].Sum(0,i)+res)%M;
        }

        for(int i=max(dp2[v].l,1);i<=dp2[v].r;++i) {
            int &res=tmp2[cur][i-1];
            res=((i64)dp2[v][i]*tmp[pre].Sum(0,i-1)+res)%M;
            res=((i64)dp2[v][i]*tmp2[pre].Sum(0,i-1)+res)%M;
        }
        for(int i=tmp2[pre].l;i<=tmp2[pre].r;++i) {
            int &res=tmp2[cur][i];
            res=((i64)tmp2[pre][i]*dp[v].Sum(0,i-1)+res)%M;
            res=((i64)tmp2[pre][i]*dp2[v].Sum(0,i)+res)%M;
        }

        tmp[cur].Build();
        tmp2[cur].Build();
    }

    dp[u]=tmp[cur];
    dp2[u]=tmp2[cur];
}

// Find x,y for ax+by=GCD(a,b).
i64 GcdExt(i64 a,i64 b,i64 &x,i64 &y) {
    if(b==0) {
        x=1;y=0;
        return a;
    }
    i64 d=GcdExt(b,a%b,x,y);
    i64 tmp=y;
    y=x-y*(a/b);
    x=tmp;
    return d;
}

void Solve() {
    scanf("%d",&n);
    for(int i=1;i<n;i++) {
        int u,v;
        scanf("%d%d",&u,&v);
        g[u].pb(v);
        g[v].pb(u);
    }

    for(radius=0;radius<=n;radius++) {
        Go(1,-1);
        int &res=f[radius];
        res=dp2[1].Sum(0,radius);
        // printf("%d: %d\n",radius,res);
    }

    int p=n-1;
    for(int i=0;i<n;i++) {
        p=((i64)i*(f[i+1]-f[i])+p)%M;
    }
    // printf("%d\n",p);

    // q=2^n
    int q=1;
    for(int i=0;i<n;i++) q=((i64)q*2)%M;

    // xq == p (mod M)
    // xq + yM = p
    i64 x,y;
    i64 d=GcdExt(q,M,x,y);
    assert(d==1);
    x=(x*p)%M;
    if(x<0) x+=M;
    printf("%lld\n",x);
}

int main() {
    int t=1;
    for (int i = 0; i < t; ++i) {
        Solve();
    }

    return 0;
}
