Write out the units in Z/31. For each unit [a] find its inverse [b], namely given gcd(a, 31) = 1 find b € Z so that ab = 1 (mod 31). Use this information to solve 45 = 7 (mod 31).