After rubbing the lamp to make the genie appear, he said, "I will grant three wishes, one for each of you."
The first said, "I wish I were smarter."
So, she became a redhead.
The second blonde said, "I wish I were smarter than she is."
She became a brunette.
The third blond ordered, "I wish I were smarter than both of them!"
So, she became a man.