import scala.io.{StdIn => in}

object Main extends App {
  val grid = Iterator.continually(in.readLine)
    .take(3)
    .toArray
  val ans = for (i <- 0 until 3) yield grid(i)(i)
  println(ans.mkString)
}