
#pragma GCC optimize("O3")
//#pragma GCC target("avx2")
//#pragma GCC optimize("unroll-loops")

#include <bits/stdc++.h>

using namespace std;

#ifdef LOCAL
#include <prettyprint.hpp>
#define debug(...)  cerr << "[" << #__VA_ARGS__ << "]: ", d_err(__VA_ARGS__);
#else
#define debug(...) 83;
#endif

void d_err() {
    cerr << endl;
}

template <typename H, typename... T>
void d_err(H h, T... t) {
    cerr << h << " ";
    d_err(t...);
}

template <typename T>
void print(T x) {
    cout << x << "\n";
}

#define ALL(x) (x).begin(), (x).end()
#define FOR(i, m, n) for (ll i = (m); i < (n); ++i)
#define REVFOR(i, m, n) for (ll i = (n - 1); i >= (m); --i)
#define REP(i, n) FOR(i, 0, n)
#define REVREP(i, n) REVFOR(i, 0, n)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define bcnt __builtin_popcountll

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<ld> vld;
typedef pair<ll,ll> Pll;
typedef pair<int,int> Pin;

ll INF = 1e16;
int inf = 1e9;

template<typename T>
struct SegTree {
    typedef function<T(T, T)> OP;
    typedef function<void(T&, T)> UP;

    int N;
    vector<T> dat;
    OP op_;
    UP up_;
    T unit_;

    int get_n(int n) {
        int ret = 1;
        while (ret < n) ret <<= 1;

        return ret;
    }

    SegTree() : N(0) {}

    explicit SegTree(int n,
                     /// todo : ↓↓↓ edit from here ↓↓↓
                     OP op = [](T a, T b){ return min(a, b); },
                     UP up = [](T& a, T b){ a = b; },
                     T unit = INF)
                     : N(get_n(n)), dat(2 * N - 1, unit), op_(op), up_(up), unit_(unit) {}

    explicit SegTree(const vector<ll> &v,
                     /// todo : ↓↓↓ edit from here ↓↓↓
                     OP op = [](T a, T b){ return min(a, b); },
                     UP up = [](T& a, T b){ a = b; },
                     T unit = INF)
                     : N(get_n(v.size())), dat(2 * N - 1, unit), op_(op), up_(up), unit_(unit) {
        REP(i, v.size()) dat[N + i - 1] = v[i];
        for (int i = N - 2; i > -1; --i) dat[i] = op_(dat[2 * i + 1], dat[2 * i + 2]);
    }

    void init(int n, T val = 0) {
        N = get_n(n);
        dat.resize(2 * N - 1, val);
    }

    void update(int i, T v) {
        i += N - 1;
        up_(dat[i], v);

        while (i > 0) {
            i = (i - 1) / 2;
            dat[i] = op_(dat[2 * i + 1], dat[2 * i + 2]);
        }
    }

    // query for [a, b), k: current node id, [l, r): current range.
    ll query(int a, int b, int k = 0, int l = 0, int r = -1) {
        if (r < 0) r = N;

        if (b <= l || r <= a) return unit_;
        if (a <= l && r <= b) return dat[k];

        int mid = (l + r) / 2;
        T c1 = query(a, b, 2 * k + 1, l, mid);
        T c2 = query(a, b, 2 * k + 2, mid, r);

        return op_(c1, c2);
    }
};

int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    ll n, q; cin >> n >> q;
    vll a(n);
    REP(i, n) cin >> a[i];

    auto op = [](ll a, ll b){ return a ^ b; };
    auto up = [](ll& a, ll b){ a ^= b; };

    SegTree<ll> st(a, op, up, 0);


    REP(i, q) {
        int t; ll x, y;
        cin >> t >> x >> y;
        if (t == 1) {
            x--;
            st.update(x, y);
        } else {
            x--, y--;
            print(st.query(x, y + 1));
        }
    }
}

#include <bits/stdc++.h>
#define rep(i, n)	for(ll i=0;i<(ll)(n);i++)
#define ALL(a)	(a).begin(),(a).end()
using namespace std;
using ll=long long;
typedef pair<ll,ll> P;

int main(){
    ll k,n,m;
    cin>>k>>n>>m;
    vector<ll> a(k);
    rep(i,k) cin>>a[i];
    long double d=m;
    vector<P> p;
    int sum=m;
    vector<ll> tmp(k);
    rep(i,k){
        ll t=d*a[i]/n;
        sum-=t;
        tmp[i]=t;
        t*=n;
        t=abs(t-m*a[i]);
        p.push_back({t,i});
    }
    sort(ALL(p),greater<P>());
    vector<ll> ans(k);
    //rep(i,k) cout<<p[i].first<<" "<<p[i].second<<endl;
    //rep(i,k) cout<<tmp[i]<<endl;
    rep(i,k){
        if(i<sum) tmp[p[i].second]+=1;
        ans[p[i].second]=tmp[p[i].second];
    }
    rep(i,k) cout<<ans[i]<<" ";
    cout<<endl;
}