Studies of the chemical composition of cosmic rays withZ=3?30 at high and low energies