Number Sequence
#描述#
Define:An = X*An-1 + Y
<BR>
and Y mod (X-1) = 0.
<BR>
Your task is to calculate the smallest positive integer k that Ak mod A0 = 0.
#格式#
##输入格式##
Each line will contain only three integers X, Y, A0 ( 1 < X < 2^31, 0 <= Y < 2^63, 0 < A0 < 2^31).
##输出格式##
For each case, output the answer in one line, if there is no such k, output "Impossible!".
#样例1#
##样例输入1##
2 0 9
##样例输出1##
1
#限制#
1000ms
32768KB
#提示#
#来源#
zjut_DD