#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
    const int value = -1;
    int n, q;
    cin >> n;
    int a[n];
    for (int i = 0; i < n; i++) cin >> a[i];
    cin >> q;
    int m[n][n];
    std::fill(*m, *m + n*n, value);
    m[0][0] = 0;
    for (int i = 1; i < n; i++) {
        if (a[i] < a[i - 1]) m[0][i] = m[0][i - 1] + 1;
        else m[0][i] = m[0][i - 1];
    }
    for (int i = 1; i < n; i++) {
        for (int j = i; j < n; j++) {
            if (a[i - 1] > a[i]) m[i][j] = m[i - 1][j] - 1;
            else m[i][j] = m[i - 1][j];
        }
    }

    string b[q];
    for (int i = 0; i < q; i++) {
        int l, r;
        cin >> l >> r;
        b[i] = m[l - 1][r - 1] < 2 ? "DA" : "NE";
    }
    for (int i = 0; i < n; i++) cout << b[i] << endl;
    return 0;
}