diff --git a/buggy.py b/buggy.py
--- a/buggy.py
+++ b/buggy.py
@@ -10,7 +10,7 @@
     for i in range(n):
         for j in range(n):
             for k in range(n):
-                res[i][k] = min(res[i][j], max(A[i][j], B[j][k]))
+                res[i][k] = min(res[i][k], max(A[i][j], B[j][k]))
     return res
 
 
