#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#define file(x) freopen(#x".in", "r", stdin), freopen(#x".out", "w", stdout)

inline int read()
{
	int data = 0, w = 1; char ch = getchar();
	while (ch != '-' && (ch < '0' || ch > '9')) ch = getchar();
	if (ch == '-') w = -1, ch = getchar();
	while (ch >= '0' && ch <= '9') data = data * 10 + (ch ^ 48), ch = getchar();
	return data * w;
}

constexpr int N(305), Mod(998244353), inv2((Mod + 1) >> 1);
inline int upd(const int &x) { return x + (x >> 31 & Mod); }
std::vector<int> G[N];
int n, R, ans, f[N][N], g[N][N], dep[N];

void dfs(int x, int fa)
{
	dep[x] = 0, f[x][0] = g[x][0] = 1;
	static int tf[N], tg[N];
	for (auto i : G[x]) if (i != fa)
	{
		dfs(i, x);
		for (int j = 0; j <= dep[x]; j++)
			for (int k = 0; k <= dep[i]; k++)
			{
				int l = std::min(j, k + 1), r = std::max(j, k + 1);
				tg[l] = (tg[l] + 1ll * g[x][j] * g[i][k]) % Mod;
				tf[r] = (tf[r] + 1ll * f[x][j] * f[i][k]) % Mod;
				if (j + k + 1 <= R)
					tg[j] = (tg[j] + 1ll * g[x][j] * f[i][k]) % Mod,
					tg[k + 1] = (tg[k + 1] + 1ll * f[x][j] * g[i][k]) % Mod;
				else tf[j] = (tf[j] + 1ll * f[x][j] * g[i][k]) % Mod,
					tf[k + 1] = (tf[k + 1] + 1ll * g[x][j] * f[i][k]) % Mod;
			}
		dep[x] = std::max(dep[x], dep[i] + 1);
		std::memcpy(f[x], tf, (dep[x] + 1) << 2), std::memset(tf, 0, (dep[x] + 1) << 2);
		std::memcpy(g[x], tg, (dep[x] + 1) << 2), std::memset(tg, 0, (dep[x] + 1) << 2);
	}
}

int main()
{
#ifndef ONLINE_JUDGE
	file(cpp);
#endif
	n = read();
	for (int i = 1, a, b; i < n; i++)
		a = read(), b = read(), G[a].push_back(b), G[b].push_back(a);
	int ans = n - 1, inv = Mod - 1;
	for (int i = 1; i <= n; i++) inv = 1ll * inv * inv2 % Mod;
	for (R = 1; R < n; R++)
	{
		dfs(1, 0); int s = 0;
		for (int i = 0; i <= n; i++) s = upd(s + g[1][i] - Mod);
		ans = (ans + 1ll * s * inv) % Mod;
	}
	printf("%d\n", ans);
	return 0;
}
