#include using namespace std; typedef long long ll; typedef vector< int > vi; typedef vector< vi > vvi; typedef vector< ll > vl; typedef vector< vl > vvl; typedef pair< int, int > pii; typedef vector< pii > vp; typedef vector< double > vd; typedef vector< vd > vvd; typedef vector< string > vs; template< class T1, class T2 > int upmin( T1 &x, T2 v ){ if( x > v ){ x = v; return 1; } return 0; } template< class T1, class T2 > int upmax( T1 &x, T2 v ){ if( x < v ){ x = v; return 1; } return 0; } const int INF = 0x3f3f3f3f; int X, Y, Z; void init(){ cin >> X >> Y >> Z; } vvi mat_mul( vvi a, vvi b ){ vvi c( a.size(), vi( a[ 0 ].size() ) ); for( int i = 0; i < a.size(); ++i ){ for( int j = 0; j < a[ 0 ].size(); ++j ){ for( int k = 0; k < b[ 0 ].size(); ++k ){ c[ i ][ k ] += a[ i ][ j ] * b[ j ][ k ]; } } } return c; } const vvi identity = { { 1, 0 }, { 0, 1 } }; const vvi feature = { { 1, 1 }, { 1, 0 } }; vvi pf[ 50 ]; // powered f void preprocess(){ vi t = { X, Y, Z }; sort( t.begin(), t.end() ); X = t[ 0 ], Y = t[ 1 ], Z = t[ 2 ]; pf[ 0 ] = identity; for( int i = 0; i + 1 < 50; ++i ){ pf[ i + 1 ] = mat_mul( pf[ i ], feature ); } } void solve(){ if( X == Y and Y == Z ){ X = 1; } else if( X == Y ){ Y = Z; } vvi t = identity; int min_A = INF, min_B = INF; for( int i = 0; i < 45; ++i ){ for( int j = i; j < 45; ++j ){ int a = pf[ j ][ 0 ][ 0 ], b = pf[ j ][ 0 ][ 1 ], c = pf[ i ][ 1 ][ 0 ], d = pf[ i ][ 1 ][ 1 ]; if( a * d == b * c ){ min_A = min_B = 1; } else{ int A = -1; if( ( c * Y - a * X ) % ( b * c - a * d ) == 0 ){ A = ( c * Y - a * X ) / ( b * c - a * d ); } int B = -1; if( ( d * Y - b * X ) % ( a * d - b * c ) == 0 ){ B = ( d * Y - b * X ) / ( a * d - b * c ); } if( A > 0 and B > 0 ){ int ok = B == Z; for( int p = A, q = B; q < Z; ){ if( p + q == Z ){ ok = 1; break; } int tmp = p + q; p = q; q = tmp; } if( not ok ) continue; if( min_A == A ){ upmin( min_B, B ); } else if( upmin( min_A, A ) ){ min_B = B; } } } } } if( min_A == INF ){ cout << -1 << endl; } else{ cout << min_A << " " << min_B << endl; } } signed main(){ ios::sync_with_stdio( 0 ); init(); preprocess(); solve(); return 0; }