#include <bits/stdc++.h>

using namespace std;

int main()
{
    int N;
    cin >> N;
    char B[N];
    int l, c;
    B[0] = 0;
    cin >> l;
    for (int i = 1; i < N; ++i) {
        cin >> c;
        if (c < l) {
            B[i] = 1;
        }
        else {
            B[i] = 0;
        }
        l = c;
    }
    int Q, L, R;
    pair<int, int> x;
    cin >> Q;
    map<pair<int, int>, bool> ans;
    for (int q = 0; q < Q; ++q) {
        c = 0;
        cin >> L >> R;
        x.first = L; x.second = R;
        if (ans.count(x) == 0) {
        for (int i = L; i < R; ++i) {
            if (B[i] == 1) {
                ++c;
                if (c > 1) {
                    break;
                }
            }
        }
        if (c > 1) {
            cout << "NE\n";
            ans[x] = false;
        }
        else {
            cout << "DA\n";
            ans[x]=true;
        }
        }
        else {
            if (ans[x]) cout << "DA\n";
            else cout << "NE\n";
        }
    }
    return 0;
}