#include #include using namespace std; typedef long long ll; typedef vector vec; typedef vector mat; typedef vector Vec; typedef vector Mat; typedef pair P; typedef pair Pd; typedef priority_queue,greater

> P_queue; typedef priority_queue,greater> Pd_queue; const ll MOD=998244353; const ll mod=1000000007; const ll INF=1e15; const double DEL=1e-3; vec dx={1,0,-1,0}; vec dy={0,1,0,-1}; #define REP(i,a,b) for(int i=(int)a;i<(int)b;i++) #define rep(i,n) REP(i,0,n) #define pb push_back #define mp make_pair #define ALL(a) a.begin(),a.end() #define SORT(a) sort(ALL(a)) #define U_ERASE(V) V.erase(unique(ALL(V)), V.end()); #define ADD(a,b) a=(a+b)%mod #define CHECK cout<<"arrived"<y) return hantei(a,b,y,x); rep(i,N) { if(a*A[i]+b*B[i]==x){ REP(j,i,N){ if(a*A[j]+b*B[j]==y) return true; if(a*A[j]+b*B[j]>y) return false; } } if(a*A[i]+b*B[i]>x) return false; } return false; } P Solve(){ REP(j,1,Y+1){ for(int i=N-1;i>=0;i--) { ll A=Solving(j,Z,i); if(A>=0){ if(hantei(j,A,X,Y)) return mp(j,A); } } } return mp(-1,-1); } int main(){ REP(i,2,120){ A.pb(A[i-1]+A[i-2]); B.pb(B[i-1]+B[i-2]); if(B[i]>1e9+10) break; } N=B.size(); vec I(3); rep(i,3) cin>>I[i]; sort(ALL(I)); X=I[0]; Y=I[1]; Z=I[2]; P ans=Solve(); if(ans.first<0) cout<<-1<