#include<iostream>
#include<cstring>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<deque>
#include <algorithm>

using namespace std;

#define mem(a,b) memset(a,b,sizeof a)
#define PII pair<int,int>
#define ll long long
#define ull unsigned long long
#define ft first
#define sd second
#define endl '\n'
#define PI acos(-1.0)
#define lcm(a,b) a/gcd(a,b)*b
#define INF_INT 0x3f3f3f3f
#define debug(a) cout<<#a<<"="<<a<<endl;
#define _for(i,a,b) for( int i=(a); i<(b); ++i)
#define _rep(i,a,b) for( int i=(a); i<=(b); ++i)

//inline void print(__int128 x){if(x<0){putchar('-');x=-x;}if(x>9) print(x/10);putchar(x%10+'0');}
int gcd(int a, int b){return b ? gcd(b, a % b) : a;}
int exgcd(int a, int b, int &x, int &y){if(!b){x = 1; y = 0;return a;}int d = exgcd(b, a % b, y, x);y -= (a/b) * x;return d;}
ll qmi(ll m, ll k, ll p){ll res = 1 % p, t = m;while (k){if (k&1) res = res * t % p;t = t * t % p;k >>= 1;}return res;}
inline int read(){int s=0,x=1;char ch=getchar();while(ch<'0'||ch>'9') {if(ch=='-') x=-1; ch=getchar();}while(ch>='0'&&ch<='9'){s=s*10+ch-'0';ch=getchar(); }return s*x;} 

const int NN = 1e6+7;
const int mod = 1e9+7;

int N,M,k;


ll C(int n, int m){
    if(n<0||m<0) return 0;
    ll res = 1;
    
    _rep(i,1,n+m){
        res = (res*i)%mod;
    }

    _rep(i,2,m){
        ll ni = qmi(i,mod-2,mod);
        res = (res*ni) %mod;
    }
    _rep(i,2,n){
        ll ni = qmi(i,mod-2,mod);
        res = (res*ni) %mod;
    }
    return res;
}
void solve()
{
    cin >> N >> M >> k;
    if(N-k-M > 0) puts("0");
    else{
        cout << (C(N,M)-C(N-k-1,M+k+1)+mod)%mod << endl;
    }
}
int main()
{
    //ios::sync_with_stdio(0);
    int T = 1;
    
    while(T--)
    {
        solve();
    }
    return 0;
} 

#include <bits/stdc++.h>
using namespace std;
const int kN = 1e5 + 10;

int k, N, M;
int a[kN];
int main() {
  scanf("%d%d%d", &k, &N, &M); 
  for(int i = 0; i < k; i++) scanf("%d", &a[i]);

  long long l = -1, r = 1LL * M * N;

  vector<pair<long long, long long>> tmp;
  auto Check = [&](long long v) {
    tmp.clear();
    long long mn = 0, mx = 0;
    for(int i = 0; i < k; i++) {
      long long l = max(0LL, (1LL * M * a[i] - v + N - 1) / N);
      long long r = (1LL * M * a[i] + v) / N;
      mn += l;
      mx += r;
      tmp.emplace_back(l, r);
    }
    if(mn <= M && mx >= M) return 1;
    else return 0;
  };
  while(r - l > 1) {
    long long m = (l + r) >> 1;
    if(Check(m)) r = m;
    else l = m;
  }

  Check(r);
  vector<long long> b(k);
  long long sum = 0;
  for(int i = 0; i < k; i++) b[i] = tmp[i].first, sum += b[i];
  sum = M - sum;
  for(int i = 0; i < k; i++) if(sum > 0) {
    long long d = min(tmp[i].second - tmp[i].first, sum); 
    b[i] += d, sum -= d;
  }

  for(int i = 0; i < k; i++) printf("%lld ", b[i]); puts("");


  return 0;
}
