我以为他是男的,原来她是女的。

I had thought that he was a man, but it turned out that he was a woman.

Source: Tatoeba

Sentence Composition