diff --git a/buggy.py b/buggy.py
--- a/buggy.py
+++ b/buggy.py
@@ -3,4 +3,4 @@
 for _ in range(n):
     a, c = map(int, input().split())
     dic[c] = min(dic.get(c, 10**10), a)
-print(max(dic))
+print(max(dic.values()))
