Hydrogen and helium spectra in large magnetic fields