Here's an attempt using the method of "have a hunch, then confirm it works", which probably follows the method by which the problem was first created. Intuiting where some missing lines ought to be can be helpful sometimes!
Begin with the following figure, with dimensions as given; we will show that filling in $z=4$ will force $y=3$, and also $x=5$, which is the answer we're looking for.

First observe that the angle at $E$ is equal to $\pi/4$ or $45^{\circ}$. [see below]
Now, because we have a bunch of similar triangles (the two meeting vertically at $G$, the two meeting vertically at $F$, and the right-angled ones along the right-hand side), we observe:
$2d/d = (x+y)/z$
$d/ (\frac{1}{3}d) = (x+z)/y$
$d/2d = (z/\sqrt{2})/(\frac{4}{3}d)$
Now if we set $z=4$, a little bit of linear algebra (or simple substitution if you will) gives us $d=3\sqrt{2}$, $y=3$, and $x=5$.
Notice how removing the continuations of the lines $EF$ and $EG$ makes everything look really hard!
Proof of the claim about the angle: This is because of a "fun fact" you may have discovered by playing around on squared graphing paper: the vectors $(2,1)$ and $(3,-1)$ (or suitable rotations of these) meet at that angle. You can prove this by reflecting one in the other using the standard formula from vector geometry: let $v=(2,1)$ and $n=(1,3)$ (which is orthogonal to $(3,-1)$). The standard reflection-in-a-line formula $v-2\frac{v\cdot n}{n\cdot n} n$ gives us
$(2,1) - 2\frac{5}{10}(1,3) = (2,1) - (1,3) = (1,-2)$
which is orthogonal to $(2,1)$; this implies that the reflection line $(3,-1)$ bisects that right angle, i.e. is at $\pi/4$ (or $45^{\circ}$) to $(2,1)$. $\square$