#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<ctime>
#include<algorithm>
#include<queue>
#include<set>
#include<map>
#include<bitset>
#include<vector>
using namespace std;

typedef long long ll;
typedef unsigned int ui;

ll read() {
	ll x=0,f=1;char ch=getchar();
	while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
	while(isdigit(ch))x=x*10+(ch^48),ch=getchar();
	return x*f;
}
void write(ll x) {
	if(x<0)putchar('-'),x=-x;
	if(x>9)write(x/10);
	putchar(x%10+48);
}
void writes(ll x) {write(x),putchar(' ');}
void Writes(ll x) {write(x),putchar('\n');}

#define N 605
#define M 1220
#define mod 998244353

int Qpow(int x,int p) {int res=1;for(;p;p>>=1,x=1ll*x*x%mod)if(p&1)res=1ll*res*x%mod;return res;}
int Inv(int x) {return Qpow(x,mod-2);}

int n;
int head[N],nxt[M],ver[M],tot=1;
void add(int x,int y) {ver[++tot]=y,nxt[tot]=head[x],head[x]=tot;}
int f[N][N],pre[N][N];
int g[N][N],suf[N][N];
int mulf[2],mulg[2];
int dep[N],maxdep[N];
bool isleaf[N];
int ans[N];
int tans;

void Reset() {
	for(int i=1;i<=n;++i)
		for(int j=dep[i];j<=maxdep[i];++j)
			f[i][j]=g[i][j]=0,pre[i][j]=suf[i][j]=0;
}

void dfs(int x,int fa) {
	maxdep[x]=dep[x]=dep[fa]+1;
	for(int i=head[x];i;i=nxt[i]) {
		int y=ver[i];
		if(y == fa)	continue;
		dfs(y,x);
		maxdep[x]=max(maxdep[x],maxdep[y]);
	}
	if(maxdep[x] == dep[x])
		isleaf[x]=1;
}

void treedp(int x,int fa,int r) {
	int d=dep[x];
	if(isleaf[x] == 1) {
		f[x][d]=1,g[x][d]=1;
		for(int d=1;d<=2*n;++d) 
			pre[x][d]=(1ll*pre[x][d-1]+1ll*f[x][d])%mod;
		for(int d=2*n;d>=1;--d) 
			suf[x][d]=(1ll*suf[x][d+1]+1ll*g[x][d])%mod;
		return ;
	}
	for(int i=head[x];i;i=nxt[i]) {
		int y=ver[i];
		if(y == fa)	continue;
		treedp(y,x,r);
	}
	//d == dep[x]
	f[x][d]=1,g[x][d]=1;
	for(int i=head[x];i;i=nxt[i]) {
		int y=ver[i];
		if(y == fa)	continue;
		int D;
		D=dep[x]+r+1;
		f[x][d]=1ll*f[x][d]*suf[y][D]%mod;
		D=dep[x]+r;
		g[x][d]=1ll*g[x][d]*(1ll*pre[y][D]+1ll*suf[y][dep[y]])%mod;
	}
	//dep[x] < d <= dep[x]+r
	for(d=dep[x]+1;d<=dep[x]+r;++d) {
		mulf[0]=1,mulg[0]=1;
		mulf[1]=1,mulg[1]=1;
		for(int i=head[x];i;i=nxt[i]) {
			int y=ver[i];
			if(y == fa)	continue;
			int D;
			D=2*dep[x]-d+r+1;
			mulf[0]=1ll*mulf[0]*(1ll*pre[y][d]+1ll*suf[y][D])%mod;
			mulf[1]=1ll*mulf[1]*(1ll*pre[y][d-1]+1ll*suf[y][D])%mod;
			D=2*dep[x]-d+r;
			mulg[0]=1ll*mulg[0]*(1ll*suf[y][d]+1ll*pre[y][D])%mod;
			mulg[1]=1ll*mulg[1]*(1ll*suf[y][d+1]+1ll*pre[y][D])%mod;
		}
		f[x][d]=(mulf[0]-mulf[1])%mod;
		g[x][d]=(mulg[0]-mulg[1])%mod;
	}
	//dep[x]+r < d <= maxdep[x]
	for(d=dep[x]+r+1;d<=maxdep[x];++d) {
		mulf[0]=1,mulf[1]=1;
		for(int i=head[x];i;i=nxt[i]) {
			int y=ver[i];
			if(y == fa)	continue;
			int D;
			D=2*dep[x]-d+r+1;
			mulf[0]=1ll*mulf[0]*(1ll*pre[y][d]+1ll*suf[y][D])%mod;
			mulf[1]=1ll*mulf[1]*(1ll*pre[y][d-1]+1ll*suf[y][D])%mod;
		}
		f[x][d]=2ll*(mulf[0]-mulf[1])%mod;
	}
	//pre and suf
	pre[x][0]=f[x][0];
	for(int d=1;d<=2*n;++d) 
		pre[x][d]=(1ll*pre[x][d-1]+1ll*f[x][d])%mod;
	suf[x][2*n+1]=g[x][2*n+1];
	for(int d=2*n;d>=1;--d) 
		suf[x][d]=(1ll*suf[x][d+1]+1ll*g[x][d])%mod;
}

int solve(int r) {
	Reset();
	treedp(1,0,r);
	return suf[1][1];
}

int main() {
	n=read();
	for(int i=1;i<n;++i) {
		int x=read(),y=read();
		add(x,y),add(y,x);
	}
	dfs(1,0);
	for(int i=0;i<=n+1;++i) 
		ans[i]=solve(i);
	tans=1ll*ans[0]*(-1); 
	for(int i=1;i<=n+1;++i) 
		tans=(1ll*tans+1ll*(1ll*ans[i]-1ll*ans[i-1])*(i-1)%mod)%mod;
	tans=(1ll*tans+1ll*1*n)%mod;
	tans=1ll*tans*Qpow(Inv(2),n)%mod;
	Writes((tans%mod+mod)%mod);
	return 0;
}