#include #define GET_MACRO(a, b, c, NAME, ...) NAME #define rep(...) GET_MACRO(__VA_ARGS__, rep3, rep2)(__VA_ARGS__) #define rep2(i, a) rep3 (i, 0, a) #define rep3(i, a, b) for (int i = (a); i < (b); i++) #define repr(...) GET_MACRO(__VA_ARGS__, repr3, repr2)(__VA_ARGS__) #define repr2(i, a) repr3 (i, 0, a) #define repr3(i, a, b) for (int i = (b) - 1; i >= (a); i--) #define chmin(a, b) ((b) < a && (a = (b), true)) #define chmax(a, b) (a < (b) && (a = (b), true)) using namespace std; typedef long long ll; ll C[50][2][2]; ll det(ll a, ll b, ll c, ll d) { return a * d - b * c; } int main() { ll X, Y, Z; cin >> X >> Y >> Z; vector v = {X, Y, Z}; sort(v.begin(), v.end()); v.erase(unique(v.begin(), v.end()), v.end()); X = v[0]; if (v.size() >= 2) Y = v[1]; if (v.size() >= 3) Z = v[2]; C[0][0][0] = 1; C[0][0][1] = 0; C[0][1][0] = 0; C[0][1][1] = 1; C[1][0][0] = 0; C[1][0][1] = 1; C[1][1][0] = 1; C[1][1][1] = 1; rep (l, 2, 50) { rep (i, 2) rep (j, 2) rep (k, 2) { C[l][i][j] += C[l - 1][i][k] * C[1][k][j]; } } const ll inf = 1e18; typedef pair P; P ans(inf, inf); if (v.size() == 1) { rep (i, 50) { ll a = C[i][0][0], b = C[i][0][1]; if (b == 0) continue; if ((X - a) % b != 0) continue; ll B = (X - a) / b; if (B <= 0) continue; chmin(ans, P(1, B)); } } else if (v.size() == 2) { rep (i, 50) rep (j, 50) { ll D = det(C[i][0][0], C[i][0][1], C[j][0][0], C[j][0][1]); ll A = det(X, C[i][0][1], Y, C[j][0][1]); ll B = det(C[i][0][0], X, C[j][0][0], Y); if (D == 0) continue; if (A % D != 0 || B % D != 0) continue; A /= D; B /= D; if (A <= 0 || B <= 0) continue; chmin(ans, P(A, B)); } } else { rep (i, 50) rep (j, 50) rep (k, 50) { ll D = det(C[i][0][0], C[i][0][1], C[j][0][0], C[j][0][1]); ll A = det(X, C[i][0][1], Y, C[j][0][1]); ll B = det(C[i][0][0], X, C[j][0][0], Y); if (D == 0) continue; if (A % D != 0 || B % D != 0) continue; A /= D; B /= D; if (A <= 0 || B <= 0) continue; if (Z != C[k][0][0] * A + C[k][0][1] * B) continue; chmin(ans, P(A, B)); } } if (ans.first == inf) { cout << -1 << endl; } else { cout << ans.first << " " << ans.second << endl; } return 0; }