#!/usr/bin/env python3

# Try to extract flag by modifying baby.py
# Read the file
with open("baby.py", "r") as f:
    code = f.read()

# Look for the success conditions - try to extract expected values
# Find all instances of g0G0SQuid comparisons and extract the second operand

import re

# Find all comparisons of the form: if g0G0SQuid(...) == g0G0SQuid(expected_val, ...)
pattern = r'if g0G0SQuid\([^)]*\) == g0G0SQuid\(([^,]+), ([^)]+)\):'

matches = re.findall(pattern, code)
print(f"Found {len(matches)} g0G0SQuid comparisons")

# Print first few
for i, (val1, val2) in enumerate(matches[:5]):
    print(f"{i}: g0G0SQuid({val1}, {val2})")

# Also look for the main comparison at the success point
# Find the return True and work backwards
lines = code.split('\n')
for i, line in enumerate(lines):
    if 'return True' in line:
        print(f"\nFound return True at line {i+1}")
        # Print context
        for j in range(max(0, i-3), min(len(lines), i+3)):
            print(f"{j+1}: {lines[j]}")
        break
