#include using namespace std; using Int = long long; template inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template inline void chmax(T1 &a,T2 b){if(a> 19) ^ (t ^ (t >> 8)); } vector generateA(int N) { vector A(N); for(int i = 0; i < N; ++ i) A[i] = xor128() % 100003; return A; } signed main(){ int n,q; cin>>n>>q; auto a=generateA(n); const int BS = 500; const int MOD = 100003; using ll = long long; if(q>x; ll res=0; for(int y:a) chmax(res,x*y%MOD); cout<ll{ ll n=MOD-2,res=1; while(n){ if(n&1) res=res*x%MOD; x=x*x%MOD; n>>=1; } return res; }; vector exist(MOD,0); for(int y:a) exist[y]=1; while(q--){ ll x; cin>>x; x=inv(x); ll res=MOD-1; while(!exist[res*x%MOD]) res--; cout<