import sys sys.setrecursionlimit(10 ** 9) MOD = 998244353 n = int(input()) edges = [[] for _ in range(n)] for _ in range(n - 1): a, b = map(int, input().split()) a -= 1 b -= 1 edges[a].append(b) edges[b].append(a) ans = 0 def dfs(pos, bpos): global ans ret = 1 for npos in edges[pos]: if npos == bpos: continue ret += dfs(npos, pos) if pos != 0: ans += n * (n - 1) // 2 - ret * (n - ret) return ret dfs(0, -1) div = n * (n - 1) // 2 * (n - 1) print(ans * pow(div, MOD - 2, MOD) % MOD)