def restore(parent, start, exit):
    if exit not in parent and start != exit:
        return []
    
    path = []
    current = exit
        
    while current != start:
        path.append(current)
        current = parent[current]
        
    path.append(start)
    path.reverse()
    return path