If we assume a rectangle then the sum of the lengths of the sides is 2z+1 (half the perimeter) and their product is 9z^2. If the sides are x and y: xy=9z^2 and x+y=2z+1. If we write y=2z+1-x and substitute for x in the other equation:
x(2z+1-x)=9z^2; 2xz+x-x^2-9z^2=0; x^2-x(2z+1)+9z^2=0. Using the quadratic formula: x=((2z+1)+sqrt(4z^2+4z+1-36z^2))/2. The square root part is 1+4z-32z^2=(1-4z)(1+8z). If this is zero, 4z=1 or 8z=-1, making z=1/4 or -1/8. The square root term becomes zero and x=(2z+1)/2=3/4 or 3/8. y=(2z+1)-(2z+1)/2=(2z+1)/2=x. Other solutions may follow if the square root is a perfect square > 0. If we assume the simplest case:
z=1/4 and x=y=3/4: xy=9/16 and 2(x+y)=3 or z=-1/8 and x=y=3/8: xy=9/64 and 2(x+y)=3/2. So the rectangle is a square with side 3/4 or 3/8.
The question asks how to figure it out. This answer hopefully guides you in the right direction!