import Control.Monad (replicateM, forM_)

main = do
  line <- getLine
  let [h, w] = fmap (read :: String -> Int) $ words line in
    do
      ls <- replicateM h getLine
      forM_ ls (\a -> putStrLn a >> putStrLn a)
