import re


def parse(data):
    """separate starting molecule from substitution rules"""
    start = data.strip().split('\n')[0]
    rules = dict(re.findall(r'(\w\w) -> (\w)', data))
    return start, rules