import Control.Applicative ((<$>), (<*>), (<*), (*>), (<$))
import Control.Monad
import Data.List

main :: IO ()
main = do
  hw <- getl $ map read . words
  solve <$> replicateM (head hw) getLine >>= mapM_ putStrLn

solve :: [String] -> [String]
solve xs = xs >>= replicate 2

getl :: (String -> a) -> IO a
getl f = f <$> getLine
