new_contents: # Definition for a binary tree node.
  # class TreeNode:
  #     def __init__(self, x):
  #         self.val = x
  #         self.left = None
  #         self.right = None
  
  
  class Solution:
      # @param {TreeNode} root
      # @param {TreeNode} p
      # @param {TreeNode} q
      # @return {TreeNode}
  
      def lowestCommonAncestor(self, root, p, q):
          if root is None or root is p or root is q:
              return root
          left = self.lowestCommonAncestor(root.left, p, q)
          right = self.lowestCommonAncestor(root.right, p, q)
          if left and right:
              return root
          return left or right
  
subject: add solution for Lowest Common Ancestor of a Binary Tree