Given a list of log lines logs, where each line is a string in the format "timestamp source severity event_id message", and an integer k, return the k most frequent event_id values among lines whose severity is at least min_severity. Severity order is DEBUG < INFO < WARN < ERROR < CRITICAL. If two event IDs have the same frequency, return the lexicographically smaller one first. Ignore malformed lines.
def top_k_security_events(logs, k, min_severity):