def split_rules_and_strings(arr):
    """
    Given a list of strings,
    representing the rules
    and the query strings,
    split the rules and strings
    into a dictionary and a list
    for further use.

    :param arr: A list of strings.
    :return: A tuple of dict and list
    representing the ruleset and the
    query strings.
    """
    rules = dict()
    string_time = False
    strings = []
    for idx, elem in enumerate(arr):
        if elem == "":
            string_time = True
        elif not string_time:
            head, *rest = elem.split(": ")
            rules[int(head)] = "".join(rest)
        else:
            strings.append(elem)
    return rules, strings