The instructor took over the controls and the student got on the radio, declared an emergency and a mayday.