Let the length of the side of the first and the second square be x and y. respectively.
According to the question:
x2 + y2 = 640.....(i)
Also
4x - 4y = 64
⇒ x - y = 16
⇒ x = 16 + y
Putting the value of x in (i), we get:

∴ y = 8
(∵Side cannot be negative)
∴ x = 16 + y = 16 + 8 = 24m
Thus, the sides of the squares are 8 m and 24 m.