#include #include using namespace std; const int LIM=100001; bool isp[LIM+1]; vectorps; main() { for(int i=2;i<=LIM;i++)if(!isp[i]) { for(int j=i+i;j<=LIM;j+=i)isp[j]=true; if(i%4!=3)ps.push_back(i); } int Q; cin>>Q; for(;Q--;) { long X;cin>>X;X=X*X+1; bool fst=true; for(int p:ps) { if((long)p*p>X)break; if(X%p==0) { while(X%p==0) { if(fst)fst=false; else cout<<' '; cout<1) { if(fst)fst=false; else cout<<' '; cout<