Then the cat thanked them for the ham , and gave them a pocket-handkerchief and a comb , and told them that when the witch pursued them , as she certainly would , all they had to do was to throw the handkerchief on the ground and run as fast as they could .