#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p;
vector<p> v;
const int maxn=1e6+10;
ll a[maxn], b[maxn];
ll k, n, m;

int main()
{
	ll sum=0;
	cin>>k>>n>>m;
	for(int i=0; i<k; i++){
		cin>>a[i];
		b[i]=a[i]*m/n;
		sum+=b[i];
		p temp;
		temp.first=(double)(a[i]*m-b[i]*n);
		temp.second=i;
		v.push_back(temp);
	}

	sort(v.begin(), v.end(), greater<p>());
    
    for(int i=0; i<m-sum; i++){
    	b[v[i].second]+=1;
    }

    for(int i=0; i<k; i++)
    	cout<<b[i]<<" ";
    cout<<endl;
	return 0;
}
//vec[i]の範囲外エラー表示
#define _GLIBCXX_DEBUG
//includeとusing
#include <bits/stdc++.h>
using namespace std;
//型名省略
template <class T> using V = vector<T>;
template <class T> using VV = V<V<T>>;
template <class T> using P = pair<T,T>;
template <class T> using M = map<T,T>;
template <class T> using S = set<T>;
template <class T> using PQ = priority_queue<T>;
template <class T> using PQG = priority_queue<T,V<T>,greater<T>>;
using ll = long long;
using st = string;
using vl = V<ll>;
using vvl = V<V<ll>>;
using vc = V<char>;
using vvc = V<V<char>>;
using vs = V<st>;
using vvs = V<V<st>>;
using vb = V<bool>;
using vvb = V<V<bool>>;
//定数
const ll INF = 1e9;
const ll MOD = 1e9+7;
const vl dx = {1,0,-1,0,1,0,-1,0};
const vl dy = {0,1,0,-1,0,1,0,-1};
//マクロ
#define re(n) for(ll _ = 0; _ < (ll) n; _++)
#define rep(i,n) for(ll i = 0; i < (ll) n; i++)
#define rrep(i,n) for(ll i = (ll) n - 1; i >= 0;i--)
#define repp(i,x,n) for(ll i = (ll) x; i < (ll) n; i++)
#define rrepp(i,x,n) for(ll i = (ll) n - 1; i >= x; i--)
#define bitrep(i,n) for(ll i = 0; i < (1<<(ll)n); i++)
#define each(x,A) for(auto &(x): (A))
#define ALL(A) A.begin(), A.end()
#define SIZE(A) ll(A.size())
#define pb(a) push_back(a)
#define mp make_pair
#define PRECISE_COUT cout << setprecision(15) << fixed
//入力
void CINT(){}
template <class Head,class... Tail>
void CINT(Head&& head,Tail&&... tail){ cin>>head; CINT(move(tail)...);}
#define CIN(...) ll __VA_ARGS__;CINT(__VA_ARGS__)
#define SCIN(...) string __VA_ARGS__;CINT(__VA_ARGS__)
#define DCIN(...) double __VA_ARGS__;CINT(__VA_ARGS__)
#define VCIN(A) for(auto &a : (A)) cin >> a
//出力
#define COUT(a) cout << a << endl
#define TEST(i,a) cout << (ll) i << " : " << (ll) a << endl
#define vout(A) for(auto &a : (A)) cout << a << " ";cout << endl
//正誤判定
void Yes(bool ans){cout << (ans? "Yes" : "No") << endl;}
void YES(bool ans){cout << (ans? "YES" : "NO") << endl;}
//余り切り上げ
ll ceil(ll a,ll b) {return (a + b - 1) / b;}
//最大値・最小値
template <typename T> bool chmax(T &a, const T& b) {if(a < b) {a = b; return true;} return false;}
template <typename T> bool chmin(T &a, const T& b) {if(a > b) {a = b; return true;} return false;}
//最大公約数
ll gcd(ll a,ll b){if(a<b)swap(a,b); if(a%b==0)return b; return gcd(b,a%b);}
//最小公倍数
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
//n乗の余り
ll modpow(ll x,ll n,ll mod){ll res=1;for(ll i=0;i<n;i++){res=res*x%mod;}return res;}
ll MODpow(ll x,ll n){ll res=1;for(ll i=0;i<n;i++){res=res*x%MOD;}return res;}
//グリッドグラフの範囲外エラー
bool range(ll ny, ll nx, ll H, ll W){if(ny < 0 || ny >= H || nx < 0 || nx >= W) return false; return true;}

/*----------------------------------------------------------------------*/

//main関数
int main() {
    CIN(N);
    ll sum = 0;
    re(N){
        CIN(a,b);
        sum += (b - a + 1) * (a + b) / 2;
    }
    COUT(sum);
}
