The ratio of the length to the width of a rectangle is 7 to 2. If the perimeter of the rectangle is 54 inches, what are the measures of the length and width of the rectangle?