If a man has two wives, one beloved and the other hated, and they have produced children by him, and if the son of the hated wife is the firstborn,