A rectangular shelf has an area of 40 square inches. Its perimeter is 28 inches. What are the dimensions of the shelf?