First, you can simplify :
Then Fermat's little theorem implies that
Since , you have :
It's the same for the others. identity the number b such that , and then write the Euclidean division of the exponent by b.
For the second one, it simplifies also as
Does it look clear to you ?