def 					SCREAMING_SNAKE_CASE_			(		lowerCAmelCase_: Optional[int] = 9_9_8_0_0_1     ):
      snake_case_     :			Optional[Any]       =       0
      for i in range(9_9_9 ,	9_9 ,	-1     ):  # 3 digit numbers range from 999 down to 100
            for j in range(9_9_9 ,	9_9 ,	-1     ):
                  snake_case_     :			int       =       str(i * j     )
                  if product_string == product_string[::-1] and i * j < n:
                        snake_case_     :			List[Any]       =       max(_UpperCAmelCase ,	i * j     )
      return answer


if __name__ == "__main__":
     print(F"{solution() = }")




import math



class 					snake_case__       :



   def __init__(				self   :   int			,	A__   :   str   )							->     int:




         '''simple docstring'''




         snake_case_     :			Tuple       =       len(A__   )
         snake_case_     :			Union[str, Any]       =       [0] * (
             4 * self.N
         )  # approximate the overall size of segment tree with array N
         self.build(1			,	0			,	self.N - 1   )



   def 					UpperCAmelCase__       (				self   :   Optional[Any]			,	A__   :   Tuple   )							->     Optional[int]:




         '''simple docstring'''




         return idx * 2



   def 					UpperCAmelCase__       (				self   :   Union[str, Any]			,	A__   :   List[str]   )							->     Dict:




         '''simple docstring'''




         return idx * 2 + 1



   def 					UpperCAmelCase__       (				self   :   str			,	A__   :   Any			,	A__   :   Optional[int]			,	A__   :   Tuple   )							->     List[str]:  # noqa: E741




         '''simple docstring'''




         if l == r:
               snake_case_     :			str       =       A[l]
         else:
               snake_case_     :			List[str]       =       (l + r) // 2
               self.build(self.left(A__   )			,	A__			,	A__   )
               self.build(self.right(A__   )			,	mid + 1			,	A__   )
               snake_case_     :			Union[str, Any]       =       max(self.st[self.left(A__   )]			,	self.st[self.right(A__   )]   )



   def 					UpperCAmelCase__       (				self   :   Optional[Any]			,	A__   :   List[str]			,	A__   :   Union[str, Any]			,	A__   :   str   )							->     int:




         '''simple docstring'''




         return self.update_recursive(1			,	0			,	self.N - 1			,	a - 1			,	b - 1			,	A__   )



   def 					UpperCAmelCase__       (				self   :   Optional[int]			,	A__   :   Optional[Any]			,	A__   :   List[str]			,	A__   :   Optional[Any]			,	A__   :   Union[str, Any]			,	A__   :   List[Any]			,	A__   :   str   )							->     Any:  # noqa: E741




         '''simple docstring'''




         if r < a or l > b:
               return True
         if l == r:
               snake_case_     :			List[str]       =       val
               return True
         snake_case_     :			Dict       =       (l + r) // 2
         self.update_recursive(self.left(A__   )			,	A__			,	A__			,	A__			,	A__			,	A__   )
         self.update_recursive(self.right(A__   )			,	mid + 1			,	A__			,	A__			,	A__			,	A__   )
         snake_case_     :			Tuple       =       max(self.st[self.left(A__   )]			,	self.st[self.right(A__   )]   )
         return True



   def 					UpperCAmelCase__       (				self   :   Optional[int]			,	A__   :   List[Any]			,	A__   :   Optional[Any]   )							->     str:




         '''simple docstring'''




         return self.query_recursive(1			,	0			,	self.N - 1			,	a - 1			,	b - 1   )



   def 					UpperCAmelCase__       (				self   :   Union[str, Any]			,	A__   :   Any			,	A__   :   int			,	A__   :   Tuple			,	A__   :   Tuple			,	A__   :   Dict   )							->     str:  # noqa: E741




         '''simple docstring'''




         if r < a or l > b:
               return -math.inf
         if l >= a and r <= b:
               return self.st[idx]
         snake_case_     :			Dict       =       (l + r) // 2
         snake_case_     :			Optional[Any]       =       self.query_recursive(self.left(A__   )			,	A__			,	A__			,	A__			,	A__   )
         snake_case_     :			Any       =       self.query_recursive(self.right(A__   )			,	mid + 1			,	A__			,	A__			,	A__   )
         return max(A__			,	A__   )



   def 					UpperCAmelCase__       (				self   :   Dict   )							->     Optional[Any]:




         '''simple docstring'''




         snake_case_     :			int       =       []
         for i in range(1			,	N + 1   ):
               show_list += [self.query(A__			,	A__   )]
         print(A__   )


if __name__ == "__main__":
     UpperCAmelCase							=       [1, 2, -4, 7, 3, -5, 6, 1_1, -2_0, 9, 1_4, 1_5, 5, 2, -8]
     UpperCAmelCase							=       1_5
     UpperCAmelCase							=       SegmentTree(A)
     print(segt.query(4, 6))
     print(segt.query(7, 1_1))
     print(segt.query(7, 1_2))
     segt.update(1, 3, 1_1_1)
     print(segt.query(1, 1_5))
     segt.update(7, 8, 2_3_5)
     segt.show_data()



