#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main()
{
    int n;
    cin>>n;
    int a[n],b[n];
    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
        a[i]=b[i];
    }


    int q,l,r;
    cin>>q;
    for (int i =0; i < q; i++)
    {
        cin>>l>>r;
        sort(b+l-1,b+r-1);
        b[r-1]=0;
        for(int i = l; i<r;i++)
        {
            if (b[i-1]!=a[i-1])
                {a[i-1]=0;
            sort(a+l-1,a+r-1);
            sort(b+l-1,b+r-1);}
            if (b[i-1]!=a[i-1])
                cout<<"NE"<<endl;
            else
                cout<<"DA"<<endl;
        }
    }
}