Ela need send large package machine 1 machine n network machine currently network condition complain network slow package can not arrive time Luckily Wiring Wizard offer help handThe network represent undirected connect graph n node node represent machine m wire connect Wire connect machine u_i v_i weight w_i the aforementioned large package go wire machine u_i machine v_i vice versa exactly w_i microsecond the Wiring Wizard use spell arbitrary number time for spell choose wire index connect machine u_i v_i rewire follow step choose machine connect wire without loss generality let choose v_i choose machine currently connect v_i include u_i t_i Disconnect wire index v_i connect u_i t_i the rewire wire take w_i microsecond weight wire change operation after rewire machine wire connect also Wiring Wizard warn Ela rewiring cause temporary disconnection machine Ela ignore her mission send large package machine 1 machine n fast possible note Wizard use spell wire zero time to sure network work seamlessly transfer large package package start transfer machine 1 Wiring Wizard use spell wire anymoreEla wonder help Wiring Wizard time need transfer large package machine 1 n