An open box is to be made from a square piece of sheet metal by removing a square of side 3 inches from each corner and turning up the edges. If the volume of the box is to be 507 cubic inches, what is the length of the sides of the square of the sheet metal.