#coding:utf-8__author__ = 'similarface'class KeyedBinaryTree: def __init__(self):self.tree=EmptyNode() def __repr__(self):return repr(self.tree) def lookup(self,key):return self.tree.lookup(key) def insert(self,key,val):self.tree=self.tree.insert(key,val)class EmptyNode: def __repr__(self): return '*' def lookup(self,key): return None def insert(self,key,val): return BinaryNode(self,key,val,self)class BinaryNode: def __init__(self,left,key,val,right): self.key,self.val=key,val self.left,self.right=left,right def lookup(self,key): if self.key==key: return self.val elif self.key>key: return self.left.lookup(key) else: return self.right.lookup(key) def insert(self,key,val): if self.key==key: self.val=val elif self.key>key: self.left=self.left.insert(key,val) elif self.key