"""simple docstring"""







def 			lowercase__(       __SCREAMING_SNAKE_CASE							:     str     ,			__SCREAMING_SNAKE_CASE							:     int      ):
     lowercase_	:				list[list[str]]													=	[[] for _ in range(__SCREAMING_SNAKE_CASE      )]
     lowercase_	:				str													=	key - 1

     if key <= 0:
          raise ValueError('Height of grid can\'t be 0 or negative'      )
     if key == 1 or len(__SCREAMING_SNAKE_CASE      ) <= key:
          return input_string

     for position, character in enumerate(__SCREAMING_SNAKE_CASE      ):
          lowercase_	:				Tuple													=	position % (lowest * 2)  # puts it in bounds
          lowercase_	:				List[str]													=	min(__SCREAMING_SNAKE_CASE     ,			lowest * 2 - num      )  # creates zigzag pattern
          temp_grid[num].append(__SCREAMING_SNAKE_CASE      )
     lowercase_	:				List[str]													=	[''.join(__SCREAMING_SNAKE_CASE      ) for row in temp_grid]
     lowercase_	:				List[str]													=	''.join(__SCREAMING_SNAKE_CASE      )

     return output_string



def 			lowercase__(       __SCREAMING_SNAKE_CASE							:     str     ,			__SCREAMING_SNAKE_CASE							:     int      ):
     lowercase_	:				List[str]													=	[]
     lowercase_	:				Dict													=	key - 1

     if key <= 0:
          raise ValueError('Height of grid can\'t be 0 or negative'      )
     if key == 1:
          return input_string

     lowercase_	:				list[list[str]]													=	[[] for _ in range(__SCREAMING_SNAKE_CASE      )]  # generates template
     for position in range(len(__SCREAMING_SNAKE_CASE      )      ):
          lowercase_	:				str													=	position % (lowest * 2)  # puts it in bounds
          lowercase_	:				List[Any]													=	min(__SCREAMING_SNAKE_CASE     ,			lowest * 2 - num      )  # creates zigzag pattern
          temp_grid[num].append('*'      )

     lowercase_	:				List[Any]													=	0
     for row in temp_grid:  # fills in the characters
          lowercase_	:				int													=	input_string[counter : counter + len(__SCREAMING_SNAKE_CASE      )]
          grid.append(list(__SCREAMING_SNAKE_CASE      )      )
          counter += len(__SCREAMING_SNAKE_CASE      )

     lowercase_	:				int													=	''  # reads as zigzag
     for position in range(len(__SCREAMING_SNAKE_CASE      )      ):
          lowercase_	:				Optional[int]													=	position % (lowest * 2)  # puts it in bounds
          lowercase_	:				Optional[int]													=	min(__SCREAMING_SNAKE_CASE     ,			lowest * 2 - num      )  # creates zigzag pattern
          output_string += grid[num][0]
          grid[num].pop(0      )
     return output_string



def 			lowercase__(       __SCREAMING_SNAKE_CASE							:     str      ):
     lowercase_	:				Dict													=	{}
     for key_guess in range(1     ,			len(__SCREAMING_SNAKE_CASE      )      ):  # tries every key
          lowercase_	:				List[Any]													=	decrypt(__SCREAMING_SNAKE_CASE     ,			__SCREAMING_SNAKE_CASE      )
     return results


if __name__ == "__main__":
       import doctest

       doctest.testmod()


"""simple docstring"""







def 			lowercase__(       __SCREAMING_SNAKE_CASE							:     list      ):

     if len(__SCREAMING_SNAKE_CASE      ) < 2:
          return collection

     def circle_sort_util(__SCREAMING_SNAKE_CASE							:     list     ,			__SCREAMING_SNAKE_CASE							:     int     ,			__SCREAMING_SNAKE_CASE							:     int      ) -> bool:
          lowercase_	:				Any													=	False

          if low == high:
               return swapped

          lowercase_	:				str													=	low
          lowercase_	:				int													=	high

          while left < right:
               if collection[left] > collection[right]:
                    lowercase_							,  lowercase_	:				Optional[Any]													=	(
                        collection[right],
                        collection[left],
                    )
                    lowercase_	:				Tuple													=	True

               left += 1
               right -= 1

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

               lowercase_	:				str													=	True

          lowercase_	:				Optional[Any]													=	low + int((high - low) / 2      )
          lowercase_	:				str													=	circle_sort_util(__SCREAMING_SNAKE_CASE     ,			__SCREAMING_SNAKE_CASE     ,			__SCREAMING_SNAKE_CASE      )
          lowercase_	:				List[Any]													=	circle_sort_util(__SCREAMING_SNAKE_CASE     ,			mid + 1     ,			__SCREAMING_SNAKE_CASE      )

          return swapped or left_swap or right_swap

     lowercase_	:				Dict													=	True

     while is_not_sorted is True:
          lowercase_	:				Optional[Any]													=	circle_sort_util(__SCREAMING_SNAKE_CASE     ,			0     ,			len(__SCREAMING_SNAKE_CASE      ) - 1      )

     return collection


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

