def METHOD_NAME(query: str) -> Tuple[str, str]:
    m = re.match(r"answer\s+(TICKET....)\s+(.)", query)
    if not m:
        raise InvalidAnswerException()
    ticket_id = m.group(1)
    # In a real world system, we'd validate the ticket_id against
    # a backend system.  (You could use Zulip itself to store incident
    # data, if you want something really lite, but there are plenty
    # of systems that specialize in incident management.)
    answer = m.group(2).upper()
    if answer not in "1234":
        raise InvalidAnswerException()
    return (ticket_id, ANSWERS[answer])