






from __future__ import annotations


def __A    (      __lowerCAmelCase ,		__lowerCAmelCase	)->  Union[str, Any]:





						"""simple docstring"""



						if len(SCREAMING_SNAKE_CASE__	) <= 1 or n <= 1:
												return

						insert_next(SCREAMING_SNAKE_CASE__ ,		n - 1	)
						rec_insertion_sort(SCREAMING_SNAKE_CASE__ ,		n - 1	)


def __A    (      __lowerCAmelCase ,		__lowerCAmelCase	)->  List[Any]:





						"""simple docstring"""



						if index >= len(SCREAMING_SNAKE_CASE__	) or collection[index - 1] <= collection[index]:
												return

						# Swaps adjacent elements since they are not in ascending order
						_UpperCAmelCase					, _UpperCAmelCase									=			(
						    collection[index],
						    collection[index - 1],
						)

						insert_next(SCREAMING_SNAKE_CASE__ ,		index + 1	)


if __name__ == "__main__":
		_a      	=  input('''Enter integers separated by spaces: ''')
		_a      	=  [int(num) for num in numbers.split()]
		rec_insertion_sort(number_list, len(number_list))
		print(number_list)



def   __SCREAMING_SNAKE_CASE					(SCREAMING_SNAKE_CASE__       ):
						snake_case_   =	[]
						if len(SCREAMING_SNAKE_CASE__       ) == 1:
												return [nums.copy()]
						for _ in range(len(SCREAMING_SNAKE_CASE__       )       ):
												snake_case_   =	nums.pop(0       )
												snake_case_   =	permute(SCREAMING_SNAKE_CASE__       )
												for perm in permutations:
																		perm.append(SCREAMING_SNAKE_CASE__       )
												result.extend(SCREAMING_SNAKE_CASE__       )
												nums.append(SCREAMING_SNAKE_CASE__       )
						return result


def   __SCREAMING_SNAKE_CASE					(SCREAMING_SNAKE_CASE__       ):

						def backtrack(SCREAMING_SNAKE_CASE__       ):
												if start == len(SCREAMING_SNAKE_CASE__       ) - 1:
																		output.append(nums[:]       )
												else:
																		for i in range(SCREAMING_SNAKE_CASE__  ,		len(SCREAMING_SNAKE_CASE__       )       ):
																								snake_case_,    snake_case_   =	nums[i], nums[start]
																								backtrack(start + 1       )
																								snake_case_,    snake_case_   =	nums[i], nums[start]  # backtrack

						snake_case_   =	[]
						backtrack(0       )
						return output


if __name__ == "__main__":
					import doctest

					# use res to print the data in permute2 function
					lowerCAmelCase_       	=	permutea([1, 2, 3])
					print(res)
					doctest.testmod()