Composition of energetic particles from solar flares