ntimes :: Int -> IO a -> IO [a]
ntimes 0 _  = return []
ntimes n io = do
    x  <- io
    xs <- ntimes (n - 1) io
    return $ x : xs

main :: IO ()
main = do
    [n, _] <- map read . words <$> getLine
    grid   <- ntimes n getLine
    mapM_ (\r -> putStrLn $ r ++ "\n" ++ r) grid
