Direction ratios of the line joining the points
$(3,1,4)$ and $(7,2,12)$ are
$= < 7-3,2-1,12-4 >$
$= < 4,1,8 >$
$= < a_{1}, a_{2}, a_{3}> $(let)
And the direction ratio of given line is
$= < 2,2,1 >$
$= < b_{1}, b_{2}, b_{3}> $(let)
Let $Q$ be the angle between the lines,
then $\cos \theta=\frac{a_{1} b_{1}+a_{2} b_{2}+a_{3} b_{3}}{\sqrt{a_{1}^{2}+a_{2}^{2}+a_{3}^{2}} \sqrt{b_{1}^{2}+b_{2}^{2}+b_{3}^{2}}}$
$\Rightarrow \cos \theta=\frac{(4)(2)+(1)(2)+(8)(1)}{\sqrt{16+1+64} \sqrt{4+4+1}}$
$\Rightarrow \cos \theta=\frac{18}{\sqrt{81} \sqrt{9}}=\frac{18}{9 \times 3}=\frac{2}{3}$
$\Rightarrow \theta=\cos ^{-1}\left(\frac{2}{3}\right)$