diff --git a/buggy.py b/buggy.py
--- a/buggy.py
+++ b/buggy.py
@@ -19,7 +19,7 @@
             return (xr * x + yr) % p
 
         if a == 0:
-            print(0 if s == g else 1 if g == 0 else -1)
+            print(0 if s == g else 1 if g == b else -1)
         else:
             print(bsgs2(s, g, r, f, fr))
 
