





from collections.abc import Sequence
from queue import Queue

class    _UpperCAmelCase							:
      def __init__(		self      ,       a__      ,       a__      ,       a__      ,       a__=None      ,       a__=None       ):
         A_     :				Any			      =	start
         A_     :				List[Any]			      =	end
         A_     :				Dict			      =	val
         A_     :				str			      =	(start + end) // 2
         A_     :				List[str]			      =	left
         A_     :				str			      =	right






      def __repr__(		self       ):
         return F"""SegmentTreeNode(start={self.start}, end={self.end}, val={self.val})"""






class    _UpperCAmelCase							:
      def __init__(		self      ,       a__      ,       a__       ):
         A_     :				Dict			      =	collection
         A_     :				str			      =	function
         if self.collection:
            A_     :				Union[str, Any]			      =	self._build_tree(0      ,       len(a__       ) - 1       )
      def 		_lowerCamelCase      (		self      ,       a__      ,       a__       ):
         self._update_tree(self.root      ,       a__      ,       a__       )
      def 		_lowerCamelCase      (		self      ,       a__      ,       a__       ):
         return self._query_range(self.root      ,       a__      ,       a__       )
      def 		_lowerCamelCase      (		self      ,       a__      ,       a__       ):
         if start == end:
            return SegmentTreeNode(a__      ,       a__      ,       self.collection[start]       )
         A_     :				Optional[int]			      =	(start + end) // 2
         A_     :				List[Any]			      =	self._build_tree(a__      ,       a__       )
         A_     :				List[str]			      =	self._build_tree(mid + 1      ,       a__       )
         return SegmentTreeNode(a__      ,       a__      ,       self.fn(left.val      ,       right.val       )      ,       a__      ,       a__       )
      def 		_lowerCamelCase      (		self      ,       a__      ,       a__      ,       a__       ):
         if node.start == i and node.end == i:
            A_     :				int			      =	val
            return
         if i <= node.mid:
            self._update_tree(node.left      ,       a__      ,       a__       )
         else:
            self._update_tree(node.right      ,       a__      ,       a__       )
         A_     :				int			      =	self.fn(node.left.val      ,       node.right.val       )
      def 		_lowerCamelCase      (		self      ,       a__      ,       a__      ,       a__       ):
         if node.start == i and node.end == j:
            return node.val

         if i <= node.mid:
            if j <= node.mid:
               # range in left child tree
               return self._query_range(node.left      ,       a__      ,       a__       )
            else:
               # range in left child tree and right child tree
               return self.fn(
                   self._query_range(node.left      ,       a__      ,       node.mid       )      ,       self._query_range(node.right      ,       node.mid + 1      ,       a__       )      ,       )
         else:
            # range in right child tree
            return self._query_range(node.right      ,       a__      ,       a__       )






      def 		_lowerCamelCase      (		self       ):
         if self.root is not None:
            A_     :				int			      =	Queue()
            queue.put(self.root       )
            while not queue.empty():
               A_     :				List[Any]			      =	queue.get()
               yield node

               if node.left is not None:
                  queue.put(node.left       )

               if node.right is not None:
                  queue.put(node.right       )


if __name__ == "__main__":
      import operator

      for fn in [operator.add, max, min]:
            print("""*""" * 50)
            _lowerCAmelCase 				=     SegmentTree([2, 1, 5, 3, 4], fn)
            for node in arr.traverse():
                  print(node)
            print()

            arr.update(1, 5)
            for node in arr.traverse():
                  print(node)
            print()

            print(arr.query_range(3, 4))  # 7
            print(arr.query_range(2, 2))  # 5
            print(arr.query_range(1, 3))  # 13
            print()













import re



def     _lowerCAmelCase		(  _lowerCAmelCase     ):
   '''simple docstring'''


   A_     :				Any			      =	re.compile(r"""^(\+91[\-\s]?)?[0]?(91)?[789]\d{9}$"""     )
   if match := re.search(_lowerCAmelCase  ,_lowerCAmelCase     ):
      return match.string == phone
   return False


if __name__ == "__main__":
      print(indian_phone_validator("""+918827897895"""))






