





import operator



def 	_a						(   UpperCAmelCase      ,  UpperCAmelCase = False      ,  UpperCAmelCase = None					)    ->    list:







   """simple docstring"""
   lowerCamelCase__       :						Dict        =							operator.lt if reverse else operator.gt
   lowerCamelCase__       :						Union[str, Any]        =							solution or []

   if not arr:
      return solution

   lowerCamelCase__       :						Optional[int]        =							[arr.pop(0					)]
   for i, item in enumerate(UpperCAmelCase					):
      if _operator(UpperCAmelCase      ,  sublist[-1]					):
         sublist.append(UpperCAmelCase					)
         arr.pop(UpperCAmelCase					)

    #  merging sublist into solution list
   if not solution:
      solution.extend(UpperCAmelCase					)
   else:
      while sublist:
         lowerCamelCase__       :						List[Any]        =							sublist.pop(0					)
         for i, xx in enumerate(UpperCAmelCase					):
            if not _operator(UpperCAmelCase      ,  UpperCAmelCase					):
               solution.insert(UpperCAmelCase      ,  UpperCAmelCase					)
               break
         else:
            solution.append(UpperCAmelCase					)

   strand_sort(UpperCAmelCase      ,  UpperCAmelCase      ,  UpperCAmelCase					)
   return solution


if __name__ == "__main__":
       assert strand_sort([4, 3, 5, 1, 2]) == [1, 2, 3, 4, 5]
       assert strand_sort([4, 3, 5, 1, 2], reverse=True) == [5, 4, 3, 2, 1]










def 	_a						(   UpperCAmelCase					)    ->    int:







   """simple docstring"""

   if not isinstance(UpperCAmelCase      ,  UpperCAmelCase					):
      raise TypeError('''only integers accepted as input'''					)
   else:
      lowerCamelCase__       :						Any        =							str(abs(UpperCAmelCase					)					)
      lowerCamelCase__       :						Union[str, Any]        =							[list(UpperCAmelCase					) for char in range(len(UpperCAmelCase					)					)]
      for index in range(len(UpperCAmelCase					)					):
         num_transpositions[index].pop(UpperCAmelCase					)
      return max(
          int(''''''.join(list(UpperCAmelCase					)					)					) for transposition in num_transpositions					)


if __name__ == "__main__":
       __import__('doctest').testmod()



