Start by applying rule 2 to get

main = 
  do
    x <- getLine
    do getLine >>= putStrLn
    putStrLn x