Sum of weights of spanning edges 64 Outputting tree with leader 7 PussInBoots Toonces 5 Puddles Snoopy 1 Figaro Heathcliff 1 Garfield KlondikeKat 1 Jinx Garfield 1 Snoopy Lassie 1 ScoobyDoo OldYeller 1 Spike Toto 1 ScoobyDoo Underdog 1 Toonces KlondikeKat 2 OldYeller Triumph 2 Farfel Underdog 2 Farfel Reveille 2 Garfield Sylvester 2 Odie Barkley 2 Reveille RinTinTin 3 Barkley Marmaduke 3 Cujo Triumph 3 Lassie Barkley 3 BillTheCat Felix 4 BillTheCat Jinx 4 Heathcliff Felix 4 Bingo Cujo 4 Garfield Snoopy 5 Barkley Bingo 5 Spike Snoopy 1