it/ be/ until/she/arrived/home/she/remember/appointment/doctor/.
A.It was not until she had arrived home when she remembered her appointment with the doctor.
B.It was not until she had arrived home that she remembered her appointment with the doctor.
C.It was not until had she arrived home and remembered her appointment with the doctor.
D.It was not until she had arrived home did she remember her appointment with the doctor.