#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int a,b,c; cin >> a >> b >> c; bool f = false; for(int i = 1; i <= 200000; i++) { long long now = 1ll*i*a; if(now > b) now -= b; if(now == c) { cout << i << endl; f = true; } } if(!f) cout << -1 << endl; }