Note that the line equation coordinates is, with $u=[0 \ 1 \ 2 ]$ and $v=[1 \ 2 \ 2 ]$: $$ x_i=u_i+v_i\lambda $$
And the final point coordinates after $k_1,k_2,k_3$ reflections in each axis is: $$ y_i=14\lceil {k_i\over2}\rceil+(-1)^{k_i}u_i $$
Hence, solving: $$ 14\lceil {k_i\over2}\rceil+(-1)^{k_i}u_i=u_i+v_i\lambda $$
Taking the first option $k_1=0$, we obtain the trivial solution, $k_1=k_2=k_3=0$, $\lambda=0$, the same point.
Taking $k_1=1$: $$ 14\lceil {1\over2}\rceil=\lambda \to \lambda=14 \\\ 14\lceil {k_2\over2}\rceil+(-1)^{k_2}1=1+28 \to k_2=4 \\\ 14\lceil {k_3\over2}\rceil+(-1)^{k_3}2=2+28 \to k_3=4 $$
Hence, $\lambda=14$, the light ray travels through the vector $v\lambda=14[1 \ 2 \ 2]$ and the total travel distance is $42$.