def is_valid_solution_by_config_id(self, solution, config_id):
    if ((0 <= config_id < 4) and solution.solution_shoulder_left.is_valid_solution):
        if ((0 <= config_id < 2) and solution.solution_shoulder_left.solution_wrist_up.is_valid_solution):
            if ((config_id == 0) and solution.solution_shoulder_left.solution_wrist_up.solution_elbow_up.is_valid_solution):
                return True
            if ((config_id == 1) and solution.solution_shoulder_left.solution_wrist_up.solution_elbow_down.is_valid_solution):
                return True
        if ((2 <= config_id < 4) and solution.solution_shoulder_left.solution_wrist_down.is_valid_solution):
            if ((config_id == 2) and solution.solution_shoulder_left.solution_wrist_down.solution_elbow_up.is_valid_solution):
                return True
            if ((config_id == 3) and solution.solution_shoulder_left.solution_wrist_down.solution_elbow_down):
                return True
    if ((4 <= config_id < 8) and solution.solution_shoulder_right.is_valid_solution):
        if ((4 <= config_id < 6) and solution.solution_shoulder_right.solution_wrist_up.is_valid_solution):
            if ((config_id == 4) and solution.solution_shoulder_right.solution_wrist_up.solution_elbow_up.is_valid_solution):
                return True
            if ((config_id == 5) and solution.solution_shoulder_right.solution_wrist_up.solution_elbow_down.is_valid_solution):
                return True
        if ((6 <= config_id < 8) and solution.solution_shoulder_right.solution_wrist_down.is_valid_solution):
            if ((config_id == 6) and solution.solution_shoulder_right.solution_wrist_down.solution_elbow_up.is_valid_solution):
                return True
            if ((config_id == 7) and solution.solution_shoulder_right.solution_wrist_down.solution_elbow_down.is_valid_solution):
                return True
    else:
        return False
def is_valid_solution_by_config_id(self, solution, config_id):
    if ((0 <= config_id < 4) and solution.solution_shoulder_left.is_valid_solution):
        if ((0 <= config_id < 2) and solution.solution_shoulder_left.solution_wrist_up.is_valid_solution):
            if ((config_id == 0) and solution.solution_shoulder_left.solution_wrist_up.solution_elbow_up.is_valid_solution):
                return True
            if ((config_id == 1) and solution.solution_shoulder_left.solution_wrist_up.solution_elbow_down.is_valid_solution):
                return True
        if ((2 <= config_id < 4) and solution.solution_shoulder_left.solution_wrist_down.is_valid_solution):
            if ((config_id == 2) and solution.solution_shoulder_left.solution_wrist_down.solution_elbow_up.is_valid_solution):
                return True
            if ((config_id == 3) and solution.solution_shoulder_left.solution_wrist_down.solution_elbow_down):
                return True
    if ((4 <= config_id < 8) and solution.solution_shoulder_right.is_valid_solution):
        if ((4 <= config_id < 6) and solution.solution_shoulder_right.solution_wrist_up.is_valid_solution):
            if ((config_id == 4) and solution.solution_shoulder_right.solution_wrist_up.solution_elbow_up.is_valid_solution):
                return True
            if ((config_id == 5) and solution.solution_shoulder_right.solution_wrist_up.solution_elbow_down.is_valid_solution):
                return True
        if ((6 <= config_id < 8) and solution.solution_shoulder_right.solution_wrist_down.is_valid_solution):
            if ((config_id == 6) and solution.solution_shoulder_right.solution_wrist_down.solution_elbow_up.is_valid_solution):
                return True
            if ((config_id == 7) and solution.solution_shoulder_right.solution_wrist_down.solution_elbow_down.is_valid_solution):
                return True
    else:
        return False