(while(defn f[x y](cond(fn? x)(x y)(="."x)(fn[z]#(f y(f z%)))1`(~x~y)))(println(reduce f(.split(read-line)" "))))