#include<bits/stdc++.h>
#define ll long long

using namespace std;


const int N=105;
int n,m,k;
ll f[N][N*N*N];
ll pre[N*N*N];
int main() {
    cin>>n>>k>>m;
    const int mod=m;

    f[0][0]=1;
    int sum=0;
    
    for(int i=1;i<=n;i++) {
        sum+=i*k;
        for(int s=0;s<=sum;s++) {
            /*
            for(int q=0;q<=k&&i*q<=s;q++) {
                f[i][s]=(f[i-1][s-q*i]+f[i][s])%mod;
            }*/
            f[i][s]=f[i-1][s];
            if(s>=i) f[i][s]+=f[i][s-i];
            if(s>=i*(k+1)) f[i][s]-=f[i-1][s-i*(k+1)];
            f[i][s]=(f[i][s]+mod)%mod;
        }
    }

    for(int ave=1;ave<=n;ave++) {
        ll ans=0;
        int L=ave-1,R=n-ave;
        for(int j=1;j<=sum;j++) ans=(ans+f[L][j]*f[R][j])%mod;
        cout<<(ans*(k+1)+k)%mod<<"\n";
    }

    return 0;
}

/*
2
2 3
1
*/
#include <bits/stdc++.h>
using namespace std;

int main() {
	long long k,n,m,i,j,cur;
	cin >> k >> n >> m;
	vector<long long> a(k),b(k);
	set<pair<long long,long long>> s;
	pair<long long,long long> p;
	cur=0;
	for(i=0; i<k; i++){
		cin >> a[i];
		b[i]=((a[i]*m+(n-1))/n);
		cur+=b[i];
		p.first=b[i]*n-a[i]*m; p.second=i;
		s.insert(p);
	}
	cur-=m;
	auto itr=s.begin();
	while(cur>0){
		itr=s.end(); itr--;
		p=*itr;
		s.erase(itr);
		b[p.second]--;
		p.first-=n;
		s.insert(p);
		cur--;
	}
	for(i=0; i<k; i++){
		cout << b[i] << endl;
	}

	return 0;
}