Let ∠E=X
∠∠A = 3∠E
∴∠A=3X
∵Rt△ABC, d is the midpoint of AB.
∴CD= 1/2AB,AD=CD
∴∠A=∠ACD=3X
∵Rt△EFC, g is the midpoint of EF.
∴CG= 1/2EF,CG=EG
∴∠E=∠ECG=X
∠∠CGD =∠E+∠ ECG, ∠ CDG =∠ ACD-∠ E.
∴∠CGD=X+X=2X,∠CDG=3X-X=2X
∴∠CGD=∠CDG
∴CG=CD
∫CD = 1/2AB,CG= 1/2EF
∴AB=EF
I hope it helps you!