#include #include using namespace std; using namespace atcoder; typedef long long ll; typedef long double ld; typedef pair P; typedef pair Pi; #define rep(i,n) for(ll i=0;i=0;i--) #define rFOR(i,a,b) for(ll i=a-1;i>=b;i--) #define all(x) (x).begin(),(x).end() #define fi first #define se second #define endl "\n" istream &operator>>(istream &is, modint &a) { long long v; is >> v; a = v; return is; } ostream &operator<<(ostream &os, const modint &a) { return os << a.val(); } istream &operator>>(istream &is, modint998244353 &a) { long long v; is >> v; a = v; return is; } ostream &operator<<(ostream &os, const modint998244353 &a) { return os << a.val(); } istream &operator>>(istream &is, modint1000000007 &a) { long long v; is >> v; a = v; return is; } ostream &operator<<(ostream &os, const modint1000000007 &a) { return os << a.val(); } template inline bool chmax(T &a, T b){if(a inline bool chmin(T &a, T b){if(a>b){a=b;return true;}return false;} template ostream& operator<<(ostream& s,const complex& d) {return s<<"("< ostream& operator<<(ostream& s,const pair& d) {return s<<"("< ostream& operator<<(ostream& s, const vector& d){int len=d.size();rep(i,len){s< ostream& operator<<(ostream& s,const vector>& d){int len=d.size();rep(i,len){s< ostream& operator<<(ostream& s,const set& v){s<<"{ ";for(auto itr=v.begin();itr!=v.end();++itr) {if (itr!=v.begin()) {s<< ", ";}s<<(*itr);}s<<" }";return s;} template ostream& operator<<(ostream& s,const multiset& v){s<<"{ ";for(auto itr=v.begin();itr!=v.end();++itr) {if (itr!=v.begin()) {s<< ", ";}s<<(*itr);}s<<" }";return s;} template ostream& operator<<(ostream& s,const map& m){s<<"{"< vector make_vec(size_t n, T a) { return vector(n, a); } template auto make_vec(size_t n, Ts... ts) { return vector(n, make_vec(ts...)); } const ll mod=1'000'000'007; const ll inf=1'000'000'000'000'000'00; const int INF=1'000'000'000; const double EPS=1e-10; const double PI=acos(-1); using mint=modint998244353; struct combination{ vector fact,ifact; combination(int n):fact(n+1),ifact(n+1){ assert(n=1;i--) ifact[i-1]=ifact[i]*i; } mint operator()(int n,int k){ if (k<0 || k>n) return 0; return fact[n]*ifact[k]*ifact[n-k]; } }; int main(){ cin.tie(0);ios::sync_with_stdio(false); int n; cin>>n; vector> g(n); rep(i,n-1){ int u,v; cin>>u>>v; u--,v--; g[u].push_back(v); g[v].push_back(u); } mint ans=0; vector dp(n); combination comb(n+1); auto dfs=[&](auto &&dfs,int v,int pre)->void{ for(auto &&to:g[v]){ if(to==pre) continue; dfs(dfs,to,v); dp[v]+=dp[to]; ans+=comb(dp[to],2); ans+=comb(n-dp[to],2); } dp[v]++; }; dfs(dfs,0,-1); ans/=(n-1); ans/=comb(n,2); cout<