#define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair i_i; typedef pair ll_i; typedef pair d_i; typedef pair ll_ll; typedef pair d_d; struct edge { int u, v; ll w; }; int INF = INT_MAX / 10; ll MOD = 1000000007; ll _MOD = 1000000009; double EPS = 1e-10; int main() { vector fib(51); fib[0] = fib[1] = 1; for (int i = 2; i <= 50; i++) fib[i] = fib[i - 1] + fib[i - 2]; vector v(3); cin >> v[0] >> v[1] >> v[2]; sort(v.begin(), v.end()); v.erase(unique(v.begin(), v.end()), v.end()); int n = v.size(); ll_ll ans(LLONG_MAX, LLONG_MAX); if (n == 1) { for (int i = 0; i < 50; i++) { int a = fib[i], b = fib[i + 1]; for (int y = 1; y * b < v[0]; y++) { int z = v[0] - y * b; if (z % a == 0) { int x = z / a; ans = min(ans, ll_ll(x, y)); } } } } else { for (int i = 0; i < 50; i++) for (int j = i + 1; j < 50; j++) for (int k = j + 1; k < 50; k++) { ll a = fib[i], b = fib[i + 1]; ll c = fib[j], d = fib[j + 1]; ll det = a * d - b * c; ll z = v[0] * d - v[1] * b; if (z % det) continue; ll x = z / det; det = b * c - d * a; z = v[0] * c - v[1] * a; if (z % det) continue; ll y = z / det; if (n == 3 && fib[k] * x + fib[k + 1] * y != v[2]) continue; if (x >= 1 && y >= 1) ans = min(ans, ll_ll(x, y)); } } if (ans.first == LLONG_MAX) cout << -1 << endl; else cout << ans.first << ' ' << ans.second << endl; }