def lowestCommonAncestor(self, root: 'TreeNode', p: 'TreeNode', q: 'TreeNode') -> 'TreeNode':
    if ((p.val < root.val) and (q.val < root.val)):
        return self.lowestCommonAncestor(root.left, p, q)
    if ((p.val > root.val) and (q.val > root.val)):
        return self.lowestCommonAncestor(root.right, p, q)
    return root
def lowestCommonAncestor(self, root: 'TreeNode', p: 'TreeNode', q: 'TreeNode') -> 'TreeNode':
    if ((p.val < root.val) and (q.val < root.val)):
        return self.lowestCommonAncestor(root.left, p, q)
    if ((p.val > root.val) and (q.val > root.val)):
        return self.lowestCommonAncestor(root.right, p, q)
    return root