


'''simple docstring'''
from __future__ import annotations

import sys
from collections import deque
from typing import Generic, TypeVar

UpperCamelCase__          = TypeVar('''T''')




class      lowerCamelCase_  (      Generic[T] ):
      lowerCAmelCase__							=	42  # Cache store of keys
      lowerCAmelCase__							=	42  # References of the keys in cache
      lowerCAmelCase__							=	1_0  # Maximum capacity of cache






      def __init__(   self							:       Optional[int]		,		_A							:       Dict					):


          '''simple docstring'''


          UpperCAmelCase__     :						Tuple						=							deque()
          UpperCAmelCase__     :						List[Any]						=							set()
          if not n:
              UpperCAmelCase__     :						List[Any]						=							sys.maxsize
          elif n < 0:
              raise ValueError('''n should be an integer greater than 0.'''					)
          else:
              UpperCAmelCase__     :						Optional[int]						=							n






      def lowercase_				(   self							:       int		,		_A							:       Any					):


          '''simple docstring'''


          if x not in self.key_reference:
              if len(self.dq_store					) == LRUCache._MAX_CAPACITY:
                  UpperCAmelCase__     :						Union[str, Any]						=							self.dq_store.pop()
                  self.key_reference.remove(__snake_case					)
          else:
              self.dq_store.remove(__snake_case					)

          self.dq_store.appendleft(__snake_case					)
          self.key_reference.add(__snake_case					)






      def lowercase_				(   self							:       List[Any]					):


          '''simple docstring'''


          for k in self.dq_store:
              print(__snake_case					)






      def __repr__(   self							:       int					):


          '''simple docstring'''


          return f"""LRUCache({self._MAX_CAPACITY}) => {list(self.dq_store					)}"""


if __name__ == "__main__":
  import doctest

  doctest.testmod()

  UpperCamelCase__          = LRUCache(4)
  lru_cache.refer('''A''')
  lru_cache.refer(2)
  lru_cache.refer(3)
  lru_cache.refer('''A''')
  lru_cache.refer(4)
  lru_cache.refer(5)
  lru_cache.display()

  print(lru_cache)
  assert str(lru_cache) == "LRUCache(4) => [5, 4, 'A', 3]"







def      UpperCAmelCase_    (    _UpperCAmelCase							:list				)	->				list:
     '''simple docstring'''


     if len(_UpperCAmelCase				) < 2:
          return collection

     def circle_sort_util(_UpperCAmelCase							:list  ,						_UpperCAmelCase							:int  ,						_UpperCAmelCase							:int				) -> bool:
          A_          =       False

          if low == high:
               return swapped

          A_          =       low
          A_          =       high

          while left < right:
               if collection[left] > collection[right]:
                    A_   ,    A_          =       (
                        collection[right],
                        collection[left],
                    )
                    A_          =       True

               left += 1
               right -= 1

          if left == right and collection[left] > collection[right + 1]:
               A_   ,    A_          =       (
                   collection[right + 1],
                   collection[left],
               )

               A_          =       True

          A_          =       low + int((high - low) / 2				)
          A_          =       circle_sort_util(_UpperCAmelCase  ,						_UpperCAmelCase  ,						_UpperCAmelCase				)
          A_          =       circle_sort_util(_UpperCAmelCase  ,						mid + 1  ,						_UpperCAmelCase				)

          return swapped or left_swap or right_swap

     A_          =       True

     while is_not_sorted is True:
          A_          =       circle_sort_util(_UpperCAmelCase  ,						0  ,						len(_UpperCAmelCase				) - 1				)

     return collection


if __name__ == "__main__":
      a__      :     Optional[Any]         =		input('Enter numbers separated by a comma:\n').strip()
      a__      :     List[str]         =		[int(item) for item in user_input.split(',')]
      print(circle_sort(unsorted))



