#include <bits/stdc++.h>
#define MAXN 200010

using namespace std;

typedef long long ll;

ll a[MAXN];
ll p[MAXN];
ll psi[MAXN];

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    ll n;
    cin >> n;
    for(int i = 1; i <= n; i++)
    {
        cin >> a[i];
    }
    for(int i = 2; i <= n; i++)
    {
        p[i] = p[i - 1];
        psi[i] = psi[i - 1];
        if(a[i - 1] > a[i])
        {
            p[i]++;
            psi[i] = i;
        }
    }
    for(int i = 1; i <= n; i++)
    {
        cout << p[i] << " " << psi[i] << "\n";
    }
    ll q, l, r;
    cin >> q;
    while(q--)
    {
        cin >> l >> r;
        if(p[r] - p[l] >= 2) cout << "NE\n";
        else if(r - l + 1 <= 3) cout << "DA\n";
        else
        {
            ll ind = psi[r];
            if(ind == r || ind - 1 == l) cout << "DA\n";
            else if(a[ind - 2] > a[ind]) cout << "NE\n";
            else cout << "DA\n";
        }
    }
    return 0;
}