Noting that

(getLine >>= putStrLn)>>putStrLn x

is one monadic expression, rule 2 can be applied again to get

main = 
  do
    getLine >>= 
      (\x ->       
        (getLine >>= putStrLn) 
          >> putStrLn x
      )