Check the picture below.
let's make α = 27°50' and β = 20°10'.

since h = h, we can simply
![xtan(\alpha)=(x+126)tan(\beta)\implies xtan(\alpha)=xtan(\beta)+126tan(\beta) \\\\\\ xtan(\alpha)-xtan(\beta)=126tan(\beta)\implies x[tan(\alpha)-tan(\beta)]=126tan(\beta) \\\\\\ x=\cfrac{126tan(\beta)}{tan(\alpha)-tan(\beta)} \\\\[-0.35em] ~\dotfill\\\\ \stackrel{\textit{since we know that}}{xtan(\alpha)=h}\implies \cfrac{126tan(\beta)}{tan(\alpha)-tan(\beta)}tan(\alpha)=h \implies \cfrac{126tan(\beta)tan(\alpha)}{tan(\alpha)-tan(\beta)}=h](https://img.qammunity.org/2023/formulas/mathematics/high-school/y5ma8h46b5shy6s5r6w15j1vj6jxc707pe.png)
now, if we do the degrees and minutes conversion to just degrees for the sake of sticking it in the calculator, mind you make sure your calculator is in Degree mode, for 27°50' we get about 27.83° and for 20°10' we get 20.16°
