Let ZN be the set of integers from 0 to N−1. For a,b,c∈ZN, b is the additive inverse of a if (a+b)modN=0, and c is the multiplicative inverse of a if (a×c)modN=1.
You are given integers N and A. Find the additive inverse and the multiplicative inverse of A in ZN. If the multiplicative inverse does not exist, print −1 for it.