def parse_dict(input_data):
    """Return a rules dict of the format:
    {
    'light red': [(1, 'bright white'), (2, 'muted yellow')],
    'dark orange': [(3, bright white), (4, muted yellow)],
    'faded blue': [(0, 'bags')]
    }
    """
    
    bags = dict()
    for line in input_data.split('\n'):
        outer, inner = line.strip().split(' bags contain ')
        inner = [i.split(' ') for i in inner.split(", ")]
        if 'no' in inner[0]:
            bags[outer] = [(0, 'bags')]
        else:
            bags[outer] = [(int(i[0]), ' '.join(i[1:3])) for i in inner]
    return bags