Solution (source code)

= Solution

First compute
$$
AB=\begin{pmatrix}
-2&2&2\\
-3&-7&-1\\
-1&-4&-1
\end{pmatrix}.
$$
The vector $\ell=(1,-2,4)^T$ lies in the <kernel> of $(AB)^T$, since $\ell^TAB=0$. If $ABx=d$ is solvable, multiplying by $\ell^T$ gives the necessary compatibility condition
$$
0=\ell^Td=1-2+4k.
$$
Therefore
$$
\boxed{4k=1}.
$$