{-# LANGUAGE OverloadedStrings   #-}
{-# LANGUAGE ScopedTypeVariables #-}
module AtCoder where

import           Control.Monad
import           Data.IORef
import qualified Data.Text     as T
import qualified Data.Text.IO  as T
import           System.IO

(+.+) = T.append
(!.!) = T.index

main :: IO ()
main = diagonalString

diagonalString :: IO ()
diagonalString = do
  c1 :: T.Text <- T.getLine
  c2 :: T.Text <- T.getLine
  c3 :: T.Text <- T.getLine
  let c11 = T.head c1
      c22 = c2 !.! 1
      c33 = T.last c3
  putStrLn [c11, c22, c33]