def invmod(a,mod):#mod逆元 if a == 0: return 0 if a == 1: return 1 return (-invmod(mod % a, mod) * (mod // a)) % mod N = int(input()) lsg = [[] for i in range(N)] mod = 998244353 for i in range(N-1): u,v = map(int,input().split()) u -= 1 v -= 1 lsg[u].append(v) lsg[v].append(u) he = dict() chil = [0]*N used = [False]*N def dfs(p,n): if used[n]: return chil[n] chil[n] = 1 for j in lsg[n]: if j == p: continue d = dfs(n,j) chil[n] += d he[(j,n)] = d return chil[n] dfs(-1,0) al = (N-1)*N*(N-1)//2 for v in he.values(): al -= v*(N-v) al %= mod a = (N-1)*N*(N-1)//2 av = invmod(a, mod) print((al*av)%mod)