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

int n, q;
int arr[MAXN], arr2[MAXN];
vector<int> cnt(MAXN, 0);
vector<int>poz;
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];
        el.insert(arr[i]);
    }
    if(el.size()==2)
    {
        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]++;
                poz.push_back(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 dx = cnt[r-1]-cnt[l-1];
            if(dx==0)cout<<"DA\n";
            else if(dx>1)cout<<"NE\n";
            else
            {
                if(arr2[r-1]==0)cout<<"DA\n";
                else if(arr2[l]==0)cout<<"DA\n";
                else
                {
                    int p;
                    for(int i = 0; i<poz.size(); i++)
                    {
                        if(poz[i]>=l && poz[i]<=r)
                        {
                            p=poz[i];
                            break;
                        }
                    }
                    if(arr[p-1]<=arr[p+1])cout<<"DA\n";
                    else cout<<"NE\n";
                }
            }

        }
    }else{
    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++)
    {
        if(i>1)
        {
            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;

        int x = cnt[r]-cnt[l-1];
        if(arr2[r]==0)x--;
        if(x<=1)cout<<"DA\n";
        else cout<<"NE\n";

    }
    }

    return 0;
}