Given a list of log lines logs, return the names of all services whose deployment sessions end in an invalid state. Each line is a string in one of these forms: START service_name, END service_name, or ERROR service_name. A service is invalid if its events are not properly nested, if an END appears without a matching open START, if names mismatch on close, if an ERROR occurs while that service is active, or if the service remains open after all logs are processed. Return the invalid service names in sorted order without duplicates.