from collections import deque from sys import stderr, setrecursionlimit setrecursionlimit(200000) MOD = 998244353 N = int(input()) edges = [[] for _ in range(N + 1)] for _ in range(N - 1): u, v = map(int, input().split()) edges[u].append(v) edges[v].append(u) parent = [-1] * (N + 1) parent[1] = 0 children = [[] for _ in range(N + 1)] q = deque([1]) while q: p = q.popleft() for n in edges[p]: if parent[n] != -1: continue parent[n] = p children[p].append(n) q.append(n) descendant = [0] * (N + 1) def bfs(n): if not children[n]: descendant[n] = 1 return 1 descendant[n] = sum(bfs(c) for c in children[n]) + 1 return descendant[n] bfs(1) # print(descendant, file=stderr) # ans = a / b a = N * (N - 1)**2 // 2 b = N * (N - 1)**2 // 2 for n in range(2, N + 1): a -= descendant[n] * (N - descendant[n]) print(a * pow(b, MOD - 2, MOD) % MOD)