Direct observation of charge state abundances of energetic He, C, O, and Fe emitted in solar flares