He could have literally just wished for the best, most ethical solution to happen without even coming up with one and had the stones figure it out for him (i mean, one of the infinitely powerful magical space crystals is the mind stone after all, could totally just say it’s capable of thought)