乘法逆元
#include<cstdio>
#define int long long
using namespace std;
const int N =3000010;
int n,p,inv[N];
signed main(){
scanf("%d%d",&n,&p);
inv[1]=1;printf("1\n");
for(register int i=2;i<=n;++i){
inv[i]=((-p/i*inv[p%i])%p+p)%p;
printf("%d\n",inv[i]);
}
return 0;
}