Magnetism and superconductivity