#include <iostream>

using namespace std;

int main()
{
    int t;
    cin >> t;

    while(t>0)
    {
        long long int n,aa=0,ba=0,ab=0,bb=0;
        cin >> n;
        long long int a[n],b[n];
        for(long long int i =0;i<n;i++)
            cin >> a[i];

            
        for(long long int i =0;i<n;i++)
            {
                cin >> b[i];
                if(b[i]!=a[i])
                    cout << "NE" << endl;
            }

            cout << "DA" << endl;
            
        t--;
    }



    return 0;
}