Abu Hurairah (May Allah be pleased with him) said:
The Messenger of Allah (ﷺ) said, "There were two women, each had her child with her. A wolf came and took away the child of one of them. One woman said to her companion: 'The wolf has taken your son.' The other said: 'It has taken your son.' So both of them took the dispute to Prophet Dawud (David) (ﷺ) who judged that the boy should be given to the older lady. Then they went to Prophet Sulaiman (Solomon) (ﷺ) son of Dawud and put the case before him. Prophet Sulaiman said: 'Give me a knife so that I may cut the child into two and give one half to each of you.' The younger woman said: 'Do not do so; may Allah bless you! He is her child.' On that Prophet Sulaiman decided the case in favour of the younger woman."[Al-Bukhari and Muslim].
App reference: Book 19, Hadith 20
Arabic/English book reference: Book 19, Hadith 1827