Energy spectra and composition of primary cosmic rays