Given a tree of nodes, where each node has coins attached with it. You have to choose a subset of nodes such that no two adjacent nodes (i.e. nodes connected directly by an edge) are chosen and sum of coins attached with nodes in chosen subset is maximum.
The first line contains the number of vertices in a tree. Each of the next lines gives two integers and and describes an edge in a tree. The last line contains positive integers — the number of coins in tree nodes.
Print the maximum sum of coins in a chosen subset of tree nodes.