Ringo has an undirected graph $G$ with $N$ vertices numbered $1,2,...,N$ and $M$ edges numbered $1,2,...,M$. Edge $i$ connects Vertex $a_{i}$ and $b_{i}$ and has a length of $w_i$.
Now, he is in the middle of painting these $N$ vertices in $K$ colors numbered $1,2,...,K$. Vertex $i$ is already painted in Color $c_i$, except when $c_i = 0$, in which case Vertex $i$ is not yet painted.
After he paints each vertex that is not yet painted in one of the $K$ colors, he will give $G$ to Snuke.
Based on $G$, Snuke will make another undirected graph $G'$ with $K$ vertices numbered $1,2,...,K$ and $M$ edges. Initially, there is no edge in $G'$. The $i$\-th edge will be added as follows:
* Let $x$ and $y$ be the colors of the two vertices connected by Edge $i$ in $G$.
* Add an edge of length $w_i$ connecting Vertex $x$ and $y$ in $G'$.
What is the minimum possible sum of the lengths of the edges in the minimum spanning tree of $G'$? If $G'$ will not be connected regardless of how Ringo paints the vertices, print $-1$.
## Constraints
* $1 \leq N,M \leq 10^{5}$
* $1 \leq K \leq N$
* $0 \leq c_i \leq K$
* $1 \leq a_i,b_i \leq N$
* $1 \leq w_i \leq 10^{9}$
* The given graph may NOT be simple or connected.
* All input values are integers.
## Input
Input is given from Standard Input in the following format:
$N$ $M$ $K$
$c_1$ $c_2$ $...$ $c_{N}$
$a_1$ $b_1$ $w_1$
$:$
$a_M$ $b_M$ $w_M$
## Partial Scores
* In the test set worth $100$ points, $N = K$ and $c_i = i$.
* In the test set worth another $100$ points, $c_i \neq 0$.
* In the test set worth another $200$ points, $c_i = 0$.
[samples]