MOD = 998244353 n = int(input()) g = [[] for _ in range(n)] edges = [] for _ in range(n - 1): u, v = map(int, input().split()) g[u - 1].append(v - 1) g[v - 1].append(u - 1) edges.append((u - 1, v - 1)) dp = [0 for _ in range(n)] src = 0 par = [None for _ in range(n)] st = [~ src, src] while len(st) > 0: cur = st.pop() if cur >= 0: for nxt in g[cur]: if nxt == par[cur]: continue par[nxt] = cur st.append(~ nxt) st.append(nxt) else: dp[~ cur] += 1 if not par[~ cur] is None: dp[par[~ cur]] += dp[~ cur] ans = 0 for u, v in edges: if par[u] == v: ans = (ans + dp[u] * (dp[u] - 1) // 2) % MOD ans = (ans + (n - dp[u]) * (n - dp[u] - 1) // 2) % MOD elif par[v] == u: ans = (ans + dp[v] * (dp[v] - 1) // 2) % MOD ans = (ans + (n - dp[v]) * (n - dp[v] - 1) // 2) % MOD ans = (ans * pow(n - 1, MOD - 2, MOD)) % MOD ans = (ans * pow(n * (n - 1) // 2, MOD - 2, MOD)) % MOD print(ans)