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

int n, q;
int arr[MAXN], arr2[MAXN], cnt[MAXN];
set<int> el;

int main()
{

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


    cin>>n;
    for(int i = 1; i<=n; i++){
        cin>>arr[i];
    }

        arr2[n]=1;
        for(int i = 1; i<n; i++)
        {
            if(arr[i]<=arr[i+1])arr2[i]=1;
            else arr2[i]=0;
        }

        cnt[0]=0;
        for(int i = 1; i<=n; i++)
        {
            cnt[i]=cnt[i-1];
            if(arr2[i]==0)cnt[i]++;
        }


        cin>>q;
        for(int qq = 0; qq<q; qq++)
        {
            int l, r;
            cin>>l>>r;
            if(l==r || l==r-1)
            {
                cout<<"DA\n";
                break;
            }
                int c = 0;
                vector<int>poz;
                for(int i = l; i<r-1; i++)
                {
                    if(arr2[i]==0)
                    {
                        c++;
                        poz.push_back(i);
                    }
                }
                for(int g:poz)
                    cout<<g<<"\n";

                if(c==0)cout<<"DA\n";
                else if(c>1)cout<<"NE\n";
                else
                {
                    int u = poz[0];
                    if(u==l)cout<<"DA\n";
                    else
                    {
                        if(arr[u-1]<=arr[u+1])cout<<"DA\n";
                        else cout<<"NE\n";
                    }
                }

        }


    return 0;
}