The donkey lay down in the courtyard outside the house , the dog behind the door , the cat in front of the fire , and the cock flew up on to a high shelf , and , as they were all tired after their long day , they soon went to sleep .