#include using namespace std; template inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template inline void chmax(T1 &a,T2 b){if(asputn(d,len)!=len){ os.setstate(ios_base::badbit); } } return os; } istream &operator>>(istream &is,Int &val){ string s; is>>s; val=0; for(Int i=0;i<(Int)s.size();i++) if(isdigit(s[i])) val=val*10+s[i]-'0'; if(s[0]=='-') val*=-1; return is; } //INSERT ABOVE HERE signed main(){ using P = pair; vector

vp; vp.emplace_back(1,0); vp.emplace_back(0,1); const Int MAX = 50; for(Int i=0;i>x>>y>>z; P ans(1e18,-1); for(Int i=0;i