

import os
import sys
from contextlib import contextmanager


# Windows only
if os.name == "nt":
					import ctypes
					import msvcrt  # noqa







					class 			lowercase    (	ctypes.Structure      ):
									# _fields is a specific attr expected by ctypes
									__SCREAMING_SNAKE_CASE :			List[Any]	      =      [('''size''', ctypes.c_int), ('''visible''', ctypes.c_byte)]





def  __lowerCamelCase     (			):







							'''simple docstring'''






							if os.name == "nt":
														snake_case_          =   CursorInfo()
														snake_case_          =   ctypes.windll.kernelaa.GetStdHandle(-11				)
														ctypes.windll.kernelaa.GetConsoleCursorInfo(UpperCamelCase__       ,							ctypes.byref(UpperCamelCase__				)				)
														snake_case_          =   False
														ctypes.windll.kernelaa.SetConsoleCursorInfo(UpperCamelCase__       ,							ctypes.byref(UpperCamelCase__				)				)
							elif os.name == "posix":
														sys.stdout.write('\033[?25l'				)
														sys.stdout.flush()





def  __lowerCamelCase     (			):







							'''simple docstring'''






							if os.name == "nt":
														snake_case_          =   CursorInfo()
														snake_case_          =   ctypes.windll.kernelaa.GetStdHandle(-11				)
														ctypes.windll.kernelaa.GetConsoleCursorInfo(UpperCamelCase__       ,							ctypes.byref(UpperCamelCase__				)				)
														snake_case_          =   True
														ctypes.windll.kernelaa.SetConsoleCursorInfo(UpperCamelCase__       ,							ctypes.byref(UpperCamelCase__				)				)
							elif os.name == "posix":
														sys.stdout.write('\033[?25h'				)
														sys.stdout.flush()





@contextmanager
def  __lowerCamelCase     (			):







							'''simple docstring'''






							try:
														hide_cursor()
														yield
							finally:
														show_cursor()







from __future__ import annotations





def  __lowerCamelCase     (			UpperCamelCase__       ,							UpperCamelCase__				):







							'''simple docstring'''






							snake_case_          =   []
							create_all_state(1       ,							UpperCamelCase__       ,							UpperCamelCase__       ,							[]       ,							UpperCamelCase__				)
							return result





def  __lowerCamelCase     (			UpperCamelCase__       ,							UpperCamelCase__       ,							UpperCamelCase__       ,							UpperCamelCase__       ,							UpperCamelCase__       ,							):







							'''simple docstring'''






							if level == 0:
														total_list.append(current_list[:]				)
														return

							for i in range(UpperCamelCase__       ,							total_number - level + 2				):
														current_list.append(UpperCamelCase__				)
														create_all_state(i + 1       ,							UpperCamelCase__       ,							level - 1       ,							UpperCamelCase__       ,							UpperCamelCase__				)
														current_list.pop()





def  __lowerCamelCase     (			UpperCamelCase__				):







							'''simple docstring'''






							for i in total_list:
														print(*UpperCamelCase__				)


if __name__ == "__main__":
					_UpperCAmelCase		:       str						    =	4
					_UpperCAmelCase		:       Tuple						    =	2
					_UpperCAmelCase		:       Optional[int]						    =	generate_all_combinations(n, k)
					print_all_state(total_list)




