We all know All/What S have to do is RV or To RV

However, I saw these four sentences which have long confused me.


The stupidest thing I ever did was "listening" to you.

The last thing I remembered was "kissing" my mom.

The worst thing I ever did was "to try" licking frozen tracks.

What John did to his car was "ruin" it.

I know in the above sentences, they use Was Ving to state that it has happened, but why the third sentence uses To Rv?? And the forth sentence uses Was RV? Top off my head, I assume it's because of the beginning of the sentence is What. Am I right?

We always use RV in the following of beVerb when the heads of the sentence are All and What. Right??

How can I use with the right grammar? Thank all replies!!!!!! Thank you!