#include using namespace std; using Int = long long; const char newl = '\n'; template inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template inline void chmax(T1 &a,T2 b){if(a void drop(const T &x){cout< vector read(size_t n){ vector ts(n); for(size_t i=0;i>ts[i]; return ts; } //INSERT ABOVE HERE using P = pair; P pos(int x){ int r=0,c=0; while(x%2==0) r++,x/=2; while(x%5==0) c++,x/=5; return P(r,c); } int val(int r,int c){ int x=1; for(int i=0;i>x1>>x2; while(1){ auto [r1,c1]=pos(x1); auto [r2,c2]=pos(x2); int ddr=0,ddc=0; if(abs(r2-r1)>abs(c2-c1)){ ddr=(r2-r1)/abs(r2-r1); }else{ ddc=(c2-c1)/abs(c2-c1); } int nr=r1+ddr,nc=c1+ddc; x1=val(nr,nc); cout<>x2; if(x1==x2) return 0; } return 0; }