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