Monique is using similar triangles in her graphic-design project. The triangles are isosceles. One has a base of 8 inches and legs of 6 inches. If the other triangle has a base of 18 inches, how long are the legs?