





from __future__ import annotations

from collections.abc import MutableSequence




class        _a    :

      """simple docstring"""


      def __init__(		self:			int	,    __lowerCamelCase:			int	,    __lowerCamelCase:			MutableSequence[float]					):
          '''simple docstring'''


          if len(__lowerCamelCase					) != degree + 1:
              raise ValueError(
                  "The number of coefficients should be equal to the degree + 1."					)

          UpperCamelCase__:	list[float]					=     list(__lowerCamelCase					)
          UpperCamelCase__:	Dict					=     degree






      def __add__(		self:			Dict	,    __lowerCamelCase:			Polynomial					):
          '''simple docstring'''


          if self.degree > polynomial_a.degree:
              UpperCamelCase__:	Optional[Any]					=     self.coefficients[:]
              for i in range(polynomial_a.degree + 1					):
                  coefficients[i] += polynomial_a.coefficients[i]
              return Polynomial(self.degree	,    __lowerCamelCase					)
          else:
              UpperCamelCase__:	List[str]					=     polynomial_a.coefficients[:]
              for i in range(self.degree + 1					):
                  coefficients[i] += self.coefficients[i]
              return Polynomial(polynomial_a.degree	,    __lowerCamelCase					)






      def __sub__(		self:			List[str]	,    __lowerCamelCase:			Polynomial					):
          '''simple docstring'''


          return self + polynomial_a * Polynomial(0	,    [-1]					)






      def __neg__(		self:			int					):
          '''simple docstring'''


          return Polynomial(self.degree	,    [-c for c in self.coefficients]					)






      def __mul__(		self:			Union[str, Any]	,    __lowerCamelCase:			Polynomial					):
          '''simple docstring'''


          UpperCamelCase__:	list[float]					=     [0] * (self.degree + polynomial_a.degree + 1)
          for i in range(self.degree + 1					):
              for j in range(polynomial_a.degree + 1					):
                  coefficients[i + j] += (
                      self.coefficients[i] * polynomial_a.coefficients[j]
                  )

          return Polynomial(self.degree + polynomial_a.degree	,    __lowerCamelCase					)






      def 			UpperCAmelCase_       (		self:			Dict	,    __lowerCamelCase:			int | float					):
          '''simple docstring'''


          UpperCamelCase__:	int | float					=     0
          for i in range(self.degree + 1					):
              result += self.coefficients[i] * (substitution**i)
          return result






      def __str__(		self:			List[str]					):
          '''simple docstring'''


          UpperCamelCase__:	List[Any]					=     ""
          for i in range(self.degree	,    -1	,    -1					):
              if self.coefficients[i] == 0:
                  continue
              elif self.coefficients[i] > 0:
                  if polynomial:
                      polynomial += " + "
              else:
                  polynomial += " - "

              if i == 0:
                  polynomial += str(abs(self.coefficients[i]					)					)
              elif i == 1:
                  polynomial += str(abs(self.coefficients[i]					)					) + "x"
              else:
                  polynomial += str(abs(self.coefficients[i]					)					) + "x^" + str(__lowerCamelCase					)

          return polynomial






      def __repr__(		self:			Dict					):
          '''simple docstring'''


          return self.__str__()






      def 			UpperCAmelCase_       (		self:			List[Any]					):
          '''simple docstring'''


          UpperCamelCase__:	list[float]					=     [0] * self.degree
          for i in range(self.degree					):
              UpperCamelCase__:	Optional[int]					=     self.coefficients[i + 1] * (i + 1)
          return Polynomial(self.degree - 1	,    __lowerCamelCase					)






      def 			UpperCAmelCase_       (		self:			Optional[int]	,    __lowerCamelCase:			int | float = 0					):
          '''simple docstring'''


          UpperCamelCase__:	list[float]					=     [0] * (self.degree + 2)
          UpperCamelCase__:	List[str]					=     constant
          for i in range(self.degree + 1					):
              UpperCamelCase__:	str					=     self.coefficients[i] / (i + 1)
          return Polynomial(self.degree + 1	,    __lowerCamelCase					)






      def __eq__(		self:			List[str]	,    __lowerCamelCase:			object					):
          '''simple docstring'''


          if not isinstance(__lowerCamelCase	,    __lowerCamelCase					):
              return False

          if self.degree != polynomial_a.degree:
              return False

          for i in range(self.degree + 1					):
              if self.coefficients[i] != polynomial_a.coefficients[i]:
                  return False

          return True






      def __ne__(		self:			str	,    __lowerCamelCase:			object					):
          '''simple docstring'''


          return not self.__eq__(__lowerCamelCase					)








def 				lowerCAmelCase_ (							A_):
    UpperCamelCase__:	Optional[int]					=     len(A_)
    for i in range(1    ,A_):
        UpperCamelCase__:	List[Any]					=     collection[i]
        UpperCamelCase__:	Tuple					=     0
        UpperCamelCase__:	Union[str, Any]					=     i - 1

        while low <= high:
            UpperCamelCase__:	Any					=     (low + high) // 2
            if val < collection[mid]:
                UpperCamelCase__:	str					=     mid - 1
            else:
                UpperCamelCase__:	str					=     mid + 1
        for j in range(A_    ,A_    ,-1):
            UpperCamelCase__:	Optional[int]					=     collection[j - 1]
        UpperCamelCase__:	Optional[Any]					=     val
    return collection


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

