gsub(/-/){$_="#$`X#$'";~/#{[0,2,3,4].map{|n|["X"]*3*("."*n)}*"|"}/m&&(print;break)}while gets$/*2