a,b,c=map(int,input().split()) ans="-1" for i in range(1,200010): x=i*a if x>b: x-=b if x==c: ans="" print(i) print(ans)