Mechanism of triazolinedione-olefin reactions. Ene and cycloaddition