#pragma GCC target("avx2") #pragma GCC optimize("O2") #include #include #include #include #include #include namespace mp=boost::multiprecision; using bint=mp::cpp_int; using greatd=mp::number>; using namespace std; using namespace __gnu_pbds; template using V=vector; template using VV=V>; using ll=long long; using ull=unsigned long long; using ld=long double; using pii=pair; using pll=pair; using pli=pair; using pil=pair; using pdd=pair; using vi=vector; using vvi=V; using vpi=vector; using vvpi=V; using vl=vector; using vvl=V; using vs=vector; using vvs=V; using vc=vector; using vvc=V; using vd=vector; using vvd=V; using vpl=vector; using vvpl=V; using vpil=vector>; using vvpil=V; using vpli=vector>; using vvpli=V; using vpd=vector; using vvpd=V; using vb=vector; using vvb=V; template using pq=priority_queue,greater>; template using rpq=priority_queue>; template using Tree=tree,rb_tree_tag,tree_order_statistics_node_update>; templateostream &operator<<(ostream &os,const pair &p){os <istream &operator>>(istream &is,pair &p){is >>p.first >>p.second;return is;} #define ovl4(a,b,c,d,name,...) name #define rep(...) ovl4(__VA_ARGS__,rep4,rep3,rep2,rep1)(__VA_ARGS__) #define rep1(a) for(int i=0; i=0; i--) #define rrep2(i,a) for(int i=a; i>=0; i--) #define rrep3(i,a,b) for(int i=a; i>=b; i--) #define rrep4(i,a,b,c) for(int i=a; i>=b; i-=c) #define atrep(i,v) for(auto i:v) void in(){} templatevoid in(T&... a){(cin >>... >>a);} template void vin(vector &v,int n=-1,int s=0){if(n==-1)n=v.size();rep(i,s,s+n)in(v[i]);} #define INT(...) int __VA_ARGS__;in(__VA_ARGS__) #define LL(...) ll __VA_ARGS__;in(__VA_ARGS__) #define ULL(...) ull __VA_ARGS__;in(__VA_ARGS__) #define DBL(...) double __VA_ARGS__;in(__VA_ARGS__) #define LD(...) ld __VA_ARGS__;in(__VA_ARGS__) #define STR(...) string __VA_ARGS__;in(__VA_ARGS__) #define CHR(...) char __VA_ARGS__;in(__VA_ARGS__) void VIN(){} template void VIN(int ind,vector& v,Ts&... vs){vin(v,v.size()-ind,ind);if constexpr(sizeof...(vs)>0)VIN(ind,vs...);} template bool chmax(T &a,Ts... b){T c=a;for(auto i:{b...})a=max(a,i);return a==c;} template bool chmin(T &a,Ts... b){T c=a;for(auto i:{b...})a=min(a,i);return a==c;} template bool chcomp(function comp,T &a,Ts... b){T c=a;for(auto i:{b...})a=comp(a,i);return a==c;} void print(){cout<<"\n";} template void print(const T &a,const Ts&... b){cout < void vprint(vector &v,bool ind1=false,string aid=" "){rep(i,(int)ind1,v.size()){if(i>(int)ind1){cout < bool eql(const T &a){return true;}; template bool eql(const T& a,const Ts&... b){bool ret=true;for(auto i:{b...})ret&=(i==a);return ret;} bool operator==(const string& a,const string& b){return a.compare(b)==0;} random_device rd; mt19937 mt(rd()); const int INF=1e9; const ll LINF=1e18; const ll MOD=1e9+7; const ll MMOD=998244353; const ld eps=1e-10; bool deql(const ld &a){return true;} template bool deql(const ld& a,const Args&... b){bool ret=true;for(auto i:{b...})ret&=(inr(-eps,i-a,eps));return ret;} int dx[8]={-1,0,1,0,-1,-1,1,1},dy[8]={0,1,0,-1,-1,1,1,-1}; namespace prime{ vl a1={2,7,61}; vl a2={2,325,9375,28178,450775,9780504,1795265022}; __int128_t modpow(__int128_t a,__int128_t b,__int128_t mod=MOD){ __int128_t ret=1; a%=mod; while(b>0){if(b&1)ret=(ret*a)%mod;a=(a*a)%mod;b>>=1;} return ret; } bool is_prime(ll n,vl& A){ ll s=0,d=n-1; while(!(d&1)){++s;d>>=1;} for(auto a:A){ if(n<=a)return true; ll t,y=modpow(a,d,n); if(y!=1){ for(t=0;tll{return ((__int128_t)x*x+s)%n;}; while(d==1){ x=f(x),y=f(f(y)); d=gcd(abs(x-y),n); } if(d!=1 && d!=n)return d; } } void divisor_dfs(int idx,ll val,vl &ret,vpli &fac){ int size=fac.size(); if(idx==size){ret.push_back(val);return;} ll v=fac[idx].ft; int c=fac[idx].sd; ll m=1; for(int i=0; i<=c; i++){ divisor_dfs(idx+1,val*m,ret,fac); m*=v; } return; } bool isprime(ll n){ if(n<=1)return false; if(n==2)return true; if(n&1==0)return false; if(n<4759123141LL)return is_prime(n,a1); else return is_prime(n,a2); } map factorize(ll n){ map ret; if(n==1)return ret; if(isprime(n)){ ret[n]=1; return ret; } ll fac=finddivisor(n); ret=factorize(fac); map ret_=factorize(n/fac); if(ret.size()>ret_.size()){for(auto i:ret_){ret[i.ft]+=i.sd;}return ret;} else{for(auto i:ret){ret_[i.ft]+=i.sd;}return ret_;} } vl enumerate(ll n){ map f=factorize(n); vpli fac; for(auto i:f)fac.push_back(i); vl ret; divisor_dfs(0,1,ret,fac); return ret; } }; using namespace prime; int main(){ ios::sync_with_stdio(false);std::cin.tie(nullptr);FIX; INT(n); rep(n){ LL(x); cout <