mod = 998244353 eps = 10**-9 def main(): import sys from collections import deque input = sys.stdin.readline N = int(input()) adj = [[] for _ in range(N+1)] for _ in range(N-1): a, b = map(int, input().split()) adj[a].append(b) adj[b].append(a) que = deque() que.append(1) seen = [-1] * (N+1) seen[1] = 0 par = [0] * (N+1) child = [[] for _ in range(N+1)] seq = [] while que: v = que.popleft() seq.append(v) for u in adj[v]: if seen[u] == -1: seen[u] = seen[v] + 1 par[u] = v child[v].append(u) que.append(u) seq.reverse() size = [1] * (N+1) for v in seq: for u in child[v]: size[v] += size[u] ans = 0 inv_N_1 = pow(N-1, mod-2, mod) nC2 = ((N * (N-1))%mod * pow(2, mod-2, mod))%mod inv_nC2 = pow(nC2, mod-2, mod) for v in seq: if v == 1: continue p = par[v] s = size[v] t = N - s ans = (ans + (inv_N_1 * (1 - ((s * t)%mod * inv_nC2)%mod))%mod)%mod print(ans) if __name__ == '__main__': main()