//interactive ll q(ll a,ll b :Memoize){ wt("?",a,b); ll@x; return x; } { ll@n,a[n],b[n]; if(n==1){ wt("! 1 1"); exit(0); } rep(i,1,n+1){ ll x=q(i,i); if(x>1){ ll f=Factor(x,a); x=a[f-1]; if(x*2>n){ ll y=q(i,(i+1)%n); if(y%x==0){ //a[i] is large prime ll o=0; rep(j,1,n+1){ ll z=q(i,j); if(z==x){ ll w=q((i+1)%n,j); if(w%x==0){ b[j-1]=x; }else{ b[j-1]=1; o=j; } }else{ b[j-1]=z/x; } } rep(j,1,n+1){ a[j-1]=q(j,o); } }else{ //b[i] is large prime ll o=0; rep(j,1,n+1){ ll z=q(j,i); if(z==x){ ll w=q(j,(i+1)%n); if(w%x==0){ a[j-1]=x; }else{ a[j-1]=1; o=j; } }else{ a[j-1]=z/x; } } rep(j,1,n+1){ b[j-1]=q(o,j); } } wt("!",a(n),b(n)); exit(0); } } } }