#include <iostream>

using namespace std;

int foo(int arr[], int n) {
    if (n == 1) {
        arr[0] = 0;
        int x;
        cin >> x;
        return x;
    };

    int a = foo(arr, n - 1);
    int b;
    cin >> b;
    arr[n - 1] = arr[n - 2];
    if (b < a) arr[n - 1]++;
    return b;
}

int main()
{
    int n, q;
    cin >> n;
    int a[n];
    foo(a, n);
    cin >> q;
    string c[q];
    for (int i = 0; i < q; i++) {
        int l, r;
        c[i] = "NE";
        cin >> l >> r;
        if (a[r - 1] - a[l - 1] < 2) c[i] = "DA";
    }

    for (int i = 0; i < n; i++) cout << c[i] << endl;
}