A maze is represented by a tree (an undirected graph, where exactly one way exists between each pair of vertices). In the maze the entrance vertex and the exit vertex are chosen with some probability. The exit from the maze is sought by Deep First Search. If there are several possible ways to move, the move is chosen equiprobably. Consider the following pseudo-code:

*V*(*x*) is the list vertices adjacent to *x*. The *flag* array is initially filled as FALSE. *DFS* initially starts with a parameter of an entrance vertex. When the search is finished, variable *count* will contain the number of moves.

Your task is to count the mathematical expectation of the number of moves one has to do to exit the maze.
The first line determines the number of vertices in the graph *n* (1 ≤ *n* ≤ 10<sup class="upper-index">5</sup>). The next *n* - 1 lines contain pairs of integers *a*<sub class="lower-index">*i*</sub> and *b*<sub class="lower-index">*i*</sub>, which show the existence of an edge between *a*<sub class="lower-index">*i*</sub> and *b*<sub class="lower-index">*i*</sub> vertices (1 ≤ *a*<sub class="lower-index">*i*</sub>, *b*<sub class="lower-index">*i*</sub> ≤ *n*). It is guaranteed that the given graph is a tree.

Next *n* lines contain pairs of non-negative numbers *x*<sub class="lower-index">*i*</sub> and *y*<sub class="lower-index">*i*</sub>, which represent the probability of choosing the *i*-th vertex as an entrance and exit correspondingly. The probabilities to choose vertex *i* as an entrance and an exit equal <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/a73c036480835f8a2e503c184293d5e5bd3dbda3.png" style="max-width: 100.0%;max-height: 100.0%;"/> and <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/b895588b3f4daa45cd2c1e9adde5ff651dda00bc.png" style="max-width: 100.0%;max-height: 100.0%;"/> correspondingly. The sum of all *x*<sub class="lower-index">*i*</sub> and the sum of all *y*<sub class="lower-index">*i*</sub> are positive and do not exceed 10<sup class="upper-index">6</sup>.
print("_RANDOM_GUESS_1690505941.9318883")# 1690505941.9319108