import Data.List

main = getLine >> getContents >>= putStrLn . unlines . compute . lines

compute :: [String] -> [String]
compute = transpose . filter keep . transpose . filter keep

keep xs = any ('.' /=) xs
