def generate_tree(possible_moves, depth, maxdepth):
    tree = []
    for move in possible_moves:
        move_profile = [move]
        if depth < maxdepth:
            possible_moves2 = possible_moves.copy()
            possible_moves2.remove(move)
            move_profile.append(generate_tree(possible_moves2, depth + 1, maxdepth))
        tree.append(move_profile)
    return(tree)
