in the end , of course , they had to do just what bilbo suggested , because it was obviously impossible for them to try and find their way into the upper halls , or to fight their way out of gates that closed by magic ; and it was no good grumbling in the passages until they were caught again .