Valera undirecte connected graph selfloop multiple edge consist n vertex the graph interesting property k edge adjacent vertex for convenience assume graph vertex index integer 1 nOne day Valera count short distance graph vertex one write array d thus element di array show short distance vertex Valera choose vertex number iThen irreparable terrible happen Valera lose initial graph however array d help restore lost graph