import sys sys.setrecursionlimit(10 ** 6) N = int(input()) P = 998244353 G = [[] for _ in range(N + 1)] for _ in range(N-1): u,v = map(int,input().split()) G[u].append(v) G[v].append(u) memo = [0] * (N + 1) ans = 0 def dfs(now = 1,parent = 0): global ans if now != 1 and len(G[now]) == 1: ans = (ans + N - 1) % P return 1 count = 1 for v in G[now]: if v != parent: count += dfs(v,now) ans = (ans + count * (N - count)) % P return count dfs() inv = pow(N * (N - 1) * (N - 1) // 2,P - 2,P) ans = N * (N - 1) * (N - 1) // 2 - ans print(ans * inv % P)