
"""simple docstring"""




import math



def 						__magic_name__		(				UpperCamelCase    :		int    )    ->	str:
    if number == 0:
        a__    = 'Zero'
        return words
    else:
        a__    = math.logaa(UpperCamelCase    )
        a__    = digits + 1
        a__    = {}
        a__    = ''
        a__    = 'One'
        a__    = 'Two'
        a__    = 'Three'
        a__    = 'Four'
        a__    = 'Five'
        a__    = 'Six'
        a__    = 'Seven'
        a__    = 'Eight'
        a__    = 'Nine'

        a__    = {}
        a__    = ''
        a__    = 'Twenty'
        a__    = 'Thirty'
        a__    = 'Forty'
        a__    = 'Fifty'
        a__    = 'Sixty'
        a__    = 'Seventy'
        a__    = 'Eighty'
        a__    = 'Ninety'

        a__    = {}
        a__    = 'Ten'
        a__    = 'Eleven'
        a__    = 'Twelve'
        a__    = 'Thirteen'
        a__    = 'Fourteen'
        a__    = 'Fifteen'
        a__    = 'Sixteen'
        a__    = 'Seventeen'
        a__    = 'Eighteen'
        a__    = 'Nineteen'

        a__    = {}
        a__    = 'Hundred,'
        a__    = 'Thousand,'
        a__    = 'Lakh,'
        a__    = 'Crore,'

        a__    = number
        a__    = ''
        a__    = 0
        a__    = int(UpperCamelCase    )
        while counter < digits:
            a__    = temp_num % 10
            if counter % 2 == 0:
                a__    = ''
                if counter in placevalue and current != 0:
                    a__    = placevalue[counter]
                if counter == 2:
                    a__    = singles[current] + addition + words
                elif counter == 0:
                    if ((temp_num % 100) // 10) == 1:
                        a__    = teens[current] + addition + words
                        a__    = temp_num // 10
                        counter += 1
                    else:
                        a__    = singles[current] + addition + words

                else:
                    a__    = doubles[current] + addition + words

            else:
                if counter == 1:
                    if current == 1:
                        a__    = teens[number % 10] + words
                    else:
                        a__    = ''
                        if counter in placevalue:
                            a__    = placevalue[counter]
                        a__    = doubles[current] + addition + words
                else:
                    a__    = ''
                    if counter in placevalue:
                        if current == 0 and ((temp_num % 100) // 10) == 0:
                            a__    = ''
                        else:
                            a__    = placevalue[counter]
                    if ((temp_num % 100) // 10) == 1:
                        a__    = teens[current] + addition + words
                        a__    = temp_num // 10
                        counter += 1
                    else:
                        a__    = singles[current] + addition + words
            counter += 1
            a__    = temp_num // 10
    return words


if __name__ == "__main__":
    import doctest

    doctest.testmod()




"""simple docstring"""




import math







class 						lowercase:



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







         """simple docstring"""



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



     def  lowercase__     (       self    ,							__SCREAMING_SNAKE_CASE      )		->    Optional[Any]:







         """simple docstring"""



         return idx * 2



     def  lowercase__     (       self    ,							__SCREAMING_SNAKE_CASE      )		->    Optional[int]:







         """simple docstring"""



         return idx * 2 + 1



     def  lowercase__     (       self    ,							__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE      )		->    List[str]:  # noqa: E741







         """simple docstring"""



         if l == r:
             a__    = A[l]
         else:
             a__    = (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__    = max(self.st[self.left(__SCREAMING_SNAKE_CASE      )]    ,							self.st[self.right(__SCREAMING_SNAKE_CASE      )]      )



     def  lowercase__     (       self    ,							__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE      )		->    int:







         """simple docstring"""



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



     def  lowercase__     (       self    ,							__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE      )		->    Optional[int]:  # noqa: E741







         """simple docstring"""



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



     def  lowercase__     (       self    ,							__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE      )		->    List[str]:







         """simple docstring"""



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



     def  lowercase__     (       self    ,							__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE      )		->    Any:  # noqa: E741







         """simple docstring"""



         if r < a or l > b:
             return -math.inf
         if l >= a and r <= b:
             return self.st[idx]
         a__    = (l + r) // 2
         a__    = self.query_recursive(self.left(__SCREAMING_SNAKE_CASE      )    ,							__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE      )
         a__    = 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  lowercase__     (       self      )		->    List[Any]:







         """simple docstring"""



         a__    = []
         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		:					Union[str, 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, 1_11)
    print(segt.query(1, 15))
    segt.update(7, 8, 2_35)
    segt.show_data()


