#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    tuple<vector<int>, vector<int>> niz;
    int x, y;
    short int n, t;
    cin >> t;
    vector<string> odg;
    for(int i = 0; i < t; i++)
    {
        get<0>(niz).clear();
        get<1>(niz).clear();
        cin >> n;
        for(int j = 0; j < n; j++)
        {
            scanf("%d%d", &x, &y);
            get<0>(niz).push_back(x);
            get<1>(niz).push_back(y);
        }
        if(n == 2)
        {
            if(get<0>(niz)[0] == -get<1>(niz)[1] && get<0>(niz)[1] == -get<1>(niz)[0])
            {
                odg.push_back("DA");
            }
            else
            {
                odg.push_back("NE");
            }
        }
        else
        {
            for(int j = 0; j < n-1; j++)
            {
                for(int k = j+1; k < n; k++)
                {
                    if(get<0>(niz)[0] == -get<1>(niz)[1] && get<0>(niz)[1] == -get<1>(niz)[0])
                    {
                        odg.push_back("DA");
                    }
                    else
                    {
                        odg.push_back("NE");
                    }
                }
            }
        }
    }

    cout.tie(0);
    for(int i = 0; i < t; i++)
        cout << odg[i] << "\n";
    return 0;
}