import Control.Monad

main = do
  handn <- (map read . words) <$> getLine :: IO [Int]
  let h = handn !! 0 :: Int
  pic <- replicateM h getLine :: IO [String]

  -- mapM_ (putStrLn . show) handn
  -- mapM_ putStrLn pic

  let ans = foldl (\a b -> b:b:a) [] $ reverse pic
  mapM_ putStrLn ans