mod = 998244353 n = int(input()) Adj = [set() for _ in range(n)] for _ in range(n-1): u, v = map(int, input().split()) Adj[u-1].add(v-1) Adj[v-1].add(u-1) Parent = [-1]*n Size = [0]*n D = [0] while D: v = D.pop() for nxt in Adj[v]: if nxt != Parent[v]: Parent[nxt] = v D.append(nxt) for i in range(n-1, 0, -1): Size[i] += 1 for child in Adj[i]: if child != Parent[i]: Size[i] += Size[child] ans = 0 cff = pow((n*(n-1)**2)//2, mod-2, mod) for i in range(1, n): s = Size[i] ans += s*(n-s) ans %= mod print(mod-ans*cff%mod)