Two women came to the judge with the baby, and each of them insisted, that he is her son and she wishes to raise him. The judge thought how to learn which of them is a real mother, and he has thought up. It has told: well, we shall cut the child half-and-half, and everyone will take her part. One of women at once has cried: no! No! DO NOT CUT HIM!! Better let her take my child and raise him!!.. So the judge has learned who is the real mother.
As jassKat has said, if she changes the son for money, she is not mother any more, and he is not her son...therefore there is no issue.