


"""simple docstring"""





def    _snake_case  (  _snake_case :	list	):
      for i in range(len(_snake_case	) - 1       ,      0       ,      -1	):
            lowerCAmelCase    :		int				=      False

            for j in range(_snake_case       ,      0       ,      -1	):
                  if unsorted[j] < unsorted[j - 1]:
                        lowerCAmelCase,					lowerCAmelCase    :		Tuple				=      unsorted[j - 1], unsorted[j]
                        lowerCAmelCase    :		Optional[Any]				=      True

            for j in range(_snake_case	):
                  if unsorted[j] > unsorted[j + 1]:
                        lowerCAmelCase,					lowerCAmelCase    :		Any				=      unsorted[j + 1], unsorted[j]
                        lowerCAmelCase    :		int				=      True

            if not swapped:
                  break
      return unsorted


if __name__ == "__main__":
 import doctest

 doctest.testmod()
 snake_case__						:   List[str]			 = input('''Enter numbers separated by a comma:\n''').strip()
 snake_case__						:   str			 = [int(item) for item in user_input.split(''',''')]
 print(f"""{cocktail_shaker_sort(unsorted) = }""")






"""simple docstring"""





import math


def    _snake_case  (  ):
      lowerCAmelCase    :		Union[str, Any]				=      input('''Enter message: '''	)
      lowerCAmelCase    :		Optional[int]				=      int(input(f'''Enter key [2-{len(_snake_case	) - 1}]: '''	)	)
      lowerCAmelCase    :		str				=      input('''Encryption/Decryption [e/d]: '''	)

      if mode.lower().startswith('''e'''	):
            lowerCAmelCase    :		Any				=      encrypt_message(_snake_case       ,      _snake_case	)
      elif mode.lower().startswith('''d'''	):
            lowerCAmelCase    :		Union[str, Any]				=      decrypt_message(_snake_case       ,      _snake_case	)

      # Append pipe symbol (vertical bar) to identify spaces at the end.
      print(f'''Output:\n{text + "|"}'''	)


def    _snake_case  (  _snake_case :	int       ,      _snake_case :	str	):
      lowerCAmelCase    :		Optional[Any]				=      [''''''] * key
      for col in range(_snake_case	):
            lowerCAmelCase    :		Optional[Any]				=      col
            while pointer < len(_snake_case	):
                  cipher_text[col] += message[pointer]
                  pointer += key
      return "".join(_snake_case	)


def    _snake_case  (  _snake_case :	int       ,      _snake_case :	str	):
      lowerCAmelCase    :		Union[str, Any]				=      math.ceil(len(_snake_case	) / key	)
      lowerCAmelCase    :		str				=      key
      lowerCAmelCase    :		Any				=      (num_cols * num_rows) - len(_snake_case	)
      lowerCAmelCase    :		Dict				=      [''''''] * num_cols
      lowerCAmelCase    :		int				=      0
      lowerCAmelCase    :		int				=      0

      for symbol in message:
            plain_text[col] += symbol
            col += 1

            if (
                (col == num_cols)
                or (col == num_cols - 1)
                and (row >= num_rows - num_shaded_boxes)
            ):
                  lowerCAmelCase    :		int				=      0
                  row += 1

      return "".join(_snake_case	)


if __name__ == "__main__":
 import doctest

 doctest.testmod()
 main()


