


'''simple docstring'''







import math


class  __lowerCamelCase :
    """simple docstring"""


    def __init__(  self			:							int      ,							SCREAMING_SNAKE_CASE			:							Optional[Any]):
           _A     :	str      =					len(SCREAMING_SNAKE_CASE)
           _A     :	Tuple      =					[0] * (
               4 * self.N
           )  # approximate the overall size of segment tree with array N
           self.build(1      ,							0      ,							self.N - 1)


    def    A    (  self			:							Optional[Any]      ,							SCREAMING_SNAKE_CASE			:							Union[str, Any]):
           return idx * 2


    def    A    (  self			:							Optional[int]      ,							SCREAMING_SNAKE_CASE			:							Dict):
           return idx * 2 + 1


    def    A    (  self			:							str      ,							SCREAMING_SNAKE_CASE			:							Optional[Any]      ,							SCREAMING_SNAKE_CASE			:							str      ,							SCREAMING_SNAKE_CASE			:							Tuple):  # noqa: E741
           if l == r:
                  _A     :	Union[str, Any]      =					A[l]
           else:
                  _A     :	List[Any]      =					(l + r) // 2
                  self.build(self.left(SCREAMING_SNAKE_CASE)      ,							SCREAMING_SNAKE_CASE      ,							SCREAMING_SNAKE_CASE)
                  self.build(self.right(SCREAMING_SNAKE_CASE)      ,							mid + 1      ,							SCREAMING_SNAKE_CASE)
                  _A     :	Any      =					max(self.st[self.left(SCREAMING_SNAKE_CASE)]      ,							self.st[self.right(SCREAMING_SNAKE_CASE)])


    def    A    (  self			:							Optional[Any]      ,							SCREAMING_SNAKE_CASE			:							List[Any]      ,							SCREAMING_SNAKE_CASE			:							str      ,							SCREAMING_SNAKE_CASE			:							List[Any]):
           return self.update_recursive(1      ,							0      ,							self.N - 1      ,							a - 1      ,							b - 1      ,							SCREAMING_SNAKE_CASE)


    def    A    (  self			:							List[str]      ,							SCREAMING_SNAKE_CASE			:							List[str]      ,							SCREAMING_SNAKE_CASE			:							Union[str, Any]      ,							SCREAMING_SNAKE_CASE			:							List[str]      ,							SCREAMING_SNAKE_CASE			:							Any      ,							SCREAMING_SNAKE_CASE			:							Optional[Any]      ,							SCREAMING_SNAKE_CASE			:							Optional[Any]):  # noqa: E741
           if r < a or l > b:
                  return True
           if l == r:
                  _A     :	str      =					val
                  return True
           _A     :	str      =					(l + r) // 2
           self.update_recursive(self.left(SCREAMING_SNAKE_CASE)      ,							SCREAMING_SNAKE_CASE      ,							SCREAMING_SNAKE_CASE      ,							SCREAMING_SNAKE_CASE      ,							SCREAMING_SNAKE_CASE      ,							SCREAMING_SNAKE_CASE)
           self.update_recursive(self.right(SCREAMING_SNAKE_CASE)      ,							mid + 1      ,							SCREAMING_SNAKE_CASE      ,							SCREAMING_SNAKE_CASE      ,							SCREAMING_SNAKE_CASE      ,							SCREAMING_SNAKE_CASE)
           _A     :	str      =					max(self.st[self.left(SCREAMING_SNAKE_CASE)]      ,							self.st[self.right(SCREAMING_SNAKE_CASE)])
           return True


    def    A    (  self			:							Tuple      ,							SCREAMING_SNAKE_CASE			:							Tuple      ,							SCREAMING_SNAKE_CASE			:							Tuple):
           return self.query_recursive(1      ,							0      ,							self.N - 1      ,							a - 1      ,							b - 1)


    def    A    (  self			:							Optional[int]      ,							SCREAMING_SNAKE_CASE			:							Any      ,							SCREAMING_SNAKE_CASE			:							Tuple      ,							SCREAMING_SNAKE_CASE			:							Optional[Any]      ,							SCREAMING_SNAKE_CASE			:							List[str]      ,							SCREAMING_SNAKE_CASE			:							Dict):  # noqa: E741
           if r < a or l > b:
                  return -math.inf
           if l >= a and r <= b:
                  return self.st[idx]
           _A     :	Dict      =					(l + r) // 2
           _A     :	Tuple      =					self.query_recursive(self.left(SCREAMING_SNAKE_CASE)      ,							SCREAMING_SNAKE_CASE      ,							SCREAMING_SNAKE_CASE      ,							SCREAMING_SNAKE_CASE      ,							SCREAMING_SNAKE_CASE)
           _A     :	List[Any]      =					self.query_recursive(self.right(SCREAMING_SNAKE_CASE)      ,							mid + 1      ,							SCREAMING_SNAKE_CASE      ,							SCREAMING_SNAKE_CASE      ,							SCREAMING_SNAKE_CASE)
           return max(SCREAMING_SNAKE_CASE      ,							SCREAMING_SNAKE_CASE)


    def    A    (  self			:							Optional[int]):
           _A     :	Union[str, Any]      =					[]
           for i in range(1      ,							N + 1):
                  show_list += [self.query(SCREAMING_SNAKE_CASE      ,							SCREAMING_SNAKE_CASE)]
           print(SCREAMING_SNAKE_CASE)


