It is narrated from Ata (may Allah have mercy on him) that both those women should perform ghusl and offer prayer.