class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
def insertNode(root, x):
if not root:
return TreeNode(x)
if x < root.val:
root.right = insertNode(root.right, x)
else:
root.left = insertNode(root.left, x)
return root