Work backwards. The smallest number that is $1\pmod3$ is $4$. $4$ is therefore the result of dividing by $5$, and therefore was $24$ before the 'divide by $5$ to leave remainder $4$' operation.
As the next operation is 'divide by $7$ to leave remainder $4$', then $24\times7=168$, and add $4$ to give $172$.
No. You need
$$ 7(5(3+1)+4)+4=172$$
Work backwards. The smallest number that is $1\pmod3$ is $4$. $4$ is therefore the result of dividing by $5$, and therefore was $24$ before the 'divide by $5$ to leave remainder $4$' operation.
As the next operation is 'divide by $7$ to leave remainder $4$', then $24\times7=168$, and add $4$ to give $172$.