"What were ___ thinking?"
I believe the answer is:
they
(Other definitions for they that I've seen before include "Those people (vb. subject)" , "Do -- Know It's Christmas (Band Aid)" , "People generally" , "People in general" , "Pronoun for people" .)