//CLOCKS_PER_SEC
using namespace std;
#include<bits/stdc++.h>
#define sqr(x) 1ll*(x)*(x)
//#define sort stable_sort
#define ll long long
#define mk make_pair
#define pb push_back
#define in insert
#define mtr(x,y,z) mk(mk(x,y),z)
#define fi first
#define se second
#define lch(x) ((x)<<1)
#define rch(x) (((x)<<1)|1)
#define all(x) (x).begin(),(x).end()
#define titose CLOCKS_PER_SEC
#define fpi(x) freopen(x,"r",stdin);
#define fpo(x) freopen(x,"w",stdout);
#define fprio fpi("in.txt");fpo("out.txt");
#define fast ios_base::sync_with_stdio(false);
inline void read(int &x){int v=0,f=1;char c=getchar();while (!isdigit(c)&&c!='-') c=getchar();if (c=='-') f=-1; else v=(c&15);while (isdigit(c=getchar())) v=(v<<1)+(v<<3)+(c&15);x=v*f;}
inline void read(ll &x){ll v=0ll,f=1ll;char c=getchar();while (!isdigit(c)&&c!='-') c=getchar();if (c=='-') f=-1; else v=(c&15);while (isdigit(c=getchar())) v=(v<<1)+(v<<3)+(c&15);x=v*f;}
inline void readc(char &x){char c;while (((c=getchar())==' ')||c=='\n');x=c;}
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vi vector<int>
#define vl vector<ll>
#define si set<int>
//#define sl set<ll>
#define mii map<int,int>
#define mll map<ll,ll>
#define msi map<string,int>
#define msl map<string,ll>
#define piii pair<int,pii >
#define piipi pair<pii,int>
#define plll pair<ll,pll >
#define pllpl pair<pll,ll>
#define pqi priority_queue<int>
#define pql priority_queue<ll>
#define npqi priority_queue<int,vector<int>,greater<int> >
#define npql priority_queue<ll,vector<ll>,greater<ll> >
#define forup(i,a,b) for ((i)=(a);(i)<=(b);(i)++)
#define fordo(i,a,b) for ((i)=(a);(i)>=(b);(i)--)
#define rep(i,x) forup ((i),1,(x))
#define repd(i,x) fordo ((i),(x),1)
#define rep0(i,x) forup ((i),0,((int)(x))-1)
#define rep0d(i,x) fordo ((i),((int)(x))-1,0)
#define itr iterator
#define fe(itcalc,c) for(__typeof((c).begin()) itcalc=(c).begin();itcalc!=(c).end();itcalc++)
#define NO {cout<<"NO";return 0;}
#define YES {cout<<"YES";return 0;}
#define y0 y000000000000000000000000000
#define y1 y111111111111111111111111111
#define j0 j000000000000000000000000000
#define j1 j111111111111111111111111111
#define cl0(a) memset((a),(0),(sizeof((a))))
#define clz(a) memset((a),(0x16),(sizeof((a))))
#define clf(a) memset((a),(-(0x16)),(sizeof((a))))
#define inf 0x3bbbbbbb
#define lnf 0x2bbbbbbbbbbbbbbbll
//#define sqrt divi
#define p2(i) (1ll<<(i))
#define readi read
#define readll read
/*************************************************/
const int mod=998244353,inv2=(mod+1)/2;
int n,i,lim,ans,dp[305][605],tmp[605];
vector<int> e[305];
void dfs(int x,int p)
{
	memset(dp[x],0,sizeof(dp[x]));
	dp[x][lim-1]=inv2;dp[x][lim+lim]=inv2;
	fe(it,e[x]){
		if(*it==p) continue;
		dfs(*it,x);
		vector<int> f,g;
		int i,j;
		forup(i,-lim,lim) if(dp[x][lim+i]) f.pb(i);
		forup(i,-lim,lim) if(dp[*it][lim+i]) g.pb(i);
		memset(tmp,0,sizeof(tmp));
		fe(it1,f)fe(it2,g){
			i=*it1;j=*it2;
			int k;
			if(i+j>=0){
				k=max(i,j-1);
			}
			else{
				k=min(i,j-1);
			}
			tmp[k+lim]=(tmp[k+lim]+1ll*dp[x][i+lim]*dp[*it][j+lim])%mod;
		}
		memcpy(dp[x],tmp,sizeof(dp[x]));
	}
}
int main()
{
	read(n);
	rep(i,n-1){
		int x,y;
		read(x);read(y);
		e[x].pb(y);e[y].pb(x);
	}
	ans=mod-1;
	rep(i,n) ans=1ll*ans*inv2%mod;
	rep(lim,n){
		(ans+=1)%=mod;
		dfs(1,0);
		forup(i,lim,lim+lim) ans=(ans+mod-dp[1][i])%mod;
	}
	cout<<ans<<endl;
	return 0;
}