#include using namespace std; using Int = long long; template inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template inline void chmax(T1 &a,T2 b){if(a20) return; dfs(y,x,d+1); dfs(x+y,x-y,d+1); } signed main(){ Int x,y; cin>>x>>y; dfs(x,y,0); cout<