Write a function to analyze log files for suspicious activity.
Implement analyze_logs(logs), where logs is a list of dictionaries containing integer timestamp, string ip, and string event fields. Return sorted IP addresses with at least three login_failed events occurring within any 300-second inclusive window; ignore other events. Examples: timestamps [0, 150, 300] return the IP, while [0, 301, 602] does not. Constraints: 0 <= len(logs) <= 100, timestamps are nonnegative integers, and each log has all required fields.
timestamp, string ip, and string event fieldslogin_failed are considereddef analyze_logs(logs):