After several days ' journeying , they reached the town where the king 's palace was , and here they parted for a few hours , while the thief sought an interview with the king , and begged his majesty to give him a glass of beer .