import Data.List

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

compute :: [String] -> [String]
compute ass = transpose [ta1 | (ta, ta1) <- zip tass tass1, keep ta]
  where
    tass = transpose ass
    tass1 = transpose $ filter keep ass

keep (x:xs) = any (x /=) xs
