generate_next_permuation