#include using namespace std; int mod = 998244353; long long modpow(long long a,long long b) { long long ans = 1; while(b) { if(b & 1) { (ans *= a) %= mod; } (a *= a) %= mod; b /= 2; } return ans; } int dp[100005]; vectorki[100005]; int dfs(int n,int p) { for(int i = 0; i < ki[n].size(); i++) { if(ki[n][i] == p) { continue; } dp[n] += dfs(ki[n][i],n); } dp[n]++; return dp[n]; } int main() { int N; cin >> N; vectoru(N-1),v(N-1); for(int i = 0; i < N-1; i++) { cin >> u[i] >> v[i]; u[i]--; v[i]--; ki[u[i]].push_back(v[i]); ki[v[i]].push_back(u[i]); } dfs(0,-1); long long tmp1 = (long long)(N)*(N-1)/2%mod*(N-1)%mod,tmp2 = 0; for(int i = 0; i < N-1; i++) { int mi = min(dp[u[i]],dp[v[i]]); int mx = N-mi; tmp2 += (long long)(mi)*(mi-1)/2; tmp2 %= mod; tmp2 += (long long)(mx)*(mx-1)/2; tmp2 %= mod; } cout << tmp2*modpow(tmp1,mod-2)%mod << endl; }