main(x) = bin(x)

bin (Z)    = Leaf
bin (S(x)) = Bin (t,t) where t = bin(x)
