#include using namespace std; #define mem(x,y) memset(x,y,sizeof(x)) #define bitcount __builtin_popcountll #define mod 1000000007 #define N 1000009 #define fast ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define ss(s) cin>>s; #define si(x) scanf("%d",&x); #define sl(x) cin>>x; #define pb push_back #define mp make_pair #define all(v) v.begin(),v.end() #define S second #define F first #define ll long long //#define TRACE #ifdef TRACE #define trace1(x) cerr << #x << ": " << x << endl; #define trace2(x, y) cerr << #x << ": " << x << " | " << #y << ": " << y << endl; #define trace3(x, y, z) cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl; #define trace4(a, b, c, d) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl; #define trace5(a, b, c, d, e) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl; #define trace6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl; #else #define trace1(x) #define trace2(x, y) #define trace3(x, y, z) #define trace4(a, b, c, d) #define trace5(a, b, c, d, e) #define trace6(a, b, c, d, e, f) #endif ll power(ll a,ll b) {ll res=1;a%=mod;for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;} string a,b,c; int q,n,t; #define maxn 1000009 int p[maxn]; vector primes; void sieve(){ p[0]=p[1]=1; for(int i=2;imaxn)continue; for(int j=1ll*i*i;j>t; sieve(); while(t--){ cin>>n; int nu = lower_bound(all(primes),n+1) - primes.begin(); //cout<