input: 
  def isSubTree(T, S):
      """
      Given two binary trees, check if the first tree is a subtree of the second tree.
      
      >>> T = Node(26)
      >>> T.left = Node(10)
      >>> T.right = Node(3)
      >>> T.left.left = Node(4)
      >>> T.left.right = Node(6)
      >>> T.right.right = Node(3)
      >>> T.left.left.right = Node(30)
      
      >>> S = Node(10)
      >>> S.left = Node(4)
      >>> S.right = Node(6)
      >>> S.left.right = Node(30)
      
      >>> isSubTree(T, S)
      True
      
      >>> T = Node(26)
      >>> T.left = Node(10)
      >>> T.right = Node(3)
      >>> T.left.left = Node(4)
      >>> T.left.right = Node(6)
      >>> T.right.right = Node(3)
      >>> T.left.left.right = Node(30)
      
      >>> S = Node(10)
      >>> S.left = Node(4)
      >>> S.right = Node(6)
      
      >>> isSubTree(T, S)
      False
      """
  
output:     def areIdentical(root1, root2):
          if root1 is None and root2 is None:
              return True
          if root1 is None or root2 is None:
              return False
          return (root1.val == root2.val and
                  areIdentical(root1.left, root2.left) and
                  areIdentical(root1.right, root2.right))
  
      def isSubTreeUtil(T, S):
          if S is None:
              return True
          if T is None:
              return False
          if areIdentical(T, S):
              return True
          return isSubTreeUtil(T.left, S) or isSubTreeUtil(T.right, S)
  
      return isSubTreeUtil(T, S)