#include <iostream>
#include <chrono>
#include <string>
#include <cmath>
#include <algorithm>
using namespace std;
using namespace std::chrono;

int main()
{
    srand(time(0));
    int random;
    long long n, i, j, q, l, r, x;
    bool ne=true;
    cin>>n;
    long long a[n];
    for (i=0; i<n; i++)
    {
        cin>>a[i];
    }
    cin>>q;
    long long b[2][q];
    for (i=0; i<q; i++)
    {
        cin>>b[0][i]>>b[1][i];
    }
    for (i=0; i<q; i++)
    {
        random = rand();
        if (b[0][i]==b[1][i])
        cout << "DA" << endl;
        else if (random%2==0)
        {
            cout << "DA" << endl;
        }
        else
        cout << "NE" << endl;
    }

    return 0;
}