#include<bits/stdc++.h>
using namespace std;

#define Mod(x) (x>=P)&&(x-=P)
#define rep(i,a,b) for(ll i=a,i##end=b;i<=i##end;++i)
#define drep(i,a,b) for(ll i=a,i##end=b;i>=i##end;--i)
#define erep(i,a) for(ll i=hd[a];i;i=nxt[i])

typedef long long ll;
void Max(ll &x,ll y){x<y&&(x=y);}
void Min(ll &x,ll y){x>y&&(x=y);}

bool vio;
char IO;
ll rd(ll res=0){
	bool f=0;
	while(IO=getchar(),IO<48||IO>57)
		f|=IO=='-';
	do res=(res<<1)+(res<<3)+(IO^48);
	while(IO=getchar(),isdigit(IO));
	return f?-res:res;
}
const ll M=1005;
ll nxt[M],to[M],hd[M],ecnt,n,m;
bool mk[M],fl;
ll dep[M];
void Add(ll a,ll b){
	nxt[++ecnt]=hd[a],to[hd[a]=ecnt]=b;
}
void dfs(ll x){
	if(!fl)return ;
	erep(i,x){
		ll y=to[i];
		if(!mk[y])continue;
		if(dep[y]==-1)dep[y]=dep[x]^1,dfs(y);
		else if(dep[y]==dep[x])fl=0;
	}
}	
bool let;
int main(){
	cerr<<(&vio-&let)/1024.0/1024<<endl;	
	n=rd(),m=rd();
	rep(i,1,m){
		ll a=rd(),b=rd();
		Add(a,b),Add(b,a);
	}
	ll S=(1<<n)-1,res=0;
	rep(k,0,S){
		rep(i,1,n)mk[i]=0,dep[i]=-1;
		rep(i,1,n)if(1<<(i-1)&k)
			mk[i]=1;
		ll ans=1;
		fl=1;
		rep(i,1,n)if(!mk[i])
			erep(j,i)if(!mk[to[j]])fl=0;
		rep(i,1,n)if(mk[i]&&dep[i]==-1)
			ans=ans*2,dep[i]=0,dfs(i);
		if(fl)res+=ans;
	}
	printf("%lld",res);
	return 0;
}	

#include<iostream>
#include<cstdio>
#include<string>
#include<cstring>
#include<algorithm>
#include<vector>
#include<utility>
using namespace std;
typedef long long ll;
const int MAXN = 1e5 + 5;
ll A[MAXN], N, M, K, mx[MAXN], mn[MAXN];
bool check(ll x) {
	ll MX = 0, MN = 0;
	for(int i = 1; i <= K; i++) {
		MX += (x + M * A[i]) / N;
		if(M * A[i] - x > 0) {
			MN += (M * A[i] - x) / N + ((M * A[i] - x) % N != 0);
		} 
	}
	return (MX >= M && MN <= M);
}
ll find() {
	ll l = 0, r = M * N;
	ll ans = (l + r) >> 1;
	while(l <= r) {
		ll mid = (l + r) >> 1;
		if(check(mid)) {
			ans = mid;
			r = mid - 1;
		} else l = mid + 1;
	}
	return ans;
}
int main() {
	scanf("%lld%lld%lld", &K, &N, &M);
	for(int i = 1; i <= K; i++) scanf("%lld", &A[i]);
	ll ans = find();
	for(int i = 1; i <= K; i++) {
		mx[i] = (ans + M * A[i]) / N;
		if(M * A[i] - ans > 0) {
			mn[i] = (M * A[i] - ans) / N + ((M * A[i] - ans) % N != 0);
		} else  mn[i] = 0;
	}
	for(int i = 1; i <= K; i++) M -= mn[i];
	for(int i = 1; i <= K; i++) {
		ll diff = mx[i] - mn[i];
		mn[i] += min(M, diff);
		M -= min(M, diff);
		if(M == 0) break;
	}
	for(int i = 1; i <= K; i++) printf("%lld ", mn[i]);
	return 0;
}
