Tree and Primes

In a tree, count pairs of nodes whose path length is prime, and output the probability as a reduced fraction.

Medium7TreeDFSNumber theoryNo attempts yetTime limit3sMemory limit512 MB

Problem

A tree with NN nodes is given. Pick two distinct nodes uniformly at random, then find the probability that the distance between them is a prime number.

The distance between two nodes is the number of edges on the unique path that joins them. All (N2)\binom{N}{2} ways of picking two distinct nodes are equally likely.

Input

The first line contains the number of nodes NN. (2N1000002 \le N \le 100000)

Each of the next N1N-1 lines contains one edge of the tree, given as the numbers uu and vv of the two nodes it joins. (1u,vN1 \le u, v \le N, uvu \ne v) The nodes are numbered from 11 to NN, and the given edges always form a tree.

Output

Print the probability that the distance between the two chosen nodes is prime, as a fraction in lowest terms. If the probability is pq\frac{p}{q} with coprime integers pp and qq and q1q \ge 1, print p/q on one line with no spaces. Print 0/1 when the probability is 00, and 1/1 when it is 11.