fun main(args: Array<String>) {
    abc058C()
}

fun abc058C() {
    val n = readLine()!!.toInt()
    val firstString = readLine()!!.toCharArray().sortedArray()
    val stringList = (1 until n).map { readLine()!!.toCharArray().sortedArray().toMutableList() }
    val buff = mutableListOf<Char>()

    firstString.forEach {
        if (stringList.all { charList -> charList.contains(it) }) {
            buff += it
            stringList.forEach { charList -> charList.remove(it) }
        }
    }

    buff.sort()

    println(buff.joinToString(separator = ""))
}
