Then the mice told her that the witch had a cat , and the cat was very fond of ham ; if she would give the cat her ham , it would show her the way out of the wood , and in the meantime they would spin the yarn for her .