diff --git a/buggy.py b/buggy.py
--- a/buggy.py
+++ b/buggy.py
@@ -1,5 +1,5 @@
 n, k = map(int, input().split())
-s = [input() for _ in range(n)]
+s = [input() for _ in range(k)]
 s.sort()
 for i in range(k):
     print(s[i])
