fun main(args: Array<String>) {
    val N = nextInt()
    val S = Array(N) { next() }
    val Ch = Array(N) { IntArray(26) }
    val Co = IntArray(26)
    S.forEachIndexed { n, s ->
        s.forEach { ch -> Ch[n][ch - 'a'] += 1 }
    }
    for (n in Co.indices) {
        var min = Int.MAX_VALUE
        for (m in Ch.indices) min = Math.min(min, Ch[m][n])
        Co[n] = min
    }
    val ans = mutableListOf<String>()
    Co.forEachIndexed { offset, count ->
       if (count > 0) ans.add(("" + ('a' + offset)).repeat(count))
    }
    println(ans.joinToString(""))
}

fun next() = readLine()!!
fun nextInt(delta: Int = 0) = Integer.parseInt(next()) + delta
fun listOfString() = next().split(" ")
fun listOfLong() = listOfString().map(String::toLong)
