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

int main()
{
    int n;
    cin >> n;
    int a[n];
    for (int i = 0; i < n; i++)
        a[i] = 0;
    vector<int> pom(n);
    vector<int>::iterator it = pom.begin();
    int res[n]; // krajnji niz
    int tr = 0;
    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
        while (a[i] < pom[n - 2])
            {
                it = find(pom.begin(), pom.end(), a[tr]);
                *it = 0;
                tr++;
                sort(pom.begin(), pom.end());
            }
        pom[0] = a[i];
        sort(pom.begin(), pom.end());
        res[i] = tr;
    }
    int q;
    cin >> q;
    for (int i = 0; i < n; i++)
    {
        int l, r;
        cin >> l >> r;
        if (res[r - 1] <= l - 1)
            cout << "DA" << '\n';
        else
            cout << "NE" << '\n';
    }
    return 0;
}