import           Control.Monad
import           Data.IORef
import           Data.List.Split
import           Data.Maybe
import           Data.List

main :: IO ()
main = do
  [h, w] <- map read . words <$> getLine
  image <- replicateM h getLine
  forM_ [0 .. h - 1] $ \x -> 
    putStrLn $ image !! x ++ "\n" ++ image !! x