import sys sys.setrecursionlimit(10 ** 9) input = sys.stdin.buffer.readline N = int(input()) T = [[] for _ in range(N)] for _ in range(N - 1): u, v = (int(x) - 1 for x in input().split()) T[u].append(v) T[v].append(u) MOD = 998244353 modinv = lambda a, mod=MOD: pow(a, mod - 2, mod) ans = - (N - 1) * N // 2 def dfs(v, parent): global ans subt = 1 for x in T[v]: if x != parent: subt += dfs(x, v) ans += subt * (subt - 1) // 2 + (N - subt) * (N - subt - 1) // 2 ans %= MOD return subt dfs(0, -1) ans *= modinv((N - 1) * N * (N - 1) // 2) ans %= MOD print(ans)