I'm doing Number Theory, completed multiplication, division etc, but now moved on to Fermat's little theorem.

Having a bit of trouble seeing how to go about a couple of examples I have.

Generally

a^(p-1)_{≡ }1 (mod p)

where p is a prime number

& a is an integer

i) 3^18 divided by 19

so p=19 & a=3

3^18_{≡}1 (mod 19)

Hence remainder is 1

Fine

ii) 3^55 divided by 19

but 55 isn't a prime, so how do I do this, please?