I asked her: What is this? She replied: This belongs to Yuhannah. We then brought the case to Uthman (for a decision). I think Mahdi said these words. He inquired from both of them, and they acknowledged (the facts).
He then said to them: Do you agree that I take the decision about you, which the Messenger of Allah (ﷺ) had taken? The Messenger of Allah (ﷺ) decided that the child was to attributed to the one on whose bed it was born. And I think he said: He flogged her and flogged him, for they were slaves.
In-book : Book 13, Hadith 101
English translation : Book 12, Hadith 2268