Write the procedure of calculating S-Polynomials and General Polynomial Division