Monte Carlo simulation of extensive air showers initiated by gamma rays and protons