SUPERCONDUCTIVITY FROM SPIN-WAVE EXCITATIONS NEAR THE FERROMAGNETIC AND ANTIFERROMAGNETIC INSTABILITIES