import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; public class Main { static int n; static long ng; static List> list; public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] sa = br.readLine().split(" "); n = Integer.parseInt(sa[0]); list = new ArrayList<>(n); for (int i = 0; i < n; i++) { list.add(new ArrayList<>()); } for (int i = 0; i < n - 1; i++) { sa = br.readLine().split(" "); int a = Integer.parseInt(sa[0]) - 1; int b = Integer.parseInt(sa[1]) - 1; list.get(a).add(b); list.get(b).add(a); } br.close(); int mod = 998244353; dfs(0, -1); long total = (long) n * (n - 1) / 2 * (n - 1); long ok = total - ng; total %= mod; ok %= mod; long mt = modinv(total, mod); long ans = ok * mt % mod; System.out.println(ans); } static int dfs(int x, int p) { int ret = 1; for (int i : list.get(x)) { if (i != p) { int res = dfs(i, x); ret += res; } } ng += (long) ret * (n - ret); return ret; } static long modinv(long a, int m) { long b = m; long u = 1; long v = 0; long tmp = 0; while (b > 0) { long t = a / b; a -= t * b; tmp = a; a = b; b = tmp; u -= t * v; tmp = u; u = v; v = tmp; } u %= m; if (u < 0) u += m; return u; } }