let n = Int(readLine()!)!
var dic = [Character: [Int]]()
"abcdefghijklmnopqrstuvwxyz".characters.forEach{dic[$0]=(0..<n).map{_ in 0}}
for i in 0..<n {
    for c in readLine()!.characters {
        dic[c]![i] += 1
    }
}
print(dic.sort{$0.0<$1.0}.reduce(""){S,d in S+(0..<d.1.minElement()!).reduce(""){s,_ in s+"\(d.0)"}})