fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val c = IntArray(26) { Int.MAX_VALUE }
    for (i in 1..n) {
        for ((j, z) in count(readLine()!!).withIndex()) c[j] = Math.min(c[j], z)
    }
    for ((i, q) in c.withIndex()) print(('a' + i).toString().repeat(q))
    println()
}

fun count(s: String): IntArray {
    val res = IntArray(26)
    s.forEach { res[it - 'a']++ }
    return res
}