import io.StdIn

object Main extends App {
  val n = StdIn.readInt
  val ans = Iterator.continually(StdIn.readLine)
    .take(n)
    .reduce((a,b) => {
      a intersect b
    }).sorted

  println(ans)
}