import java.lang.StringBuilder

fun main(arr:Array<String>) {
    val inputCount = readLine()!!.toInt()
    val mojiList = (1..inputCount).map { readLine()!! }.sortedBy { it.length }
    var mp = getCharCount(mojiList[0])
    for(i in (1 until mojiList.size)) {
        mp = getSub(mojiList[i], mp)
    }
    if(mp.count() <= 0) {
        println("")
        return
    }
    val ans = StringBuilder()
    for(c in mp.keys.sorted()) {
        ans.append("".padStart(mp[c]!!, c))
    }
    println(ans.toString())
}

fun getSub(txt:String, map:MutableMap<Char, Int>): MutableMap<Char, Int> {
    val ret = getCharCount(txt)
    val keys = ret.keys.union(map.keys)
    val newMap = mutableMapOf<Char, Int>()
    for(c in keys) {
        val cnt1 = map[c]?:0
        val cnt2 = ret[c]?:0
        val cnt = Math.min(cnt1, cnt2)
        if(cnt > 0) {
            newMap[c] = cnt
        }
    }
    return newMap
}

fun getCharCount(txt:String): MutableMap<Char, Int> {
    val ans = mutableMapOf<Char, Int>()
    for(c in txt) {
        val cnt = ans[c]?:0
        ans[c] = cnt + 1
    }
    return ans
}
