class Array
def insert k
x,l,r=self
x ?(k<x ?l:r).insert(k):self<<k<<[]<<[]
end
def find k
puts f(k) ?:yes: :no
end
def f k
x,l,r=self
x&&(k==x||(k<x ?l:r).f(k))
end
def print
$x,$y=[p],[p]
w
puts $y*" ",$x*" "
end
def w
x,l,r=self
x&&($x<<x
l.w
$y<<x
r.w)
end
end
t=[]
gets
eval"t.#$_"while gets