
'''simple docstring'''
def        A_     (						__SCREAMING_SNAKE_CASE						:  Optional[Any] )				->       Tuple:





  """simple docstring"""

  __A							,					__A		:     Any												=		[], []
  while len(__SCREAMING_SNAKE_CASE ) > 1:
    __A							,					__A		:     Optional[int]												=		min(__SCREAMING_SNAKE_CASE ), max(__SCREAMING_SNAKE_CASE )
    start.append(__SCREAMING_SNAKE_CASE )
    end.append(__SCREAMING_SNAKE_CASE )
    collection.remove(__SCREAMING_SNAKE_CASE )
    collection.remove(__SCREAMING_SNAKE_CASE )
  end.reverse()
  return start + collection + end


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





'''simple docstring'''
def        A_     (						__SCREAMING_SNAKE_CASE						:  Dict )				->       Optional[Any]:





  """simple docstring"""

  if not head:
    return True
  # split the list to two parts
  __A							,					__A		:     Any												=		head.next, head
  while fast and fast.next:
    __A		:     List[str]												=		fast.next.next
    __A		:     List[Any]												=		slow.next
  __A		:     int												=		slow.next
  __A		:     List[str]												=		None  # Don't forget here! But forget still works!
  # reverse the second part
  __A		:     Dict												=		None
  while second:
    __A		:     Dict												=		second.next
    __A		:     str												=		node
    __A		:     int												=		second
    __A		:     Optional[int]												=		nxt
  # compare two parts
  # second part has the same or one less node
  while node:
    if node.val != head.val:
      return False
    __A		:     List[Any]												=		node.next
    __A		:     Tuple												=		head.next
  return True







def        A_     (						__SCREAMING_SNAKE_CASE						:  Union[str, Any] )				->       Optional[int]:





  """simple docstring"""

  if not head or not head.next:
    return True

  # 1. Get the midpoint (slow)
  __A		:     int												=		head
  while fast and fast.next:
    __A							,					__A		:     Optional[int]												=		fast.next.next, slow.next

  # 2. Push the second half into the stack
  __A		:     Union[str, Any]												=		[slow.val]
  while slow.next:
    __A		:     List[str]												=		slow.next
    stack.append(slow.val )

  # 3. Comparison
  while stack:
    if stack.pop() != cur.val:
      return False
    __A		:     Tuple												=		cur.next

  return True







def        A_     (						__SCREAMING_SNAKE_CASE						:  Dict )				->       Any:





  """simple docstring"""

  if not head or not head.next:
    return True
  __A		:     List[Any]												=		{}
  __A		:     Optional[int]												=		0
  while head:
    if head.val in d:
      d[head.val].append(__SCREAMING_SNAKE_CASE )
    else:
      __A		:     Tuple												=		[pos]
    __A		:     List[Any]												=		head.next
    pos += 1
  __A		:     List[Any]												=		pos - 1
  __A		:     List[str]												=		0
  for v in d.values():
    if len(__SCREAMING_SNAKE_CASE ) % 2 != 0:
      middle += 1
    else:
      __A		:     List[Any]												=		0
      for i in range(0			,     len(__SCREAMING_SNAKE_CASE ) ):
        if v[i] + v[len(__SCREAMING_SNAKE_CASE ) - 1 - step] != checksum:
          return False
        step += 1
    if middle > 1:
      return False
  return True



