F10=[0 for i in range(50)] F01=[0 for i in range(50)] F10[0]=1 F01[1]=1 for i in range(2,50): F10[i]=F10[i-1]+F10[i-2] F01[i]=F01[i-1]+F01[i-2] X=map(int,raw_input().split()) X=list(set(X)) X.sort() if len(X)==1: a=1 ans=1000000000 for i in range(50): if F01[i]==0: if F10[i]==X[0]: ans=min(ans,1) elif (X[0]-F10[i])%F01[i]==0 and X[0]-F10[i]>0: ans =min(ans,(X[0]-F10[i])/F01[i]) print a,ans elif len(X)==2: x,y=X[0],X[1] A,B=1000000000,1000000000 for i in range(50): for j in range(i+1,50): if(x*F01[j]-y*F01[i])%(F01[j]*F10[i]-F10[j]*F01[i])!=0 or (x*F10[j]-y*F10[i])%(F10[j]*F01[i]-F01[j]*F10[i])!=0 : continue a=(x*F01[j]-y*F01[i])/(F01[j]*F10[i]-F10[j]*F01[i]) b=(x*F10[j]-y*F10[i])/(F10[j]*F01[i]-F01[j]*F10[i]) if a<=0 or b<=0: continue #print x,"=",a,"*",F10[i],"+",b,"*",F01[i],"...",i #print y,"=",a,"*",F10[j],"+",b,"*",F01[j],"...",j (A,B)=min((A,B),(a,b)) print A,B else: x,y,z=X[0],X[1],X[2] A,B=1000000000,1000000000 for i in range(50): for j in range(i+1,50): if(x*F01[j]-y*F01[i])%(F01[j]*F10[i]-F10[j]*F01[i])!=0 or (x*F10[j]-y*F10[i])%(F10[j]*F01[i]-F01[j]*F10[i])!=0 : continue a=(x*F01[j]-y*F01[i])/(F01[j]*F10[i]-F10[j]*F01[i]) b=(x*F10[j]-y*F10[i])/(F10[j]*F01[i]-F01[j]*F10[i]) if a<=0 or b<=0: continue #print x,"=",a,"*",F10[i],"+",b,"*",F01[i],"...",i #print y,"=",a,"*",F10[j],"+",b,"*",F01[j],"...",j ok=False for k in range(j+1,50): if a*F10[k]+b*F01[k]==z: ok=True break if ok: (A,B)=min((A,B),(a,b)) if A==1000000000: print -1 else: print A,B