n=int(input()) e=[[] for i in range(n)] for i in range(n-1): a,b=map(int,input().split()) a-=1 b-=1 e[a]+=[b] e[b]+=[a] M=998244353 p=0 v=[0]*n c=[0]*n q=[0] while len(q)>0: s=q[-1] if v[s]==0: v[s]=1 q+=[t for t in e[s] if v[t]==0] else: c[s]+=1 c[s]+=sum(c[t]*(v[t]==0) for t in e[s]) if s!=0: p+=c[s]*(c[s]-1)+(n-c[s])*(n-c[s]-1) p%=M v[s]=0 q.pop() print(p*pow(n*(n-1)*(n-1),M-2,M)%M)