I have a list of distances that stores the value of each node after they have been relaxed n-1 times by the Bellman Ford algorithm.
The index of the elements in dista