They wandered through many halls and rooms till at last they found the second princess , who was quite as grateful as the first , and thanked the three companions most warmly for having set her free .