The formula for the perimeter of a rectangle is p=2l+2w, where l is the length and w is the width. A rectangle has a perimeter of 24 inches. Find its dimensions if its length is 3 inches greater than its width.