#include <bits/stdc++.h>

using namespace std;

int main()
{
    vector<int> a;
    vector<int> b;
    vector<string> odgovori;
    int t, n, x, y;
    scanf("%d", &t);
    for(int i = 0; i < t; i++)
    {
        a.clear();
        b.clear();
        scanf("%d", &n);
        for(int j = 0; j < n; j++)
        {
            scanf("%d%d", &x, &y);
            a.push_back(x);
            b.push_back(y);
        }
        if(n == 2)
        {
            (a[0] == -b[1] && a[1] == -b[0])?(odgovori.push_back("DA")):(odgovori.push_back("NE"));
        }
        else
        {
            for(int j = 0; j < n-1; j++)
            {
                for(int k = j+1; k < n; k++)
                {
                    (a[j] == -b[k] && a[k] == -b[j])?(odgovori.push_back("DA")):(odgovori.push_back("NE"));
                }
            }
        }
    }

    for(int i = 0; i < t; i++)
    {
        cout << odgovori[i] << "\n";
    }
    return 0;
}