import java.io.*; import java.util.*; import java.math.BigInteger; public class Main { static class Edge { int u, v, w, index; public Edge(int u, int v, int w, int index) { this.u = u; this.v = v; this.w = w; this.index = index; ...