





import math



class  SCREAMING_SNAKE_CASE_  :


  """simple docstring"""





  def __init__(  self	,  A						)		->   Optional[int]:





       '''simple docstring'''







       __magic_name__				=       len(A						)
       __magic_name__				=       [0] * (
           4 * self.N
       )  # approximate the overall size of segment tree with array N
       self.build(1	,  0	,  self.N - 1						)





  def 			__A      (  self	,  A						)		->   Dict:





       '''simple docstring'''







       return idx * 2





  def 			__A      (  self	,  A						)		->   Tuple:





       '''simple docstring'''







       return idx * 2 + 1





  def 			__A      (  self	,  A	,  A	,  A						)		->   Any:  # noqa: E741





       '''simple docstring'''







       if l == r:
            __magic_name__				=       A[l]
       else:
            __magic_name__				=       (l + r) // 2
            self.build(self.left(A						)	,  A	,  A						)
            self.build(self.right(A						)	,  mid + 1	,  A						)
            __magic_name__				=       max(self.st[self.left(A						)]	,  self.st[self.right(A						)]						)





  def 			__A      (  self	,  A	,  A	,  A						)		->   List[str]:





       '''simple docstring'''







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





  def 			__A      (  self	,  A	,  A	,  A	,  A	,  A	,  A						)		->   Optional[int]:  # noqa: E741





       '''simple docstring'''







       if r < a or l > b:
            return True
       if l == r:
            __magic_name__				=       val
            return True
       __magic_name__				=       (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						)
       __magic_name__				=       max(self.st[self.left(A						)]	,  self.st[self.right(A						)]						)
       return True





  def 			__A      (  self	,  A	,  A						)		->   Union[str, Any]:





       '''simple docstring'''







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





  def 			__A      (  self	,  A	,  A	,  A	,  A	,  A						)		->   Optional[int]:  # noqa: E741





       '''simple docstring'''







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







  def 			__A      (  self						)		->   Any:





       '''simple docstring'''







       __magic_name__				=       []
       for i in range(1	,  N + 1						):
            show_list += [self.query(A	,  A						)]
       print(A						)


if __name__ == "__main__":
    a_    :				Any					=			[1, 2, -4, 7, 3, -5, 6, 11, -20, 9, 14, 15, 5, 2, -8]
    a_    :				Dict					=			15
    a_    :				Tuple					=			SegmentTree(A)
    print(segt.query(4, 6))
    print(segt.query(7, 11))
    print(segt.query(7, 12))
    segt.update(1, 3, 111)
    print(segt.query(1, 15))
    segt.update(7, 8, 235)
    segt.show_data()






from math import pi




def   _SCREAMING_SNAKE_CASE      (	snake_case_		:						float						):
     return degree / (180 / pi)


if __name__ == "__main__":
    from doctest import testmod

    testmod()