Improved photomeson model for interactions of cosmic ray nuclei