def process_data(data: str) -> tuple[str, dict[str, str]]:
    """ Process one row of template, then an empty line, then rows of rules

    Returns:
        tuple[str, dict[str, str]]: (template, rules-dict)
            where rules-dict looks like {'CH':'B', 'HH':'N', ...}
    """
    template, _, rules_lines = data.partition('\n\n')
    rules = {}
    for line in rules_lines.splitlines():
        if len(line) > 0:
            pair, element = line.split(" -> ")
            rules[pair] = element
        
    return template, rules