I understand how to do the Chinese Remainder Theorem when all of the moduli are pairwise relatively prime, but I don't understand how to do it when all of the moduli are NOT pairwise relatively prime.

For example, say we have

x≡9 (mod 12)

x≡3 (mod 9)

x≡7 (mod 10)

According to my teacher this becomes

x≡1 (mod 4)

x≡3 (mod 9)

x≡2 (mod 5).

I don't understand how this was arrived at though. Could someone please clearly explain the process?