Path Magic

Find the simple path in a tree minimizing (product of node values)/(path length), and output the reduced fraction.

Medium7MathDFSGreedyNo attempts yetTime limit4sMemory limit256 MB

Problem

You are given an undirected tree in which every node has a magic value. Node ii has magic XiX_i.

The magic of a path is the product of the magic values of the nodes on that path, divided by the number of nodes on the path. For example, a path made of a node with magic 3 and a node with magic 5 has magic 3×5/2=7.53 \times 5 / 2 = 7.5.

Find the path with the smallest magic in the given tree and print the magic of that path.

Input

The first line contains the number of nodes NN (1N1061 \le N \le 10^6).

Each of the next N1N-1 lines contains the labels AiA_i and BiB_i of two nodes joined by an edge (1Ai,BiN1 \le A_i, B_i \le N).

The ii-th of the next NN lines contains the magic XiX_i of node ii (1Xi1091 \le X_i \le 10^9).

The given graph is always a tree.

Output

Print the magic of the path with the smallest magic on one line, as a fully reduced fraction P/Q. PP and QQ are coprime positive integers, and the denominator is written out even when it is 1. In every test case PP and QQ are smaller than 101810^{18}.

Note

A path may start and end at the same node, so a path made of a single node is also a candidate.