diff --git a/buggy.py b/buggy.py
--- a/buggy.py
+++ b/buggy.py
@@ -4,7 +4,7 @@
     q = int(input())
     ans = {}
     tmp = {"value": -1, "list": set()}
-    for _ in range(n):
+    for _ in range(q):
         i = list(map(int, input().split()))
         if i[0] == 1:
             tmp["value"] = i[1]
