#include <iostream>
using namespace std;
long long a[200003];
long long prefiksna[200003];
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    long long n, q, l, r, s;
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
    }
    cin >> q;
    prefiksna[0] = 0;
    for (int i = 0; i < n-1; i++)
    {
        if (a[i] <= a[i + 1])
        {
            a[i] = 0;
        }
        else
        {
            a[i] = 1;
        }
        prefiksna[i + 1] = prefiksna[i] + a[i];
    }
    for (int i = 0; i < q; i++)
    {
        cin >> l >> r;
        s = prefiksna[r - 1] - prefiksna[l - 1];
        cout << s << endl;
        if (s >= 2)
        {
            cout << "NE" << endl;
        }
        else
        {
            cout << "DA" << endl;
        }
    }
    return 0;
}