






'''simple docstring'''
def 		__SCREAMING_SNAKE_CASE       (	_UpperCamelCase				):


   """simple docstring"""




   if not all(char in "01" for char in bin_string				):
      raise ValueError("Non-binary value was passed to the function"				)
   if not bin_string:
      raise ValueError("Empty string was passed to the function"				)
   lowercase_						:     List[str]							     =  """"""
   while len(_UpperCamelCase				) % 3 != 0:
      lowercase_						:     Dict							     =  """0""" + bin_string
   lowercase_						:     Union[str, Any]							     =  [
       bin_string[index : index + 3]
       for index in range(len(_UpperCamelCase				)				)
       if index % 3 == 0
   ]
   for bin_group in bin_string_in_3_list:
      lowercase_						:     Any							     =  0
      for index, val in enumerate(_UpperCamelCase				):
         oct_val += int(2 ** (2 - index) * int(_UpperCamelCase				)				)
      oct_string += str(_UpperCamelCase				)
   return oct_string


if __name__ == "__main__":
 from doctest import testmod

 testmod()





"""simple docstring"""



def  _A(		lowerCAmelCase			,  lowerCAmelCase							):
							A__       :     List[Any]								=			[1]
							for i in range(2			,  lowerCAmelCase							):
														factorials.append(factorials[-1] * i							)
							assert 0 <= k < factorials[-1] * n, "k out of bounds"

							A__       :     Union[str, Any]								=			[]
							A__       :     int								=			list(range(lowerCAmelCase							)							)

							# Find permutation
							while factorials:
														A__       :     Optional[int]								=			factorials.pop()
														A__				,							A__       :     Union[str, Any]								=			divmod(lowerCAmelCase			,  lowerCAmelCase							)
														permutation.append(elements[number]							)
														elements.remove(elements[number]							)
							permutation.append(elements[0]							)

							return permutation


if __name__ == "__main__":
				import doctest

				doctest.testmod()





