The length of a rectangle is 3 inches greater than its width. The perimeter of a rectangle is 27 inches. Find the length and width.