Heck, I don't care if you had an affair, but if you're going to resign because of it don't say, "I have come to learn that the particular combination of drugs prescribed for me in the past has caused some impairment in my judgment." Puuuhhhhllleeeezzzzzeeee.
You've spent your life pointing the finger at people, demanding accountability, preaching about "consequences for your actions." Sir, you should demand the same of yourself. I wouldn't care if you chose to stay in office, just don't go making excuses.