Poilog who got a 4.0 grade in mathematical analysis, invented a game called Poilogtopia. Today he invites his friend Vltava, a master in game theory, to play Poilogtopia with him.
There are castles on the map of Poilogtopia, the
of which has gained
coins. The castles are initially connected with
undirected weighted roads, the
of which connects castle
with weight
. At the beginning of the game, Poilog is given
additional roads, in which he can choose the first
roads to construct. Constructing the
road would cost Poilog
coins, which must be taken into account.
Poilog's score
Vltava would like to maximize , while Poilog would like to minimize
.
Smart as Vltava and Poilog are, they would both choose the optimal strategy. As you are a huge fan of the two experts, please compute the final result .
The first line contains three integers
.
The second line containsintegers
.
The third line containsintegers
.
The next
lines each contain three integers
, each describing a weighted road. Notice that the first
roads are initially placed on the map, and the following
roads are additional roads which Poilog would choose to add with certain costs.
It is guaranteed that for all
roads, no two roads connect the same set of castles.
Note that the castles do not have to be connected.
Output one single integer indicating