The ruler of Byteland has decided to make a grand tour through every city of the country. A long time has passed since the previous tour, and in the meantime the country's cities and road network have changed considerably.
Byteland has $N$ cities, and some pairs of cities are connected by roads. Of these roads, $M$ are owned by the state and the remaining $K$ are privately owned. Every road can be traveled in both directions. Between any two cities there is at most one road. Moreover, using state and private roads together, it is possible to travel from any city to every other city.
The ruler wants to use only state-owned roads on the tour. To make this possible, the government has found out, for each private road, the price at which the state could buy it. At the same time, not every state road is needed for the tour, so unneeded state roads can be sold and the money used to buy private roads.
For the tour you must build a road network in which the ruler can visit all cities (passing through the same city several times is allowed if the network requires it), while spending as little money from the treasury as possible. When a state road is sold, its proceeds are first used to buy private roads, and money is taken from the treasury only when the proceeds are not enough. Any money left over after selling and buying is not returned to the treasury.
Find the minimum amount that must be taken from the treasury so that the ruler can visit all cities.
The first line contains three integers $N$, $M$, and $K$ separated by spaces ($1 \le N \le 10^5$, $1 \le M \le 10^5$, $1 \le K \le 10^5$): the number of cities, the number of state roads, and the number of private roads, respectively.
Each of the next $M$ lines contains three integers $X$, $Y$, and $S_{X,Y}$ ($1 \le X < Y \le N$, $0 \le S_{X,Y} \le 10^9$): a state road connecting cities $X$ and $Y$ and its selling price.
Each of the following $K$ lines contains three integers $X$, $Y$, and $B_{X,Y}$ ($1 \le X < Y \le N$, $0 \le B_{X,Y} \le 10^9$): a private road connecting cities $X$ and $Y$ and its buying price.
Output a single non-negative integer: the minimum amount that must be taken from the treasury to build a road network in which the ruler can visit all cities.