#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i ) #define rep(i,n) REP(i,0,n) using ll = long long; const int inf=1e9+7; const ll longinf=1LL<<60 ; const ll mod=1e9+7 ; int main(){ int M = 2000001; int p; cin>>p; assert(1<=p && p<=1000000000); vector ans(M),a(M); a[2]=1; for(int i=3;i>q; assert(1<=q && q<=200000); rep(i,q){ int x; cin>>x; assert(1<=x && x<=2000000); cout<