Rapid cooling of magnetized neutron stars