#include <bits/stdc++.h>
#define endl '\n'
//#define int long long
#define debug(x) cout << #x << " = " << x << '\n';
using namespace std;

const int MAXN=200009;
int niz[MAXN],delta[MAXN];
int t,n,k;
int VAL(){
    int rez=0;
    for(int i=1; i<=n; i++){
        if(rez<=niz[i]) rez++;
        else rez--;
    }
    return rez;
}
void ispis(){
    for(int i=1; i<=n; i++) cout << niz[i] << " ";
    cout << endl;
}

void n500(){
    for(int i=1; i<=n; i++){
        for(int j=i; j<=n; j++){
            reverse(niz+i,niz+j+1);
            if(VAL()==k){
                cout << "DA" << endl;
                ispis();
                return;
            }
            reverse(niz+i,niz+j+1);
        }
    }
    cout << "NE";
    return;
}
void n5000(){
    for(int i=1; i<=n; i++){
        reverse(niz+1,niz+i+1);
        if(VAL()==k){
            cout << "DA" << endl;
            ispis();
            return;
        }
        reverse(niz+1,niz+i+1);
    }
    cout << "NE";
    return;
}


int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);

    cin >> t >> n >> k;
    for(int i=1; i<=n; i++) cin >> niz[i];
    if(abs(n%2)!=abs(k%2)){cout << "NE"; return 0;}
    sort(niz+1,niz+n+1);
    int maxi=VAL();
    reverse(niz+1,niz+n+1);
    int mini=VAL();
    reverse(niz+1,niz+n+1);///rastuce je sortiran
    //if(n<=500){n500(); return 0;}
    ///if(n<=5000){n5000(); return 0;}
    //for(int i=1; i<=n; i++) cout << niz[i] << " "; cout << endl;

    int tr=0;
    for(int i=1; i<=n; i++){
        if(tr<=niz[i]) delta[i]=1;
        else delta[i]=-1;
    }
    ///for(int i=n-2; i>=1; i--) delta[i]+=delta[i+1];
    if(mini<=k && k<=maxi) cout << "DA" << endl;
    else {cout << "NE"; return 0;}
    int l=1,d=n;
    while(l<=d){
        int s=l+d>>1;
        reverse(niz+1,niz+s+1);
        int v=VAL();
        if(v==k)
            break;
        if(v>k)
            l=s+1;
        else
            d=s-1;
        reverse(niz+1,niz+s+1);
    }
    ispis();




    /*if(mini<=k && k<=maxi){
        cout << "DA" << endl;
        int tr_rez=maxi;
        int ind=1;
        while(tr_rez!=k){
            swap(niz[ind],niz[n+1-ind]);
            tr_rez-=2;
            ind++;
        }
        if(t)
            ispis();

    }
    else cout << "NE";*/





    return 0;
}
/*
1
7 8 3
1 5 7
1 6
6 2
2 7
7 4
4 3
4 2
3 6
4 5


*/