We are given that the angles ∠DEF and ∠DGH are equal.
Also, notice that the angles ∠EDF and ∠GDH are equal since they are "vertically opposite" angles.
Since two of the angles are equal then it means these two triangles are similar.
Now we can set up the ratio of corresponding sides to find the value of q.
Therefore, the length of the side q is 3 m