if __name__ == "__main__":
   A      :     str										= [1, 2, -4, 7, 3, -5, 6, 11, -20, 9, 14, 15, 5, 2, -8]
   A      :     List[Any]										= 15
   A      :     Dict										= 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()










'''simple docstring'''







import sys

sys.set_int_max_str_digits(0)  # type: ignore






def       lowerCAmelCase__       (				lowerCamelCase     :			int   ):
       _A     :	Optional[Any]      =					[0] * 11
       _A     :	str      =					[0] * 11

       # mark last 9 numbers
       for _ in range(9   ):
              _A     :	int      =					1
              _A     :	Optional[int]      =					number // 10
       # flag
       _A     :	List[Any]      =					True

       # check last 9 numbers for pandigitality

       for x in range(9   ):
              if not check_last[x + 1]:
                     _A     :	Optional[int]      =					False
       if not f:
              return f

       # mark first 9 numbers
       _A     :	Optional[int]      =					int(str(lowerCamelCase   )[:9]   )

       for _ in range(9   ):
              _A     :	Optional[Any]      =					1
              _A     :	str      =					number // 10

       # check first 9 numbers for pandigitality

       for x in range(9   ):
              if not check_front[x + 1]:
                     _A     :	Optional[Any]      =					False
       return f






def       lowerCAmelCase__       (				lowerCamelCase     :			int   ):
       _A     :	Dict      =					[0] * 11

       # mark last 9 numbers
       for _ in range(9   ):
              _A     :	List[str]      =					1
              _A     :	Dict      =					number // 10
       # flag
       _A     :	Optional[int]      =					True

       # check last 9 numbers for pandigitality

       for x in range(9   ):
              if not check_last[x + 1]:
                     _A     :	List[str]      =					False
       return f






def       lowerCAmelCase__       (				):
       _A     :	List[Any]      =					1
       _A     :	Dict      =					1
       _A     :	Dict      =					2
       # temporary Fibonacci numbers

       _A     :	List[Any]      =					1
       _A     :	Union[str, Any]      =					1
       _A     :	List[Any]      =					2
       # temporary Fibonacci numbers mod 1e9

       # mod m=1e9, done for fast optimisation
       _A     :	Tuple      =					[0] * 1000000
       _A     :	Any      =					1000000000

       for x in range(1000000   ):
              _A     :	Tuple      =					(aa + ba) % m
              _A     :	Optional[Any]      =					ba % m
              _A     :	str      =					ca % m
              if checka(lowerCamelCase   ):
                     _A     :	Dict      =					1

       for x in range(1000000   ):
              _A     :	List[str]      =					a + b
              _A     :	Optional[int]      =					b
              _A     :	str      =					c
              # perform check only if in tocheck
              if tocheck[x + 3] and check(lowerCamelCase   ):
                     return x + 3  # first 2 already done
       return -1


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






