Input edges
ArrayList < Pair < Pair < Integer , Integer > , Integer > > ed = new ArrayList < > ( Arrays . asList ( new Pair < Pair < Integer , Integer > , Integer > ( new Pair < Integer , Integer > ( 0 , 1 ) , 10 ) , new Pair < Pair < Integer , Integer > , Integer > ( new Pair < Integer , Integer > ( 0 , 2 ) , 3 ) , new Pair < Pair < Integer , Integer > , Integer > ( new Pair < Integer , Integer > ( 0 , 3 ) , 2 ) , new Pair < Pair < Integer , Integer > , Integer > ( new Pair < Integer , Integer > ( 1 , 3 ) , 7 ) , new Pair < Pair < Integer , Integer > , Integer > ( new Pair < Integer , Integer > ( 2 , 3 ) , 7 ) ) ) ;