def extract_data(data: str) -> tuple:
    """ Extract polymer template and pair insertion rules """
    
    polymer, rules = data.split('\n\n')
    rules = dict(list(map(lambda x: x.split(' -> '), rules.splitlines())))
    return polymer, rules