Chinese remainder theorem for divisibility problem Find the smallest $n$ so that:

$n$ divided by $3$ gives remainder $2$, $n$ divided by $11$ gives remainder $8$, $n$ divided by $27$ gives remainder $5$, $n$ divided by $47$ gives remainder $40$.   

I'm not sure if it is $2813$, but that is the number I used to generate this problem. Anyways, I'm trying to figure out how to use the Chinese remainder to solve this problem step by step. I've seen "tricks" where they use the LCM and other things, but I need to know the way with the Chinese remainder theorem for my exam.
You have $M = 11\times 27\times 47 = 13959$ and $M_1 = M/11 = 1269$, $M_2 = M/27 = 517$, $M_3 = M/47 = 297$. Taking $y_1$, $y_2$, $y_3$ such that $M_1y_1 = 1$ (mod 11), $M_2y_2 = 1$ (mod 27), $M_3y_3 = 1$ (mod 47). Then we have $$n = 8M_1y_1 + 5M_2y_2 + 40M_3y_3.$$  

EDIT: make some simple calculation, you have $y_1 = 3$, $y_2 = 7$, $y_3 = 22$, then $n = 309911 = 2813$ (mod M).
3 is   not needed, it is taken care of by 27.  Begins with

$$ 27 \cdot (-2) + 11 \cdot 5 = 1 $$
$$ 297 \cdot 22 + 47 \cdot (-139) = 1 $$

$$ 8 \cdot 27 \cdot (-2) + 5 \cdot 11 \cdot 5 = -432 + 275 = -157 $$
is $8 \pmod {11}$ and $5 \pmod {27}.$

$$ 40 \cdot 297 \cdot 22 + (-157) \cdot 47 \cdot (-139) = 1287041 $$
is $40 \pmod {47}$ and $-157 \pmod {297}$

Now, as you knew,
$$  1287041 \equiv 2813 \pmod {13959},  $$
so the smallest answer is your 2813.

Note
$$ 27 \cdot 11 \cdot 47 = 13959 $$
$$  1287041 = 92 \cdot 13959 + 2813   $$

LATER

Looking at the other answers, I can see how there is an advantage to choosing positive representatives in the middle stages. In this case
$$ -157 + 297 = 140 \equiv -157 \pmod {297}  $$
The next step changes to
$$ 40 \cdot 297 \cdot 22 + 140 \cdot 47 \cdot (-139) = 261360-914620 = -653260 $$
Well, not much better