main=interact$(%' ').words x%s=s:drop 3(x&s>>"_")++f"| "x&s++x&s++f"_|"x&'_' x&s="\n|"++do y<-x;s:y++s:"|" f=map.zipWith const.cycle