John cut a paper square with a perimeter of 18 inches into two rectangles. The perimeter of one of the rectangles is 10 inches. What is the perimeter of the second rectangle?