I have the following picture:
Considering only lengths AN = 30 and LM = 10 are given, x is needed to be found (RM on the picture).
I started the problem based on triangle similarities (3 angles the same, so the proportion of the sides should be the same) and if I note the length of a square as len then I figured:
(len - 30) : (len - NP) = NP : 30
where len - 30 is NB.
So 30*(len - 30) = NP*(len-NP)
And from that I get that NP is equal to 30 and that is equal to len which cannot be from the picture. Am I doing something wrong and could x be found?

Let the unknown variable be the angle $\theta$. Then, all the segment lengths can be computed successively. They are all given in the diagram. Matching the left and right side lengths of the upright square to get
$$30+30\cos\theta = 30(1-\sin\theta) + 10 + 30(1+\cos\theta-\sin\theta)\tan\theta$$
which simplifies to
$$3(1-\sin\theta)=\cos\theta$$
Solve to get $\cos\theta=\frac35$ and $\sin\theta =\frac45$. Thus,
$$x= 30(1+\cos\theta-\sin\theta)\sec\theta=40$$