N = int(input()) adj = [[] for i in range(N)] E = [] for i in range(N - 1): u, v = map(int, input().split()) u -= 1 v -= 1 adj[u].append(v) adj[v].append(u) E.append((u, v)) depth = [-1] * N from collections import deque depth[0] = 0 qu = deque([0]) while len(qu): v = qu.popleft() for nv in adj[v]: if depth[nv] == -1: depth[nv] = depth[v] + 1 qu.append(nv) V = [i for i in range(N)] V.sort(key = lambda x: depth[x], reverse = True) dp = [1] * N for v in V: for nv in adj[v]: if depth[nv] > depth[v]: dp[v] += dp[nv] ans = 0 MOD = 998244353 for e in E: u, v = e if depth[u] > depth[v]: u, v = v, u a = dp[v] b = N - dp[v] tmp = a * (a - 1) + b * (b - 1) tmp = tmp * pow(N * (N - 1), MOD - 2, MOD) ans = (ans + tmp) % MOD ans = ans * pow(N - 1, MOD - 2, MOD) print(ans % MOD)