单项选择题

Only when I began to do it ______ that I had made a mistake.

A.I realized
B.I had realized
C.did I realize
D.would I realize