Determining all the steady solutions of the chemical-kinetics equations using the modified exclusion method. I. Algorithm