\[x = 312:\]
\[17x - 8x + 31x - 18 =\]
\[= x \cdot (17 - 8 + 31) - 18 =\]
\[= 40x - 18 =\]
\[= 40 \cdot 312 - 18 =\]
\[= 12\ 480 - 18 = 12\ 462\]