#include using namespace std; using ll = long long int; using ld = long double; #define pow(n,m) powl(n,m) #define sqrt(n) sqrtl(n) const ll MAX = 1000000000000000000; const ll MOD = 998244353; void randinit(){srand((unsigned)time(NULL));} ll modinv(ll A,ll M){ //A*r+B*n=gcd(A,B) A %= M; if(A == 0 || __gcd(A,M) != 1){ //cout << "Error modinv(" << A << "," << M << ")" << endl; return -1; } ll B = M,U = 1,V = 0; while(B){ ll T = A / B; A -= T * B; swap(A,B); U -= T * V; swap(U,V); } U %= M; if(U < 0) U += M; return U; } ll N; vector> G(100000); vector S(100000,0); ll s = 0; ll dfs(ll n){ if(S[n] == 1) return 0; S[n] = 1; ll ans = 1; for(ll i = 0;i < G[n].size();i++) ans += dfs(G[n][i]); if(n != 0) s += (ans * (ans - 1)); if(n != 0)s += ((N - ans) * (N - ans - 1)); s %= MOD; return ans; } int main(){ cin >> N; for(ll i = 0;i < N - 1;i++){ ll a,b; cin >> a >> b; G[a - 1].emplace_back(b - 1); G[b - 1].emplace_back(a - 1); } dfs(0); ll t = (N * (N - 1)) % MOD; t = (t * (N - 1)) % MOD; s = (s * modinv(2,MOD)) % MOD; t = (t * modinv(2,MOD)) % MOD; cout << (s * modinv(t,MOD)) % MOD << endl; }