Graph: (), (), (), (). Run Bellman-Ford from node . After iterations, dist[1] = -6, dist[2] = -1, dist[3] = -3. The -th iteration improves dist[2] (to ) via edge . Set parent[2] = 1.
Walk back steps from node : . After steps, you are at node (inside the cycle). Follow parents from : . Reverse to get forward cycle . Output: .