wa in spoj Cobbled streets!!!

spoj
wa

#1

hey constantly getting WA…though i have applied kruskal algorithm…plzzz help me guys.http://www.spoj.com/problems/CSTREET/ .here my code http://ideone.com/pAhcao