#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
    int t, n, k,p;
    cin >> t >> n >> k;
    vector<int> a(n);
    for (size_t i = 0; i < n; i++)
    {
        cin >> p;
        a[i] = p;
    }
    sort(a.begin(), a.end());
    int max = 0;
    for (size_t i = 0; i < n; i++)#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
    int t, n, k, p;
    cin >> t >> n >> k;
    vector<int> a(n);
    for (size_t i = 0; i < n; i++)
    {
        cin >> p;
        a[i] = p;
    }
    sort(a.begin(), a.end());
    int max = 0;
    for (size_t i = 0; i < n; i++)
    {
        if (max <= a[i])
            max++;
        else
            max--;

    }
    int min = 0;
    for (int i = n - 1; i > -1; i--)
    {
        if (min <= a[i])
            min++;
        else
            min--;
    }
    int vred = 0;    
    bool f = true;
        
            for (size_t r = 0; r < n; r++)
            {
                vred = 0;
                for (int i = n - 1; i > n - 1 - r; i--)
                {
                    if (vred <= a[i])
                        vred++;
                    else
                        vred--;
                }
                for (int i = 0; i < n - r; i++)
                {
                    if (vred <= a[i])
                        vred++;
                    else
                        vred--;
                }
                if (vred == k)
                {

                    cout << "DA" << '\n';
                    if (t == 1)
                    {
                        for (int i = n - 1; i > n - 1 - r; i--)
                        {
                            cout << a[i] << " ";
                        }
                        for (int i = 0; i < n - r; i++)
                        {
                            cout << a[i] << " ";
                        }
                    }
                    f = false;
                    break;
                    
                }
            }
            if (f)
            {
                cout << "NE";
            }

}
    {
        if (max <= a[i])
            max++;
        else
            max--;

    }
    int min = 0;
    for (int i = n - 1; i > -1; i--)
    {
        if (min <= a[i])
            min++;
        else
            min--;
    }
    //cout << min << max;
    if (min <= k && k <= max && k % 2 == max % 2)
    {
        cout << "DA" << '\n';
        if (t == 1)
        {
            int r = n - (max - k)/2;
            for (size_t i = r; i < n; i++)
            {
                cout << a[i] << " ";
            }
            for (int i = 0; i < r; i++)
            {
                cout << a[i]<< " ";
            }
        }
    }
    else
    {
        cout << "NE";
    }
}