fun main(args : Array<String>) {
    val n = readLine()!!.toInt()
    val ss = mutableListOf<Map<Char, List<Char>>>()

    repeat(n) {
        val s = readLine()!!.groupBy { it }
        ss.add(s)
    }

    var ans = ""

    for (i in 'a'..'z') {
        val repeat = ss.minBy { it[i]?.size ?: 0 }?.get(i)?.size ?: 0
        ans += "$i".repeat(repeat)
    }

    println(ans)
}