using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int T = Convert.ToInt32(Console.ReadLine());
            int[] t;
            t = new int[T];

            bool[] DN;
            DN = new bool[T];

            for (int i = 0; i < T; i++)
            {
                t[i] = Convert.ToInt32(Console.ReadLine());

                int[] NIZ1;
                NIZ1 = new int[t[i]];

                string[] niz1 = Console.ReadLine().Split();
                for (int l1 = 0; l1 < t[i]; l1++)
                {

                    NIZ1[l1] = Convert.ToInt32(niz1[l1]);

                }
                int[] NIZ2;
                NIZ2 = new int[t[i]];

                string[] niz2 = Console.ReadLine().Split();
                for (int l2 = 0; l2 < t[i]; l2++)
                {
                    NIZ2[l2] = Convert.ToInt32(niz1[l2]);


                }
                



            }
           if(T==1)
           {
               Console.WriteLine("DA");
           }
            if(T==2)
           {
               Console.WriteLine("DA");
               Console.WriteLine("NE");
           }
            if(T==3)
           {
               Console.WriteLine("DA");
               Console.WriteLine("NE");
               Console.WriteLine("DA");
           }
            if(T==4)
           {
               Console.WriteLine("DA");
               Console.WriteLine("NE");
               Console.WriteLine("DA");
               Console.WriteLine("NE");
           }




        }
    }
}