Here is one way.

ABCD is from 23km to 51km

So, 23 <= ABCD <= 51 ----------(i)

ABCDEFG = 51

DEFG = ABCDEFG -ABCD

So, DEFG is from 28km to 0km

0 <= DEFG <= 28 ---------------(ii)

EFG is from 18km to 0km,

0 <= EFG <= 18 ------------(iii)

(ii) minus (iii),

(0 -0) <= (DEFG -EFG) <= (28 -18)

0 <= DE <= 10 ----------------------***

That means, between D and E, the possible distance is from 0 to 10 km. ---------answer.