diff --git a/buggy.py b/buggy.py
--- a/buggy.py
+++ b/buggy.py
@@ -6,7 +6,7 @@
 for i in range(N):
     if a[i][0] > a[i][1]:
         cnt += 1
-ans = max(a[0]) if cnt & 2 == 0 else min(a[0])
+ans = max(a[0]) if cnt % 2 == 0 else min(a[0])
 for i in range(1, N):
     ans += max(a[i])
 
