


"""simple docstring"""







def        UpperCAmelCase__	(lowerCAmelCase_  ,						lowerCAmelCase_       ):




					'''simple docstring'''


					__SCREAMING_SNAKE_CASE						       =    [1]
					for i in range(2  ,						a__       ):
										factorials.append(factorials[-1] * i       )
					assert 0 <= k < factorials[-1] * n, "k out of bounds"

					__SCREAMING_SNAKE_CASE						       =    []
					__SCREAMING_SNAKE_CASE						       =    list(range(a__       )       )

					# Find permutation
					while factorials:
										__SCREAMING_SNAKE_CASE						       =    factorials.pop()
										__SCREAMING_SNAKE_CASE       ,  __SCREAMING_SNAKE_CASE						       =    divmod(a__  ,						a__       )
										permutation.append(elements[number]       )
										elements.remove(elements[number]       )
					permutation.append(elements[0]       )

					return permutation


if __name__ == "__main__":
		import doctest

		doctest.testmod()




"""simple docstring"""







def        UpperCAmelCase__	(lowerCAmelCase_       ):




					'''simple docstring'''


					return " ".join(
					    "".join(word[::-1]       ) if len(lowerCAmelCase_       ) > 4 else word for word in sentence.split()       )


if __name__ == "__main__":
		import doctest

		doctest.testmod()
		print(reverse_long_words('''Hey wollef sroirraw'''))
