It's a question of setting up the right system of equations. At least, that's how I solved it. Let each variable name be the length of a side of the corresponding square. Then the equations I have are the following:

At this point, admitting laziness, I turned the solution over to Mathematica, which spit out the result:

Spoiler:

In principle, though, you would probably employ Gaussian elimination with back substitution to solve the system. You have a decently sparse system there, so it might not be all that messy, actually.

Cheers.