





'''simple docstring'''




def 	UpperCAmelCase_							(					__lowercase							:      list[int]       )		->       list[list[int]]:


     '''simple docstring'''



     _UpperCAmelCase     							=   []
     if len(__lowercase       ) == 1:
          return [nums.copy()]
     for _ in range(len(__lowercase       )       ):
          _UpperCAmelCase     							=   nums.pop(0       )
          _UpperCAmelCase     							=   permute(__lowercase       )
          for perm in permutations:
               perm.append(__lowercase       )
          result.extend(__lowercase       )
          nums.append(__lowercase       )
     return result
def 	UpperCAmelCase_							(					__lowercase							:      str       )		->       str:


     '''simple docstring'''



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

     _UpperCAmelCase     							=   []
     backtrack(0       )
     return output


if __name__ == "__main__":
  import doctest

  # use res to print the data in permute2 function
  __SCREAMING_SNAKE_CASE     :Union[str, Any]       =				permutea([1, 2, 3])
  print(res)
  doctest.testmod()











'''simple docstring'''




def 	UpperCAmelCase_							(					__lowercase							:      str       )		->       str:


     '''simple docstring'''



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


if __name__ == "__main__":
  import doctest

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




