ENERGY SPECTRA OF PRIMARY AND SECONDARY COSMIC-RAY NUCLEI MEASURED WITH TRACER