The perimeter of a square is 12 cm greater than that of another square. Its area exceeds the area of the other square by 39 sq cm. How do you find the perimeter of each square?