fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val s1 = readLine()!!.toMutableList()
    repeat(n - 1) {
        val sx = readLine()!!.toMutableList()
        s1.removeAll { c -> !sx.remove(c) }
    }
    println(s1.sorted().joinToString(""))
}
