q=p=' '*99 exec"try:r=raw_input()+q\nexcept:r=q\nprint''.join('| '[x<'.'>y]+'_ '[y<'.'>z]for x,y,z in zip(' '+p,p,r)).rstrip();p=r\n"*18