diff --git a/buggy.py b/buggy.py
--- a/buggy.py
+++ b/buggy.py
@@ -1,7 +1,7 @@
 N = int(input())
 A = [list(map(int, input().split())) for _ in range(N)]
-ans = []
 for i in range(N):
+    ans = []
     for j in range(N):
         if A[i][j] == 1:
             ans.append(j + 1)
