#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;

const ll MOD = 50510000;
const ld eps = -1e-9;
const ld EULER_GAMMA = 0.57721566490153286060651209008240243104215933593992;
ld harmonic_exact(ll k) {
    ld sum = 0.0;
    for (ll i = 1; i < k + 1; i++) {
        sum += 1.0 / i;
    }
    return sum;
}

ld harmonic_approx(ll k) {
    if (k == 0) return 0.0;
    ld ln_k = logl(k);
    ld k2 = k * k;
    ld k4 = k2 * k2;
    ld k6 = k4 * k2;
    ld k8 = k4 * k4;

    ld correction =
        1.0 / (2.0 * k) -
        1.0 / (12.0 * k2) +
        1.0 / (120.0 * k4) -
        1.0 / (252.0 * k6) +
        1.0 / (240.0 * k8);

    return ln_k + EULER_GAMMA + correction;
}



int main() {
    ll d, a, b;
    cin >> d >> a >> b;
    if (b > d) {
        cout << -1 << endl;
        return 0;
    }
    ll l = 0, r = 1e9;
    while (l < r - 1) {
        ll mid = (l + r) / 2;
        ld val = ld(b) + ld(b) * harmonic_approx(mid - 1) / ld(2);
        if (val - ld(d) < eps) {
            l = mid;
        }
        else {
            r = mid;
        }
    }
    ld val = ld(b) + ld(b) * harmonic_approx(r - 1) / 2;
    if (val - ld(d) < eps) cout << -1 << endl;
    else cout << (r % MOD) * a % MOD << endl;
}

