a,b,c=map(int,input().split()) cnt=0 for i in range(1,10**6): s=a*i-b if s<=0: s+=b if s==c: print(i) cnt+=1 if cnt==0: print(-1)