#include <bits/stdc++.h>
#define FAST {ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);}
#define ll long long
#define ull unsigned long long
#define pqueue priority_queue
#define pb push_back
#define fi first
#define se second
#define ld long double
#define pii pair<int,int>
#define pll pair<long long,long long>
#define all(a) (a).begin(), (a).end()
#define mp make_pair
using namespace std;
/*
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

#define ordered_set tree<pll, null_type,less<pll>, rb_tree_tag,tree_order_statistics_node_update>
*/
// order_of_key -> # less than k
// find_by_order -> k-th element
// pq max element

const int NMAX=200010;

int dd[NMAX];
int p[NMAX];
int ps[NMAX];
int pp[NMAX];
int v[NMAX];

int izbroj(int * d, int l, int r) {
    return max(d[r] - d[l-1],0);
}


int main () {
    FAST
    int n;
    cin >> n;

    bool nd = false;
    for (int i = 0 ; i < n ; i++ ) {
        cin >> v[i];
        if ( v[i] > 2 ) {
            nd=true;
        }
    }

    if ( !nd ) {
    int d1[NMAX];
    int d2[NMAX];
        for (int i = 1 ; i <= n ; i++ ) {
            if ( v[i-1] == 2 ) {
                d2[i]++;
            }
            else d1[i]++;
            d1[i] += d1[i-1];
            d2[i] += d2[i-1];
        }

        int q;
        cin>>q;
        while(q--) {
            int l,r;
            cin>>l>>r;
            if ( d1[r]-d1[l-1] == r-l+1 || d2[r]-d2[l-1] == r-l+1 ) {
                cout << "DA" << endl;
                continue;
            }
            int L = l;
            int R = r;
            int pos2 = l;
            int pos1 = l;
            while(L<=R) {
                int mid = (L+R)/2;
                if ( izbroj(d2,L,mid) ) {
                    pos2 = mid;
                    R = mid-1;
                }
                else L = mid+1;
            }
            L = l;
            R = r;
            while(L<=R) {
                int mid = (L+R)/2;
                if ( izbroj(d1,mid,R) ) {
                    pos1 = mid;
                    L = mid+1;
                }
                else R = mid-1;
            }

            cout << "!" << pos1 << ' ' << pos2 << endl;

            if ( d1[r] - d1[pos2] < 2 ){
                cout <<"DA"<<endl;
                continue;
            }
            if ( d2[pos1] - d2[l-1] < 2 ) {
                cout << "DA" << endl;
                continue;
            }
            cout <<"NE" << endl;
        }

        return 0;
    }

    for (int i = 1 ; i < n ; i++ ) {
        if ( v[i] < v[i-1] ) p[i] = 1;
        p[i] += p[i-1];
        //cout << p[i];
    }


    int q;
    cin >> q;
    while(q--){
        int l,r;
        cin >> l >> r;
        r--;l--;
        if ( p[r]-p[l] > 1 ) {
            cout << "NE" <<endl;
        }
        else cout << "DA"<<endl;
    }

}

/*
5
2 2 1 1 2
3
1 5
//*/