Elastic scattering of π−p, K−p and pp at 25 and 40 GeV/c