I'm trying to write a phrase that says "Fortunately I passed (the exam)" and I would like to use 幸い in it, but I'm not sure how I would go about writing it, mainly because I'm not quite sure which particle to use together with 幸い. In my vision there are 2 options:
幸いに合格した
or
幸いで合格した
I'm more inclined to say that the first option is the right one, but both could be wrong or the second option could be the right one. I would appreciate some insight.