there was a chase in and out of windows , and along dark passages , and round pillars , and out and up and round the domes ; till at last the mer-dog himself was exhausted , and his bad temper too , and they sat down together on the top of the highest cupola next to the flag-pole .