parrot i iter
  | i == iter = do
    return 0
  | otherwise = do
    str <- getLine
    putStrLn $ str ++ "\n" ++ str
    return =<< parrot (i+1) iter

main = do
  [h, w] <- map read . words <$> getLine
  parrot 0 h
