#include using namespace std; void solve() { int a, b, c; cin >> a >> b >> c; bool flag = true; for (long long n = 1; n <= 200000; n++) { long long v = a * n; if (v > b) { v -= b; } if (v == c) { cout << n << '\n'; flag = false; } } if (flag) { cout << -1 << '\n'; } } int main() { int q = 1; // cin >> q; while (q--) { solve(); } }