import sys sys.setrecursionlimit(200000) N = int(input()) mod = 998244353 to = [[] for i in range(N)] e = [] for i in range(N-1): u, v = list(map(int, input().split())) to[u-1].append(v-1) to[v-1].append(u-1) e.append((u-1, v-1)) a = [-1] * N b = [-1] * N time = 0 def DFS(x): global time global a global b a[x] = time time += 1 for y in to[x]: if a[y] == -1: DFS(y) b[x] = time time += 1 DFS(0) # print(a) # print(b) ans = 0 for i in range(N-1): s, t = e[i] m = min((b[s]-a[s]+1)//2, (b[t]-a[t]+1)//2) ans = (ans + m*(N-m)) % mod # print(m, ans) u = (N * (N-1) * (N-1) // 2) % mod ans = (ans * pow(u, mod-2, mod)) print((1 - ans) % mod)