#include <bits/stdc++.h>
using namespace std;
int main(){
    int u;
    cin >> u;
    vector<string> o;
    int sum = 0;
    int n,a,b;
    vector<int> c;
    vector<int> v;
    for(int y = 0; y < u; y++){
        cin >> n;
    for(int i = 0; i < n; i++){
        cin >> a;
        v.push_back(a);
    }
    for(int j = 0; j < n; j++){
        cin >> b;
        c.push_back(b);
    }
    for(int k = 0; k < n; k++){
        c[k] *= -1;
    }
    for(int h = 0; h < n; h++){
        if(v[h] == c[h]){
            sum++;
        }
        else{
            sum--;
        }
    }
    if(sum == n){
        o.push_back("NE");
    }
    else{
        o.push_back("DA");
    }
    v.clear();
    c.clear();
}
    for(int x = 0; x < o.size(); x++){
        cout << o[x] << endl;
    }
}