You are given a connected, undirected, weighted graph G with N vertices and M edges. G has no self-loops, and at most one edge joins any pair of vertices.
For each edge (u,v), compute the total weight of a minimum spanning tree that is forced to contain that edge.
Input
The first line contains the number of vertices N and the number of edges M (2≤N≤200000, N−1≤M≤200000).
Each of the next M lines contains the edge information u, v, w, meaning that the edge joining vertex u and vertex v has weight w (1≤u,v≤N, u=v, 1≤w≤109).
Output
For each edge, print the total weight of a minimum spanning tree containing that edge, one per line. Print the answers in the order the edges are given in the input.