import Data.Array
import Data.List

main = do
  getLine -- n
  co <- getContents
  let ss = lines co
  let ans = compute ss
  putStrLn ans

-- 要は、全ての文字について、その個数の最小値だけ繰り返したものを作ればいいのかな。

compute :: [String] -> String
compute ss = buildString $ map minimum $ transpose $ map (elems.buildArray) ss

buildArray :: String -> Array Char Int
buildArray s = accumArray (+) 0 ('a','z') [ (c,1) | c <- s ]

buildString :: [Int] -> String
buildString ns = [ c | (c,i) <- zip ['a'..'z'] ns, _ <- [1..i] ]
