#include #include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int A, B, C; cin >> A >> B >> C; bool ok = false; for (int i = 1; i < 1e6; i++) { int x = i * A; if (x - B > 0) x -= B; if (x == C) { cout << i << endl; ok = true; } } if (!ok) cout << -1 << endl; return 0; }