Mari has 39 square feet of patio bricks. Each square brick has sides 1 foot long. What is the greatest perimeter of a rectangle that she can make with the bricks?