单项选择题

It was not until he closed the door ______ he ______ he forgot Io take the keys with him.

A.that, realized
B.did, realize
C.which, realized
D.when, realized