diff --git a/buggy.py b/buggy.py
--- a/buggy.py
+++ b/buggy.py
@@ -25,5 +25,5 @@
         if kt > k - 1:
             kt = k - 1
         heapq.heappush(P, (-kt * d - l, A))
-for a in ans:
+for a in ans[:-1]:
     print(a if a >= 0 else "Unreachable")
