def extract(input_data: str) -> tuple:
    """take input data and return the appropriate data structure"""
    rules = dict()
    messages = list()
    rules_input, messages_input = input_data.split('\n\n')[0:2]

    for rule_input in rules_input.split('\n'):
        rule_id, rule = rule_input.split(': ')
        rules[rule_id] = rule

    messages = messages_input.split('\n')

    return rules, messages