#include #include #include #include #include #include #include #include #include #include #include #include "assert.h" using namespace std; vector get_fibonacci_sequence(){ //fibonacci 1,1,2,3,5,... vector f = {1,0,1,1}; for(int i=f.size(); f.back() < 2000000000LL; i++){ f.push_back( f[i-1] + f[i-2] ); } return f; } /* fi fi+1 0 | A x fj fj+1 0 | B = y fk fk+1 0 | 0 z */ pair solver(long long x, long long y , vector& f, int i, int j){ if(i==0){ long long A = x; if(f[j+1] == 0) return {1LL<<60, 1LL<<60}; long long B = y - A*f[j]; if(B%f[j+1] != 0) return {1LL<<60, 1LL<<60}; B /= f[j+1]; if(A <= 0 || B <= 0) return {1LL<<60, 1LL<<60}; return {A,B}; } if(i==1){ long long B = x; if(f[j] == 0) return {1LL<<60, 1LL<<60}; long long A = y - B*f[j+1]; if(A%f[j] != 0) return {1LL<<60, 1LL<<60}; A /= f[j]; if(A <= 0 || B <= 0) return {1LL<<60, 1LL<<60}; return {A,B}; } long long p = f[i] * y - f[j] * x; long long q = f[i] * f[j+1] - f[i+1] * f[j]; if(q == 0) return {1LL<<60, 1LL<<60}; if(p%q != 0) return {1LL<<60, 1LL<<60}; long long B = p/q; if(B <= 0) return {1LL<<60, 1LL<<60}; long long s = x - f[i+1] * B; if(f[i] == 0) return {1LL<<60, 1LL<<60}; if(s%f[i] != 0) return {1LL<<60, 1LL<<60}; long long A = s/f[i]; if(A <= 0) return {1LL<<60, 1LL<<60}; return {A,B}; } int main(){ vector f = get_fibonacci_sequence(); long long x,y,z; cin >> x >> y >> z; pair ans = {1LL<<60, 1LL<<60}; if(x==y && y==z){ for(int i=0; i p; p.first = 1; long long s = x-f[i]; if(f[i+1] == 0) continue; if(s%f[i+1] != 0) continue; p.second = s/f[i+1]; if(p.second <= 0) continue; //cerr << p.first << " " << p.second << endl; for(int k=0; k= pair{1LL<<60, 1LL<<60}) continue; //cerr << p.first << " " << p.second << endl; for(int k=0; k= pair{1LL<<60, 1LL<<60}){ cout << -1 << endl; }else{ cout << ans.first << " " << ans.second << endl; } return 0; }