def parse_program(line):
    """Parse line to tuple with name, weight and list of programs above."""
    program, *above = line.split(' -> ')
    name, weight = program.split()
    return name, int(weight[1:-1]), above[0].split(', ') if above else []