#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"< REN(ll x, ll y){ if(x>y) return REN(y,x); vector

ret; if(x==y) return ret; rep(i,N-1) REP(j,i+1,N){ P kari=renritsu(x,y,i,j); if(kari.first>0) ret.pb(kari); } sort(ALL(ret)); return ret; } P Solve(){ if(X==Z) { if(X==1) return mp(1,1); vector

d=REN(1,X); return d[0]; } vector

d=REN(X,Z); rep(i,d.size()){ rep(j,N){ ll AA=d[i].first, BB=d[i].second; if(AA*A[j]+BB*B[j]==Y) return d[i]; if(AA*A[j]+BB*B[j]>Y) break; } } return NG; } int main(){ REP(i,2,120){ A.pb(A[i-1]+A[i-2]); B.pb(B[i-1]+B[i-2]); if(A[i]+B[i]>1e9) 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<