Tree
You are given an undirected tree with each of its node assigned a magic .
The magic of a path (a path in a graph is a finite sequence of edges which connect a sequence of vertices which are all distinct from one another) is defined as the product of the magic of the nodes on that path divided by the number of the nodes on the path. For example, the magic of a path that consists of nodes with magic and is .
In the given tree, find the path with the minimal magic and output the magic of that path.
Input
The first line contains the integer , the number of nodes in the tree.
Each of the following lines contains two integers and , the labels of nodes connected with an edge.
The -th of the following lines contains the integer , magic of the -th node.
Output
Output the magic of the path with minimal magic in the form of a completely reduced fraction and are relatively prime integers). In all test cases, it will hold that the required and are smaller than .
Examples
First test case. Notice that the path may begin and end in the same node. The path with the minimal magic consists of the node with magic , so the entire path’s magic is .
Second test case. The path that consists of nodes with labels and is of magic . That is also the path with the minimal possible magic.