Hint: Use
If $a = bq + r$,
$a,b,q,r \in \mathbb Z, a \not = 0$ and $b \not = 0$ then
$\gcd(a,b) = \gcd(b,r)$
Which will expand to:
\begin{align*}
a &= bq_1 + r_1 && 0 \leq r_1 < b\\
b &= r_1q_2 + r_2 && 0 \leq r_2 < r_1\\
r_1 &= r_2q_3 + r_3 && 0 \leq r_3 < r_2\\
r_2 &= r_3q_4 + r_4 && 0 \leq r_4 < r_3\\
& \vdots && \vdots
\end{align*}
So for your problem:
\begin{align*}
51781 &= 4655(11) + 576\\
4655 &= 576(8) + 47\\
\dots
\end{align*}
Once you get to the end you can just substitute back in the steps:
\begin{align*}
1 &= 12 - 11\\
&= (576 - 12 \cdot 47) - (47 - 3 \cdot 12)\\
&= 576 - 12 \cdot 47 + 3 \cdot 12\\
&= 576 - 13 \cdot 47 + 3 ( 576 - 12 \cdot 47)\\
&= 4(576) - 49(47)\\
&= 4(51781 - 11\cdot4655) - 49(4655 - 8\cdot576)\\
&= 4(51781) - 93(4655) + 392(576)\\
&= 4(51781) - 93(4655) + 392(51781 - 11 \cdot 4655)\\
1 &= 51781(396) + 4655(-4405)
\end{align*}
So that is your linear combination. All you have to do is substitute the steps you did to find the gcd and you will have the linear combination.
Which is the euclidean algorithm: http://en.wikipedia.org/wiki/Euclidean_algorithm