Of the new gen sleep aids Ambien is considered 1st gen, I would go with sonata- shorter half life, little to no hang over, refreshing sleep.
Of course you should do a demo run before taking it on D-day -1 just to see how you react.
Oh and don't take it for at least 4-5 days before the exam- don't want to build tolerance.
Best of luck!