A square ABCD is constructed inside a triangle PQR having sides 10,17and21 as shown in figure. Find the perimeter of the square ABCD.