Proton and pion distributions in heavy-ion collisions at SIS energies