Abu al-Khalil or Ibn al-Khalil narrates from Ali (may Allah be pleased with him) that a group of three men had shared in a woman's period of purity, and they all claimed the child. Ali (may Allah be pleased with him) decided between them by lot: the one whose name the lot fell on was to pay his companions 2/3 of the blood money (diyah), and the child would be his.
This is the most authentic of what has been narrated on this subject. It is mawquf (stopping at Ali), and Ibn al-Khalil is alone in narrating it, and Allah knows best. Al-Shafi'i (may Allah have mercy on him) mentioned this hadith in al-Qadim and in Kitab Ali wa Abdullah, and stated that if it were established from the Prophet (peace and blessings be upon him), we would hold by it and it would be the proof.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الدعوى والبينات / 21284