Alica and Bob are playing a game.

Initially they have a binary string $s$ consisting of only characters 0 and 1.

Alice and Bob make alternating moves: Alice makes the first move, Bob makes the second move, Alice makes the third one, and so on. During each move, the current player must choose two different adjacent characters of string $s$ and delete them. For example, if $s = 1011001$ then the following moves are possible:   delete $s_1$ and $s_2$: $\textbf{10}11001 \rightarrow 11001$;  delete $s_2$ and $s_3$: $1\textbf{01}1001 \rightarrow 11001$;  delete $s_4$ and $s_5$: $101\textbf{10}01 \rightarrow 10101$;  delete $s_6$ and $s_7$: $10110\textbf{01} \rightarrow 10110$. 

If a player can't make any move, they lose. Both players play optimally. You have to determine if Alice can win.


-----Input-----

First line contains one integer $t$ ($1 \le t \le 1000$) — the number of test cases.

Only line of each test case contains one string $s$ ($1 \le |s| \le 100$), consisting of only characters 0 and 1.


-----Output-----

For each test case print answer in the single line.

If Alice can win print DA (YES in Russian) in any register. Otherwise print NET (NO in Russian) in any register.


-----Example-----
Input
3
01
1111
0011

Output
DA
NET
NET



-----Note-----

In the first test case after Alice's move string $s$ become empty and Bob can not make any move.

In the second test case Alice can not make any move initially.

In the third test case after Alice's move string $s$ turn into $01$. Then, after Bob's move string $s$ become empty and Alice can not make any move.

Source: codeforces | Difficulty: EASY
Tags: Game theory


Solutions:
def solve():
	a = input()
	ones = 0
	zero = 0
	for i in a:
		if i == '0':
			zero += 1
		else:
			ones += 1
	minor = min(zero, ones)
	if minor % 2:
		print('DA')
	else:
		print('NET')
t = int(input())
for test in range(t):
	solve()


for _ in range(int(input())):
	l1 = list(input())
	if min(l1.count('1'), l1.count('0')) % 2 == 1:
		print('DA')
	else:
		print('NET')


import math
t = int(input())
for testcase in range(t):
	A = input()
	if A == '01' or A == '10':
		print('DA')
	else:
		ones = 0
		zeros = 0
		for i in range(len(A)):
			if A[i] == '0':
				zeros = zeros + 1
			else:
				ones = ones + 1
		p = min(zeros, ones)
		if p == 0:
			print('NET')
		elif p % 2 == 0:
			print('NET')
		else:
			print('DA')


def finder(bi):
	if list(bi).count('0') == 0 or list(bi).count('1') == 0:
		print('NET')
	else:
		x = min(list(bi).count('0'), list(bi).count('1'))
		if x % 2 == 0:
			print('NET')
		else:
			print('DA')
for i in range(int(input())):
	bi = input()
	finder(bi)


t = int(input())
for _ in range(0, t):
	st = str(input())
	zeroes = st.count('0')
	ones = st.count('1')
	num = min(zeroes, ones)
	if num % 2 == 1:
		print('DA')
	else:
		print('NET')


def solve():
	s = input()
	ones = s.count('1')
	zeros = s.count('0')
	print(['NET', 'DA'][min(ones, zeros) % 2])
for i in range(int(input())):
	solve()


t = int(input())
for tt in range(t):
	s = input()
	n = len(s)
	x = s.count('0')
	y = s.count('1')
	if x == 1 and y == 1:
		print('DA')
	elif x == 0 or y == 0:
		print('NET')
	else:
		for i in range(n):
			if i % 2 == 0:
				if x > 0 and y > 0:
					x -= 1
					y -= 1
				else:
					print('NET')
					break
			elif x > 0 and y > 0:
				x -= 1
				y -= 1
			else:
				print('DA')
				break


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
sys.setrecursionlimit(int(pow(10, 6)))
mod = int(pow(10, 9) + 7)
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
t = 1
t = int(input())
for _ in range(t):
	s = input()
	c = [0, 0]
	for i in range(len(s)):
		c[ord(s[i]) - ord('0')] += 1
	print('DA' if min(c) % 2 == 1 else 'NET')


t = int(input())
for i in range(t):
	s = input()
	zero = s.count('0')
	ones = s.count('1')
	ans = min(zero, ones)
	if ans % 2 == 0:
		print('NET')
	else:
		print('DA')


import sys
input = sys.stdin.readline
f = lambda : list(map(int, input().split()))
for _ in range(int(input())):
	s = input()
	cnt = 0
	stack = ''
	for i in range(len(s)):
		if stack and (stack[-1] == '0' and s[i] == '1' or (stack[-1] == '1' and s[i] == '0')):
			cnt += 1
			stack = stack[:-1]
		else:
			stack += s[i]
	print('DA' if cnt % 2 else 'NET')


for t in range(int(input())):
	s = input().strip()
	c = 0
	ok = True
	while ok and len(s) > 0:
		ok = False
		for i in range(len(s) - 1):
			if s[i] != s[i + 1]:
				c += 1
				ok = True
				s = s[:i] + s[i + 2:]
				break
	if c % 2 != 0:
		print('DA')
	else:
		print('NET')


test_case = int(input())
for _ in range(test_case):
	st = [i for i in input()]
	l = []
	count = 0
	for i in range(len(st)):
		if len(l) and (l[-1] == '0' and st[i] == '1' or (l[-1] == '1' and st[i] == '0')):
			l.pop(-1)
			count += 1
		else:
			l.append(st[i])
	if count % 2:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	s = input()
	num = []
	co = 0
	for i in s:
		if len(num) == 0:
			num.append(i)
		elif i == num[-1]:
			num.append(i)
		else:
			co += 1
			num.pop()
	if co % 2 != 0:
		print('DA')
	else:
		print('NET')


t = int(input())
for _ in range(t):
	s = str(input())
	one = 0
	zero = 0
	for i in range(len(s)):
		if s[i] == '1':
			one += 1
		else:
			zero += 1
	if one > 0 and zero > 0:
		if min(one, zero) % 2 == 0:
			print('NET')
		else:
			print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	s = input()
	(num0, num1) = (0, 0)
	for i in range(len(s)):
		if s[i] == '0':
			num0 += 1
		if s[i] == '1':
			num1 += 1
	cnt = min(num0, num1)
	if cnt & 1:
		print('DA')
	else:
		print('NET')


def solve():
	arr = list(input())
	(zeros, ones) = (0, 0)
	for e in arr:
		if e == '1':
			ones += 1
		else:
			zeros += 1
	ones = min(ones, zeros)
	if ones & 1:
		return 'da'
	return 'net'
for _ in range(int(input())):
	print(solve())


for _ in range(int(input())):
	s = input()
	c = 0
	i = 1
	while len(s) > 0 and i < len(s):
		if i <= 0:
			i = 1
		elif s[i] == s[i - 1]:
			i += 1
		else:
			c += 1
			s = s[:i - 1] + s[i + 1:]
			i -= 1
	if c % 2:
		print('DA')
	else:
		print('NET')


import re
for _ in range(int(input())):
	s = input()
	count1 = 0
	count0 = 0
	count = 0
	for i in range(len(s)):
		if s[i] == '1':
			count1 += 1
		else:
			count0 += 1
		if count1 == count0:
			count += count1
			count1 = 0
			count0 = 0
		elif count1 == 1 and count0 > 1:
			count0 -= 1
			count1 = 0
			count += 1
		elif count0 == 1 and count1 > 1:
			count1 -= 1
			count0 = 0
			count += 1
	if count & 1:
		print('DA')
	else:
		print('NET')


def fun(s):
	c = 0
	for i in range(len(s)):
		if s[i] == '1':
			c += 1
	if min(c, len(s) - c) % 2 == 0:
		return 'NET'
	return 'DA'
x = []
t = int(input())
for i in range(t):
	x.append(input())
for i in range(t):
	print(fun(x[i]))


for _ in range(int(input())):
	st = input()
	count = 0
	while '01' in st or '10' in st:
		st = st.replace('10', '#')
		count += st.count('#')
		st = st.replace('#', '')
		st = st.replace('01', '#')
		count += st.count('#')
		st = st.replace('#', '')
	if count % 2 == 1:
		print('DA')
	else:
		print('NET')


t = int(input())
while t:
	t -= 1
	a = list(input())
	count = [0, 0]
	for i in a:
		if i == '1':
			count[1] += 1
		else:
			count[0] += 1
	step = min(count[0], count[1])
	if step % 2 == 1:
		print('DA')
	else:
		print('NET')


d = ['NET', 'DA']
for _ in range(int(input())):
	s = input()
	cnt = min(s.count('0'), s.count('1'))
	print(d[cnt % 2])


def solve(s):
	n = len(s)
	st = []
	cnt = 0
	for i in range(n):
		if st == []:
			st += [s[i]]
		elif st[-1] == '0':
			if s[i] == '1':
				cnt += 1
				st.pop()
			else:
				st += [s[i]]
		elif st[-1] == '1':
			if s[i] == '0':
				cnt += 1
				st.pop()
			else:
				st += [s[i]]
	if cnt % 2 == 1:
		return 'DA'
	return 'NET'

def main():
	[print(solve(input())) for i in range(int(input()))]
main()


for t in range(int(input())):
	s = input()
	c0 = 0
	c1 = 0
	for i in range(len(s)):
		if s[i] == '0':
			c0 += 1
		else:
			c1 += 1
	k = min(c0, c1)
	if k & 1:
		print('DA')
	else:
		print('NET')


for i in range(int(input())):
	s = input()
	if min(s.count('1'), s.count('0')) % 2 != 0:
		print('DA')
	else:
		print('NET')


t = int(input())
for _ in range(t):
	s = input()
	x = s.count('1')
	y = s.count('0')
	ans = min(x, y)
	if ans % 2 == 0:
		print('NET')
	else:
		print('DA')


from sys import stdin
for _ in range(int(stdin.readline())):
	s = stdin.readline().strip()
	cou = 0
	st = []
	for i in range(len(s)):
		if not len(st):
			st.append(s[i])
		elif st[-1] != s[i]:
			st.pop()
			cou += 1
		else:
			st.append(s[i])
	if cou % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for i in range(t):
	s = input()
	how_many_left = abs(s.count('0') - s.count('1'))
	total_moves = (len(s) - how_many_left) / 2
	if total_moves % 2 == 0 or total_moves == 0:
		print('NET')
	else:
		print('DA')


def game(s):
	a = s.count('1')
	b = s.count('0')
	if min(a, b) % 2 == 1:
		return 'DA'
	else:
		return 'NET'
t = int(input())
for i in range(t):
	s = input()
	print(game(s))


for _ in range(int(input())):
	a = input()
	x1 = 0
	x2 = 0
	for i in range(len(a)):
		if a[i] == '0':
			x1 += 1
		else:
			x2 += 1
	x3 = min(x1, x2)
	if x3 % 2 == 0:
		print('NET')
	else:
		print('DA')


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	s = list(input())
	(zero, one) = (s.count('0'), s.count('1'))
	if min(zero, one) % 2 == 0:
		print('NET')
	else:
		print('DA')


pa = input()
p = int(pa)
while p > 0:
	p = p - 1
	n = input()
	count = 0
	i = 0
	if min(n.count('0'), n.count('1')) % 2 == 1:
		print('DA')
	else:
		print('NET')


t = int(input())
for _ in range(t):
	string1 = input()
	listOf01 = list(string1)
	if True:
		while True:
			break
		aChance = True
		bChance = False
		while True:
			length = len(listOf01)
			if length < 2 or listOf01.count('1') == 0 or listOf01.count('0') == 0:
				break
			for i in range(length - 1):
				if listOf01[i] != listOf01[i + 1]:
					listOf01.pop(i)
					listOf01.pop(i)
					break
			aChance = not aChance
			bChance = not bChance
		if True:
			if aChance:
				print('NET')
			else:
				print('DA')


import sys
input = lambda : sys.stdin.readline().strip()
t = int(input())
while t:
	t -= 1
	s = input()
	z = 0
	o = 0
	for i in s:
		if i == '0':
			z += 1
		else:
			o += 1
	if min(o, z) % 2 == 0:
		print('NET')
	else:
		print('DA')


PUTIN_HELP_ME = not None
NAVALNY_HELP_ME = not None
DURKA_HELP_ME = not None
import sys, os, re
from math import *
from random import *

class Answer(BaseException):

	def __init__(self, txt):
		self.__text = txt

	def what(self):
		return self.__text

def answer(arg):
	raise Answer

def lcm(a, b: int):
	return a * b // gcd(a, b)

def readArr(modifier=int):
	return list(map(modifier, input().split()))

def rA(m=int):
	return readArr(m)

def chomp(s: str):
	return s[:-1] if s[-1] == '\n' else s

def readFile(name: str):
	f = open(name, 'r')
	r = f.readlines()
	f.close()
	return r

def init_all():
	sys.setrecursionlimit(max(sys.getrecursionlimit(), 500000))

def lower_bound(a, k):
	(l, r) = (0, len(a) - 1)
	while l != r:
		mid = (l + r) // 2
		if a[mid] < k:
			l = mid + 1
		else:
			r = mid
	return l

def upper_bound(a, k):
	(l, r) = (0, len(a) - 1)
	while l + 1 < r:
		mid = (l + r) // 2
		if a[mid] <= k:
			l = mid
		else:
			r = mid - 1
	if a[r] == k:
		return r
	else:
		return l

class poly_hash:

	def __init__(self, s):
		self.seed = 228
		self.M = 1000000007
		self.n = len(s)
		self.pows = [1]
		self.hsh = [0 for _ in range(self.n + 1)]
		for _ in range(self.n):
			self.pows.append(self.pows[-1] * self.seed % self.M)
		for i in range(self.n):
			self.hsh[i + 1] = (self.hsh[i] * self.seed + s[i]) % self.M

	def sub_hash(self, l, r):
		return (self.hsh[r] - self.hsh[l] * self.pows[r - l]) % self.M

def pre_func(s):
	p = [0]
	a = 0
	for i in range(1, len(s)):
		while a > 0 and s[i] != s[a]:
			a = p[a - 1]
		if s[i] == s[a]:
			a += 1
		p.append(a)
	return p

def solve():
	s = input()
	zeros = s.count('0')
	units = s.count('1')
	x = min(zeros, units)
	print('DA' if x % 2 else 'NET')

def main(argv: list):
	init_all()
	t = 1
	t = int(input())
	for _ in range(t):
		try:
			solve()
		except Answer as a:
			print(a.what())
	return 0
exit(main(sys.argv))


from sys import stdin, stdout
t = int(stdin.readline().strip())
for _ in range(t):
	ss = stdin.readline().strip()
	s = [i for i in ss]
	p = 0
	while len(s) >= 1:
		f = 0
		for i in range(len(s) - 1):
			if s[i] == '0' and s[i + 1] == '1' or (s[i] == '1' and s[i + 1] == '0'):
				del s[i]
				del s[i]
				p += 1
				f = 1
				break
		if f == 0:
			break
	if p % 2 == 1:
		stdout.write('DA' + '\n')
	else:
		stdout.write('NET' + '\n')


t = int(input())
while t != 0:
	n = list(input())
	(cz, co) = (0, 0)
	for i in range(len(n)):
		if n[i] == '0':
			cz += 1
		else:
			co += 1
	ans = min(co, cz)
	if ans % 2 == 0:
		print('NET')
	else:
		print('DA')
	t -= 1


T = int(input())
for t in range(T):
	i = input().rstrip()
	N = len(i)
	S = []
	for _ in i:
		S.append(_)
	A = None
	B = None
	i = 1
	while i < len(S) and len(S):
		if S[i - 1] != S[i]:
			S.pop(i)
			S.pop(i - 1)
			i = 0
			continue
		i += 1
	if (N - len(S)) / 2 % 2 == 0:
		print('NET')
	else:
		print('DA')


size = int(input())
for i in range(size):
	a = input()
	x = a.count('0')
	y = a.count('1')
	if min(x, y) % 2 == 1:
		print('DA')
	else:
		print('NET')


t = int(input())
for _ in range(t):
	s = str(input())
	n = len(s)
	zero = 0
	one = 0
	count = 0
	for i in range(n):
		if s[i] == '0':
			zero += 1
		else:
			one += 1
	if one != 0 or zero != 0:
		count = min(one, zero)
	if count % 2 == 1:
		print('DA')
	else:
		print('NET')


from sys import stdin
A = int(stdin.readline())
for u in range(0, A):
	B = stdin.readline()
	count0 = 0
	count1 = 0
	for t in B:
		if t == '0':
			count0 += 1
		elif t == '1':
			count1 += 1
	temp = min(count0, count1)
	if temp % 2 == 1:
		print('DA')
	else:
		print('NET')


t = int(input())
for _ in range(t):
	s = input()
	n = len(s)
	zerocount = s.count('0')
	if zerocount == 0 or zerocount == n:
		print('NET')
	else:
		ans = 0
		if zerocount <= n // 2:
			ans = zerocount
		else:
			ans = n - zerocount
		if ans % 2 != 0:
			print('DA')
		else:
			print('NET')


n = int(input())
for w in range(n):
	s = input()
	(c1, c2) = (0, 0)
	for i in range(len(s)):
		if s[i] == '0':
			c1 += 1
		else:
			c2 += 1
	m2 = min(c1, c2)
	if m2 == 0:
		print('NET')
	elif m2 % 2 == 0:
		print('NET')
	else:
		print('DA')


try:
	k = int(input())
	for i in range(k):
		inp = input()
		xe = 0
		oe = 0
		for t in range(len(inp)):
			if inp[t] == '0':
				xe += 1
			else:
				oe += 1
		diff = min(xe, oe)
		if diff % 2 == 0:
			print('NET')
		elif diff % 2 == 1:
			print('DA')
except Exception:
	pass


for i in range(int(input())):
	a = list(input())
	print(['NET', 'DA'][min(a.count('1'), a.count('0')) % 2])


def saurabh(B):
	A = len(B)
	x = [B[0]]
	count = 0
	for i in range(1, len(B)):
		if x == []:
			x.append(B[i])
		elif x[-1] != B[i]:
			x.pop()
			count += 1
		else:
			x.append(B[i])
	if count % 2 == 1:
		return 'DA'
	else:
		return 'NET'
for i in range(int(input())):
	print(saurabh(input()))


import sys
input = lambda : sys.stdin.readline().rstrip()
t = int(input())
for _ in range(t):
	S = input()
	ct = min(S.count('0'), S.count('1'))
	if ct % 2 == 1:
		print('DA')
	else:
		print('NET')


t = int(input())
for _ in range(0, t):
	s = str(input())
	o = s.count('1')
	z = s.count('0')
	a = min(o, z)
	if a % 2 == 0:
		print('NET')
	else:
		print('DA')


from collections import Counter
from collections import defaultdict
from collections import deque
import math
import heapq
import sys
import io, os
input = sys.stdin.readline
from bisect import *
rs = lambda : input().strip()
ri = lambda : int(input())
rl = lambda : list(map(int, input().strip().split()))
rls = lambda : list(map(str, input().split()))
t = int(input())
for _ in range(0, t):
	a = list(input())
	s = []
	s.append(a[0])
	c = 0
	for i in range(1, len(a)):
		s.append(a[i])
		while len(s) > 1 and (s[-1] == '1' and s[-2] == '0' or (s[-2] == '1' and s[-1] == '0')):
			s.pop()
			s.pop()
			c = c + 1
	if c % 2 == 0:
		print('NET')
	else:
		print('DA')


def main():
	t = int(input())
	while t > 0:
		arr = list(input())
		if len(arr) == 1:
			print('NET')
			t -= 1
			continue
		count = 0
		change = [-1]
		prev = count - 1
		while change[-1] != count and len(arr) > 1:
			i = 0
			while i < len(arr) - 1:
				if arr[i] != arr[i + 1]:
					arr.pop(i)
					arr.pop(i)
					change.append(count)
					count += 1
					break
				else:
					i += 1
				change.append(count)
		if count % 2 == 0:
			print('NET')
		else:
			print('DA')
		t -= 1
main()


t = int(input())
for tt in range(t):
	s = input()
	a = []
	p = 0
	q = 0
	for x in s:
		if x == '1':
			p += 1
		else:
			q += 1
	r = min(p, q)
	if r % 2 == 0:
		print('NET')
	else:
		print('DA')


for i in range(int(input())):
	s = input()
	t = 0
	a = 0
	for i in range(len(s)):
		if s[i] == '1':
			t += 1
		else:
			a += 1
	a = min(a, t)
	if a % 2 != 0:
		print('DA')
	else:
		print('NET')


def main():
	for case in range(int(input())):
		s = input().strip()
		num_0s = sum((1 for c in s if c == '0'))
		num_1s = sum((1 for c in s if c == '1'))
		print('DA' if min(num_0s, num_1s) % 2 == 1 else 'NET')
main()


for _ in range(int(input())):
	s = input()
	count = 0
	ones = 0
	for i in s:
		if i == '1':
			ones += 1
			count += 1
		else:
			count -= 1
	temp = ones - max(0, count)
	if temp % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	s = input()
	zero = s.count('0')
	ones = len(s) - zero
	print('DA' if min(zero, ones) % 2 == 1 else 'NET')


a = int(input())
i = 0
while i < a:
	b = input()
	k = 0
	p = 0
	m = 0
	s = 0
	while s < len(b):
		if b[s] == '1':
			p = p + 1
		if b[s] == '0':
			m = m + 1
		s = s + 1
	while p > 0 and m > 0:
		p = p - 1
		m = m - 1
		k = k + 1
	if k % 2 == 0:
		print('NET')
	else:
		print('DA')
	i = i + 1


for _ in range(int(input())):
	s = input()
	l = len(s)
	c = 0
	for i in range(l):
		if s[i] == '0':
			c += 1
	m = min(l - c, c)
	if m % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for i in range(0, t):
	s = input()
	zero_count = 0
	one_count = 0
	for j in range(0, len(s)):
		if s[j] == '1':
			one_count += 1
		else:
			zero_count += 1
	ans = min(zero_count, one_count)
	if ans & 1:
		print('DA')
	else:
		print('NET')


import sys
n = int(sys.stdin.readline())
for _ in range(n):
	string = str(sys.stdin.readline())
	if min(string.count('0'), string.count('1')) % 2 == 0:
		print('NET')
	else:
		print('DA')


from sys import exit, stdin, stderr

def rl():
	return [int(w) for w in stdin.readline().split()]
(T,) = rl()
for _ in range(T):
	s = input().rstrip()
	c0 = len([c for c in s if c == '0'])
	c1 = len([c for c in s if c == '1'])
	print(['NET', 'DA'][min(c0, c1) & 1])


n = int(input())
for i in range(0, n):
	s = input()
	m = len(s)
	y = list(s)
	p = [0] * (m + 1)
	t = min(y.count('1'), y.count('0'))
	if t % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	s = input()
	x = 0
	y = 0
	for i in range(len(s)):
		if s[i] == '0':
			x += 1
		else:
			y += 1
	if y < x:
		x = y
	print('DA' if x % 2 == 1 else 'NET')


for i in range(int(input())):
	a = input()
	b = a.count('1')
	c = a.count('0')
	if b >= c and c % 2 != 0:
		print('DA')
	elif b < c and b % 2 != 0:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	s = input()
	cnt1 = 0
	cnt2 = 0
	for i in s:
		if i == '0':
			cnt1 += 1
		else:
			cnt2 += 1
	if min(cnt1, cnt2) % 2 == 0:
		print('NET')
	else:
		print('DA')


for s in [*open(0)][1:]:
	print('NDEAT'[min(s.count('0'), s.count('1')) % 2::2])


t = int(input())
for _ in range(t):
	s = list(input())
	state = 1
	while len(s) > 1:
		c = True
		for i in range(1, len(s)):
			if s[i] != s[i - 1]:
				s.pop(i - 1)
				s.pop(i - 1)
				state = 1 if state == 0 else 0
				c = False
				break
		if c:
			break
	if state:
		print('NET')
	else:
		print('DA')


def game(s):
	if s == '0' * len(s) or s == '1' * len(s):
		print('NET')
		return
	c_0 = 0
	c = 0
	i = 0
	while i < len(s) - 1:
		if s[i] != s[i + 1]:
			c += 1
			i += 2
		else:
			if s[i] == '0':
				c_0 += 1
			i += 1
	if i != len(s):
		if s[-1] == '0':
			c_0 += 1
	c_1 = len(s) - 2 * c - c_0
	c = c + min(c_0, c_1)
	if c % 2 != 0:
		print('DA')
	else:
		print('NET')
T = int(input())
for i in range(T):
	s = input()
	game(s)


t = int(input())
for i in range(t):
	s = input()
	pairs = 0
	stack = []
	for j in s:
		if len(stack) == 0:
			stack.append(j)
		elif stack[-1] != j:
			stack.pop(-1)
			pairs += 1
		else:
			stack.append(j)
	if pairs % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for i in range(t):
	k = 0
	str = list(input())
	k0 = 0
	k1 = 0
	for j in range(len(str)):
		if str[j] == '1':
			k1 += 1
		else:
			k0 += 1
	if min(k1, k0) % 2 == 0:
		print('NET')
	else:
		print('DA')


def solution():
	for _ in range(int(input())):
		s = list(input())
		cnt0 = 0
		cnt1 = 0
		for i in s:
			if i == '1':
				cnt1 += 1
			else:
				cnt0 += 1
		x = min(cnt1, cnt0)
		if x % 2 == 0:
			print('NET')
		else:
			print('DA')
solution()


def solve():
	st = []
	s = input()
	moves = 0
	for i in range(len(s)):
		if not st or s[st[-1]] == s[i]:
			st.append(i)
		elif st:
			st.pop(-1)
			moves += 1
	if moves % 2:
		print('DA')
	else:
		print('NET')
t = int(input())
for _ in range(t):
	solve()


for i in range(int(input())):
	s = input()
	a = 0
	b = 0
	for i in s:
		if i == '1':
			a = a + 1
		else:
			b = b + 1
	if a < b:
		c = a % 2
	else:
		c = b % 2
	if c == 0:
		print('NET')
	else:
		print('DA')


def read_int():
	return int(input())

def read_string_array():
	return input().split()

def read_int_array():
	return [int(_) for _ in read_string_array()]

def read_line():
	return input()
from itertools import groupby

def solve(s):
	l = [list(__) for (_, __) in groupby(sorted(s))]
	if len(l) <= 1:
		return 'NET'
	return 'DA' if min(len(l[1]), len(l[0])) % 2 == 1 else 'NET'
T = read_int()
for _ in range(T):
	S = read_line()
	print(solve(S))


def isEven(n):
	return True if n % 2 == 0 else False

def canWin(s, n):
	return 'DA' if not isEven(n) else 'NET'
t = int(input())
for i in range(t):
	s = input()
	print(canWin(s, min(s.count('0'), s.count('1'))))


def solve():
	s = list(input())
	x = min(s.count('1'), s.count('0'))
	if x & 1:
		print('DA')
	else:
		print('NET')
t = 1
t = int(input())
for _ in range(t):
	solve()


for _ in range(int(input())):
	s = input()
	count = 0
	while True:
		tobreak = True
		i = 0
		q = ''
		while i < len(s) - 1:
			if s[i] != s[i + 1]:
				count += 1
				tobreak = False
				i += 2
			else:
				q = q + s[i]
				i += 1
		if i == len(s) - 1:
			q = q + s[i]
		s = q
		if tobreak:
			break
	if count % 2 == 1:
		print('DA')
	else:
		print('NET')


import math
for _ in range(int(input())):
	s = list(input())
	c = 0
	for j in range(len(s)):
		for i in range(len(s) - 1):
			if s[i] != s[i + 1]:
				c += 1
				s.remove(s[i])
				s.remove(s[i])
				break
	if c % 2 == 1:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	string = input()
	zero = 0
	one = 0
	for i in string:
		if i == '0':
			zero += 1
		else:
			one += 1
	minimum = min(zero, one)
	if minimum % 2 == 1:
		print('DA')
	else:
		print('NET')


t = int(input())
for test in range(t):
	s = list(input())
	res = 0
	i = 0
	while i < len(s) - 1:
		if s[i] != s[i + 1]:
			del s[i]
			del s[i]
			res += 1
			if i != 0:
				i -= 1
		else:
			i += 1
	if res % 2 == 0:
		print('NET')
	else:
		print('DA')


cases = int(input())
answers = []
for i in range(cases):
	s = input()
	flag = True
	while True:
		if '01' in s:
			s = s.replace('01', '', 1)
			flag = not flag
		elif '10' in s:
			s = s.replace('10', '', 1)
			flag = not flag
		else:
			break
	if not flag:
		answers.append('DA')
	else:
		answers.append('NET')
for ans in answers:
	print(ans)


for _ in range(int(input())):
	s = input()
	zeros = s.count('0')
	ones = s.count('1')
	check = min(zeros, ones)
	if check & 1 == 1:
		print('DA')
	else:
		print('NET')


n = int(input())
ans = []
for i in range(n):
	b = []
	a = input()
	a = a.replace(' ', '')
	for j in a:
		b.append(int(j))
	b.sort()
	ans.extend([b])

def z(lst):
	tracker = 0
	for i in lst:
		if i == 0:
			tracker += 1
	return tracker

def o(lst):
	tracker = 0
	for i in lst:
		if i == 1:
			tracker += 1
	return tracker
for i in range(n):
	one = o(ans[i])
	zero = z(ans[i])
	if one < zero:
		if one % 2 == 0:
			print('NET')
		else:
			print('DA')
	elif zero % 2 == 0:
		print('NET')
	else:
		print('DA')


import math
t = int(input())
for _ in range(t):
	s = input()
	one = 0
	zero = 0
	for i in s:
		if i == '0':
			zero += 1
		else:
			one += 1
	if min(one, zero) % 2 == 0:
		print('NET')
	else:
		print('DA')


from sys import stdin
input = stdin.readline
INF = 10 ** 9 + 7
MAX = 10 ** 7 + 7
MOD = 10 ** 9 + 7
for Ti in range(int(input().strip())):
	s = input().strip()
	ans = 0
	t = ['$']
	for si in s:
		if si == t[-1] or t[-1] == '$':
			t.append(si)
		else:
			t.pop()
			ans += 1
	if ans % 2:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	a = input()
	odin = 0
	nol = 0
	for i in a:
		if i == '1':
			odin += 1
		else:
			nol += 1
	ss = min(odin, nol)
	if ss % 2 == 0:
		print('NET')
	else:
		print('DA')


T = int(input().rstrip())
for tt in range(T):
	st = input().rstrip()
	cnt0 = 0
	cnt1 = 0
	for i in st:
		if i == '1':
			cnt1 += 1
		else:
			cnt0 += 1
	cnt = min(cnt0, cnt1)
	if cnt % 2 == 0:
		print('NET')
	else:
		print('DA')


import sys
import math
read = lambda : sys.stdin.readline()
T = int(read())
for t in range(T):
	s = read()
	n0 = 0
	for i in range(len(s)):
		if s[i] == '0':
			n0 += 1
	n1 = len(s) - 1 - n0
	moves = min(n0, n1)
	if moves % 2 == 1:
		print('DA')
	else:
		print('NET')


t = int(input())
for i in range(t):
	n = input()
	a = n.count('1')
	b = n.count('0')
	if a == 0 or b == 0:
		print('NET')
		continue
	else:
		v = min(a, b)
		if v % 2 != 0:
			print('DA')
		else:
			print('NET')


t = int(input())
for _ in range(t):
	k = input()
	s = list(k)
	flag = 0
	count = 0
	while flag != 1:
		flag = 1
		for i in range(len(s) - 1):
			if s[i] == '0' and s[i + 1] != '0' or (s[i] == '1' and s[i + 1] != '1'):
				flag = 0
				count += 1
				s.pop(i + 1)
				s.pop(i)
				break
	if count % 2 == 0:
		print('NET')
	else:
		print('DA')


for testcase in range(int(input())):
	s = input()
	zero = s.count('0')
	one = s.count('1')
	m = min(zero, one)
	if m % 2 == 0:
		print('NET')
	else:
		print('DA')


for i in range(int(input())):
	s = input()
	tmp = 0
	ans = 0
	for i in range(len(s)):
		if s[i] == '1':
			tmp += 1
		else:
			ans += 1
	ans = min(ans, tmp)
	if ans % 2 != 0:
		print('DA')
	else:
		print('NET')


t = int(input())
while t > 0:
	s = input()
	if min(s.count('0'), s.count('1')) % 2 == 1:
		print('DA')
	else:
		print('NET')
	t -= 1


for i in range(int(input())):
	k = list(input())
	a = k.count('0')
	b = k.count('1')
	x = min(a, b)
	if x % 2 == 1:
		print('DA')
	else:
		print('NET')


for t in range(int(input())):
	s = list(input())
	ans = 0
	while True:
		i = 0
		different = 0
		while i < len(s) - 1:
			if s[i] != s[i + 1]:
				different += 1
				ans += 1
				s[i] = 'X'
				s[i + 1] = 'X'
				i += 2
			else:
				i += 1
		if different == 0:
			break
		else:
			a = []
			for i in s:
				if i != 'X':
					a.append(i)
			s = a
			if len(s) == 0:
				break
	if ans % 2 == 0:
		print('NET')
	else:
		print('DA')


from collections import Counter
for _ in range(int(input())):
	b = Counter(input())
	if len(b.keys()) == 1:
		print('NET')
	elif min(b['1'], b['0']) % 2 != 0:
		print('DA')
	else:
		print('NET')


import sys
import math

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def minput():
	return map(int, sys.stdin.readline().strip().split())

def listinput():
	return list(map(int, sys.stdin.readline().strip().split()))
for _ in range(iinput()):
	s = input()
	(a, b) = (0, 0)
	for i in s:
		if i == '0':
			a += 1
		else:
			b += 1
	if min(a, b) % 2 == 1:
		print('DA')
	else:
		print('NET')


t = int(input())
for _ in range(t):
	s = input()
	no_zeros = 0
	no_ones = 0
	for i in s:
		if i == '0':
			no_zeros += 1
	no_ones = len(s) - no_zeros
	decider = min(no_ones, no_zeros)
	if decider % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for _ in range(t):
	s = input()
	count = 0
	for i in range(len(s)):
		if s[i] == '0':
			count += 1
	x = min(count, len(s) - count)
	if x % 2 == 1:
		print('DA')
	else:
		print('NET')


cases = int(input())
for i in range(cases):
	s = input()
	c_one = s.count('1')
	c_zero = s.count('0')
	mi = min(c_one, c_zero)
	if mi % 2 == 1:
		print('DA')
	else:
		print('NET')


def answer(s):
	count = 0
	for i in range(len(s)):
		if s[i] == '0':
			count += 1
	mini = min(count, len(s) - count)
	if mini % 2 == 0:
		return 'NET'
	else:
		return 'DA'
t = int(input())
for i in range(t):
	s = input()
	print(answer(s))


import math

def main():
	line = input()
	have = 0
	for i in line:
		if i == '0':
			have -= 1
		else:
			have += 1
	have = abs(have)
	if (len(line) - have) // 2 % 2 == 0:
		print('NET')
	else:
		print('DA')
t = int(input())
for i in range(t):
	main()


import sys

def find_optimal_i(s):
	i = 0
	maybe_i = -1
	while i < len(s) - 1:
		if s[i] != s[i + 1]:
			maybe_i = i
			if i > 0 and i + 2 < len(s) and (s[i - 1] != s[i + 2]) or (i == 0 and i + 3 < len(s) and (s[i + 2] != s[i + 3])):
				return i
		i += 1
	if maybe_i >= 0:
		return maybe_i
	return None
input = sys.stdin.readline
num_games = int(input().strip())
data = [0] * num_games
for i in range(num_games):
	data[i] = input().strip()
for game in range(num_games):
	s = data[game]
	next_turn = 1
	no_next_optimal = False
	while len(s) > 0:
		i = find_optimal_i(s)
		if i == None:
			no_next_optimal = True
			break
		s = s[0:i] + s[i + 2:len(s)]
		next_turn += 1
	if (len(s) == 0 or no_next_optimal) and next_turn % 2 == 0:
		print('DA')
	else:
		print('NET')


t = int(input())

def calc(s):
	c = min(s.count('0'), s.count('1'))
	if c % 2 == 1:
		print('DA')
	else:
		print('NET')
for i in range(t):
	s = input()
	calc(s)


from sys import stdin
t = int(stdin.readline())
for _ in range(t):
	stack = []
	moves = 0
	s = stdin.readline().rstrip()
	for i in range(len(s)):
		if len(stack) > 0:
			if s[i] == '1' and stack[-1] == '0' or (s[i] == '0' and stack[-1] == '1'):
				stack.pop()
				moves += 1
			else:
				stack.append(s[i])
		else:
			stack.append(s[i])
	if moves % 2 == 0:
		print('NET')
	else:
		print('DA')


def main():
	t = int(input())
	n = [input() for i in range(t)]
	for o in n:
		if o.count('0') == 1 and o.count('1') == 1:
			print('DA')
			continue
		elif min(o.count('0'), o.count('1')) % 2 == 0:
			print('NET')
		else:
			print('DA')
main()


for _ in range(int(input())):
	s = input()
	zeros = s.count('0')
	ones = s.count('1')
	count = 0
	while zeros > 0 and ones > 0:
		zeros -= 1
		ones -= 1
		count += 1
	print('DA') if count & 1 else print('NET')


for _ in range(int(input())):
	st = input()
	zer = st.count('0')
	one = st.count('1')
	fin = min(zer, one)
	if fin % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	inp = input()
	y = min(inp.count('0'), inp.count('1'))
	print('NET' if y % 2 == 0 else 'DA')


t = int(input())
while t:
	x = input()
	ans = min(x.count('0'), x.count('1'))
	if ans % 2:
		print('DA')
	else:
		print('NET')
	t -= 1


n = int(input())
for _ in range(n):
	str = input()
	turn = 0
	while len(str) > 0:
		if '01' in str:
			str = str.replace('01', '', 1)
			turn += 1
		elif '10' in str:
			str = str.replace('10', '', 1)
			turn += 1
		else:
			break
	if turn % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for _ in range(t):
	n = input()
	lst = [int(x) for x in list(n)]
	count1 = 0
	count0 = 0
	for i in lst:
		if i == 0:
			count0 += 1
		else:
			count1 += 1
	count = 0
	while count0 > 0 and count1 > 0:
		count0 -= 1
		count1 -= 1
		count += 1
	if count % 2 == 0:
		print('NET')
	else:
		print('DA')


for i in range(int(input())):
	s = list(input())
	s1 = s.count('0')
	s2 = s.count('1')
	x = min(s1, s2)
	if x % 2 != 0:
		print('DA')
	else:
		print('NET')


def solve(s):
	zeros = s.count('0')
	return min(zeros, len(s) - zeros) % 2 == 1
t = int(input())
for _ in range(t):
	s = input()
	print('DA' if solve(s) else 'NET')


tc = int(input())
for ctr in range(tc):
	lis = input().strip()
	o = lis.count('0')
	z = lis.count('1')
	k = min(o, z)
	if k % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for _ in range(t):
	s = input()
	count = 0
	while s.count('10') + s.count('01') != 0:
		if s.count('10'):
			idx = s.index('10')
		else:
			idx = s.index('01')
		s = s[:idx] + s[idx + 2:]
		count += 1
		count = count % 2
	if count == 1:
		print('DA')
	else:
		print('NET')


import math
wqr = int(input())
for er in range(wqr):
	a = list(input())
	o = 0
	z = 0
	for i in a:
		if i == '0':
			z += 1
		else:
			o += 1
	m = min(o, z)
	if m % 2 == 0:
		print('NET')
	else:
		print('DA')


from collections import *
for t in range(int(input())):
	s = input()
	s += s[-1]
	i = 0
	count = 0
	flag = True
	while flag:
		i = 0
		flag = False
		stack = ''
		l = len(s)
		while i < l - 1:
			if s[i] != s[i + 1]:
				i += 1
				count += 1
				flag = True
			else:
				stack += s[i]
			i += 1
		s = stack
		if s != '':
			s += s[-1]
		else:
			break
		if not flag:
			break
	if count % 2 == 1:
		print('DA')
	else:
		print('NET')


for t in range(int(input())):
	a = input()
	x = a.count('0')
	y = len(a) - x
	if min(x, y) % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(0, int(input())):
	v = input()
	n = len(v)
	o = v.count('1')
	c = min(o, n - o)
	print(['NET', 'DA'][c % 2])


t = int(input())
for _ in range(t):
	s = input()
	st = []
	ct = 0
	for i in s:
		if not st:
			st.append(i)
		elif st[-1] != i:
			st.pop(-1)
			ct += 1
		else:
			st.append(i)
	if ct % 2 == 1:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	s = input()
	if '1' not in s or '0' not in s:
		print('NET')
	else:
		c = 0
		while True:
			if '10' in s:
				s = s.replace('10', '', 1)
				c += 1
			elif '01' in s:
				s = s.replace('01', '', 1)
				c += 1
			else:
				if c % 2 == 0:
					print('NET')
				else:
					print('DA')
				break


numberoftests = int(input())
for _ in range(numberoftests):
	s = input()
	m = len([char for char in s if char == '1'])
	n = len([char for char in s if char == '0'])
	if min(m, n) % 2 == 0:
		print('NET')
	else:
		print('DA')


n = int(input())
result = []
for i in range(n):
	a = input()
	zeros = a.count('0')
	ones = a.count('1')
	mini = 0
	if zeros > ones:
		mini = ones
	else:
		mini = zeros
	if mini % 2 == 0:
		result.append(0)
	else:
		result.append(1)
for j in result:
	if j == 1:
		print('DA')
	else:
		print('NET')


for i in range(int(input())):
	a = input()
	(b, c) = (0, 0)
	for j in a:
		if j == '0':
			b += 1
		else:
			c += 1
	m = min(b, c)
	if m and m % 2 == 1:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	n = input()
	print('DA' if min(n.count('0'), n.count('1')) % 2 == 1 else 'NET')


t = int(input())
while t > 0:
	t -= 1
	s = input()
	l = len(s)
	c1 = 0
	c0 = 0
	for i in range(l):
		if s[i] == '0':
			c0 += 1
		else:
			c1 += 1
	n = min(c0, c1)
	if n % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	s = input()
	o = 0
	z = 0
	for i in s:
		if i == '0':
			o += 1
		else:
			z += 1
	mn = min(o, z)
	if mn % 2 == 1:
		print('DA')
	else:
		print('NET')


T = int(input())
for i in range(T):
	n = input()
	arr = []

	def sol(s):
		for i in range(1, len(s)):
			if s[i] != s[i - 1]:
				return s[:i - 1] + s[i + 1:]
	turn = 0
	res = ''
	d = {0: 'DA', 1: 'NET'}
	while True:
		ans = sol(n)
		if ans == None:
			res = d[1 - turn]
			break
		turn = 1 - turn
		n = str(ans)
	print(res)


n = int(input())
for i in range(n):
	string = str(input())
	zeros = 0
	ones = 0
	for i in string:
		if int(i) == 0:
			zeros += 1
		else:
			ones += 1
	if ones >= zeros:
		if zeros % 2 == 0:
			print('NET')
		else:
			print('DA')
	elif ones % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for i in range(t):
	s = input().rstrip()
	if s.count('0') == len(s) or s.count('1') == len(s):
		print('NET')
	else:
		mini = min(s.count('0'), s.count('1'))
		if mini % 2 == 0:
			print('NET')
		else:
			print('DA')


t = int(input())
while t > 0:
	t -= 1
	a = input()
	res = 0
	stack = []
	for i in range(len(a)):
		if len(stack) == 0 or stack[len(stack) - 1] == a[i]:
			stack.append(a[i])
		else:
			stack.pop()
			res += 1
	if res % 2:
		print('DA')
	else:
		print('NET')


for i in range(int(input())):
	a = list(map(str, input()))
	if a.count('1') == a.count('0'):
		if a.count('1') % 2 == 0:
			print('NET')
		else:
			print('DA')
	else:
		h = min(a.count('1'), a.count('0'))
		if h % 2 == 0:
			print('NET')
		else:
			print('DA')


for _ in range(int(input())):
	s = input()
	cnt = 0
	while s != '':
		flg = 0
		for i in range(len(s) - 1):
			if s[i] != s[i + 1]:
				flg = 1
				cnt += 1
				break
		if flg:
			s = s[:i] + s[i + 2:]
		else:
			break
	if cnt % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	s = str(input())
	t = False
	while True:
		if s.find('01') != -1:
			s = s.replace('01', '', 1)
		elif s.find('10') != -1:
			s = s.replace('10', '', 1)
		else:
			break
		t = not t
	if t:
		print('DA')
	else:
		print('NET')


t = int(input())
for _ in range(t):
	s = list(input())
	oc = s.count('1')
	zc = s.count('0')
	if min(oc, zc) % 2 == 0:
		print('NET')
	else:
		print('DA')


N = int(input())
for _ in range(N):
	(c0, c1) = (0, 0)
	for i in input():
		if i == '1':
			c1 += 1
		else:
			c0 += 1
	v = min(c0, c1)
	if v % 2:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	w = list(input())
	d = dict()
	for i in range(len(w)):
		d[w[i]] = d.get(w[i], 0) + 1
	l = list(d.values())
	try:
		if int(l[0]) != 0 and int(l[1]) != 0:
			if min(l) % 2 == 1:
				print('DA')
			else:
				print('NET')
	except:
		print('NET')


from fractions import Fraction
import sys
import bisect
import heapq
from math import *
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
import statistics
from statistics import mode
mod = 1000000007

def inp():
	return sys.stdin.readline().strip()

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def graph(vertex):
	return [[] for i in range(0, vertex + 1)]

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def lcm(a, b):
	return a * b // gcd(a, b)

def power(a, b):
	ans = 1
	while b > 0:
		if b % 2 == 1:
			ans *= a
		a *= a
		b //= 2
	return ans

def most_frequent(List):
	occurence_count = Counter(List)
	return occurence_count.most_common(1)[0][0]

def most_common(List):
	return mode(List)

def createMatrix(rowCount, colCount, dataList):
	mat = []
	for i in range(rowCount):
		rowList = []
		for j in range(colCount):
			if dataList[j] not in mat:
				rowList.append(dataList[j])
		mat.append(rowList)
	return mat

def isprime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
import collections

def minimalFilps1(bits):
	n = len(bits)
	flipsFromLeft = [0 for i in range(n)]
	flipsFromRight = [0 for i in range(n)]
	flips = 0
	for i in range(0, n, 1):
		if bits[i] == '1':
			flips = flips + 1
		flipsFromLeft[i] = flips
	flips = 0
	i = n - 1
	while i >= 0:
		if bits[i] == '0':
			flips = flips + 1
		i = i - 1
		flipsFromRight[i] = flips
	minFlips1 = sys.maxsize
	for i in range(1, n, 1):
		if flipsFromLeft[i - 1] + flipsFromRight[i] < minFlips1:
			minFlips1 = flipsFromLeft[i - 1] + flipsFromRight[i]
	return minFlips1

def minimalFilps(bits):
	n = len(bits)
	flipsFromLeft = [0 for i in range(n)]
	flipsFromRight = [0 for i in range(n)]
	flips = 0
	for i in range(0, n, 1):
		if bits[i] == '0':
			flips = flips + 1
		flipsFromLeft[i] = flips
	flips = 0
	i = n - 1
	while i >= 0:
		if bits[i] == '1':
			flips = flips + 1
		i = i - 1
		flipsFromRight[i] = flips
	minFlips = sys.maxsize
	for i in range(1, n, 1):
		if flipsFromLeft[i - 1] + flipsFromRight[i] < minFlips:
			minFlips = flipsFromLeft[i - 1] + flipsFromRight[i]
	return minFlips

def oddn(n):
	for i in range(2, n + 1):
		if i % 2 != 0 and n % i == 0:
			return i
	return 3

def memoized(*args):
	if args in stored_results:
		return stored_results[args]
	else:
		result = stored_results[args] = fn(*args)
		return result
	return memoized
for i in range(int(input())):
	s = input()
	a = list(s)
	b = 1
	if len(a) == 2 and a[0] == a[1]:
		print('NET')
	elif len(a) == 2 and a[0] != a[1]:
		print('DA')
	else:
		i = 0
		while i < len(a) - 1:
			if a[i] != a[i + 1]:
				b += 1
				a.pop(i)
				if len(a) > 1:
					a.pop(i)
				i = 0
			else:
				i += 1
				continue
		if b % 2 == 0:
			print('DA')
		else:
			print('NET')


for _ in range(int(input())):
	s = input()
	a = s.count('1')
	b = s.count('0')
	x = min(a, b)
	if x % 2 == 1:
		print('DA')
	else:
		print('NET')


def printWinner(s):
	count1 = 0
	count0 = 0
	for x in s:
		if x == '1':
			count1 = count1 + 1
		else:
			count0 = count0 + 1
	mincount = min(count0, count1)
	if mincount % 2 == 0:
		print('NET')
	else:
		print('DA')
t = int(input())
for i in range(0, t):
	bstr = input()
	printWinner(bstr)


for ino in range(int(input())):
	s = input()
	p = min(s.count('0'), s.count('1'))
	if p % 2 == 0:
		print('NET')
	else:
		print('DA')


import math
t = int(input())
for w in range(t):
	s = input()
	k1 = s.count('0')
	k2 = s.count('1')
	k = min(k1, k2)
	if k == 0:
		print('NET')
	elif k % 2 == 1:
		print('DA')
	else:
		print('NET')


t = int(input())
for k in range(t):
	s = input()
	qtd_1 = s.count('1')
	qtd_0 = s.count('0')
	if qtd_0 > qtd_1:
		pares_possiveis = qtd_1
	else:
		pares_possiveis = qtd_0
	if pares_possiveis % 2 == 0:
		print('NET')
	else:
		print('DA')


def solve(s):
	stack = [None] * len(s)
	ix = -1
	cnt = 0
	for c in s:
		if ix < 0 or c == stack[ix]:
			ix += 1
			stack[ix] = c
		else:
			ix -= 1
			cnt += 1
	return 'DA' if cnt % 2 == 1 else 'NET'
t = int(input())
for i_t in range(t):
	s = input()
	print(solve(s))


for _ in range(int(input())):
	s = input()
	s = list(s)
	result = 0
	i = 0
	count = 0
	while i < len(s) - 1:
		if s[i] != s[i + 1]:
			count += 1
			del s[i]
			del s[i]
			i = 0
		else:
			i += 1
	if count == 0:
		print('NET')
	elif count % 2 != 0:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	a = input()
	(p, q) = (0, 0)
	for i in a:
		if i == '1':
			p += 1
		else:
			q += 1
	p = min(p, q)
	if p % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
while t > 0:
	t = t - 1
	s = input()
	zero = one = 0
	for i in s:
		if i == '1':
			zero += 1
		else:
			one += 1
	count = min(zero, one)
	if count % 2 == 0:
		print('NET')
	else:
		print('DA')


def main():
	for _ in range(int(input())):
		a = list(input())
		x = min(a.count('0'), a.count('1'))
		if not x % 2 == 0:
			print('DA')
		else:
			print('NET')
main()


import sys, math, cmath, time
start_time = time.time()

def solve():
	a = insr()
	i = 0
	c = 0
	q = []
	while i < len(a):
		q.append(a[i])
		if len(q) > 1 and q[-1] != q[-2]:
			q.pop()
			q.pop()
			c = c + 1
		i = i + 1
	if c % 2 == 0:
		print('NET')
	else:
		print('DA')

def main():
	global tt
	if not ONLINE_JUDGE:
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	t = 1
	t = inp()
	for tt in range(t):
		solve()
	if not ONLINE_JUDGE:
		print('Time Elapsed :', time.time() - start_time, 'seconds')
		sys.stdout.close()

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	return input().strip()

def invr():
	return map(int, input().split())

def counter(a):
	q = [0] * max(a)
	for i in range(len(a)):
		q[a[i] - 1] = (q[a[i] - 1], 1)
	return q

def string_counter(a):
	q = [0] * 26
	for i in range(len(a)):
		q[ord(a[i]) - 97] = (q[ord(a[i]) - 97], 1)
	return q

def factors(n):
	q = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			q.append(i)
			q.append(n // i)
	return list(sorted(list(set(q))))

def prime_factors(n):
	q = []
	while n % 2 == 0:
		q.append(2)
		n = n // 2
	for i in range(3, int(n ** 0.5) + 1, 2):
		while n % i == 0:
			q.append(i)
			n = n // i
	if n > 2:
		q.append(n)
	return list(sorted(q))
ONLINE_JUDGE = __debug__
if ONLINE_JUDGE:
	input = sys.stdin.readline
main()


import re
t = int(input())
for i in range(t):
	x = input()
	r = list(x)
	alice = 0
	bob = 0
	flag = 0
	n = len(r)
	while len(r) > 0:
		count = 0
		for k in range(len(r) - 1):
			if r[k] != r[k + 1]:
				count = 1
				if flag == 0:
					alice += 1
					r = r[:k] + r[k + 2:]
					flag = 1
					break
				if flag == 1:
					bob += 1
					r = r[:k] + r[k + 2:]
					flag = 0
					break
		if count == 0 and bob >= alice:
			print('NET')
			break
		if count == 0 and bob < alice:
			print('DA')
			break
		if len(r) == 0 and bob >= alice:
			print('NET')
			break
		if len(r) == 0 and bob < alice:
			print('DA')
			break


t = int(input())
while t > 0:
	s = input()
	a = list(s)
	if a.count('0') == len(a):
		print('NET')
	elif a.count('1') == len(a):
		print('NET')
	else:
		cnt = 0
		i = 0
		while len(a) > 1 and i < len(a) - 1:
			if a[i] != a[i + 1]:
				a.remove(a[i])
				a.remove(a[i])
				cnt = cnt + 1
				i = 0
			else:
				i = i + 1
		if cnt % 2 != 0:
			print('DA')
		else:
			print('NET')
	t = t - 1


t = int(input())
for tc in range(t):
	num = input()
	one = 0
	zero = 0
	for x in num:
		if x == '0':
			zero += 1
		else:
			one += 1
	steps = min(one, zero)
	if steps % 2 == 0:
		print('NET')
	else:
		print('DA')


from math import *
tests = int(input())
for t in range(tests):
	s = input()
	alisa = False
	stack = []
	for i in range(len(s)):
		c = s[i]
		if len(stack):
			top = stack[-1]
			if c == top:
				stack.append(c)
			else:
				alisa = not alisa
				stack.pop()
		else:
			stack.append(c)
	ans = 'DA' if alisa else 'NET'
	print(ans)


t = int(input())
from collections import Counter
for _ in range(t):
	n = list(input())
	cn = Counter(n)
	cnt = min(cn['0'], cn['1'])
	print('DA' if cnt % 2 else 'NET')


t = int(input())
while t > 0:
	string = input()
	count_zero = 0
	count_one = 0
	for i in range(len(string)):
		if string[i] == '0':
			count_zero = count_zero + 1
		else:
			count_one = count_one + 1
	if count_one > 0 and count_zero > 0:
		if count_zero == count_one:
			if count_zero % 2 != 0:
				print('DA')
			else:
				print('NET')
		elif count_zero > count_one:
			if count_one % 2 != 0:
				print('DA')
			else:
				print('NET')
		elif count_zero % 2 != 0:
			print('DA')
		else:
			print('NET')
	else:
		print('NET')
	t = t - 1


for ad in range(int(input())):
	s = list(input())
	t = 0
	ans = 0
	while t == 0:
		c = 0
		ind = []
		i = 0
		while i < len(s) - 1:
			if s[i] != s[i + 1]:
				ind.extend([i, i + 1])
				c += 1
				i += 1
			i += 1
		if c == 0:
			t = 1
		for i in range(len(ind)):
			s.pop(ind[i] - i)
		ans += c
	if ans % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
while t > 0:
	t -= 1
	x = input()
	o = e = 0
	for i in x:
		if i == '0':
			o += 1
		else:
			e += 1
	x = min(o, e)
	if x % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for i in range(t):
	s = list(input())
	(c0, c1) = (0, 0)
	for j in s:
		if j == '0':
			c0 += 1
		else:
			c1 += 1
	c2 = min(c0, c1)
	if c2 % 2 == 1:
		print('DA')
	else:
		print('NET')


dfg = True
n = int(input())
for kk in range(n):
	i = 0
	cvcvvc = 0
	fwekjfnewk = 0
	fewnfkenfko = input()
	while i < len(fewnfkenfko) and dfg:
		if fewnfkenfko[i] == '0':
			cvcvvc = cvcvvc + 1
		else:
			fwekjfnewk = fwekjfnewk + 1
		i = i + 1
	wdjenwf = min(cvcvvc, fwekjfnewk)
	if wdjenwf % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for _ in range(t):
	s = input()
	st = 0
	for i in s:
		if i == '1':
			st += 1
		else:
			st -= 1
	md = (len(s) - abs(st)) / 2
	if md % 2 == 1:
		print('DA')
	else:
		print('NET')


t = int(input())
for _ in range(t):
	s = input()
	n = len(s)
	ch = min(s.count('1'), s.count('0'))
	if ch % 2 == 0:
		print('NET')
	else:
		print('DA')


import sys
input = lambda : sys.stdin.readline().rstrip()
inp = sys.stdin.buffer.readline

def I():
	return list(map(int, inp().split()))
for _ in range(int(input())):
	s = input()
	cnt = min(s.count('0'), s.count('1'))
	print(['NET', 'DA'][cnt & 1])


from collections import Counter
t = int(input())
for i in range(t):
	l = list(map(int, input()))
	if len(Counter(l)) == 1 or min(Counter(l)[0], Counter(l)[1]) % 2 == 0:
		print('NET')
	else:
		print('DA')


def handle():
	binary = input().strip()
	one = binary.count('1')
	zero = len(binary) - one
	pairs = min(one, zero)
	if pairs % 2 == 0:
		return False
	else:
		return True
t = int(input())
while t > 0:
	t -= 1
	if handle():
		print('DA')
	else:
		print('NET')


t = int(input())
for _ in range(t):
	s = input()
	zero = s.count('0')
	one = s.count('1')
	x = min(zero, one)
	if x % 2 == 0:
		print('NET')
	else:
		print('DA')


s = int(input())
for i in range(s):
	t = input()
	f = 0
	while t.find('01') >= 0 or t.find('10') >= 0:
		if t.find('01') < t.find('10') and t.find('01') != -1 or t.find('10') == -1:
			t = t[:t.find('01')] + t[t.find('01') + 2:]
			f += 1
		elif t.find('10') < t.find('01') and t.find('10') != -1 or t.find('01') == -1:
			t = t[:t.find('10')] + t[t.find('10') + 2:]
			f += 1
	if f % 2 == 1:
		print('DA')
	else:
		print('NET')


n = int(input())
for _ in range(n):
	s = input()
	i = 0
	zc = 0
	oc = 0
	while i < len(s):
		if s[i] == '0':
			zc = zc + 1
		else:
			oc = oc + 1
		i = i + 1
	moves = min(zc, oc)
	if moves % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for tt in range(t):
	s = list(map(int, input()))
	j = 0
	while 1:
		ans = []
		for i in range(len(s) - 1):
			if s[i] != s[i + 1]:
				ans.append((i, i + 1))
		if not ans:
			break
		a = ans[0][0]
		b = ans[0][1]
		del s[a:b + 1]
		j += 1
	if j % 2 != 0:
		print('DA')
	else:
		print('NET')


t = int(input())
for _ in range(t):
	s = input()
	turns = min(s.count('0'), s.count('1'))
	if turns % 2 == 1:
		print('DA')
	else:
		print('NET')


from collections import deque

def main():
	t = int(input())
	for _ in range(t):
		pairs = 0
		queue = deque()
		string = input()
		change = False
		act = string[0]
		for x in string[1:]:
			if change:
				if len(queue) != 0:
					act = queue.pop()
					change = False
				else:
					act = x
					change = False
					continue
			if x != act:
				change = True
				pairs += 1
			else:
				queue.appendleft(x)
		if pairs % 2 == 0:
			print('NET')
		else:
			print('DA')
main()


t = int(input())
for _ in range(t):
	s = input()
	n = p = 0
	for i in range(len(s)):
		if s[i] == '0':
			n += 1
		else:
			p += 1
	m = min(n, p)
	if m % 2 == 1:
		print('DA')
	else:
		print('NET')


for i in range(int(input())):
	s = input()
	p = 0
	while len(s) != 0:
		z = s
		if '10' in s:
			a = s.find('10')
			s = s[:a] + s[a + 2:]
			p += 1
		elif '01' in s:
			a = s.find('01')
			s = s[:a] + s[a + 2:]
			p += 1
		if z == s:
			break
	if p % 2 == 0:
		print('NET')
	else:
		print('DA')


def solve():
	s = input()
	zero = s.count('0')
	one = s.count('1')
	move = min(zero, one)
	ans = 'DA' if move % 2 == 1 else 'NET'
	print(ans)
t = int(input())
for _ in range(t):
	solve()


for i in range(int(input())):
	st = input()
	c0 = st.count('0')
	c1 = st.count('1')
	ans = min(c0, c1)
	if ans % 2 == 1:
		print('DA')
	else:
		print('NET')


for _ in ' ' * int(input()):
	a = input()
	k = min(a.count('0'), a.count('1'))
	if k & 1 == 0:
		print('NET')
	else:
		print('DA')


import sys
input = sys.stdin.readline

def main():
	for t in range(int(input())):
		s = input()
		i = 0
		sol = 0
		s = s[:len(s) - 1]
		while i < len(s) - 1:
			if s[i] != s[i + 1]:
				sol += 1
				s = s[:i] + s[i + 2:]
				i = 0
			else:
				i += 1
		print('NET' if sol % 2 == 0 else 'DA')
main()


n = int(input())
for _ in range(n):
	st = input()
	alice = 0
	while '10' in st or '01' in st:
		if '10' in st:
			st = st.replace('10', '', 1)
			alice += 1
		elif '01' in st:
			st = st.replace('01', '', 1)
			alice += 1
	if alice % 2 != 0:
		print('DA')
	else:
		print('NET')


for i in range(int(input())):
	s = str(input())
	ct = 0
	while '0' in s and '1' in s:
		if '01' in s:
			s = s.replace('01', '', 1)
		elif '10' in s:
			s = s.replace('10', '', 1)
		ct += 1
	if ct % 2 == 1:
		print('DA')
	else:
		print('NET')


for i in range(int(input())):
	x = str(input())
	print('DA' if min(x.count('0'), x.count('1')) % 2 == 1 else 'NET')


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
t = int(input())
from collections import defaultdict as dd
for i in range(t):
	l = list(input())
	c = 0
	while l.count(l[0]) != len(l):
		l1 = []
		d = dd(int)
		for j in range(len(l) - 1):
			if l[j] != l[j + 1] and d[j] == d[j + 1] == 0:
				d[j] = 1
				d[j + 1] = 1
				c += 1
			if d[j] == 0:
				l1.append(l[j])
		if d[len(l) - 1] == 0:
			l1.append(l[-1])
		l = l1.copy()
		if len(l) == 0:
			break
	if c % 2:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	s = str(input())
	m = min(s.count('1'), s.count('0'))
	if m % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for i in range(t):
	str1 = str(input())
	a = str1.count('0')
	b = str1.count('1')
	q = min(a, b)
	if q % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for _ in range(t):
	s = list(input())
	o = s.count('1')
	z = s.count('0')
	val = min(o, z)
	ans = 'DA' if val % 2 else 'NET'
	print(ans)


for _ in range(int(input())):
	s = input()
	a0 = s.count('1')
	a1 = s.count('0')
	if min(a0, a1) % 2 != 0:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	s = input()
	(count, i) = (0, 1)
	l = [s[0]]
	for i in range(1, len(s)):
		if not l:
			l.append(s[i])
		elif s[i] != l[-1]:
			l.pop()
			count += 1
		else:
			l.append(s[i])
	if count % 2 == 0:
		print('NET')
	else:
		print('DA')


n = input('')
n = int(n)
strr = []
for i in range(n):
	strr.append(input(''))
for i in strr:
	str = list(i)
	index = 0
	cnt = 0
	n = len(str)
	while len(str) >= 0 and index < len(str) - 1:
		if str[index] != str[index + 1]:
			del [str[index:index + 2]]
			index = 0
			cnt = cnt + 1
		else:
			index = index + 1
	if cnt % 2 == 0:
		print('NET')
	else:
		print('DA')


import sys
input = sys.stdin.readline
tc = int(input())
for _ in range(tc):
	string = list(input().rstrip())
	ans = 0
	check = []
	while 1 < len(string):
		tmp = 0
		for i in range(len(string) - 1):
			if string[i] != string[i + 1]:
				tmp += 1
				check = [i, i + 1]
				break
		if tmp != 0:
			ans += tmp
			string.pop(check[0])
			string.pop(check[1] - 1)
		else:
			break
	if ans % 2 == 1:
		print('DA')
	else:
		print('NET')


T = int(input())
for t in range(T):
	s = list(input())
	i = 0
	flag = 0
	while i >= 0 and i < len(s) - 1:
		if s[i] == s[i + 1]:
			i += 1
		else:
			del s[i:i + 2]
			i -= 1
			if flag == 0:
				flag = 1
			else:
				flag = 0
		if i < 0:
			i = 0
	if flag == 0:
		print('NET')
	else:
		print('DA')


import sys
import math
from sys import stdin, stdout
from collections import deque, defaultdict
from math import ceil, floor, inf, sqrt, factorial, gcd, log2
from copy import deepcopy
ii1 = lambda : int(stdin.readline().strip())
is1 = lambda : stdin.readline().strip()
iia = lambda : list(map(int, stdin.readline().strip().split()))
isa = lambda : stdin.readline().strip().split()
mod = 1000000007
for _ in range(ii1()):
	s = is1()
	n = len(s)
	flag = [False] * n
	count = 0
	for i in range(n - 1):
		if s[i] != s[i + 1] and flag[i] == False and (flag[i + 1] == False):
			flag[i] = True
			flag[i + 1] = True
			count += 1
	if count == 0:
		print('NET')
		continue
	arr = deque()
	for i in range(n):
		if flag[i] == False:
			arr.append(s[i])
	while True:
		l = len(arr)
		subcount = 0
		flag = [False] * l
		for i in range(l - 1):
			if arr[i] != arr[i + 1] and flag[i] == False and (flag[i + 1] == False):
				flag[i] = True
				flag[i + 1] = True
				subcount += 1
		if subcount == 0:
			break
		count += subcount
		arr1 = deque()
		for i in range(l):
			if flag[i] == False:
				arr1.append(arr[i])
		arr = arr1
	if count % 2:
		print('DA')
	else:
		print('NET')


t = int(input())
for _ in range(t):
	s = input()
	n = len(s)
	cnt0 = s.count('0')
	cnt1 = n - cnt0
	if min(cnt0, cnt1) % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(0, int(input())):
	s = list(input())
	zero = 0
	one = 0
	for i in range(0, len(s)):
		if s[i] == '0':
			zero += 1
		else:
			one += 1
	if zero == 0 or one == 0:
		print('NET')
	elif zero > one:
		if one % 2 == 1:
			print('DA')
		else:
			print('NET')
	elif one > zero:
		if zero % 2 == 1:
			print('DA')
		else:
			print('NET')
	elif zero == one:
		if zero % 2 == 1:
			print('DA')
		else:
			print('NET')


for _ in range(int(input())):
	s = list(str(input()))
	print(['NET', 'DA'][min(s.count('0'), s.count('1')) % 2])


for _ in range(int(input())):
	s = input()
	z = 0
	u = 0
	for c in s:
		if c == '0':
			z += 1
		else:
			u += 1
	if min(z, u) & 1 == 0:
		print('NET')
	else:
		print('DA')


cases = int(input())
for _ in range(cases):
	dizi = input()
	count0 = 0
	count1 = 0
	for i in dizi:
		if i == '0':
			count0 += 1
		else:
			count1 += 1
	count = len(dizi) - abs(count0 - count1)
	count /= 2
	if count % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for i in range(t):
	x = input()
	c = 0
	while x.find('10') != -1 or x.find('01') != -1:
		if len(x) == 2:
			x = ''
		elif x.find('10') != -1:
			p = x.find('10')
			x = x[:p] + x[p + 2:]
		elif x.find('01') != -1:
			p = x.find('01')
			x = x[:p] + x[p + 2:]
		c += 1
	if c % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for _ in range(t):
	a = input()
	count = 0
	i = 1
	while len(a) > 0 and i < len(a):
		name = ''
		if a[i] != a[i - 1]:
			count += 1
			name = a[:i - 1] + a[i + 1:]
			a = name
			i = 1
		else:
			i += 1
	if count % 2 != 0:
		print('DA')
	else:
		print('NET')


n = int(input())
for i in range(n):
	a = input()
	k = 1
	while 1:
		if '01' in a:
			a = a[:a.index('01')] + a[a.index('01') + 2:]
		elif '10' in a:
			a = a[:a.index('10')] + a[a.index('10') + 2:]
		else:
			break
		k = 1 - k
	if k == 1:
		print('NET')
	else:
		print('DA')


t = int(input())
for _ in range(t):
	l = input()
	c0 = 0
	c1 = 0
	for i in range(len(l)):
		if l[i] == '0':
			c0 = c0 + 1
		else:
			c1 = c1 + 1
	if min(c0, c1) % 2 == 0:
		print('NET')
	else:
		print('DA')


ll = lambda : list(map(int, input().split()))
st = lambda : input()
v = lambda : map(int, input().split())
ii = lambda : int(input())
from collections import *
from math import *
for _ in range(ii()):
	x = st()
	s = []
	c = 0
	for i in x:
		if not s:
			s.append(i)
		elif i != s[-1]:
			s.pop()
			c += 1
		else:
			s.append(i)
	if c % 2:
		print('DA')
	else:
		print('NET')


for ii in range(int(input())):
	s = input()
	z = 0
	while '01' in s:
		z += s.count('01')
		s = s.replace('01', '')
	while '10' in s:
		z += s.count('10')
		s = s.replace('10', '')
	if z % 2 == 0:
		print('NET')
	else:
		print('DA')


def canRemove(array):
	i = 0
	while i < len(array) - 1:
		if array[i] == '0' and array[i + 1] == '1':
			return True
		elif array[i] == '1' and array[i + 1] == '0':
			return True
		i += 1
	return False

def removePair(array):
	i = 0
	pairRemoved = False
	outputArray = []
	while i < len(array):
		if not pairRemoved and i < len(array) - 1:
			if array[i] == '0' and array[i + 1] == '1':
				i += 2
				pairRemoved = True
			elif array[i] == '1' and array[i + 1] == '0':
				i += 2
				pairRemoved = True
		if i < len(array):
			outputArray.append(array[i])
		i += 1
	return outputArray
quantityOfTests = int(input())
test = 0
while test < quantityOfTests:
	line = input()
	alicaWon = False
	bobWon = False
	while not alicaWon and (not bobWon):
		alicaCanRemove = True
		bobCanRemove = True
		alicaCanRemove = canRemove(line)
		if alicaCanRemove:
			line = removePair(line)
			bobCanRemove = canRemove(line)
			if bobCanRemove:
				line = removePair(line)
			else:
				alicaWon = True
		else:
			bobWon = True
	if alicaWon:
		print('DA')
	else:
		print('NET')
	test += 1


t = int(input())
while t:
	s = input()
	zeros = s.count('0')
	ones = s.count('1')
	m = min(zeros, ones)
	if m % 2 == 0:
		print('NET')
	else:
		print('DA')
	t -= 1


for i in range(int(input())):
	st = input()
	stlist = list(st)
	zero = stlist.count('0')
	one = len(stlist) - zero
	if min(zero, one) % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	s = input()
	(one, zero) = (0, 0)
	for i in range(len(s)):
		if s[i] == '1':
			one += 1
		else:
			zero += 1
	rounds = min(one, zero)
	if rounds % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	a = input()
	p = 0
	if len(set(a)) == 1:
		print('NET')
	else:
		z = o = 0
		for i in range(len(a)):
			if a[i] == '0':
				z += 1
			else:
				o += 1
		p = min(z, o)
		if p % 2 == 0:
			print('NET')
		else:
			print('DA')


def winner(s):
	zeros = 0
	ones = 0
	for char in s:
		if char == '0':
			zeros += 1
		else:
			ones += 1
	if min(zeros, ones) % 2 != 0:
		return 'DA'
	else:
		return 'NET'
t = int(input())
for _ in range(t):
	s = input()
	print(winner(s))


import sys
input = lambda : sys.stdin.readline().rstrip()
from collections import deque
from queue import LifoQueue
for _ in range(int(input())):
	s = input()
	(zero, one) = (0, 0)
	for i in s:
		if i == '0':
			zero += 1
		else:
			one += 1
	if min(zero, one) % 2 == 1:
		print('DA')
	else:
		print('NET')


for i in range(int(input())):
	s = input()
	n = 0
	o = 0
	for elem in s:
		if elem == '1':
			o += 1
		else:
			n += 1
	if min(n, o) % 2:
		print('DA')
	else:
		print('NET')


t = int(input())

def amount(s):
	(a, b) = (0, 0)
	for c in s:
		if c == '0':
			a += 1
		else:
			b += 1
	return (a, b)
for i in range(t):
	print('DA' if min(amount(input())) % 2 == 1 else 'NET')


import sys
input = sys.stdin.readline
(inp, ip) = (lambda : int(input()), lambda : [int(w) for w in input().split()])
for _ in range(inp()):
	s = input().strip()
	if len(s) == 1:
		print('NET')
		continue
	(z, o) = (s.count('0'), s.count('1'))
	n = min(z, o)
	if n % 2:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	x = input()
	k = min(x.count('1'), x.count('0'))
	print(['DA', 'NET'][k % 2 == 0])


for t in range(int(input())):
	s = str(input())
	(z, o) = (0, 0)
	for i in s:
		if i == '0':
			z += 1
		elif i == '1':
			o += 1
	if z == 0 or o == 0:
		print('NET')
	elif min(z, o) % 2 == 0:
		print('NET')
	else:
		print('DA')


import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__

def gift():
	for _ in range(t):
		charit = input()
		n = len(charit)
		(count0, count1) = (0, 0)
		for ele in charit:
			if ele == '0':
				count0 += 1
			else:
				count1 += 1
		dud = min(count0, count1)
		if dud % 2:
			yield 'DA'
		else:
			yield 'NET'
t = int(input())
ans = gift()
print(*ans, sep='\n')


for s in [*open(0)][1:]:
	t = 0
	q = s
	while t != q:
		t = q
		q = t.replace('01', '').replace('10', '')
	print('NDEAT'[len(s) - len(t) >> 1 & 1::2])


for _ in range(int(input())):
	k = input()
	alice = 0
	bob = 0
	c = 0
	while len(k) > 0:
		l = k.count('01')
		p = k.count('10')
		if l == 0 and p == 0:
			break
		ct = False
		if l > 0:
			if c % 2 == 0:
				alice += 1
			else:
				bob += 1
			k = k.replace('01', '', 1)
			ct = True
			c += 1
		if p > 0 and ct == False:
			k = k.replace('10', '', 1)
			if c % 2 == 0:
				alice += 1
			else:
				bob += 1
			c += 1
	print('DA' if alice > bob else 'NET')


t = input()
for _ in range(int(t)):
	s = input()
	(zeros, ones) = (0, 0)
	for i in s:
		if i == '0':
			zeros += 1
		else:
			ones += 1
	if zeros == 0 or ones == 0:
		print('NET')
	else:
		r = min(zeros, ones)
		if r % 2:
			print('DA')
		else:
			print('NET')


import copy
nn = int(input())
while nn > 0:
	nn -= 1
	a = input()
	l = list(a)
	s = 0
	i = 0
	while i < len(l) - 1:
		if l[i:i + 2] == ['0', '1'] or l[i:i + 2] == ['1', '0']:
			l.pop(i + 1)
			l.pop(i)
			s += 1
			i -= 1
		else:
			i += 1
	if s % 2 == 0:
		print('NET')
	else:
		print('DA')


n = int(input())

def solve():
	string = list(input())
	if len(string) == 1:
		print('NET')
	else:
		win = False
		turn = True
		while True:
			found = False
			for i in range(len(string) - 1):
				if string[i] != string[i + 1]:
					found = True
					string.pop(i)
					string.pop(i)
					break
			if found == False and turn == False:
				print('DA')
				win = True
				break
			elif found == False and turn == True:
				break
			if turn:
				turn = False
			else:
				turn = True
		if not win:
			print('NET')
for i in range(n):
	solve()


import operator as op
import re
import sys
from bisect import bisect, bisect_left, insort, insort_left
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from functools import reduce
from itertools import accumulate, combinations, combinations_with_replacement, groupby, permutations, product
from math import acos, asin, atan, ceil, cos, degrees, factorial, gcd, hypot, log2, pi, radians, sin, sqrt, tan
from operator import itemgetter, mul
from string import ascii_lowercase, ascii_uppercase, digits

def inp():
	return int(input())

def inlist():
	return list(map(int, input().split()))

def instr():
	s = input()
	return list(s[:len(s)])

def invr():
	return map(int, input().split())

def def_value():
	return 0
t = inp()
for _ in range(t):
	a = input()
	ones = 0
	zeros = 0
	for c in a:
		if c == '1':
			ones += 1
		else:
			zeros += 1
	pairs = min(ones, zeros)
	res = 'DA'
	if pairs % 2 == 0:
		res = 'NET'
	else:
		res = 'DA'
	print(res)


t = int(input().split()[0])
for i in range(t):
	s = str(input().split()[0])
	zeros = 0
	ones = 0
	for j in range(len(s)):
		if s[j] == '1':
			zeros += 1
		else:
			ones += 1
	if ones == 0 or zeros == 0:
		print('NET')
		continue
	if min(ones, zeros) % 2 == 1:
		print('DA')
	else:
		print('NET')


def solve():
	s = input()
	for i in range(1, len(s) + 1):
		if '01' in s:
			index = s.index('01')
			s = s[:index] + s[index + 2:]
		elif '10' in s:
			index = s.index('10')
			s = s[:index] + s[index + 2:]
		else:
			if i % 2 == 0:
				print('DA')
			else:
				print('NET')
			break

def main():
	for _ in range(int(input())):
		solve()
main()


def test(s, win=False):
	if len(s) < 2:
		return win
	j = 1
	while j < len(s):
		if s[0] != s[j]:
			if j == 1:
				return test(s[2:], not win)
			else:
				return test(s[:j - 1] + s[j + 1:], not win)
		else:
			j += 1
	return win
d = {True: 'DA', False: 'NET'}
n = int(input())
for i in range(n):
	print(d[test(input())])


for i in range(int(input())):
	s = input()
	c = 0
	while '01' in s or '10' in s:
		if '01' in s:
			s = s.replace('01', '', 1)
		else:
			s = s.replace('10', '', 1)
		c = c + 1
	if c % 2 == 0:
		print('NET')
	else:
		print('DA')


def solve():
	s = input()
	if min(s.count('0'), s.count('1')) % 2 == 1:
		print('DA')
	else:
		print('NET')

def main():
	q = int(input())
	for _ in range(q):
		solve()
main()


t = int(input())
for _ in range(t):
	s = list()
	a = list(input())
	count = 0
	for x in a:
		if len(s) > 0 and (x == '0' and s[-1] == '1' or (x == '1' and s[-1] == '0')):
			s.pop()
			count += 1
		else:
			s.append(x)
	if count % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for i in range(t):
	a = input()
	l = [int(x) for x in str(a)]
	a0 = l.count(0)
	a1 = l.count(1)
	if min(a0, a1) % 2:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	s = input()
	x = s.count('10') + s.count('01')
	ans = 0
	while x > 0:
		ans += s.count('10')
		s = s.replace('10', '')
		ans += s.count('01')
		s = s.replace('01', '')
		x = s.count('10') + s.count('01')
	if ans % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	s = input()
	alts = 0
	i = 0
	stack = []
	for i in range(len(s)):
		if i == 0:
			stack.append(s[i])
		elif stack and stack[-1] != s[i]:
			alts += 1
			stack.pop(0)
		else:
			stack.append(s[i])
	if alts % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for i in range(t):
	string = input()
	qtd_0 = 0
	qtd_1 = 0
	for l in string:
		if l == '0':
			qtd_0 += 1
		else:
			qtd_1 += 1
	pares = min(qtd_0, qtd_1)
	if pares == 0 or pares % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
while t:
	s0 = 0
	s1 = 0
	s = input()
	for i in s:
		if i == '0':
			s0 += 1
		else:
			s1 += 1
	m = min(s0, s1)
	if m % 2 == 0:
		print('NET')
	else:
		print('DA')
	t = t - 1


import os
import sys
from io import BytesIO, IOBase
import threading
from math import floor, ceil
from heapq import heappop, heappush, heapify
mod = 10 ** 9 + 7

def main():
	for _ in range(int(input())):
		s = input()
		g = 0
		cnt_0 = 0
		cnt_1 = 0
		for i in s:
			if i == '0':
				if cnt_1:
					cnt_1 -= 1
					g += 1
				else:
					cnt_0 += 1
			elif cnt_0:
				cnt_0 -= 1
				g += 1
			else:
				cnt_1 += 1
		if g % 2 == 1:
			print('DA')
		else:
			print('NET')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


t = int(input())
while t:
	s = input()
	ones = 0
	zeros = 0
	for (a, b) in enumerate(s):
		if b == '1':
			ones = ones + 1
		else:
			zeros = zeros + 1
	x = min(ones, zeros)
	if x == 0:
		print('NET')
	elif x % 2 == 1:
		print('DA')
	else:
		print('NET')
	t = t - 1


from sys import stdin
from collections import Counter
for _ in range(int(stdin.readline())):
	check = Counter(stdin.readline().strip())
	print('DA' if min(check['0'], check['1']) % 2 == 1 else 'NET')


from sys import stdin, stdout
for _ in range(int(stdin.readline())):
	s = input()
	o = 0
	st = []
	for i in range(len(s)):
		st += [s[i]]
		if len(st) > 1 and st[-1] != st[-2]:
			o += 1
			st.pop()
			st.pop()
	print('DA' if o & 1 else 'NET')


for _ in range(int(input())):
	s = input()
	print('DA' if min(s.count('1'), s.count('0')) & 1 else 'NET')


from collections import Counter
for _ in range(int(input())):
	s = Counter(input())
	a = min(s.get('0', 0), s.get('1', 0))
	if a % 2 == 0:
		print('NET')
	else:
		print('DA')


for i in range(int(input())):
	s = input()
	a = 0
	b = 0
	for i in s:
		if i == '0':
			a += 1
		else:
			b += 1
	if min(a, b) & 1:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	s = input()
	c1 = s.count('1')
	c0 = s.count('0')
	if c1 == c0:
		if c1 % 2:
			print('DA')
		else:
			print('NET')
	elif c1 == 0 or c0 == 0:
		print('NET')
	else:
		p = min(c1, c0)
		if p % 2:
			print('DA')
		else:
			print('NET')


from collections import defaultdict as dd
from collections import deque
import bisect
import heapq

def ri():
	return int(input())

def rl():
	return list(map(int, input().split()))

def solve():
	S = input()
	stack = []
	moves = 0
	for c in S:
		if stack and stack[-1] != c:
			stack.pop()
			moves += 1
		else:
			stack.append(c)
	if moves % 2 == 0:
		print('NET')
	else:
		print('DA')
mode = 'T'
if mode == 'T':
	t = ri()
	for i in range(t):
		solve()
else:
	solve()


for _ in range(int(input())):
	turn = 0
	s = input()
	count1 = 0
	count0 = 0
	for i in range(len(s)):
		if s[i] == '1':
			count1 += 1
		else:
			count0 += 1
	while True:
		if count0 == 0 or count1 == 0:
			break
		else:
			count0 -= 1
			count1 -= 1
			turn += 1
	if turn % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	s = input()
	l = len(s)
	zer = one = 0
	for i in range(len(s)):
		if s[i] == '0':
			zer += 1
		else:
			one += 1
	mm = min(zer, one)
	if mm % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	s = input().strip()
	s = list(s)
	n = len(s)
	i = 1
	ans = 0
	while i < len(s):
		if s[i] != s[i - 1]:
			ans += 1
			s.pop(i)
			s.pop(i - 1)
			if i - 1 >= 0:
				i -= 1
			else:
				i += 1
		else:
			i += 1
	if ans % 2 != 0:
		print('DA')
	else:
		print('NET')


import sys
import bisect as b
import math
from collections import defaultdict as dd
input = sys.stdin.readline
mo = 10 ** 9 + 7

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return int(input())

def pref(a, n, f):
	pre = [0] * n
	if f == 0:
		pre[0] = a[0]
		for i in range(1, n):
			pre[i] = a[i] + pre[i - 1]
	else:
		pre[-1] = a[-1]
		for i in range(n - 2, -1, -1):
			pre[i] = pre[i + 1] + a[i]
	return pre
for i in range(inin()):
	s = sin().strip()
	n = len(s)
	c1 = s.count('1')
	if min(c1, n - c1) % 2 == 1:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	tekst = input()
	(i_zer, i_jeden) = (tekst.count('0'), 0)
	i_jeden = len(tekst) - i_zer
	mniejsze = min(i_zer, i_jeden)
	if mniejsze % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for _ in range(t):
	a = input()
	c = a.count('1')
	d = a.count('0')
	ans = min(c, d)
	if ans % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for i in range(t):
	a = input()
	(zero, one) = (0, 0)
	d = []
	for z in range(len(a)):
		if a[z] == '0':
			zero += 1
		else:
			one += 1
	if zero == 0 or one == 0:
		print('NET')
	elif zero > one and one % 2 == 0:
		print('NET')
	elif zero <= one and zero % 2 == 0:
		print('NET')
	elif zero > one and one % 2 != 0:
		print('DA')
	elif zero <= one and zero % 2 != 0:
		print('DA')


for t in range(int(input())):
	a = list(input())
	x = a.count('1')
	y = a.count('0')
	m = min(x, y)
	if m % 2 != 0:
		print('DA')
	else:
		print('NET')


for i in range(int(input())):
	a = input()
	zero = a.count('0')
	one = a.count('1')
	if min(zero, one) % 2 == 1:
		print('DA')
	else:
		print('NET')


import sys, math
input = lambda : sys.stdin.readline().rstrip()
for _ in range(int(input())):
	mas = []
	s = input()
	for i in s:
		mas.append(i)
	ans = 0
	k = len(mas)
	while True:
		cur = True
		for i in range(k - 1):
			if mas[i] != mas[i + 1]:
				k -= 2
				del mas[i]
				del mas[i]
				ans += 1
				cur = False
				break
		if cur or k <= 1:
			break
	if ans % 2 == 1:
		print('DA')
	else:
		print('NET')


T = int(input().strip())
for case_ in range(1, T + 1):
	s = input().strip()
	cnt = int(0)
	for ch in s:
		if ch == '0':
			cnt = cnt + 1
	if s.__len__() - cnt < cnt:
		cnt = s.__len__() - cnt
	if cnt % 2 == 1:
		print('DA')
	else:
		print('NET')


t = int(input())
for _ in range(t):
	s = list(input())
	no1 = 0
	no0 = 0
	for i in s:
		if int(i) == 1:
			no1 += 1
		else:
			no0 += 1
	no = min(no1, no0)
	if no % 2 == 1:
		print('DA')
	else:
		print('NET')


t = int(input())
for _ in range(t):
	s = input()
	length = len(s)
	zeros = s.count('0')
	ones = s.count('1')
	minm = min(zeros, ones)
	if minm % 2 == 0:
		print('NET')
	else:
		print('DA')


import math
from fractions import Fraction as frac
MOD = 1000000000.0 + 7

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def lcm(a, b):
	return a * b // gcd(a, b)

def solve(case_no):
	s = str(input())
	cnt = 0
	for i in range(len(s)):
		cnt += ord(s[i]) - 48
	print('DA' if min(cnt, len(s) - cnt) % 2 == 1 else 'NET')
t = 1
t = int(input())
for i in range(1, t + 1):
	solve(i)


a = int(input())
for i in range(a):
	b = input()
	c = b.count('1')
	d = b.count('0')
	e = 0
	for i in range(999):
		c -= 1
		d -= 1
		if c < 0 or d < 0:
			break
		e += 1
	if e % 2 == 0:
		print('NET')
	else:
		print('DA')


from sys import stdin
input = stdin.readline
import bisect
import math
for xoxo in range(1):
	for _ in range(int(input())):
		ans = ['DA', 'NET']
		s = input()
		k = s.count('0')
		k = min(len(s) - 1 - k, k) + 1
		print(ans[k % 2])


t = int(input())

def makeMove(seq):
	global s, player1, player2, move
	try:
		index = s.index(seq)
	except:
		return False
	s = s[:index] + '' + s[index + 2:]
	if move == player1:
		move = player2
	else:
		move = player1
	return True
for _ in range(t):
	s = input()
	player1 = 0
	player2 = 1
	move = player1
	while s:
		isMovePossible = makeMove('01')
		if isMovePossible:
			continue
		else:
			isMovePossible = makeMove('10')
			if isMovePossible:
				continue
			else:
				break
	if move == player2:
		print('DA')
	else:
		print('NET')


def games(s):
	if s.count('0') == 0 or s.count('1') == 0:
		return 'NET'
	flag = True
	while True:
		if flag == True:
			if '01' in s:
				s = s.replace('01', '', 1)
				flag = False
			elif '10' in s:
				s = s.replace('10', '', 1)
				flag = False
			elif '10' not in s and '01' not in s:
				return 'NET'
			if not s:
				return 'DA'
		if flag == False:
			if '01' in s:
				s = s.replace('01', '', 1)
				flag = True
			elif '10' in s:
				s = s.replace('10', '', 1)
				flag = True
			elif '10' not in s and '01' not in s:
				return 'DA'
			if not s:
				return 'NET'
t = int(input())
for i in range(t):
	s = input()
	print(games(s))


for i in range(int(input())):
	s = input()
	i = 0
	c = 0
	c1 = s.count('1')
	c2 = s.count('0')
	if min(c1, c2) == 0:
		print('NET')
	elif min(c1, c2) % 2 == 0:
		print('NET')
	else:
		print('DA')


n = int(input())
for i in range(n):
	s = str(input())
	count = 0
	flag = s.find('01')
	while flag != -1:
		count += 1
		if flag + 2 < len(s):
			s = s[:flag] + s[flag + 2:]
		else:
			s = s[:flag]
		flag = s.find('01')
	flag = s.find('10')
	while flag != -1:
		count += 1
		if flag + 2 < len(s):
			s = s[:flag] + s[flag + 2:]
		else:
			s = s[:flag]
		flag = s.find('10')
	if count % 2 == 0:
		print('NET')
	else:
		print('DA')


import os
import sys
debug = True
if debug and os.path.exists('input.in'):
	input = open('input.in', 'r').readline
else:
	debug = False
	input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return s[:len(s) - 1]

def invr():
	return map(int, input().split())
test_count = int(input())
for t in range(test_count):
	if debug:
		print('Test Case #', t + 1)
	s = insr()
	x = min(s.count('0'), s.count('1'))
	if x % 2 == 1:
		print('DA')
	else:
		print('NET')


t = int(input())
for _ in range(t):
	s = input()
	n = len(s)
	n0 = 0
	n1 = 0
	for i in range(n):
		if s[i] == '0':
			n0 += 1
		else:
			n1 += 1
	mn = min(n0, n1)
	if mn % 2 == 0:
		print('NET')
	else:
		print('DA')


def main():
	t = int(input())
	for g in range(t):
		s = input()
		count_0 = 0
		count_1 = 0
		count = 0
		for i in s:
			if i == '0':
				if count_1 > 0:
					count_1 -= 1
					count += 1
				else:
					count_0 += 1
			elif count_0 > 0:
				count_0 -= 1
				count += 1
			else:
				count_1 += 1
		if count % 2 == 1:
			print('DA')
		else:
			print('NET')
main()


import math

def isPrimes2(n):
	if n > 1:
		if n == 2:
			return True
		if n % 2 == 0:
			return False
		for x in range(3, int(math.sqrt(n) + 1), 2):
			if n % x == 0:
				return False
		return True
	return False

def main():
	t = int(input())
	for i in range(t):
		s = input()
		c0 = 0
		c1 = 0
		for j in range(len(s)):
			if s[j] == '0':
				c0 += 1
			else:
				c1 += 1
		c = min(c0, c1)
		if c % 2 == 1:
			print('DA')
		else:
			print('NET')
main()


for _ in range(int(input())):
	a = input()
	n = len(a)
	s = []
	for i in range(n):
		s.append(int(a[i]))
	if n == 1:
		print('NET')
	else:
		cnt = 1
		while True:
			f = 0
			for i in range(n - 1):
				if s[i] != -1:
					j = i + 1
					while j < n:
						if s[j] != -1:
							break
						j += 1
					if j == n:
						f = 0
						break
					if s[i] != s[j]:
						f = 1
						s[i] = -1
						s[j] = -1
						break
			if f == 0:
				break
			cnt += 1
		if cnt % 2 == 0:
			print('DA')
		else:
			print('NET')


t = int(input())
for _ in range(t):
	s = input()
	flag = 0
	while True:
		i = s.find('01')
		if i == -1:
			i = s.find('10')
		if i == -1:
			if flag == 0:
				print('NET')
				break
			else:
				print('DA')
				break
		s = s[:i] + s[i + 2:]
		if flag == 0:
			flag = 1
		else:
			flag = 0


q = int(input())
for _ in range(q):
	s = input()
	z = s.count('0')
	j = s.count('1')
	cyk = min(z, j)
	if cyk % 2 == 1:
		print('DA')
	else:
		print('NET')


import sys
import math
import collections
import heapq
import queue
import itertools
import functools
import operator
import time
readline = sys.stdin.readline
IPS = lambda : readline().rstrip()
IP = lambda : int(readline().rstrip())
MP = lambda : map(int, readline().split())
LS = lambda : list(map(int, readline().split()))

def solve():
	for _ in range(IP()):
		st = IPS()
		if len(st) <= 1:
			print('NET')
		else:
			(i, cnt) = (0, 0)
			while i < len(st) - 1:
				if st[i] != st[i + 1]:
					newst = st[:i] + st[i + 2:]
					st = newst
					cnt += 1
					if i > 0:
						i -= 1
				else:
					i += 1
			if cnt & 1:
				print('DA')
			else:
				print('NET')
solve()


def func(n):
	for i in range(n):
		k = input()
		counter = 0
		i = 0
		while i + 1 < len(k):
			if k[i] + k[i + 1] == '01' or k[i] + k[i + 1] == '10':
				k = k[:i] + k[i + 2:]
				counter += 1
				i = 0
			else:
				i += 1
		if counter % 2 != 0:
			print('DA')
		else:
			print('NET')
n = int(input())
func(n)


t = int(input())
for j in range(t):
	s = input()
	c = 0
	for i in range(len(s)):
		if s[i] == '0':
			c += 1
	x = min(c, len(s) - c)
	if x % 2 == 1:
		print('DA')
	else:
		print('NET')


t = int(input())
while t > 0:
	t = t - 1
	s = input()
	x = s.count('0')
	y = s.count('1')
	c = min(x, y)
	if c % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for i in range(t):
	s = input()
	c = 0
	while True:
		if '01' in s:
			s = s.replace('01', '', 1)
			c += 1
		elif '10' in s:
			s = s.replace('10', '', 1)
			c += 1
		else:
			break
	if c % 2 != 0:
		print('DA')
	else:
		print('NET')


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	S = input().rstrip()
	zero = 0
	one = 0
	for i in range(len(S)):
		if S[i] == '0':
			zero += 1
		else:
			one += 1
	X = min(zero, one)
	if X & 1:
		print('DA')
	else:
		print('NET')


tests = int(input())
for tst in range(tests):
	s = input()
	a = [[s[0], 1]]
	for i in range(1, len(s)):
		if s[i] == s[i - 1]:
			a[-1][1] += 1
		else:
			a.append([s[i], 1])
	ans = 0
	(l, r) = (0, 1)
	while l < len(a) and r < len(a):
		if a[l][1] < a[r][1]:
			a[r][1] -= a[l][1]
			ans += a[l][1]
			a[l][1] = 0
			l += 2
		elif a[r][1] < a[l][1]:
			a[l][1] -= a[r][1]
			ans += a[r][1]
			a[r][1] = 0
			r += 2
		else:
			ans += a[l][1]
			a[l][1] = 0
			a[r][1] = 0
			l += 2
			r += 2
	if ans % 2 == 1:
		print('DA')
	else:
		print('NET')


def solve():
	s = input()
	k = s.count('0')
	x = min(k, len(s) - k)
	if x % 2:
		print('DA')
	else:
		print('NET')
t = int(input())
for _ in range(t):
	solve()


def allCharactersSame(s):
	n = len(s)
	for i in range(1, n):
		if s[i] != s[0]:
			return False
	return True
for _ in range(int(input())):
	flag = 0
	li = str(input())
	while allCharactersSame(li) == False:
		if '01' in li:
			li = li.replace('01', '', 1)
			flag += 1
		elif '10' in li:
			li = li.replace('10', '', 1)
			flag += 1
	if flag % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for i in range(t):
	binario = input()
	lista = list(binario)
	if '1' not in binario or '0' not in binario:
		print('NET')
	else:
		tamanho = len(binario)
		moves = 0
		i = 0
		while i < len(lista) - 1:
			if lista[i] == '1' and lista[i + 1] == '0' or (lista[i] == '0' and lista[i + 1] == '1'):
				lista.pop(i)
				lista.pop(i)
				i = -1
				tamanho -= 2
				moves += 1
			i += 1
		if moves % 2 == 0:
			print('NET')
		else:
			print('DA')


n1 = int(input())
for x in range(n1):
	n2 = input()
	awin = 'DA'
	i = 0
	while True:
		if len(n2) == 0 and i % 2 == 0:
			awin = 'NET'
			break
		else:
			pr = 'NO'
			for x in range(len(n2) - 1):
				if n2[x] != n2[x + 1]:
					pr = 'YES'
					if x == 0 and len(n2) == 2:
						n2 = ''
					elif x == 0 and len(n2) > 2:
						n2 = n2[2:]
					elif x == len(n2) - 2:
						n2 = n2[:x]
					else:
						n2 = n2[:x] + n2[x + 2:]
					break
			if pr == 'NO' and i % 2 == 0:
				awin = 'NET'
				break
			elif pr == 'NO' and i % 2 != 0:
				awin = 'DA'
				break
			else:
				i = i + 1
	print(awin)


t = int(input())
s = list()
for x in range(t):
	s.append(input())
for y in range(t):
	c = 0
	while '01' in s[y]:
		s[y] = s[y].replace('01', '', 1)
		c += 1
	while '10' in s[y]:
		s[y] = s[y].replace('10', '', 1)
		c += 1
	if c % 2 == 1:
		print('DA')
	else:
		print('NET')


import sys
t = int(sys.stdin.readline())
while t:
	s = sys.stdin.readline()
	stack = []
	count = 0
	for e in s:
		if e == '1':
			if stack and stack[-1] == '0':
				stack.pop()
				count += 1
			else:
				stack.append(e)
		elif e == '0':
			if stack and stack[-1] == '1':
				stack.pop()
				count += 1
			else:
				stack.append(e)
	if count % 2 == 0:
		print('NET')
	else:
		print('DA')
	t -= 1


for j in range(int(input())):
	s = input()
	if min(s.count('0'), s.count('1')) % 2 == 1:
		print('da')
	else:
		print('net')


import math
import collections

def inpu():
	return input().split(' ')

def inti(a):
	for i in range(len(a)):
		a[i] = int(a[i])
	return a

def inp():
	a = inpu()
	a = inti(a)
	return a

def binary_search(arr, x):
	low = 0
	high = len(arr) - 1
	mid = 0
	while low <= high:
		mid = (high + low) // 2
		if arr[mid] < x:
			low = mid + 1
		elif arr[mid] > x:
			high = mid - 1
		else:
			return mid
	return -1
for _ in range(int(input())):
	a = input()
	if '1' not in a:
		print('NET')
		continue
	elif '0' not in a:
		print('NET')
		continue
	n = len(a)
	ones = 0
	zero = 0
	for i in range(n):
		if a[i] == '0':
			zero += 1
		else:
			ones += 1
	if min(ones, zero) % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
while t:
	s = input()
	c = 0
	while len(s) > 0:
		left = -1
		right = -1
		for i in range(1, len(s)):
			if s[i] != s[i - 1]:
				left = i - 1
				right = i
		if left == -1:
			break
		else:
			s = s[:left] + s[right + 1:]
			c += 1
	if c % 2 == 0:
		print('NET')
	else:
		print('DA')
	t -= 1


for _ in range(int(input())):
	L = input()
	o = 0
	z = 0
	for i in L:
		if i == '1':
			o += 1
		else:
			z += 1
	if z < o:
		o = z
	if o % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for i in range(t):
	s = input()
	p = -1
	while '01' in s or '10' in s:
		if '01' in s:
			n = s.index('01')
		elif '10' in s:
			n = s.index('10')
		s = s[:n] + s[n + 2:]
		p *= -1
	if p == 1:
		print('DA')
	else:
		print('NET')


t = int(input())
while t > 0:
	s = input()
	one = 0
	zero = 0
	l = len(s)
	for i in s:
		if i == '1':
			one += 1
		else:
			zero += 1
	if one == 0 or zero == 0:
		print('NET')
	else:
		Min = one
		if Min > zero:
			Min = zero
		if Min % 2:
			print('DA')
		else:
			print('NET')
	t -= 1


t = int(input())
for _ in range(t):
	s = input()
	a = list(s)
	i = 0
	c = 0
	while i + 1 < len(a):
		if a[i] != a[i + 1]:
			a.pop(i)
			a.pop(i)
			c += 1
			i = 0
		else:
			i += 1
	if c == 0 or c % 2 == 0:
		print('NET')
	else:
		print('DA')


n = int(input())
for i in range(0, n):
	s = str(input())
	rounds = 0
	while '01' in s or '10' in s:
		if '01' in s:
			rounds += 1
			s = s.replace('01', '', 1)
		elif '10' in s:
			rounds += 1
			s = s.replace('10', '', 1)
	if rounds % 2 == 0:
		print('NET')
	else:
		print('DA')


import sys
_INPUT_LINES = sys.stdin.read().splitlines()
input = iter(_INPUT_LINES).__next__
t = int(input())
for zz in range(t):
	s = input()
	ze = s.count('0')
	on = s.count('1')
	le = min(ze, on)
	if le % 2 == 1:
		print('DA')
	else:
		print('NET')


total = 0
a = int(input())
for i in range(a):
	s = input()
	ans = []
	count = 1
	for i in range(1, len(s)):
		if s[i] == s[i - 1]:
			count += 1
		else:
			ans.append(count)
			count = 1
	ans.append(count)
	total = 0
	i = 0
	for i in range(1, len(ans)):
		if i >= 2:
			ans[i] += ans[i - 2]
		if ans[i] > ans[i - 1]:
			total += ans[i - 1]
			ans[i] -= ans[i - 1]
			ans[i - 1] = 0
		else:
			total += ans[i]
			ans[i - 1] = ans[i - 1] - ans[i]
			ans[i] = 0
	if total % 2 == 1:
		print('DA')
	else:
		print('NET')


import math
t = int(input())
for _ in range(t):
	s = input()
	n = len(s)
	l = []
	c = 0
	for i in range(n):
		if i == 0:
			l.append(s[i])
		elif len(l) > 0 and s[i] != l[-1]:
			c = c + 1
			l.pop()
		else:
			l.append(s[i])
	if c % 2 == 0:
		print('NET')
	else:
		print('DA')


def f(n):
	if min(n.count('1'), n.count('0')) % 2 == 0:
		print('NET')
	else:
		print('DA')
x = int(input())
for i in range(x):
	n = input()
	f(n)


line = input()
t = int(line)
for _ in range(t):
	line = input()
	(one, zero) = (line.count('1'), line.count('0'))
	cnt = min(one, zero)
	if cnt % 2:
		print('DA')
	else:
		print('NET')


def main():
	s = input()
	t = 0
	while s:
		c = 0
		for i in range(1, len(s)):
			if s[i] != s[i - 1]:
				t += 1
				c += 1
				s = s[:i - 1] + s[i + 1:]
				break
		if not c:
			break
	print('DA' if t & 1 else 'NET')
t = int(input())
for _ in range(t):
	main()


for adsf in range(int(input())):
	s = input()
	c = min(s.count('0'), s.count('1'))
	print('DA' if c % 2 else 'NET')


for _ in range(int(input())):
	s = input()
	c = 0
	while '01' in s or '10' in s:
		for i in range(len(s) - 1):
			if s[i] == '1' and s[i + 1] == '0':
				s = s[:i] + s[i + 2:]
				c += 1
				break
			elif s[i] == '0' and s[i + 1] == '1':
				s = s[:i] + s[i + 2:]
				c += 1
				break
	print('DA' if c % 2 else 'NET')


for _ in range(int(input())):
	s = list(input())
	x0 = s.count('0')
	x1 = s.count('1')
	if min(x0, x1) % 2 == 0:
		print('NET')
	else:
		print('DA')


z = int(input())
for i in range(z):
	x = input()
	l = list(x)
	c = x.count('0')
	d = x.count('1')
	if c == len(x) or d == len(x):
		print('NET')
	elif min(c, d) % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	s = input()
	prev = None
	ans = min(s.count('0'), s.count('1'))
	print('DA' if ans % 2 else 'NET')


t = int(input())
for i in range(t):
	s = input()
	one_count = len([x for x in s if x == '1'])
	zero_count = len([x for x in s if x == '0'])
	m = min(one_count, zero_count)
	if m % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	s = input()
	(n0, n1) = (0, 0)
	for i in s:
		if i == '0':
			n0 += 1
		else:
			n1 += 1
	if min(n0, n1) % 2 == 0:
		print('NET')
	else:
		print('DA')


def solve(s):
	if min(s.count('0'), s.count('1')) & 1:
		return True
	else:
		return False

def main():
	for _ in range(int(input())):
		s = str(input())
		if solve(s):
			print('DA')
		else:
			print('NET')
main()


import re
pola = '(10)|(01)'
case = int(input())
jumlah = 0
for i in range(case):
	x = input()
	while True:
		if re.search(pola, x):
			jumlah += 1
			y = re.sub(pola, '', x, 1)
			x = y
		else:
			break
	if jumlah % 2 == 0:
		print('NET')
	elif jumlah % 2 == 1:
		print('DA')
	jumlah = 0


import sys
import math
from collections import defaultdict, deque
import heapq
mod = 10 ** 9 + 7
t = int(sys.stdin.readline())
for _ in range(t):
	s = sys.stdin.readline()[:-1]
	(cnt1, cnt0) = (0, 0)
	n = len(s)
	for i in range(n):
		if s[i] == '1':
			cnt1 += 1
		else:
			cnt0 += 1
	x = min(cnt1, cnt0)
	if x % 2 == 0:
		print('NET')
	else:
		print('DA')


import sys

def solve(s):
	ctr = 0
	while len(s) > 1:
		ind = -2
		for g in range(len(s) - 1):
			if s[g] != s[g + 1]:
				ind = g
				break
		if ind == -2:
			break
		s = s[:ind] + s[ind + 2:]
		ctr += 1
	if ctr % 2 == 1:
		return 'DA'
	return 'NET'
t = int(sys.stdin.readline())
ans_arr = []
for i in range(t):
	s = sys.stdin.readline().strip()
	ans_arr.append(str(solve(s)))
print('\n'.join(ans_arr))


import math
import re
for cases in range(int(input())):
	s = input()
	d = len(s)
	count = 0
	for i in range(0, d):
		if '01' or '10' in s:
			if '01' in s:
				s = s.replace('01', '', 1)
				count += 1
			elif '10' in s:
				s = s.replace('10', '', 1)
				count += 1
		else:
			break
	if count % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
while t > 0:
	s = input()
	(c0, c1, c) = (0, 0, 0)
	for i in range(len(s)):
		if s[i] == '0':
			if c1 > c0:
				c1 -= 1
				c += 1
			else:
				c0 += 1
		elif c0 > c1:
			c0 -= 1
			c += 1
		else:
			c1 += 1
	if c % 2 == 0:
		print('NET')
	else:
		print('DA')
	t -= 1


t = int(input())
for _ in range(t):
	s = input()
	n = len(s)
	one = s.count('1')
	zeros = s.count('0')
	x = min(one, zeros)
	if x % 2 == 0:
		print('NET')
	else:
		print('DA')


ans = []
n = int(input())
for i in range(n):
	s = input()
	l = len(s)
	c_0 = s.count('0')
	c_1 = l - c_0
	ans.append(min(c_0, c_1))
for i in ans:
	if i % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
a = []
for i in range(t):
	n = input()
	s = 0
	g = 0
	r = 0
	b = 0
	h = len(n) // 2
	for i in range(len(n) // 2):
		g = n.count('01')
		b += g
		n = n.replace('01', '')
		r = n.count('10')
		b += r
		n = n.replace('10', '')
	if len(n) == 2 and n[0] != n[1]:
		a.append('DA')
	elif b % 2 != 0:
		a.append('DA')
	else:
		a.append('NET')
for i in a:
	print(i)


import re
a = int(input())
for i in range(a):
	s = input()
	x = len(re.findall('0', s))
	y = len(re.findall('1', s))
	if x < y:
		k = x
	else:
		k = y
	if k % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for i in range(t):
	s = input()
	n = len(s)
	r = 0
	q = 0
	for j in s:
		if j == '1':
			r += 1
		else:
			q += 1
	f = abs(r - q)
	e = min(r, q)
	if e % 2 == 0 and f != 0:
		print('NET')
	elif e % 2 != 0 and f != 0:
		print('DA')
	elif f == 0:
		if r % 2 == 0:
			print('NET')
		else:
			print('DA')


n = int(input())
g = '01'
d = '10'
for i in range(n):
	a = input()
	if g in a or d in a:
		q = a.count('0')
		s = a.count('1')
		if q >= s:
			j = s
		elif s >= q:
			j = q
		else:
			j = q
		if j % 2 == 0:
			print('NET')
		else:
			print('DA')
	else:
		print('NET')


for t in range(int(input())):
	s = input()
	turn = 0
	i = 0
	while i < len(s) - 1:
		if s[i] != s[i + 1]:
			turn += 1
			s = s[:i] + s[i + 2:]
			i = -1
		i += 1
	if turn % 2 == 1:
		ans = 'DA'
	else:
		ans = 'NET'
	print(ans)


import sys
INF = 10 ** 20
MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
from math import gcd
from math import ceil
from collections import defaultdict as dd, Counter
from bisect import bisect_left as bl, bisect_right as br

def solve():
	s = input()
	stack = []
	cnt = 0
	for i in range(len(s)):
		if stack and stack[-1] != s[i]:
			cnt += 1
			stack.pop()
			continue
		stack.append(s[i])
	if cnt % 2:
		print('DA')
	else:
		print('NET')
(t,) = I()
while t:
	t -= 1
	solve()


def canDelete(s):
	for i in range(len(s) - 1):
		if s[i] != s[i + 1]:
			return i
	return -1
for _ in range(int(input())):
	s = input()
	turn = 'Alice'
	delIndex = canDelete(s)
	while delIndex != -1:
		pref = s[:delIndex]
		suff = s[delIndex + 2:]
		s = pref + suff
		if turn == 'Alice':
			turn = 'Bob'
		else:
			turn = 'Alice'
		delIndex = canDelete(s)
	if turn == 'Alice':
		print('NET')
	else:
		print('DA')


t = int(input())
for kase in range(t):
	s = input()
	c0 = s.count('0')
	c1 = s.count('1')
	rd = min(c0, c1)
	if rd % 2 == 1:
		print('DA')
	else:
		print('NET')


t = int(input())
for _ in range(t):
	n = input()
	zero = n.count('0')
	one = n.count('1')
	mn = min(zero, one)
	if mn % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for i in range(t):
	s = input()
	(one, zero) = (0, 0)
	for j in range(len(s)):
		if s[j] == '1':
			one = one + 1
		else:
			zero = zero + 1
	ans = min(one, zero)
	if ans % 2 != 0:
		print('DA')
	else:
		print('NET')


query = int(input())
for i in range(query):
	s = list(input())
	count1 = 0
	count0 = 0
	for j in range(len(s)):
		if s[j] == '0':
			count0 += 1
		else:
			count1 += 1
	ans = min(count1, count0)
	if ans % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	s = list(input())
	a = s.count('1')
	b = s.count('0')
	if a == 0 and b == 0:
		print('NET')
	elif a % 2 == 0 and b % 2 == 0:
		print('NET')
	elif a % 2 == 1 and b % 2 == 1:
		print('DA')
	else:
		minn = a
		if a > b:
			minn = b
		if minn % 2 == 0:
			print('NET')
		else:
			print('DA')


for _ in range(int(input())):
	s = input()
	mov = 0
	while '01' in s or '10' in s:
		if '01' in s:
			ind = s.index('01')
			s = list(s)
			s.pop(ind)
			s.pop(ind)
			s = ''.join(s)
			if mov == 0:
				mov = 1
			else:
				mov = 0
		elif '10' in s:
			ind = s.index('10')
			s = list(s)
			s.pop(ind)
			s.pop(ind)
			s = ''.join(s)
			if mov == 0:
				mov = 1
			else:
				mov = 0
	if mov == 1:
		print('DA')
	else:
		print('NET')


t = int(input())
for i in range(t):
	s = input()
	i = 0
	a = 0
	b = 0

	def dec(s):
		f = s.find('01')
		g = s.find('10')
		if f == -1:
			f = 0
		else:
			f = 1
		if g == -1:
			g = 0
		else:
			g = 1
		return f or g

	def che(s):
		f = s.find('01')
		g = s.find('10')
		if f == -1:
			f = 0
		else:
			f = 1
		if g == -1:
			g = 0
		else:
			g = 1
	while dec(s):
		if i % 2 == 0:
			p = s.find('01')
			if p != -1:
				s = s[:p] + s[p + 2:]
			else:
				q = s.find('10')
				s = s[:q] + s[q + 2:]
			a += 1
		elif i % 2 != 0:
			p = s.find('01')
			if p != -1:
				s = s[:p] + s[p + 2:]
			else:
				p2 = s.find('10')
				s = s[:p2] + s[p2 + 2:]
			b = b + 1
		else:
			break
		i += 1
	if a > b:
		print('DA')
	else:
		print('NET')


def count(st):
	for i in range(len(st) - 1):
		if st[i] != st[i + 1]:
			return count(st[:i] + st[i + 2:]) + 1
	return 0
t = int(input())
for i in range(t):
	st = input()
	if count(st) % 2 == 1:
		print('DA')
	else:
		print('NET')


n = int(input())
while n:
	s = list(input())
	thingy = min(s.count('1'), s.count('0'))
	if thingy % 2:
		print('DA')
	else:
		print('NET')
	n -= 1


for case in range(int(input())):
	nums = input()
	count = min(nums.count('0'), nums.count('1'))
	print('DA' if count % 2 else 'NET')


q = int(input())
for i in range(q):
	s = input()
	o = int(0)
	z = int(0)
	for i in range(int(len(s))):
		if s[i] == '0':
			o += 1
		else:
			z += 1
	if o > z:
		o = z
	if o % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	str1 = str(input())
	a = 0
	b = 0
	for i in range(len(str1)):
		if str1[i] == '0':
			a += 1
		else:
			b += 1
	if a >= b:
		if b % 2 == 0:
			print('NET')
		else:
			print('DA')
	elif a % 2 == 0:
		print('NET')
	else:
		print('DA')


for i in range(int(input())):
	string = input()
	min_count = min(string.count('0'), string.count('1'))
	print('DA') if min_count % 2 == 1 else print('NET')


t = int(input())
while t:
	s = input()
	s = list(s)
	c = 0
	while 1 and len(s):
		i = 0
		f = 1
		while i < len(s) - 1:
			if s[i] == '0' and s[i + 1] == '1' or (s[i] == '1' and s[i + 1] == '0'):
				s.pop(i)
				s.pop(i)
				c += 1
				f = 0
			else:
				i += 1
		if f == 1:
			break
	if c % 2 == 0:
		print('NET')
	else:
		print('DA')
	t -= 1


import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__
t = int(input())
for _ in range(t):
	string = input()
	stack = []
	ans = 0
	for x in string:
		if not len(stack):
			stack.append(x)
		elif stack[-1] == x:
			stack.append(x)
		else:
			stack.pop()
			ans += 1
	print('DA' if ans & 1 else 'NET')


t = int(input())
for _ in range(t):
	s = list(input())
	p = 1
	boo = True
	while boo:
		n = len(s)
		boo = False
		for i in range(n - 1):
			if s[i] != s[i + 1]:
				p += 1
				del s[i]
				del s[i]
				boo = True
				break
	if p % 2 == 0:
		print('DA')
	else:
		print('NET')


test = int(input())
for _ in range(test):
	s = list(input())
	ones = 0
	zero = 0
	for i in range(len(s)):
		if s[i] == '1':
			ones += 1
		else:
			zero += 1
	pairs = min(zero, ones)
	if pairs % 2:
		print('DA')
	else:
		print('NET')


from sys import stdin, stdout
LI = lambda : list(map(int, input().split()))
MAP = lambda : map(int, input().split())
IN = lambda : int(input())
S = lambda : input()
import math

def p(a):
	print(' '.join(list(map(str, a))))
from collections import Counter

def solve():
	s = S()
	o = s.count('0')
	one = s.count('1')
	m = min(o, one)
	if m % 2:
		print('DA')
	else:
		print('NET')
for i in range(IN()):
	solve()


for i in range(int(input())):
	s = input()
	cnt = 0
	while s.count('01') or s.count('10'):
		cnt += 1
		if len(s) <= 2:
			s = ''
			break
		if s.count('01'):
			s = s[:s.index('01')] + s[s.index('01') + 2 % len(s):]
		else:
			s = s[:s.index('10')] + s[s.index('10') + 2 % len(s):]
	if cnt % 2 != 0:
		print('DA')
	else:
		print('NET')


T = int(input())
while T > 0:
	s = input()
	ones = 0
	zeros = 0
	pair = 0
	for i in range(len(s)):
		if s[i] == '0':
			if ones > 0:
				ones -= 1
				pair += 1
			else:
				zeros += 1
		elif zeros > 0:
			zeros -= 1
			pair += 1
		else:
			ones += 1
	if pair % 2 == 1:
		print('DA')
	else:
		print('NET')
	T -= 1


from sys import stdin
from math import ceil
inp = lambda : stdin.readline().strip()
t = int(inp())
for _ in range(t):
	s = inp()
	one = 0
	zero = 0
	for i in s:
		if i == '0':
			zero += 1
		else:
			one += 1
	minimum = min(one, zero)
	if minimum % 2:
		print('DA')
	else:
		print('NET')


from sys import stdin, stdout
import sys
INF = 100000000000.0
import bisect

def get_int():
	return int(stdin.readline().strip())

def get_ints():
	return map(int, stdin.readline().strip().split())

def get_array():
	return list(map(int, stdin.readline().strip().split()))

def get_string():
	return stdin.readline().strip()

def op(c):
	return stdout.write(c)
from collections import defaultdict
import math
for _ in range(int(stdin.readline())):
	s = get_string()
	a = [c for c in s]
	c = 0
	while len(a) > 0:
		for i in range(len(a) - 1):
			if a[i] != a[i + 1]:
				c += 1
				a.pop(i)
				a.pop(i)
				break
		c0 = 0
		c1 = 0
		for i in a:
			if i == '0':
				c0 += 1
			if i == '1':
				c1 += 1
		if c0 == len(a) or c1 == len(a):
			break
	if c % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	s = input()
	ans = 0
	st = []
	for i in s:
		if len(st) and st[-1] != i:
			st.pop(-1)
			ans += 1
		else:
			st.append(i)
	print('DA' if ans % 2 else 'NET')


for tst in range(int(input())):
	s = input()
	if len(s) < 2:
		print('NET')
		continue
	ii = 1
	while 1:
		p = 1
		g = len(s)
		for i in range(g - 1):
			if s[i] == s[i + 1]:
				continue
			else:
				p = 0
				if i + 2 < g:
					s = s[:i] + s[i + 2:]
				else:
					s = s[:i]
				break
		if p == 0:
			ii += 1
		if p or len(s) < 2:
			if ii % 2 == 0:
				print('DA')
			else:
				print('NET')
			break


for t in range(int(input())):
	a = input()
	s = set(a)
	if s == {'0'} or s == {'1'}:
		print('NET')
	else:
		l = list(a)
		x = l.count('1')
		y = l.count('0')
		m = min(x, y)
		if m % 2 == 0:
			print('NET')
		else:
			print('DA')


n = int(input())
for i in range(n):
	x = input()
	x = list(x)
	m = len(x)
	i = 0
	o = 0
	c = 0
	while True:
		i = 0
		if c % 2 == 0:
			while True:
				if i >= len(x) - 1:
					o = 11
					break
				if x[i] != x[i + 1]:
					x.pop(i + 1)
					x.pop(i)
					break
				else:
					i = i + 1
			c = c + 1
		else:
			while True:
				if i >= len(x) - 1:
					o = 12
					break
				if x[i] != x[i + 1]:
					x.pop(i + 1)
					x.pop(i)
					break
				else:
					i = i + 1
			c = c + 1
		if o == 11:
			print('NET')
			break
		elif o == 12:
			print('DA')
			break


t = int(input())
for i in range(t):
	s = input()
	k = 0
	while '01' in s or '10' in s:
		if '01' in s:
			z = s.find('01')
			s = s[:z] + s[z + 2:]
			k += 1
		elif '10' in s:
			z = s.find('10')
			s = s[:z] + s[z + 2:]
			k += 1
		else:
			break
	if k % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	s = input()
	c1 = 0
	c2 = 0
	for i in range(len(s)):
		if s[i] == '1':
			c1 += 1
		else:
			c2 += 1
	ans = min(c1, c2)
	if ans % 2 == 1:
		print('DA')
	else:
		print('NET')


MOD = 1000000007
ii = lambda : int(input())
si = lambda : input()
dgl = lambda : list(map(int, input()))
f = lambda : map(int, input().split())
il = lambda : list(map(int, input().split()))
ls = lambda : list(input())
from collections import *
for _ in range(ii()):
	a = si()
	co = a.count('0')
	cl = a.count('1')
	mi = min(co, cl)
	if mi % 2 == 0:
		print('NET')
	else:
		print('DA')


from collections import Counter
t = int(input())
for _ in range(t):
	s = input()
	c = Counter(s)
	x = c['1']
	y = c['0']
	a = min(x, y)
	if a & 1:
		print('DA')
		continue
	else:
		print('NET')


def homosubstrings(s, c):
	n = len(s)
	spaces = []
	i = 0
	found = False
	while i < n:
		if s[i] != c:
			spaces.append(i)
			found = True
		i += 1
	tspaces = []
	if found:
		i = 1
		if spaces[0] != 0:
			tspaces.append(spaces[0])
		while i < len(spaces):
			if spaces[i] - spaces[i - 1] - 1 != 0:
				tspaces.append(spaces[i] - spaces[i - 1] - 1)
			i += 1
		if spaces[-1] != n - 1 and n - 1 - spaces[-1] != 0:
			tspaces.append(n - 1 - spaces[-1])
	elif i != 0:
		tspaces.append(i)
	return tspaces
t = int(input())
for i in range(t):
	s = input()
	ones = homosubstrings(s, '1')
	zeros = homosubstrings(s, '0')
	if len(ones) == 0 or len(zeros) == 0:
		print('NET')
	else:
		tones = sum(ones)
		tzeros = sum(zeros)
		thing = min(tones, tzeros)
		if thing % 2 == 0:
			print('NET')
		else:
			print('DA')


t = int(input())
while t > 0:
	t -= 1
	s = input()
	val = s.count('0')
	print(min(val, len(s) - val) % 2 and 'DA' or 'NET')


for _ in range(int(input())):
	s = input()
	(o, z) = (s.count('1'), s.count('0'))
	e = min(o, z)
	if e % 2 != 0:
		print('DA')
	else:
		print('NET')


rr = lambda : input().strip()

def solve(s):
	su = 0
	N = len(s)
	for i in range(N):
		if s[i] == '1':
			su += 1
		else:
			su -= 1
	x = (N - abs(su)) // 2
	if x % 2:
		return 'DA'
	else:
		return 'NET'
T = int(rr())
for _ in range(T):
	s = rr()
	ans = solve(s)
	print(ans)


for t in range(int(input())):
	s = list(input())
	count = 0
	while len(s) > 1:
		not_poss = 0
		for i in range(len(s) - 1):
			if s[i] != s[i + 1]:
				s.pop(i)
				s.pop(i)
				count += 1
				not_poss += 1
				break
		if not_poss == 0:
			break
	if count % 2 == 1:
		print('DA')
	else:
		print('NET')


t = int(input())
for _ in range(t):
	s = input().strip()
	c = 0
	temp = [1, 0]
	for i in range(1, len(s)):
		if s[i] != s[i - 1]:
			c ^= 1
		temp[c] += 1
	if min(temp) % 2:
		print('DA')
	else:
		print('NET')


from fractions import Fraction
from collections import defaultdict
import math
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')
krish = 1000
res = krish - 900
t = int(input())
for _ in range(t):
	st = input()
	c1 = 0
	c2 = 0
	for i in range(len(st)):
		if st[i] == '1':
			c1 += 1
		else:
			c2 += 1
	ans = min(c1, c2)
	if ans % 2 == 1:
		print('DA')
	else:
		print('NET')
	res += 1


t = int(input())
for _ in range(t):
	a = input()
	s = [a[0]]
	total = 0
	for i in range(1, len(a)):
		if len(s) == 0:
			s.append(a[i])
			continue
		if a[i] != s[-1]:
			s.pop()
			total += 1
		else:
			s.append(a[i])
	if total % 2 == 0:
		print('NET')
	else:
		print('DA')


import math

def nod(a, b):
	while True:
		if a > b:
			if a % b == 0:
				return b
				break
			else:
				a = a % b
		elif b % a == 0:
			return a
			break
		else:
			b = b % a

def dtod(a):
	s = ''
	while a != 0:
		s += str(a % 2)
		a = int(a / 2)
	return s[::-1]

def _8_(a):
	return a[0] * a[1] * a[2] * a[3] * a[4] * a[5] * a[6] * a[7] * a[8] * a[9]
t = int(input())
for i in range(t):
	s = input()
	zero = 0
	one = 0
	for i in range(len(s)):
		if s[i] == '0':
			zero += 1
		else:
			one += 1
	if min(zero, one) % 2 == 0:
		print('NET')
	else:
		print('DA')


import atexit
import io
import sys
import math
from collections import defaultdict, Counter
t = int(input())
for i in range(t):
	s = input()
	od = 0
	ev = 0
	for j in s:
		if j == '0':
			od += 1
		else:
			ev += 1
	if min(od, ev) & 1:
		print('DA')
	else:
		print('NET')


def main():
	t = int(input())
	for i in range(t):
		s = input()
		zero = s.count('0')
		one = s.count('1')
		if zero >= one:
			if one % 2 == 0:
				print('NET')
			else:
				print('DA')
		elif zero % 2 == 0:
			print('NET')
		else:
			print('DA')
main()


n = int(input())
for i in range(n):
	x = input()
	a = list(x)
	flag = 0
	count = 0
	while 1:
		i = 0
		if count % 2 == 0:
			while 1:
				if i >= len(a) - 1:
					flag = 1
					break
				if a[i] != a[i + 1]:
					a.pop(i + 1)
					a.pop(i)
					break
				else:
					i = i + 1
			count = count + 1
		else:
			while 1:
				if i >= len(a) - 1:
					flag = 2
					break
				if a[i] != a[i + 1]:
					a.pop(i + 1)
					a.pop(i)
					break
				else:
					i = i + 1
			count = count + 1
		if flag == 1:
			print('NET')
			break
		elif flag == 2:
			print('DA')
			break


t = int(input())
for _ in range(t):
	a = input()
	wa = 0
	for i in range(len(a) - 1):
		if a[i] != a[i + 1]:
			wa += 1
	if wa == 0:
		print('NET')
	else:
		a1 = a.count('1')
		a2 = a.count('0')
		hod = 0
		while a1 != 0 and a2 != 0:
			a1 -= 1
			a2 -= 1
			hod += 1
		if hod % 2 == 1:
			print('DA')
		else:
			print('NET')


t = int(input())
for i in range(t):
	s = input()
	list1 = list(s)
	c = 0
	d = 0
	for j in range(0, len(list1)):
		if list1[j] == '1':
			c = c + 1
		else:
			d = d + 1
	chal = min(c, d)
	if chal % 2 != 0:
		print('DA')
	else:
		print('NET')


t = int(input())
for _ in range(t):
	s = input()
	(c_0, c_1) = (0, 0)
	for i in range(len(s)):
		if s[i] == '0':
			c_0 += 1
		else:
			c_1 += 1
	if c_1 == len(s) or c_0 == len(s):
		print('NET')
	elif c_0 < c_1:
		if c_0 % 2 == 0:
			print('NET')
		else:
			print('DA')
	elif c_0 == c_1:
		if c_0 % 2 == 0:
			print('NET')
		else:
			print('DA')
	elif c_1 % 2 == 0:
		print('NET')
	else:
		print('DA')


import sys
input = sys.stdin.buffer.readline
T = int(input())
for testcase in range(T):
	s = list(input())
	n = len(s) - 2
	zero = 0
	one = 0
	for e in s:
		if e == 49:
			zero += 1
	one = n - zero
	mi = min(one, zero)
	if mi % 2 == 0:
		print('NET')
	else:
		print('DA')


from sys import stdin, stdout
from collections import Counter
from collections import defaultdict

def ai():
	return list(map(int, stdin.readline().split()))

def ei():
	return map(int, stdin.readline().split())

def ip():
	return int(stdin.readline().strip())

def op(ans):
	return stdout.write(str(ans) + '\n')
for i in range(ip()):
	s = input()
	c0 = s.count('0')
	c1 = s.count('1')
	x = min(c0, c1)
	if x % 2:
		print('DA')
	else:
		print('NET')


testes = int(input())
for i in range(testes):
	palavra = input()
	uns = palavra.count('1')
	zeros = palavra.count('0')
	if uns > zeros:
		if zeros % 2 == 0:
			print('NET')
		else:
			print('DA')
	elif uns % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for _ in range(t):
	l = list(map(int, input()))
	ones = 0
	zeros = 0
	for i in range(len(l)):
		if l[i] == 1:
			ones += 1
		else:
			zeros += 1
	x = min(ones, zeros)
	if x % 2 == 1:
		print('DA')
	else:
		print('NET')


test = int(input())
for iter in range(0, test):
	item = input()
	one = item.count('0')
	two = item.count('1')
	if one != two:
		n = min(one, two)
	else:
		n = one
	if n % 2 == 0:
		print('NET')
	else:
		print('DA')


import sys
input = sys.stdin.readline
t = int(input())
for test in range(t):
	s = input()
	s = s[0:-1]
	zeros = 0
	ones = 0
	for i in range(len(s)):
		if s[i] == '0':
			zeros += 1
		else:
			ones += 1
	pairs = min(zeros, ones)
	if pairs % 2 != 0:
		print('DA')
	else:
		print('NET')


from collections import deque
t = int(input())
for _ in range(t):
	s = input()
	stack = deque()
	moves = 0
	for c in s:
		if stack and stack[-1] != (c == '1'):
			stack.pop()
			moves += 1
		else:
			stack.append(c == '1')
	ans = 'DA' if moves & 1 else 'NET'
	print(ans)


for _ in range(int(input())):
	s = input()
	zeros = len([i for i in s if i == '0'])
	ones = len([i for i in s if i == '1'])
	zeros = min(zeros, ones)
	if zeros % 2 == 1:
		print('DA')
	else:
		print('NET')


from collections import *
for _ in range(int(input())):
	s = []
	l = deque(input())
	c = 0
	for i in range(len(l)):
		if l == []:
			break
		elif s == []:
			s.append(l[0])
			l.popleft()
		elif l[0] == '0' and s[-1] == '1':
			s.pop()
			l.popleft()
			c += 1
		elif l[0] == '1' and s[-1] == '0':
			s.pop()
			l.popleft()
			c += 1
		else:
			s.append(l[0])
			l.popleft()
	if c % 2 == 1:
		print('DA')
	else:
		print('NET')


import sys
import math
strInp = lambda : input().strip().split()
intInp = lambda : list(map(int, strInp()))
for t in range(int(input())):
	s = input()
	moves = 0
	while True:
		p = 0
		for i in range(1, len(s)):
			if s[p] != s[i]:
				s = s[0:p] + s[i + 1:]
				break
			p = i
		else:
			break
		moves += 1
	if moves % 2 == 0:
		print('NET')
	else:
		print('DA')


nu = int(input())
for i in range(0, nu):
	s = str(input())
	d = 0
	while s.find('10') != -1 or s.find('01') != -1:
		if s.find('10') != -1:
			s = s.replace('10', '', 1)
			d += 1
			continue
		if s.find('01') != -1:
			s = s.replace('01', '', 1)
			d += 1
	if d % 2 == 1:
		print('DA')
	else:
		print('NET')


for i in range(int(input())):
	s = input()
	l = len(s)
	if s == '0' * l or s == '1' * l:
		print('NET')
	else:
		cnt = s.count('1')
		c = l - cnt
		mi = min(c, cnt)
		if mi % 2 == 0:
			print('NET')
		else:
			print('DA')


for _ in range(int(input())):
	s = input()
	ct_0 = ct_1 = 0
	for i in s:
		if i == '0':
			ct_0 += 1
		else:
			ct_1 += 1
	ans = min(ct_0, ct_1)
	if ans % 2 == 0:
		print('NET')
	else:
		print('DA')


import math
T = int(input())
for _ in range(T):
	S = input()
	A = min(S.count('1'), S.count('0'))
	if A % 2 == 1:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	s = input()
	count = s.count('0')
	count1 = s.count('1')
	mi = min(count, count1)
	if mi == 1:
		print('DA')
	elif mi == 0:
		print('NET')
	elif mi % 2 == 0:
		print('NET')
	else:
		print('DA')


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	S = list(input())[:-1]
	if min(S.count('0'), S.count('1')) % 2:
		print('DA')
	else:
		print('NET')


n = int(input())
for _ in range(n):
	s = input()
	print(['DA', 'NET'][min(s.count('0'), s.count('1')) % 2 == 0])


for i in range(int(input())):
	a = input()
	z = a.count('0')
	o = a.count('1')
	if z == o:
		if z % 2 == 0:
			print('NET')
		else:
			print('DA')
	if z != o:
		if min(z, o) % 2 == 0:
			print('NET')
		else:
			print('DA')


from sys import stdin, stdout
t = int(stdin.readline().strip())
for _ in range(t):
	s = stdin.readline().strip()
	if min(s.count('0'), s.count('1')) % 2 == 0:
		stdout.write('NET' + '\n')
	else:
		stdout.write('DA' + '\n')


for _ in range(int(input())):
	s = input()
	(s1, s2) = (s.count('0'), s.count('1'))
	if s1 >= s2:
		if s2 % 2 != 0:
			print('DA')
		else:
			print('NET')
	elif s1 < s2:
		if s1 % 2 != 0:
			print('DA')
		else:
			print('NET')


import sys
import math
import itertools
import functools
import collections
import operator
import fileinput
import copy
ORDA = 97

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return [int(i) for i in input().split()]

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def revn(n):
	return str(n)[::-1]

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=1):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base):
	newnumber = 0
	while number > 0:
		newnumber += number % base
		number //= base
	return newnumber

def cdiv(n, k):
	return n // k + (n % k != 0)

def ispal(s):
	for i in range(len(s) // 2 + 1):
		if s[i] != s[-i - 1]:
			return False
	return True
for _ in range(ii()):
	s = input()
	(zero, one) = (s.count('0'), s.count('1'))
	if min(zero, one) % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for _ in range(t):
	s = input()
	ze = s.count('0')
	on = len(s) - ze
	print('DA' if min(on, ze) % 2 else 'NET')


x = int(input())
a = []
for i in range(x):
	g = input()
	one = 0
	zero = 0
	for i in g:
		if i == '1':
			one += 1
		else:
			zero += 1
	t = 0
	while one > 0 and zero > 0:
		one -= 1
		zero -= 1
		t += 1
	if t % 2 == 0:
		a.append('NET')
	else:
		a.append('DA')
for i in range(x):
	print(a[i])


t = int(input())
for _ in range(t):
	s = input()
	one_count = s.count('1')
	zero_count = s.count('0')
	c = min(one_count, zero_count)
	print('DA' if c % 2 == 1 else 'NET')


t = int(input())
for _ in range(t):
	l = [int(x) for x in input()]
	ones = 0
	for x in l:
		if x == 1:
			ones += 1
	val = min(ones, len(l) - ones)
	if val % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for i in range(t):
	s = input()
	a = s.count('1')
	d = len(s) - a
	k = min(a, d)
	if k % 2 == 1:
		print('DA')
	else:
		print('NET')


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def fact(x):
	if x == 0:
		return 1
	else:
		return x * fact(x - 1)

def lower_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] >= num:
			answer = middle
			end = middle - 1
		else:
			start = middle + 1
	return answer

def upper_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] <= num:
			answer = middle
			start = middle + 1
		else:
			end = middle - 1
	return answer

def abs(x):
	return x if x >= 0 else -x

def binary_search(li, val, lb, ub):
	ans = 0
	while lb <= ub:
		mid = (lb + ub) // 2
		if li[mid] > val:
			ub = mid - 1
		elif val > li[mid]:
			lb = mid + 1
		else:
			ans = 1
			break
	return ans

def sieve_of_eratosthenes(n):
	ans = []
	arr = [1] * (n + 1)
	(arr[0], arr[1], i) = (0, 0, 2)
	while i * i <= n:
		if arr[i] == 1:
			j = i + i
			while j <= n:
				arr[j] = 0
				j += i
		i += 1
	for k in range(n):
		if arr[k] == 1:
			ans.append(k)
	return ans

def nc2(x):
	if x == 1:
		return 0
	else:
		return x * (x - 1) // 2
from math import *
for _ in range(int(input())):
	string = input()
	check = min(string.count('1'), string.count('0'))
	if check & 1:
		print('DA')
	else:
		print('NET')


for t in range(int(input())):
	s = input()
	m = min(s.count('0'), s.count('1'))
	f = 0
	if m & 1:
		f = 1
	print('NDEAT'[f::2])


def run():
	import sys
	sys.stdin = open('/home/punit/Documents/Cpp Programs/input.txt', 'r')
	sys.stdout = open('/home/punit/Documents/Cpp Programs/output.txt', 'w')
	from math import ceil, sqrt, floor
for _ in range(int(input())):
	s = input()
	a1 = s.count('0')
	a2 = s.count('1')
	re = min(a1, a2)
	if re % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	s = input()
	(f, o) = (0, 0)
	for i in s:
		if i == '1':
			f += 1
		else:
			o += 1
	c = 0
	while f > 0 and o > 0:
		f -= 1
		o -= 1
		c += 1
	if c % 2:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	s = input()
	n = len(s)
	l = [s[0]]
	c = 0
	for i in range(1, n):
		if len(l) > 0:
			if l[-1] != s[i]:
				c += 1
				l.pop(-1)
			else:
				l.append(s[i])
		else:
			l.append(s[i])
	if c % 2 == 1:
		print('DA')
	else:
		print('NET')


def read_list():
	return list(map(int, input().strip().split(' ')))

def print_list(l):
	print(' '.join(map(str, l)))
N = int(input())
for _ in range(N):
	s = input()
	a = s.count('1')
	b = len(s) - a
	if min(a, b) & 1 == 1:
		print('DA')
	else:
		print('NET')


from sys import stdin

def help():
	stri = stdin.readline().strip()
	n1 = stri.count('0')
	n2 = stri.count('1')
	nn = min(n1, n2)
	if nn % 2 == 1:
		print('DA')
	else:
		print('NET')
for _ in range(int(stdin.readline())):
	help()


for _ in range(int(input())):
	s = input()
	h = [0, 0]
	for i in s:
		h[int(i)] += 1
	ans = min(h[0], h[1])
	if ans % 2:
		print('DA')
		continue
	print('NET')


import math
b = int(input())
for k in range(b):
	a = input()
	c = a.count('0')
	d = a.count('1')
	if min(c, d) % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
ans = []
for i in range(t):
	s = input()
	count = 0
	if s.count('1') >= s.count('0'):
		count = s.count('0')
	else:
		count = s.count('1')
	if count % 2 == 0:
		ans.append('NET')
	else:
		ans.append('DA')
for i in ans:
	print(i)


from copy import *
from math import *
import sys
t = int(input())
for i in range(t):
	s = input()
	c1 = s.count('1')
	c0 = s.count('0')
	c = min(c1, c0)
	if c % 2 == 0:
		print('NET')
	else:
		print('DA')


from math import *
from itertools import *
from collections import *

def ii():
	return int(input())

def mas():
	return [int(i) for i in input().split()]

def mapis():
	return map(int, input().split())
INF = 1000000000.0 + 1

def solve():
	s = input()
	Alice = 0
	i = 1
	while s.count('01') != 0 or s.count('10') != 0:
		if s.count('01') == 0:
			s = s.replace('10', '', 1)
		else:
			s = s.replace('01', '', 1)
		if i % 2 == 1:
			Alice = 1
		else:
			Alice = 0
		i += 1
	if Alice:
		print('DA')
	else:
		print('NET')

def main():
	t = ii()
	while t:
		solve()
		t -= 1
main()


import math
for _ in range(int(input())):
	st = list(input())
	a = st.count('1')
	b = st.count('0')
	if a == 0 or b == 0:
		print('NET')
	elif a % 2 == 0 and b % 2 == 0:
		print('NET')
	elif a % 2 != 0 and b % 2 != 0:
		print('DA')
	elif a > b:
		if b % 2 == 0:
			print('NET')
		else:
			print('DA')
	elif b > a:
		if a % 2 == 0:
			print('NET')
		else:
			print('DA')


import os
import operator
from collections import defaultdict
import sys
from io import BytesIO, IOBase

def main():
	for _ in range(int(input())):
		st = input()
		n = len(st)
		ans = 0
		res = []
		for i in range(n):
			if len(res) == 0:
				res.append(st[i])
			elif st[i] != res[-1]:
				ans += 1
				res.pop(-1)
			else:
				res.append(st[i])
		if ans % 2 == 0:
			print('NET')
		else:
			print('DA')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


t = int(input())
for case in range(t):
	s = input()
	moves = 0
	while True:
		if '01' in s:
			s = s.replace('01', '', 1)
			moves += 1
		elif '10' in s:
			s = s.replace('10', '', 1)
			moves += 1
		else:
			break
	if moves % 2 == 1:
		ans = 'DA'
	else:
		ans = 'NET'
	print(ans)


t = int(input())
while t:
	t = t - 1
	s = input()
	ss = list(s)
	ans = 0
	while '10' in s or '01' in s:
		if '10' in s:
			ans += s.count('10')
			s = s.replace('10', '')
		if '01' in s:
			ans += s.count('01')
			s = s.replace('01', '')
	if ans % 2 != 0:
		print('DA')
	else:
		print('NET')


t = int(input())
for i in range(t):
	lis = [int(i) for i in input()]
	co = lis.count(0)
	bo = lis.count(1)
	if min(co, bo) % 2 == 0:
		print('NET')
	else:
		print('DA')


from collections import Counter
for _ in range(int(input())):
	c = Counter(input())
	m = min(c['0'], c['1'])
	print('DA' if m & 1 else 'NET')


t = int(input())
for _ in range(t):
	n = str(input())
	(count_1, count_0) = (0, 0)
	for i in n:
		if i == '1':
			count_1 += 1
		else:
			count_0 += 1
	k = min(count_0, count_1)
	if k & 1:
		print('DA')
	else:
		print('NET')


t = int(input())
for i in range(t):
	s = input()
	count_0 = 0
	for i in s:
		if i == '0':
			count_0 += 1
	count_1 = len(s) - count_0
	if count_0 <= count_1:
		if count_0 % 2 == 0:
			print('NET')
		else:
			print('DA')
	elif count_1 % 2 == 0:
		print('NET')
	else:
		print('DA')


import math
import collections
from sys import stdin, stdout, setrecursionlimit
from bisect import bisect_left as bsl
from bisect import bisect_right as bsr
import heapq as hq
setrecursionlimit(2 ** 20)
t = 1
t = int(stdin.readline())
for _ in range(t):
	s = input()
	cnt = 0
	i = 0
	while i < len(s) - 1:
		if s[i] != s[i + 1]:
			s = s[:i] + s[i + 2:]
			i = 0
			cnt += 1
			continue
		i += 1
	if cnt % 2 == 0:
		print('NET')
	else:
		print('DA')


import math
for t in range(int(input())):
	s = input()
	alice = False
	i = 0
	while '01' in s or '10' in s:
		while i < len(s) - 1:
			if s[i] == '1' and s[i + 1] == '0' or (s[i] == '0' and s[i + 1] == '1'):
				s = s[:i] + s[i + 2:]
				i = -1
				alice = not alice
			i += 1
	if alice:
		print('DA')
	else:
		print('NET')


t = int(input())
while t > 0:
	x = input()
	c1 = 0
	c2 = 0
	for i in x:
		if i == '0':
			c1 += 1
		else:
			c2 += 1
	if c1 == c2:
		if c1 % 2 == 0:
			print('NET')
		else:
			print('DA')
	else:
		d = abs(c1 - c2)
		m = max(c1, c2)
		m -= d
		if m % 2 == 0:
			print('NET')
		else:
			print('DA')
	t -= 1


test = int(input())
for t in range(test):
	s = input()
	ans = 0
	while '01' in s or '10' in s:
		ans += 1
		if '01' in s:
			te = s.index('01')
			s = s[:te] + s[te + 2:len(s)]
		else:
			te = s.index('10')
			s = s[:te] + s[te + 2:len(s)]
	if ans % 2 == 0:
		print('NET')
	else:
		print('DA')


from typing import AnyStr
t = int(input())
answer = []
while t > 0:
	s = input()
	c0 = 0
	c1 = 0
	for i in s:
		if i == '0':
			c0 += 1
		else:
			c1 += 1
	if min(c0, c1) % 2 == 1:
		answer.append('DA')
	else:
		answer.append('NET')
	t -= 1
print('\n'.join(answer))


for _ in range(int(input())):
	s = input()
	(o, z) = (s.count('0'), s.count('1'))
	mv = min(o, z)
	print(['NET', 'DA'][mv % 2])


for _ in range(int(input())):
	s = input()
	a = 0
	b = 0
	i = 0
	while '10' in s or '01' in s:
		if '10' in s:
			s = s.replace('10', '', 1)
		elif '01' in s:
			s = s.replace('01', '', 1)
		if i % 2 == 0:
			a += 1
		else:
			b += 1
		i += 1
	if a <= b:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	string = input()
	turn = 0
	cnt = 0
	while 1:
		if len(string) > 1:
			if string[cnt] != string[cnt + 1]:
				string = string[:cnt] + string[cnt + 2:]
				turn += 1
				cnt = 0
			else:
				cnt += 1
				if cnt == len(string) - 1:
					break
				else:
					continue
		else:
			break
	if turn % 2 == 1:
		print('DA')
	else:
		print('NET')


n = int(input())
for i in range(n):
	lis = list(input())
	a = min(lis.count('1'), lis.count('0'))
	if a % 2 == 0:
		print('NET')
	else:
		print('DA')


n = int(input())
for i in range(n):
	a = input()
	nz = a.count('0')
	no = a.count('1')
	if min(nz, no) % 2 == 1:
		print('DA')
	else:
		print('NET')


for i in range(int(input())):
	a = str(input())
	b = 0
	while True:
		c = a.find('01')
		d = a.find('10')
		if c != -1:
			b += 1
			a = a[:c] + a[c + 2:]
		elif d != -1:
			b += 1
			a = a[:d] + a[d + 2:]
		else:
			break
	if b % 2 != 0:
		print('DA')
	else:
		print('NET')


import sys
input = sys.stdin.readline

def prog():
	for _ in range(int(input())):
		s = input().strip()
		zeros = 0
		ones = 0
		for c in s:
			if c == '0':
				zeros += 1
			else:
				ones += 1
		if zeros == 0 or ones == 0:
			print('NET')
		else:
			smallest = min(zeros, ones)
			if smallest % 2 == 0:
				print('NET')
			else:
				print('DA')
prog()


for _ in range(int(input())):
	S = input()
	l = list(S)
	s = 1
	i = 0
	while i < len(l) - 1:
		if l[i] == '0' and l[i + 1] == '1':
			del l[i]
			del l[i]
			s += 1
			if i != 0:
				i -= 1
		elif l[i] == '1' and l[i + 1] == '0':
			del l[i]
			del l[i]
			s += 1
			if i != 0:
				i -= 1
		else:
			i += 1
	if s % 2 == 0:
		print('DA')
	else:
		print('NET')


import sys

def solve(a, b, c):
	return (x, y)
IN = [x.strip() for x in sys.stdin.readlines()]
T = int(IN[0])
for ti in range(T):
	string = [int(x) for x in IN[1 + ti]]
	(ALICE, BOB) = (0, 1)
	turn = ALICE
	n0 = len([x for x in range(len(string)) if string[x] == 0])
	n1 = len([x for x in range(len(string)) if string[x] == 1])
	sm = min(n0, n1)
	print('DA' if sm % 2 == 1 else 'NET')


def solve():
	s = input()
	z = 0
	o = 0
	for ch in s:
		if ch == '1':
			o += 1
		else:
			z += 1
	if min(z, o) % 2 != 0:
		return 'DA'
	return 'NET'

def main():
	t = int(input())
	while t:
		print(solve())
		t -= 1
main()


for _ in range(int(input())):
	s = input().strip()
	zeros = len([x for x in s if x == '0'])
	ones = len([x for x in s if x == '1'])
	minn = min(zeros, ones)
	this = 'DA' if minn % 2 == 1 else 'NET'
	print(this)


def Binary(s):
	n = len(s)
	n0 = 0
	n1 = 0
	for i in range(n):
		if s[i] == '0':
			n0 += 1
		else:
			n1 += 1
	if n0 == 0 or n1 == 0:
		return 'NET'
	else:
		a = min(n0, n1)
		if a % 2 == 1:
			return 'DA'
		else:
			return 'NET'

def Run(t):
	test = []
	for i in range(t):
		test.append(input())
	for i in range(t):
		print(Binary(test[i]))
Run(int(input()))


t = int(input())
for _ in range(t):
	s = str(input())
	count = 0
	count1 = 0
	count0 = 0
	for i in range(len(s)):
		if s[i] == '0':
			count0 = count0 + 1
		else:
			count1 = count1 + 1
	count = min(count0, count1)
	if count % 2 == 0:
		print('NET')
	else:
		print('DA')


a = input()
for x in range(int(a)):
	b = input()
	tag = 0
	tag1 = 0
	for i in b:
		if i == '1':
			tag += 1
		else:
			tag1 += 1
	ans = min(tag, tag1)
	if ans % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	s = input()
	(oc, zc) = (0, 0)
	for i in s:
		if i == '0':
			zc += 1
		else:
			oc += 1
	m = min(zc, oc)
	if m % 2 != 0:
		print('DA')
	else:
		print('NET')


for i in range(int(input())):
	a = input()
	t = len(a)
	s = 0
	while t != 0:
		a = a.replace('01', 'a')
		a = a.replace('10', 'a')
		if 'a' not in a:
			break
		else:
			t -= 2 * a.count('a')
			s += a.count('a')
			a = a.replace('a', '')
	if s % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for _ in range(t):
	s = list(input())
	cnt = 0
	i = 0
	while i < len(s) - 1:
		if s[i] != s[i + 1]:
			cnt += 1
			del s[i + 1]
			del s[i]
			i = 0
			continue
		i += 1
	if cnt & 1:
		print('DA')
	else:
		print('NET')


import sys
import math
import heapq
import collections

def inputnum():
	return int(input())

def inputnums():
	return map(int, input().split())

def inputlist():
	return list(map(int, input().split()))

def inputstring():
	return [x for x in input()]

def inputmatrixchar(rows):
	arr2d = [[j for j in input().strip()] for i in range(rows)]
	return arr2d

def inputmatrixint(rows):
	arr2d = []
	for _ in range(rows):
		arr2d.append([int(i) for i in input().split()])
	return arr2d
t = int(input())
for q in range(t):
	s = inputstring()
	zero = 0
	one = 0
	for c in s:
		if c == '0':
			zero += 1
		else:
			one += 1
	if min(zero, one) % 2 == 0:
		print('NET')
	else:
		print('DA')


n = int(input())
for i in range(0, n):
	a = input()
	l = []
	for p in range(0, len(a)):
		l.append(a[p])
	x = l.count('0')
	y = l.count('1')
	z = min(x, y)
	if z % 2 == 1:
		print('DA')
	else:
		print('NET')


t = int(input())
for u in range(t):
	s = input()
	z_count = 0
	o_count = 0
	for i in range(len(s)):
		if s[i] == '0':
			z_count += 1
		else:
			o_count += 1
	if z_count <= o_count:
		if z_count % 2 == 1:
			print('DA')
		else:
			print('NET')
	elif o_count % 2 == 1:
		print('DA')
	else:
		print('NET')


t = int(input())
while t > 0:
	t -= 1
	arr = list(input())
	(mvs, a, b) = (0, 0, 0)
	for bi in arr:
		if bi == '1':
			b += 1
		elif bi == '0':
			a += 1
		if a > 0 and b > 0:
			a -= 1
			b -= 1
			mvs += 1
	if mvs % 2 == 0:
		print('NET')
	elif mvs % 2 == 1:
		print('DA')


t = int(input())
for ___ in range(t):
	(s, count_0, count_1) = (input(), 0, 0)
	length = len(s)
	for i in range(length):
		if s[i] == '0':
			count_0 += 1
		else:
			count_1 += 1
	moves = min(count_0, count_1)
	if moves % 2 == 1:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	s = list(input())
	(x, y) = (s.count('1'), s.count('0'))
	if x == 0 or y == 0:
		print('NET')
	else:
		k = min(x, y)
		if k % 2 == 0:
			print('NET')
		else:
			print('DA')


def solve():
	s = input()
	u = min(s.count('0'), s.count('1'))
	if u % 2 == 1:
		print('DA')
	else:
		print('NET')
t = int(input())
for _ in range(t):
	solve()


for _ in range(int(input())):
	s = input()
	n = len(s)
	(c1, c2) = (0, 0)
	ans = 0
	i = 0
	while i < n:
		if s[i] == '1':
			if c2 == 0:
				c1 += 1
			else:
				c2 -= 1
				ans += 1
		elif c1 == 0:
			c2 += 1
		else:
			c1 -= 1
			ans += 1
		i += 1
	if ans % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	s = list(map(int, list(input())))
	if min(len(s) - sum(s), sum(s)) % 2 == 0:
		print('NET')
	else:
		print('DA')


q = int(input())
while q > 0:
	s = input()
	t = 1
	while True:
		m = s.find('10')
		n = s.find('01')
		if m == -1 and n == -1:
			print('NET' if t % 2 == 1 else 'DA')
			break
		else:
			t += 1
			if m != -1:
				try:
					s = s[:m] + s[m + 2:]
				except:
					s = s[:m]
			else:
				try:
					s = s[:n] + s[n + 2:]
				except:
					s = s[:n]
	q = q - 1


t = int(input())
for i in range(t):
	line = input()
	one = 0
	zero = 0
	for j in line:
		if j == '1':
			one = one + 1
		else:
			zero = zero + 1
	if zero == 0 or one == 0:
		print('NET')
	else:
		l = min(zero, one)
		if l % 2 == 0:
			print('NET')
		else:
			print('DA')


t = int(input())
for i in range(t):
	s = input()
	l = []
	for j in s:
		l.append(j)
	count = 0
	flag = 1
	while flag == 1:
		i = 1
		flag = 0
		while i < len(s):
			if s[i] != s[i - 1]:
				s = s[:i - 1] + s[i + 1:]
				flag = 1
				count = count + 1
			else:
				i = i + 1
	if count % 2 == 0:
		print('NET')
	else:
		print('DA')


T = int(input())
for i in range(1, T + 1):
	s = str(input())
	z = 0
	o = 0
	for j in range(0, len(s)):
		if s[j] == '1':
			o = o + 1
		else:
			z = z + 1
	if min(z, o) % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for i in range(t):
	s = input()
	z = 0
	o = 0
	ans = 0
	for i in s:
		if i == '0':
			if o > 0:
				ans += 1
				o -= 1
			else:
				z += 1
		elif z > 0:
			ans += 1
			z -= 1
		else:
			o += 1
	if ans % 2:
		print('DA')
	else:
		print('NET')


from sys import stdin, stdout
for query in range(int(stdin.readline())):
	s = [int(x) for x in list(stdin.readline().strip())]
	count0 = 0
	count1 = 0
	n = len(s)
	for x in range(n):
		if s[x] == 1:
			count1 += 1
		else:
			count0 += 1
	x = (n - abs(count1 - count0)) // 2
	if x % 2 == 1:
		stdout.write('DA\n')
	else:
		stdout.write('NET\n')


def raf():
	s = input()
	r = [0, 0]
	for i in s:
		i = int(i)
		r[i % 2] += 1
	if min(r[0], r[1]) % 2 == 0:
		print('NET')
	else:
		print('DA')

def main():
	for _ in range(int(input())):
		raf()
main()


t = int(input())
while t:
	s = input()
	(a, b) = (s.count('1'), s.count('0'))
	c = min(a, b)
	if c % 2 == 1:
		print('DA')
	else:
		print('NET')
	t -= 1


import sys
import math
from decimal import *

def I():
	return int(sys.stdin.readline())

def IL():
	return list(map(int, sys.stdin.readline().strip().split()))

def ILS():
	return list(map(str, sys.stdin.readline().strip().split()))

def solve():
	tt = I()
	for ii in range(tt):
		s = input()
		ones = 0
		ze = 0
		for ss in s:
			if ss == '0':
				ze += 1
			else:
				ones += 1
		ans = min(ze, ones)
		if ans % 2 == 0:
			print('NET')
		else:
			print('DA')
solve()


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def instr():
	return str(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(map(int, list(s[:len(s) - 1])))

def invr():
	return map(int, input().split())
from collections import Counter

def main():
	t = inp()
	for _ in range(t):
		s = insr()
		n = len(s)
		ones = sum(s)
		zeros = n - ones
		if min(ones, zeros) % 2 == 0:
			print('NET')
		else:
			print('DA')
main()


t = int(input())
for _ in range(t):
	s = input()
	s = list(s)
	a = 'DA'
	b = 'NET'
	res = 0
	i = 0
	while i < len(s) - 1:
		if s[i] != s[i + 1]:
			res += 1
			s.pop(i + 1)
			s.pop(i)
			i = 0
		else:
			i += 1
	if res & 1:
		print(a)
	else:
		print(b)


import sys, math, os
from io import BytesIO, IOBase
from collections import defaultdict as dd, deque, Counter

def data():
	return sys.stdin.readline().strip()

def mdata():
	return list(map(int, data().split()))

def outl(var):
	sys.stdout.write(' '.join(map(str, var)) + '\n')

def out(var):
	sys.stdout.write(str(var) + '\n')
INF = 10 ** 9
mod = 998244353
for t in range(int(data())):
	s = data()
	i = 0
	cnt1 = 0
	cnt0 = 0
	while i < len(s):
		if s[i] == '1':
			cnt1 += 1
		else:
			cnt0 += 1
		i += 1
	cnt = min(cnt1, cnt0)
	if cnt % 2 == 1:
		out('DA')
	else:
		out('NET')


t = int(input())
for _ in range(t):
	a = input()
	b = len(a)
	z = 0
	for i in range(100):
		z += 1
	p = a.count('1')
	q = a.count('0')
	for i in range(100):
		z += 1
	o = min(p, q)
	for i in range(100):
		z += 1
	if o % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	s = str(input())
	l = list(s)
	z = 0
	o = 0
	ans = 0
	c2 = min(l.count('0'), l.count('1'))
	if c2 % 2 == 0:
		print('NET')
	else:
		print('DA')


for i in range(int(input())):
	s = input()
	a = 0
	while 1:
		b = s.find('10')
		c = s.find('01')
		if b == -1 and c == -1:
			if a % 2 == 0:
				print('NET')
			else:
				print('DA')
			break
		else:
			a = a + 1
			if b != -1:
				s = s[:b] + s[b + 2:]
			elif c != -1:
				s = s[:c] + s[c + 2:]


t = int(input())
for tit in range(t):
	s = input()
	if len(s) == 1:
		print('NET')
		continue
	count = 0
	i = 1
	while i < len(s):
		if s[i] != s[i - 1]:
			count += 1
			s = s[:i - 1] + s[i + 1:]
			i -= 1
			if i == 0:
				i = 1
			continue
		i += 1
	if count % 2 == 0:
		print('NET')
	else:
		print('DA')


for iii in range(int(input())):
	s = input()
	sm = 0
	while True:
		tmp = 0
		i = 0
		while i < len(s) - 1:
			if s[i] == '0' and s[i + 1] == '1' or (s[i + 1] == '0' and s[i] == '1'):
				tmp += 1
				i += 2
			else:
				i += 1
		if tmp == 0:
			break
		s = s.replace('01', '')
		s = s.replace('10', '')
		sm += tmp
	if sm % 2 == 0:
		print('net')
	else:
		print('da')


for _ in range(int(input())):
	a = list(input())
	st = [a[0]]
	c = 0
	for i in range(1, len(a)):
		st.append(a[i])
		if len(st) >= 2 and st[-1] != st[-2]:
			st.pop(-1)
			st.pop(-1)
			c += 1
	print('DA') if c % 2 != 0 else print('NET')


t = int(input())
for i in range(t):
	s = input()
	count = 0
	while '01' in s or '10' in s:
		a = s.find('01')
		b = s.find('10')
		if a != -1 and b != -1:
			pos = min(a, b)
		else:
			pos = max(a, b)
		s = s[:pos] + s[pos + 2:]
		count = count + 1
	if count % 2 == 0:
		ans = 'NET'
	else:
		ans = 'DA'
	print(ans)


def linput():
	return [int(i) for i in input().split()]

def nod(a, b):
	while a != 0 and b != 0:
		if a > b:
			a = a % b
		else:
			b = b % a
	return a + b
qwertyyyyyy = int(input())
for ______ in range(qwertyyyyyy):
	s = input()
	s0 = s.count('0')
	s1 = len(s) - s0
	w = min(s0, s1)
	if w % 2 == 1:
		print('DA')
	else:
		print('NET')


t = int(input())
for _ in range(t):
	s = input()
	a = list(s)
	count = 0
	while True:
		flag = 0
		for i in range(len(a) - 1):
			if a[i] != a[i + 1]:
				a.pop(i)
				a.pop(i)
				flag = 1
				count += 1
				break
		if flag == 0:
			break
	if count % 2 != 0:
		print('DA')
	else:
		print('NET')


test = int(input())

def solve():
	n = input()
	c0 = 0
	c1 = 0
	for i in range(len(n)):
		if n[i] == '0':
			c0 += 1
		if n[i] == '1':
			c1 += 1
	if min(c1, c0) % 2 == 0:
		print('NET')
	else:
		print('DA')
while test:
	solve()
	test -= 1


test = int(input())
test_arr = []
for _ in range(test):
	string = str(input())
	(count0, count1) = (0, 0)
	for i in string:
		if i == '0':
			count0 += 1
		else:
			count1 += 1
	if min(count0, count1) % 2 == 0:
		test_arr.append('NET')
	else:
		test_arr.append('DA')
for t in test_arr:
	print(t)


for _ in range(int(input())):
	s = input()
	num0 = s.count('0')
	num1 = s.count('1')
	if num0 == 0 or num1 == 0:
		print('NET')
	elif min(num0, num1) % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for i in range(t):
	s = input()
	if len(s) == 1:
		print('NET')
		continue
	num1 = 0
	num0 = 0
	for j in range(len(s)):
		if s[j] == '0':
			num0 += 1
		else:
			num1 += 1
	x = 0
	if num1 > num0:
		x = num0
	else:
		x = num1
	if x % 2 != 0:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	a = input()
	c = 0
	d = 0
	for i in range(len(a)):
		if a[i] == '1':
			c = c + 1
		else:
			d = d + 1
	e = min(c, d)
	if c == 0 or d == 0:
		print('NET')
		continue
	if e % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	a = input()
	f = 1
	c = 0
	while f != 0:
		if len(a) < 1 or len(set(a)) == 1:
			f = 0
			break
		else:
			c += a.count('01')
			a = a.replace('01', '')
			c += a.count('10')
			a = a.replace('10', '')
	if c % 2 != 0:
		print('DA')
	else:
		print('NET')


n = int(input())
games = []
for i in range(n):
	games.append(input())
for string in games:
	count = 0
	str_list = list(string)
	while True:
		for i in range(len(str_list) - 1):
			if str_list[i] != str_list[i + 1]:
				str_list.pop(i)
				str_list.pop(i)
				count += 1
				break
		else:
			break
	if count % 2 != 0:
		print('DA')
	else:
		print('NET')


for t in range(int(input())):
	s = list(map(int, input()))
	stack = []
	cnt = 0
	for i in s:
		if len(stack) == 0:
			stack.append(i)
		elif stack[-1] != i:
			cnt += 1
			stack.pop()
		else:
			stack.append(i)
	if cnt % 2 == 0:
		print('NET')
	else:
		print('DA')


from sys import stdin
for _ in range(int(stdin.readline().rstrip())):
	s = input()
	a = s.count('1')
	r = min(a, len(s) - a)
	if r % 2:
		print('DA')
	else:
		print('NET')


t = int(input())
while t:
	s = input()
	num0 = 0
	num1 = 0
	for c in s:
		if c == '1':
			num1 += 1
	num0 = len(s) - num1
	ans = min(num1, num0)
	if ans % 2 == 0:
		print('NET')
	else:
		print('DA')
	t -= 1


import sys
input = sys.stdin.readline

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def nCr(n, k):
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def upper_bound(a, x, lo=0):
	hi = len(a)
	while lo < hi:
		mid = (lo + hi) // 2
		if a[mid] < x:
			lo = mid + 1
		else:
			hi = mid
	return lo

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
MAXN = int(1000000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def factoriazation(x):
	ret = {}
	while x != 1:
		ret[spf[x]] = ret.get(spf[x], 0) + 1
		x = x // spf[x]
	return ret

def int_array():
	return list(map(int, input().strip().split()))

def str_array():
	return input().strip().split()
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
for _ in range(int(input())):
	s = input().strip()
	stack = []
	count = 0
	for i in s:
		if not stack:
			stack.append(i)
			continue
		if stack[-1] != i:
			stack.pop()
			count += 1
		else:
			stack.append(i)
	if count % 2 == 0:
		print('NET')
	else:
		print('DA')


for i in range(int(input())):
	s = str(input())
	if len(s) == 1:
		print('NET')
	else:
		k = abs(s.count('0') - s.count('1'))
		m = (len(s) - k) // 2
		if m == 0:
			print('NET')
		elif m % 2 == 0:
			print('NET')
		else:
			print('DA')


t = int(input())
for _ in range(t):
	l = [int(x) for x in input()]
	moves = min(l.count(0), l.count(1))
	if moves % 2 != 0:
		print('DA')
	else:
		print('NET')


for i in range(int(input())):
	z = input()
	w = [z[0]]
	ans = 0
	for i in range(1, len(z)):
		if z[i] == '1' and w != [] and (w[len(w) - 1] == '0'):
			ans += 1
			w = w[:len(w) - 1]
			continue
		elif z[i] == '0' and w != [] and (w[len(w) - 1] == '1'):
			ans += 1
			w = w[:len(w) - 1]
			continue
		w += [z[i]]
	if ans % 2 == 1:
		print('DA')
	else:
		print('NET')


t = int(input())
from collections import Counter
for _ in range(t):
	s = input()
	n = len(s)
	c = Counter(s)
	if c['0'] == 0 or c['1'] == 0:
		print('NET')
	else:
		mi = min(c['0'], c['1'])
		if mi % 2:
			print('DA')
		else:
			print('NET')


t = int(input())
for i in range(t):
	s = str(input())
	a = len(s)
	b = 0
	j = 0
	while j < a:
		if j < a - 1 and s[j] != s[j + 1]:
			b += 1
			s = s[:j] + s[j + 2:]
			j = 0
			a -= 2
		else:
			j += 1
	if b % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	a = input()
	counter1 = a.count('1')
	counter0 = a.count('0')
	if counter1 == len(a) or counter1 == 0:
		print('NET')
		continue
	if min(counter1, counter0) % 2 == 0:
		print('NET')
	else:
		print('DA')


def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s)])

def invr():
	return map(int, input().split())
entries = inp()
for i in range(entries):
	one = 0
	zero = 0
	s = insr()
	move = 0
	stack = []
	prev = -1
	for x in s:
		if x == '0':
			if len(stack) != 0:
				if stack[-1] == 1:
					stack.pop(-1)
					move += 1
				else:
					stack.append(0)
			else:
				stack.append(0)
		elif len(stack) != 0:
			if stack[-1] == 0:
				stack.pop(-1)
				move += 1
			else:
				stack.append(1)
		else:
			stack.append(1)
	if move % 2 == 1:
		print('DA')
	else:
		print('NET')


t = int(input())
cases = []
for i in range(t):
	cases.append(list(input()))
for case in cases:
	alice = True
	start_index = 0
	while True:
		moves = 0
		for fi in range(start_index, len(case) - 1):
			bi = case[fi:fi + 2]
			if bi[0] != bi[1]:
				moves = 1
				alice = not alice
				case = case[:fi] + case[fi + 2:]
				start_index = max(0, fi - 1)
				break
		if moves == 0:
			if alice:
				print('NET')
			else:
				print('DA')
			break


import sys
from math import sqrt
input = sys.stdin.readline

def inp():
	return int(input())

def inlist():
	return list(map(int, input().split()))

def instr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())

def main():
	t = inp()
	for l in range(t):
		s = instr()
		(one, zero) = (0, 0)
		for i in range(len(s)):
			if s[i] == '0':
				zero += 1
			else:
				one += 1
		if one > zero:
			(one, zero) = (zero, one)
		if one % 2 == 0:
			print('NET')
		else:
			print('DA')
main()


for _ in range(int(input())):
	s = input()
	s = list(s)
	if len(s) < 2:
		print('NET')
	elif len(s) == 2:
		if s[0] == '1' and s[1] == '0' or (s[0] == '0' and s[1] == '1'):
			print('DA')
	else:
		alice = False
		bob = True
		while True:
			n = len(s)
			popped = False
			for i in range(n - 1):
				if s[i] == '1' and s[i + 1] == '0' or (s[i] == '0' and s[i + 1] == '1'):
					popped = True
					s.pop(i + 1)
					s.pop(i)
					alice = not alice
					bob = not bob
					break
			if not popped:
				break
		if alice:
			print('DA')
		else:
			print('NET')


t = int(input())
for _ in range(t):
	s = input()
	n = len(s)
	jack = s.count('1')
	joe = s.count('0')
	m = min(jack, joe)
	if m % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for i in range(t):
	s = input()
	if not '0' in s:
		print('NET')
	elif s.count('0') == 1 and s.count('1') == 1:
		print('DA')
	else:
		a_flag = False
		b_flag = True
		while True:
			if '10' in s:
				if not a_flag:
					a_flag = True
					b_flag = False
				elif not b_flag:
					a_flag = False
					b_flag = True
				s = s.replace('10', '', 1)
			elif '01' in s:
				if not a_flag:
					a_flag = True
					b_flag = False
				elif not b_flag:
					a_flag = False
					b_flag = True
				s = s.replace('01', '', 1)
			else:
				break
		if a_flag:
			print('DA')
		else:
			print('NET')


import sys

def get_ints():
	return map(int, sys.stdin.readline().strip().split())
n = int(input())
for i in range(n):
	s = input()
	one = s.count('1')
	zero = s.count('0')
	m = min(zero, one)
	if m % 2 == 0:
		print('NET')
	else:
		print('DA')
	i


t = int(input())
for i in range(t):
	s = input()
	(czero, cone) = (0, 0)
	for i in range(0, len(s)):
		if s[i] == '0':
			czero += 1
		else:
			cone += 1
	m = min(cone, czero)
	if m % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for test in range(t):
	s = input()
	zeros = 0
	ones = 0
	for i in s:
		if i == '1':
			ones += 1
		else:
			zeros += 1
	x = min(zeros, ones)
	if x % 2 == 0:
		print('NET')
	else:
		print('DA')


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
testcases = int(input())
for j in range(testcases):
	initial = input()
	one = 0
	zero = 0
	for s in range(len(initial)):
		if initial[s] == '1':
			one += 1
		else:
			zero += 1
	miny = min(one, zero)
	if miny % 2 == 1:
		print('DA')
	else:
		print('NET')


n = int(input())
for i in range(n):
	s = input()
	arr = [0, 0]
	for ch in s:
		arr[int(ch)] += 1
	print('DA') if min(arr) % 2 else print('NET')


import sys
from collections import defaultdict, deque, Counter
import math
from bisect import bisect_left, bisect_right
input = sys.stdin.readline
getS = lambda : input().strip()
getN = lambda : int(input())
getList = lambda : list(map(int, input().split()))
getZList = lambda : [int(x) - 1 for x in input().split()]
INF = 10 ** 20
MOD = 10 ** 9 + 7
divide = lambda x: pow(x, MOD - 2, MOD)

def solve():
	s = getS()
	cnt = Counter(s)
	op = min(cnt['0'], cnt['1'])
	if op % 2 == 0:
		print('NET')
	else:
		print('DA')

def main():
	n = getN()
	for _ in range(n):
		solve()
main()


n = int(input())
for i in range(n):
	s = input()
	t = 0
	tt = 0
	while tt != -1 and len(s) > 0:
		p = s.find('01')
		if p != -1:
			s = s[0:p] + s[p + 2:]
			t = 1 - t
		q = s.find('10')
		if q != -1:
			s = s[0:q] + s[q + 2:]
			t = 1 - t
		if p == -1 and q == -1:
			tt = -1
	if t == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	s = list(input())
	if s.count('1') > s.count('0'):
		z = '0'
	else:
		z = '1'
	if s.count(z) % 2 != 0:
		print('DA')
	else:
		print('NET')


tstr = input()
t = int(tstr)
que = list()
for i in range(t):
	que.append(input())
for i in range(t):
	l = len(que[i])
	while '01' in que[i] or '10' in que[i]:
		que[i] = que[i].replace('10', '')
		que[i] = que[i].replace('01', '')
	l = l - len(que[i])
	if l / 2 % 2 == 1:
		print('DA')
	else:
		print('NET')


import sys
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
(t,) = I()
for _ in range(t):
	s = input().strip()
	ar = [s[0]]
	n = 0
	for i in range(1, len(s)):
		if len(ar) > 0 and ar[-1] != s[i]:
			ar.pop()
			n += 1
		else:
			ar.append(s[i])
	print('NDEAT'[n % 2::2])


T = int(input())
for _ in range(T):
	s = input()
	zeros = s.count('0')
	ones = s.count('1')
	res = min(zeros, ones)
	if res % 2 == 0:
		print('NET')
	else:
		print('DA')


from math import *

def _in():
	return [int(x) for x in input().split(' ')]

def main():
	s = input()
	o = s.count('1')
	z = s.count('0')
	ans = min(o, z)
	if ans % 2 == 0:
		print('NET')
	else:
		print('DA')
tt = 1
tt = int(input())
for _ in range(tt):
	main()


def a(s):
	for i in range(len(s) - 1):
		if len(s) < 2:
			return 0
		if s[i] != s[i + 1]:
			return 1 + a(s[:i] + s[i + 2:])
	return 0
T = int(input())
for _ in range(T):
	s = list(input())
	count = a(s)
	if count % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
while t > 0:
	p = 0
	f = ''
	ans = 0
	s = input()
	for i in s:
		if p == 0:
			f = i
		if f == i:
			p = p + 1
		else:
			p = p - 1
			ans = ans + 1
	if ans % 2 == 1:
		print('DA')
	else:
		print('NET')
	t = t - 1


for i in range(int(input())):
	s = input()
	ctr = 0
	while len(s) > 0:
		a = s.find('01')
		b = s.find('10')
		if a >= 0:
			ctr += 1
			s = s.replace('01', '', 1)
		elif b >= 0:
			ctr += 1
			s = s.replace('10', '', 1)
		else:
			break
	if ctr % 2 == 1:
		print('DA')
	else:
		print('NET')


t = int(input())
for l in range(t):
	a = str(input())
	s = []
	s[:0] = a
	p = 0
	k = 0
	while k < len(s) - 1:
		if s[k] != s[k + 1]:
			s.remove(s[k + 1])
			s.remove(s[k])
			k = -1
			p += 1
		k = k + 1
	if p % 2 == 0:
		print('NET')
	else:
		print('DA')


import math
for _ in range(int(input())):
	s = input()
	a = [s[0]]
	ans = 0
	for i in range(1, len(s)):
		a.append(s[i])
		if len(a) > 1 and a[-1] != a[-2]:
			ans += 1
			a.pop()
			a.pop()
	if ans % 2 == 0:
		print('NET')
	else:
		print('DA')


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def RL():
	return map(int, sys.stdin.readline().rstrip().split())

def RLL():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def N():
	return int(input())

def comb(n, m):
	return factorial(n) / (factorial(m) * factorial(n - m)) if n >= m else 0

def perm(n, m):
	return factorial(n) // factorial(n - m) if n >= m else 0

def mdis(x1, y1, x2, y2):
	return abs(x1 - x2) + abs(y1 - y2)
mod = 998244353
INF = float('inf')
from math import factorial
from collections import Counter, defaultdict, deque
from heapq import heapify, heappop, heappush

def main():
	for _ in range(N()):
		a = 'DA'
		b = 'NET'
		s = input()
		q = []
		now = 0
		for i in s:
			if q and q[-1] != i:
				q.pop()
				now ^= 1
			else:
				q.append(i)
		if now:
			print(a)
		else:
			print(b)
main()


n = int(input())
q = []
for i in range(n):
	q.append(input())
for j in q:
	s = list(j)
	count = 0
	no0 = 0
	n01 = 0
	for i in range(len(s)):
		if s[i] == '0':
			no0 += 1
		else:
			n01 += 1
	step = min(no0, n01)
	if step % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	s = input()
	one = s.count('1')
	zero = s.count('0')
	mn = min(zero, one)
	print('DA' if mn & 1 else 'NET')


test = int(input())
for x in range(test):
	s = list(input())
	f = 1
	if len(s) < 2:
		print('NET')
	else:
		while True:
			if s.count('1') == len(s) or s.count('0') == len(s):
				break
			if len(s) < 2:
				break
			i = 0
			while i < len(s) - 1:
				if s[i] != s[i + 1]:
					s.pop(i)
					s.pop(i)
					break
				i += 1
			if f == 1:
				f = 2
			else:
				f = 1
		if f == 1:
			print('NET')
		else:
			print('DA')


import os
import sys
from io import BytesIO, IOBase
sys.setrecursionlimit(10 ** 4)
from math import ceil, factorial, floor, gcd, log2, log10, sqrt
from collections import defaultdict as dd, Counter as cc, deque
from itertools import permutations as perm, combinations as comb
from heapq import heapify, heappush, heappushpop, nlargest, nsmallest
inpl = lambda : list(map(int, input().split()))
lstinp = lambda : list(input().split())
inpm = lambda : map(int, input().split())
inps = lambda : int(input())
inp = lambda : input()

def Divisors(n):
	l = []
	i = 2
	while i <= sqrt(n):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
		i = i + 1
	return l

def SieveOfEratosthenes(n):
	l = []
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	for p in range(2, n + 1):
		if prime[p]:
			l.append(p)
	return l

def primeFactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n / 2
	for i in range(3, int(sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(i)
			n = n / i
	if n > 2:
		l.append(n)
	return l

def Factors(n):
	result = []
	for i in range(2, int(sqrt(n)) + 1):
		if n % i == 0:
			if i == n / i:
				result.append(i)
			else:
				result.append(i)
				result.append(n // i)
	result.append(1)
	result.append(n)
	return result

def maxSubArraySum(a):
	max_so_far = 0
	max_ending_here = 0
	size = len(a)
	for i in range(0, size):
		max_ending_here = max_ending_here + a[i]
		if max_so_far < max_ending_here:
			max_so_far = max_ending_here
		if max_ending_here < 0:
			max_ending_here = 0
	return max_so_far

def longestsubarray(arr, n, k):
	current_count = 0
	max_count = 0
	for i in range(0, n, 1):
		if arr[i] % k != 0:
			current_count += 1
		else:
			current_count = 0
		max_count = max(current_count, max_count)
	return max_count

def check(s):
	t = 1
	i = 0
	while i < len(s) - 1:
		if s[i] != s[i + 1]:
			t *= -1
			s.pop(i)
			s.pop(i)
			i = 0
			continue
		i += 1
	return t

def main():
	t = inps()
	while t:
		s = inp()
		if check(list(s)) == 1:
			print('NET')
		else:
			print('DA')
		t -= 1
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


t = int(input())
while t > 0:
	t = t - 1
	s = input()
	k = len(s)
	while '10' in s or '01' in s:
		if '10' in s:
			s = s.replace('10', '')
		if '01' in s:
			s = s.replace('01', '')
	k -= len(s)
	k = k // 2
	if k % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
while t:
	t -= 1
	s = input()
	cnt = 1
	i = 0
	while i < len(s) - 1:
		if s[i] != s[i + 1]:
			s = s[0:i] + s[i + 2:]
			i = 0
			cnt += 1
			continue
		i += 1
	if cnt % 2 == 1:
		print('NET')
	else:
		print('DA')


T = int(input())
while T > 0:
	S = input()
	cnt1 = 0
	cnt2 = 0
	for i in range(0, len(S)):
		if S[i] == '0':
			cnt1 += 1
		else:
			cnt2 += 1
	if min(cnt1, cnt2) % 2 == 0:
		print('NET')
	else:
		print('DA')
	T -= 1


t = int(input())
for _ in range(t):
	s = input()
	z = 0
	o = 0
	for i in s:
		if i == '0':
			z += 1
	o = len(s) - z
	ans = min(o, z)
	if ans % 2 == 0:
		print('NET')
	else:
		print('DA')


T = int(input())
for t in range(T):
	s = input()
	i = 1
	ans = 'NET'
	flag = 0
	for i in s:
		if i == '1':
			flag += 1
	zero = len(s) - flag
	flag = min(zero, flag)
	if flag % 2 == 0:
		ans = 'NET'
	else:
		ans = 'DA'
	print(ans)


from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def LS():
	return [list(x) for x in sys.stdin.readline().split()]

def S():
	res = list(sys.stdin.readline())
	if res[-1] == '\n':
		return res[:-1]
	return res

def IR(n):
	return [I() for i in range(n)]

def LIR(n):
	return [LI() for i in range(n)]

def SR(n):
	return [S() for i in range(n)]

def LSR(n):
	return [LS() for i in range(n)]
sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
	t = I()
	for _ in range(t):
		s = list(map(int, input()))
		k = 1
		while s:
			for i in range(len(s) - 1):
				if s[i] != s[i + 1]:
					s.pop(i)
					s.pop(i)
					break
			else:
				break
			k ^= 1
		print(['DA', 'NET'][k])
	return
solve()


import sys
import math as mt
t = int(input())
for _ in range(t):
	s = input()
	mini = min(s.count('0'), s.count('1'))
	if mini % 2 != 0:
		print('DA')
	else:
		print('NET')


t = int(input())
for _ in range(t):
	s = input()
	o = 0
	z = 0
	for se in s:
		if se == '1':
			o += 1
		else:
			z += 1
	m = min(o, z)
	if m % 2 == 0:
		print('NET')
	else:
		print('DA')


def main():
	t = int(input())
	for _ in range(t):
		s = input()
		n = len(s)
		ones = s.count('1')
		zeroes = n - ones
		if zeroes == ones:
			n %= 4
			if n in [0, 1]:
				print('NET')
			else:
				print('DA')
			continue
		m = min(ones, zeroes)
		if m % 2 == 0:
			print('NET')
		else:
			print('DA')
main()


def ab(a, i, ans):
	if len(a) > 1 and i < len(a) - 1:
		if a[i] == 1 and a[i + 1] == 0 or (a[i] == 0 and a[i + 1] == 1):
			if ans == 'NET':
				ans = 'DA'
				a.pop(i)
				a.pop(i)
				return ab(a, i, ans)
			else:
				ans = 'NET'
				a.pop(i)
				a.pop(i)
				return ab(a, i, ans)
		else:
			return ab(a, i + 1, ans)
	else:
		return ans
for _ in range(int(input())):
	a = [int(i) for i in input()]
	ans = 'NET'
	for _ in range(50):
		ans = ab(a, 0, ans)
	print(ans)


import collections
t = input()
t = int(t)

def solve(s):
	s_dict = collections.Counter(s)
	n1 = s_dict['1']
	n0 = s_dict['0']
	if n0 <= n1:
		if n0 % 2 == 1:
			print('DA')
		else:
			print('NET')
	elif n1 % 2 == 1:
		print('DA')
	else:
		print('NET')
	return
for i in range(t):
	s = input()
	solve(s)


for _ in range(int(input())):
	ins = input()
	print(['NET', 'DA'][min(ins.count('0'), ins.count('1')) % 2])


def solution(a):
	c1 = a.count(1)
	c0 = a.count(0)
	if min(c1, c0) % 2 == 1:
		return 'DA'
	return 'NET'

def main():
	for test in range(int(input())):
		stroka = list(map(int, input()))
		result = solution(stroka)
		print(result)
main()


def helper(s):
	flag = 0
	for i in range(len(s) - 1):
		if s[i] != s[i + 1]:
			flag = 1
			break
	return flag
t = int(input())
for i in range(t):
	s = input()
	s = list(s)
	count = 0
	while helper(s) == 1:
		i = 0
		while i < len(s):
			if i < len(s) - 1:
				if s[i] != s[i + 1]:
					count += 1
					s[i] = '-1'
					s[i + 1] = '-1'
					s = [i for i in s if i != '-1']
			i += 1
	if count % 2 == 0:
		print('NET')
	elif count % 2 != 0:
		print('DA')


t = int(input())
res = []
for i in range(t):
	sum1 = 0
	w = tuple(input())
	word = [int(k) for k in w]
	for i in range(len(word)):
		sum1 += word[i]
	sum0 = len(word) - sum1
	if 2 * min(sum0, sum1) % 4 == 0 or 2 * min(sum0, sum1) % 4 == 1:
		res.append('net')
	else:
		res.append('da')
for i in range(t):
	print(res[i])


import sys
import math
import collections

def set_debug(debug_mode=False):
	if debug_mode:
		fin = open('input.txt', 'r')
		sys.stdin = fin

def int_input():
	return list(map(int, input().split()))
t = int(input())
for ti in range(1, t + 1):
	s = input()
	d = [0, 0]
	for x in s:
		d[int(x)] += 1
	r = min(d[0], d[1])
	if r & 1:
		print('DA')
	else:
		print('NET')


def solve():
	n = input()
	l = list()
	count = 0
	for i in n:
		if len(l) == 0:
			l.append(i)
			continue
		if l[-1] != i:
			l.pop()
			count += 1
		else:
			l.append(i)
	if count % 2 == 0:
		print('NET')
	else:
		print('DA')
t = int(input())
for i in range(t):
	solve()


for _ in range(int(input())):
	s = input()
	x = s.count('0')
	y = s.count('1')
	if set(s) == 1:
		print('NET')
	elif x < y:
		if x % 2 == 0:
			print('NET')
		else:
			print('DA')
	elif y % 2 == 0:
		print('NET')
	else:
		print('DA')


import sys
input = sys.stdin.readline
from functools import lru_cache
for _ in range(int(input())):
	s = input().rstrip()

	@lru_cache(maxsize=None)
	def f(s):
		for i in range(1, len(s)):
			if s[i - 1] != s[i]:
				return not f(s[:i - 1] + s[i + 1:])
		return False
	print('DA' if f(s) else 'NET')


for _ in range(int(input())):
	s = input()
	ans = 'b'
	flag = True
	while s and flag:
		for i in range(len(s) - 1):
			if s[i] != s[i + 1]:
				s = s[:i] + s[i + 2:]
				if ans == 'b':
					ans = 'a'
				else:
					ans = 'b'
				break
			else:
				continue
		else:
			flag = False
	if ans == 'a':
		print('DA')
	else:
		print('NET')


from sys import stdin, stdout
from collections import Counter, deque
import math
cin = stdin.readline
cout = stdout.write

def inpn():
	return int(cin())

def inpl():
	return list(map(int, cin().split()))

def inps():
	return cin()[:-1]

def invr():
	return map(int, cin().split())

def outs(s):
	cout(s)

def outn(n):
	cout(str(n))

def outl(l):
	for i in l:
		cout(str(i) + ' ')

def outb(s):
	cout(str(s))

def fun(s):
	res = 0
	for i in range(0, 1000001):
		cur = i
		ok = True
		for j in range(len(s)):
			res += 1
			if s[j] == '+':
				cur += 1
			else:
				cur -= 1
			if cur < 0:
				ok = False
				break
		if ok:
			return res
for _ in range(inpn()):
	s = deque(inps())
	count = 0
	for j in range(len(s) // 2):
		for i in range(len(s) - 1):
			if s[i] != s[i + 1]:
				count += 1
				s.remove(s[i + 1])
				s.remove(s[i])
				break
		else:
			break
	if count & 1 == 0:
		outs('NET')
	else:
		outs('DA')
	cout('\n')


for _ in range(int(input())):
	s = input().strip('\n')
	x1 = s.count('1')
	x2 = s.count('0')
	min1 = min(x1, x2)
	if min1 % 2 == 1:
		print('DA')
	else:
		print('NET')


import math
t = int(input())
for i in range(t):
	s = input()
	l = len(s)
	s = list(str(s))
	if l == 1:
		print('NET')
	else:
		c = 0
		for j in range(1, len(s)):
			for i in range(1, len(s)):
				if s[i] != s[i - 1]:
					c += 1
					s.pop(i)
					s.pop(i - 1)
					break
		if c == 0 or c % 2 == 0:
			print('NET')
		else:
			print('DA')


for i in range(int(input())):
	l = [j for j in input()]
	a = l.count('0')
	b = l.count('1')
	if min(a, b) % 2 == 0:
		print('NET')
	else:
		print('DA')


for i in range(int(input())):
	a = input()
	c = min(a.count('1'), a.count('0'))
	if c & 1:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	a = input()
	(o, z) = (0, 0)
	for el in a:
		if el == '1':
			o += 1
		else:
			z += 1
	m = min(o, z)
	if m % 2 == 0:
		print('NET')
	else:
		print('DA')


n = int(input())
num_list = []
i = 0
while i < n:
	string = input()
	len_zero = string.count('0')
	len_one = string.count('1')
	if len_zero == 0 or len_one == 0:
		print('NET')
	elif min(len_zero, len_one) % 2 == 0:
		print('NET')
	else:
		print('DA')
	i += 1


t = int(input())
for i in range(t):
	s = input()
	m = min(s.count('0'), s.count('1'))
	print('DA' if m & 1 else 'NET')


t = int(input())
while t:
	t -= 1
	s = input()
	(z, o) = (0, 0)
	for i in range(len(s)):
		if s[i] == '0':
			z += 1
		else:
			o += 1
	x = min(z, o)
	if x % 2 == 0:
		print('NET')
	else:
		print('DA')


T = int(input())
for _ in range(T):
	s = input()
	cnt = min(s.count('1'), s.count('0'))
	print('NET' if cnt % 2 == 0 else 'DA')


css = int(input())
for _ in range(css):
	text = input()
	turn = 0
	while True:
		if '01' in text:
			turn += 1
			text = text.replace('01', '', 1)
			continue
		elif '10' in text:
			turn += 1
			text = text.replace('10', '', 1)
			continue
		break
	result = 'DA' if turn % 2 == 1 else 'NET'
	print(result)


def ans(s):
	count = 0
	while '01' in s or '10' in s:
		if '01' in s:
			count += 1
			s = s.replace('01', '', 1)
		elif '10' in s:
			count += 1
			s = s.replace('10', '', 1)
		else:
			assert False
	if count % 2 == 0:
		return 'NET'
	else:
		return 'DA'
T = int(input())
for _ in range(T):
	s = input()
	print(ans(s))


for _ in range(int(input())):
	l = input()
	n = len(l)
	i = 0
	c = 0
	while i < len(l) - 1:
		if l[i] == '1' and l[i + 1] == '0' or (l[i] == '0' and l[i + 1] == '1'):
			if i + 2 < len(l):
				l = l[:i] + l[i + 2:]
			else:
				l = l[:i]
			c += 1
			i = 0
		else:
			i += 1
	if c % 2:
		print('DA')
	else:
		print('NET')


def helper(n):
	pairs = 0
	z = 0
	o = 0
	for i in n:
		if i == '0':
			z += 1
		else:
			o += 1
	if len(n) == 2:
		if z == o:
			print('DA')
			return
		else:
			print('NET')
			return
	elif z == 0 or o == 0:
		print('NET')
	elif z == o:
		print('NET')
	elif z > o:
		if o % 2 == 0:
			print('NET')
		else:
			print('DA')
	elif o > z:
		if z % 2 == 0:
			print('NET')
		else:
			print('DA')
for _ in range(int(input())):
	n = input()
	pairs = helper(n)


n = int(input())
for m in range(n):
	inp = input()
	x1 = 0
	x0 = 0
	for i in range(len(inp)):
		if inp[i] == '1':
			x1 += 1
		else:
			x0 += 1
	ans = 'DA' if min(x1, x0) % 2 == 1 else 'NET'
	print(ans)


for _ in range(int(input())):
	s = list(input())
	ans = 0
	while 1:
		if len(s) == 0 or len(s) == 1:
			break
		if len(s) == 2 and s[0] == s[1]:
			break
		for j in range(len(s) - 1):
			if s[j] != s[j + 1]:
				del s[j]
				del s[j]
				ans += 1
				break
		else:
			break
	ans %= 2
	if ans == 0:
		print('NET')
	else:
		print('DA')


for n in range(int(input())):
	mov = list(map(int, str(input())))
	l = len(mov)
	ones = sum(mov)
	zeros = l - ones
	if l == 0:
		print('NET')
	elif min(ones, zeros) % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
lis = []
for i in range(t):
	s = str(input())
	lis.append(s)
for i in lis:
	s = i
	c = 0
	flag = True
	while flag and len(s) > 1:
		flag = False
		pair_list = [''.join(two) for two in zip(s[:-1], s[1:])]
		for pair in pair_list:
			if pair == '01' or pair == '10':
				s = s.replace(pair, '', 1)
				flag = True
				c += 1
				break
	if c % 2 == 0:
		print('NET')
	else:
		print('DA')


def da_or_net(array):
	if len(array) < 2:
		return False
	elif len(array) < 4 and array.count(0) == 1:
		return True
	else:
		j = 1
		aux_var = False
		while j < len(array):
			if array[j - 1] != array[j]:
				aux_var = True
				break
			j += 1
		if not aux_var:
			return False
		tmp = []
		for k in range(len(array)):
			if k != j - 1 and k != j:
				tmp.append(array[k])
		return not da_or_net(tmp)
t = int(input())
for i in range(t):
	arr = str(input())
	a = [int(arr[j]) for j in range(len(arr))]
	print('DA' if da_or_net(a) else 'NET')


def solve():
	x = input()
	zero = x.count('0')
	one = x.count('1')
	ct = min(zero, one)
	if zero == 0 or one == 0:
		print('NET')
	elif ct % 2 == 1:
		print('DA')
	else:
		print('NET')
t = 1
t = int(input())
for _ in range(t):
	solve()


t = int(input())
for k in range(t):
	s = input()
	s = list(s)
	c = 1
	a = 0
	b = 0
	while len(s) >= 2:
		f = 0
		for i in range(0, len(s) - 1, 1):
			if int(s[i]) != int(s[i + 1]):
				f = 1
				s.pop(i)
				s.pop(i)
				if c % 2 != 0:
					a = 1
					b = 0
				else:
					b = 1
					a = 0
				break
		if f == 0:
			break
		else:
			c += 1
	if a == 1:
		print('DA')
	else:
		print('NET')


for t in range(int(input())):
	s = input()
	x = list(s)
	a = x.count('1')
	b = x.count('0')
	c = min(a, b)
	if c % 2 != 0:
		print('DA')
	else:
		print('NET')


import math
import sys
import itertools
import fractions
wtf = sys.stdin.read()
wtf = wtf.strip().split('\n')
t = int(wtf[0])
for s in wtf[1:]:
	zc = s.count('0')
	oc = s.count('1')
	mc = min(zc, oc)
	print('DA' if mc % 2 != 0 and zc != 0 and (oc != 0) else 'NET')


import sys
import math
from collections import defaultdict as dd
mod = 1000000007
T = 1
T = int(sys.stdin.readline())
for _ in range(T):
	s = input()
	x = min(s.count('0'), s.count('1'))
	if x & 1:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	string = input()
	player = 0
	while True:
		if '01' in string or '10' in string:
			for i in range(1, len(string)):
				new_string = ''
				if string[i] == '0' and string[i - 1] == '1':
					player += 1
					if i - 1 > 0:
						new_string += string[:i - 1]
					if i + 1 < len(string):
						new_string += string[i + 1:]
					string = new_string
					break
				if string[i - 1] == '0' and string[i] == '1':
					player += 1
					if i - 1 > 0:
						new_string += string[:i - 1]
					if i + 1 < len(string):
						new_string += string[i + 1:]
					string = new_string
					break
		else:
			break
	if player % 2 == 1:
		print('DA')
	else:
		print('NET')


from __future__ import division, print_function

def get_ints():
	return map(int, input().strip().split())

def get_array():
	return list(map(int, input().strip().split()))
from math import pow, gcd
from random import randint

def main():
	for _ in range(int(input())):
		s = input()
		(z, o, diff) = (0, 0, 0)
		for i in range(len(s)):
			if s[i] == '0':
				z += 1
			else:
				o += 1
		if min(z, o) % 2 == 1:
			print('DA')
		else:
			print('NET')
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import os, io
from sys import stdout
import collections
import random
import math
from operator import itemgetter
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
from collections import Counter
import heapq

def primes(n):
	sieve = [True] * n
	for i in range(3, int(n ** 0.5) + 1, 2):
		if sieve[i]:
			sieve[i * i::2 * i] = [False] * ((n - i * i - 1) // (2 * i) + 1)
	return [2] + [i for i in range(3, n, 2) if sieve[i]]

def binomial_coefficient(n, k):
	if 0 <= k <= n:
		ntok = 1
		ktok = 1
		for t in range(1, min(k, n - k) + 1):
			ntok *= n
			ktok *= t
			n -= 1
		return ntok // ktok
	else:
		return 0

def powerOfK(k, max):
	if k == 1:
		return [1]
	if k == -1:
		return [-1, 1]
	result = []
	n = 1
	while n <= max:
		result.append(n)
		n *= k
	return result

def prefixSum(arr):
	for i in range(1, len(arr)):
		arr[i] = arr[i] + arr[i - 1]
	return arr

def divisors(n):
	i = 1
	result = []
	while i * i <= n:
		if n % i == 0:
			if n / i == i:
				result.append(i)
			else:
				result.append(i)
				result.append(n / i)
		i += 1
	return result
t = int(input())
for _ in range(t):
	s = input().decode('utf-8').strip()
	z = s.count('0')
	o = s.count('1')
	r = min(z, o)
	if r % 2 == 0:
		print('NET')
	else:
		print('DA')


q = int(input())
while q > 0:
	q = q - 1
	s = str(input())
	one = 0
	zro = 0
	for i in s:
		if i == '1':
			one += 1
		else:
			zro += 1
	mn = min(one, zro)
	if mn % 2 == 0:
		print('NET')
	else:
		print('DA')


import sys
input = sys.stdin.readlines()
for i in range(1, int(input[0]) + 1):
	l = list(input[i])
	l.pop(-1)
	lista = list(map(int, l))
	unos = sum(lista)
	ceros = len(lista) - unos
	if min(unos, ceros) % 2 == 0:
		print('NET')
	else:
		print('DA')


import os
import sys
import math
from io import BytesIO, IOBase
t = int(sys.stdin.readline())
for _ in range(t):
	a = input()
	s = 0
	while a.count('10') != 0 or a.count('01') != 0:
		s += a.count('10')
		a = a.replace('10', '')
		s += a.count('01')
		a = a.replace('01', '')
	print('DA' if s % 2 != 0 else 'NET')


t = int(input())
for _ in range(t):
	s = [int(i) for i in input()]
	count1 = s.count(1)
	count2 = s.count(0)
	count = min(count1, count2)
	if count % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for _ in range(t):
	turn = 0
	stk = []
	for c in input():
		if not stk or stk[-1] == c:
			stk.append(c)
		else:
			stk.pop()
			turn ^= 1
	if turn == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for i in range(t):
	n = input()
	if '1' not in n or '0' not in n:
		print('NET')
	elif n.count('0') == n.count('1'):
		if n.count('0') % 2 == 0:
			print('NET')
		else:
			print('DA')
	elif n.count('0') < n.count('1'):
		if n.count('0') % 2 == 0:
			print('NET')
		else:
			print('DA')
	elif n.count('1') % 2 == 0:
		print('NET')
	else:
		print('DA')


T = int(input())
for t in range(1, T + 1):
	string = input()
	zeros = 0
	ones = 0
	for x in string:
		if x == '0':
			zeros += 1
		else:
			ones += 1
	x = min(zeros, ones)
	if x % 2:
		print('DA')
	else:
		print('NET')


t = int(input())
while t > 0:
	s = input()
	alice = True
	while s:
		temp = [s[0]]
		popped = False
		for i in range(1, len(s)):
			if temp and s[i] != temp[-1]:
				popped = True
				alice = not alice
				temp.pop()
			else:
				temp.append(s[i])
		if popped:
			s = temp
		else:
			break
	if alice:
		print('NET')
	else:
		print('DA')
	t -= 1


def sol(s):
	stack = []
	chance = 0
	for i in range(len(s)):
		if stack == []:
			stack.append(s[i])
		elif stack[-1] != s[i]:
			stack.pop()
			chance = (chance + 1) % 2
		else:
			stack.append(s[i])
	if chance == 0:
		print('NET')
	else:
		print('DA')
k = int(input())
for i in range(k):
	bs = input()
	sol(bs)


def main():
	t = int(input())
	for _ in range(t):
		a = list(input())
		count_0 = count_1 = 0
		for i in a:
			if i == '0':
				count_0 += 1
			else:
				count_1 += 1
		ans = min(count_0, count_1)
		if ans % 2 == 0:
			print('NET')
		else:
			print('DA')
main()


t = int(input())
for _ in range(t):
	s = list(input())
	cnt = 0
	while len(s) >= 2:
		i = 0
		f = True
		while i < len(s) - 1:
			if s[i] != s[i + 1]:
				f = False
				s.pop(i)
				s.pop(i)
				cnt += 1
				break
			else:
				i += 1
		if f:
			break
	if cnt % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	s = input()
	ones = s.count('1')
	zeroes = len(s) - ones
	print('DA') if min(ones, zeroes) & 1 else print('NET')


t = int(input())
for t in range(t):
	string = input()
	string = list(string)
	prev_alice = 0
	bob = 0
	alice = 0
	while True:
		if len(string) == 0 and alice == bob:
			print('NET')
			break
		prev_alice = alice
		for i in range(len(string) - 1):
			if string[i] == '1' and string[i + 1] == '0':
				alice += 1
				del string[i], string[i]
				break
			elif string[i] == '0' and string[i + 1] == '1':
				alice += 1
				del string[i], string[i]
				break
			else:
				continue
		for i in range(len(string) - 1):
			if string[i] == '1' and string[i + 1] == '0':
				bob += 1
				del string[i], string[i]
				break
			elif string[i] == '0' and string[i + 1] == '1':
				bob += 1
				del string[i], string[i]
				break
			else:
				continue
		if alice > bob:
			print('DA')
			break
		elif alice == prev_alice:
			print('NET')
			break
		else:
			continue


for _ in range(int(input())):
	l = list(input())
	ans = True
	while len(l) >= 2:
		found = False
		for i in range(1, len(l)):
			if l[i] != l[i - 1]:
				ans = not ans
				del l[i]
				del l[i - 1]
				found = True
				break
		if not found:
			break
	print(['DA', 'NET'][ans])


z = input
n = int(z())
for i in range(n):
	x = z()
	one = x.count('1')
	ze = x.count('0')
	p = min(one, ze)
	if p % 2 != 0:
		print('DA')
	else:
		print('NET')


t = int(input())
for _ in range(t):
	s = input()
	n = len(s)
	t1 = s.count('1')
	t2 = s.count('0')
	if t1 == 0 or t2 == 0:
		print('NET')
	elif t1 == t2:
		if t1 % 2 == 0:
			print('NET')
		else:
			print('DA')
	elif min(t1, t2) % 2 == 1:
		print('DA')
	else:
		print('NET')


n = int(input())
inp = []
for i in range(0, n):
	inp.append(list(map(int, input())))
for i in range(0, n):
	n_0 = 0
	n_1 = 0
	for j in range(0, len(inp[i])):
		if inp[i][j] == 0:
			n_0 += 1
		elif inp[i][j] == 1:
			n_1 += 1
	small = n_0
	if n_1 < n_0:
		small = n_1
	if small % 2 == 0:
		print('NET')
	else:
		print('DA')


T = int(input())

def reduce(s, index, move_count):
	flag = True
	for i in range(index, len(s) - 1):
		if s[i] == '1' and s[i + 1] == '0':
			move_count = move_count + 1
			s = s[:i] + s[i + 2:]
			flag = False
			index = index - 1
			break
		elif s[i] == '0' and s[i + 1] == '1':
			move_count = move_count + 1
			s = s[:i] + s[i + 2:]
			index = index - 1
			flag = False
			break
		else:
			continue
	if flag:
		return (s, -1, move_count)
	else:
		if index < 0:
			index = 0
		return (s, index, move_count)

def main():
	s = input()
	move_count = 0
	index = 0
	while len(s) > 2:
		(s, index, move_count) = reduce(s, index, move_count)
		if index == -1:
			if move_count % 2 == 0:
				return 'NET'
			else:
				return 'DA'
	if s == '01' or s == '10':
		move_count = move_count + 1
	if move_count % 2 == 0:
		return 'NET'
	else:
		return 'DA'
for _ in range(T):
	print(main())


def main():
	t = int(input())
	for _ in range(t):
		print(case())

def case():
	s = input()
	s1 = s.count('1')
	s0 = s.count('0')
	move = min(s1, s0)
	if move % 2:
		return 'DA'
	else:
		return 'NET'
main()


import sys
input = sys.stdin.readline
for T in range(int(input())):
	s = list(input().strip())
	n = len(s)
	cnt = 0
	i = 1
	d = [s[0]]
	while i < n:
		if len(d) == 0:
			d.append(s[i])
		elif d[-1] != s[i]:
			d.pop()
			cnt += 1
		else:
			d.append(s[i])
		i += 1
	if cnt % 2 == 0:
		print('NET')
	else:
		print('DA')


import os
import sys

def oki(s):
	tm = min(s.count('0'), s.count('1'))
	if tm % 2 == 1:
		print('DA')
	else:
		print('NET')
for _ in range(int(input())):
	s = str(input())
	oki(s)


t = int(input())
for _ in range(t):
	s = input()
	zeros = s.count('0')
	ones = s.count('1')
	moves = min(zeros, ones)
	if moves % 2 == 0:
		print('NET')
	else:
		print('DA')


from sys import stdin, gettrace
if gettrace():
	inputi = input
else:

	def input():
		return next(stdin)[:-1]

	def inputi():
		return stdin.buffer.readline()

def solve():
	ss = list(map(int, input()))
	oc = sum(ss)
	zc = len(ss) - oc
	mn = min(oc, zc)
	if mn % 2 == 0:
		print('NET')
	else:
		print('DA')

def main():
	t = int(inputi())
	for _ in range(t):
		solve()
main()


from sys import stdin, stdout

class SOLVE:

	def solve(self):
		R = stdin.readline
		W = stdout.write
		ans = []
		for i in range(int(input())):
			s = R()
			mn = min(s.count('0'), s.count('1'))
			ans += [['NET', 'DA'][mn % 2]]
		W('\n'.join(ans))

def main():
	s = SOLVE()
	s.solve()
main()


def task_B():
	t = int(input())
	for _ in range(t):
		array = input()
		zeros = 0
		ones = 0
		for char in array:
			if char == '0':
				zeros += 1
			else:
				ones += 1
		moves = min(zeros, ones)
		if moves % 2 == 1:
			print('DA')
		else:
			print('NET')

def main():
	task_B()
main()


for _ in ' ' * int(input()):
	s = input()
	print('NDEAT'[min(s.count('0'), s.count('1')) % 2::2])


import math
import sys
input = sys.stdin.readline
for _ in range(int(input())):
	s = input().strip()
	n = 0
	e = 0
	for i in range(len(s)):
		if s[i] == '0':
			n += 1
		else:
			e += 1
	n = min(n, e)
	if n % 2:
		print('DA')
	else:
		print('NET')


test = int(input())
for i in range(test):
	s = list(input())
	if len(s) == 1:
		print('NET')
		continue
	i = 0
	alice = True
	while True:
		flag = False
		if s[i] != s[i + 1]:
			flag = True
			if alice:
				s.remove(s[i])
				s.remove(s[i])
				alice = False
			else:
				s.remove(s[i])
				s.remove(s[i])
				alice = True
		if not flag:
			i += 1
		else:
			i = 0
		if i + 1 >= len(s):
			break
	if alice:
		print('NET')
	else:
		print('DA')


t = int(input())
for i in range(t):
	l = list(input())
	k = 0
	m = 0
	for j in range(len(l)):
		if l[j] == '1':
			k += 1
		else:
			m += 1
	k = min(k, m)
	if k % 2 == 1:
		print('DA')
	else:
		print('NET')


from sys import stdin, stdout
import math, queue, heapq
fastinput = stdin.readline
fastout = stdout.write
t = int(fastinput())
while t:
	t -= 1
	s = input()
	ans = 0
	stk = []
	for i in s:
		if not stk:
			stk.append(i)
		elif stk[-1] == '1' and i == '0':
			stk.pop()
			ans = 0 if ans else 1
		elif stk[-1] == '0' and i == '1':
			stk.pop()
			ans = 0 if ans else 1
		else:
			stk.append(i)
	if ans:
		print('DA')
	else:
		print('NET')


t = int(input())
for caseNr in range(1, t + 1):
	l = str(input())
	l1 = l.count('1')
	l0 = l.count('0')
	if min(l0, l1) % 2 == 1:
		print('DA')
	else:
		print('NET')


from collections import defaultdict
import sys, math
f = None
try:
	f = open('q1.input', 'r')
except IOError:
	f = sys.stdin
if 'xrange' in dir(__builtins__):
	range = xrange
sys.setrecursionlimit(10 ** 2)

def print_case_iterable(case_num, iterable):
	print('Case #{}: {}'.format(case_num, ' '.join(map(str, iterable))))

def print_case_number(case_num, iterable):
	print('Case #{}: {}'.format(case_num, iterable))

def print_iterable(A):
	print(' '.join(A))

def read_int():
	return int(f.readline().strip())

def read_int_array():
	return [int(x) for x in f.readline().strip().split(' ')]

def rns():
	a = [x for x in f.readline().split(' ')]
	return (int(a[0]), a[1].strip())

def read_string():
	return list(f.readline().strip())

def ri():
	return int(f.readline().strip())

def ria():
	return [int(x) for x in f.readline().strip().split(' ')]

def rns():
	a = [x for x in f.readline().split(' ')]
	return (int(a[0]), a[1].strip())

def rs():
	return list(f.readline().strip())

def bi(x):
	return bin(x)[2:]
from collections import deque
import math
NUMBER = 10 ** 9 + 7

def factorial(n):
	M = NUMBER
	f = 1
	for i in range(1, n + 1):
		f = f * i % M
	return f

def mult(a, b):
	return a * b % NUMBER

def minus(a, b):
	return (a - b) % NUMBER

def plus(a, b):
	return (a + b) % NUMBER

def egcd(a, b):
	if a == 0:
		return (b, 0, 1)
	else:
		(g, y, x) = egcd(b % a, a)
		return (g, x - b // a * y, y)

def modinv(a):
	m = NUMBER
	(g, x, y) = egcd(a, m)
	if g != 1:
		raise Exception('modular inverse does not exist')
	else:
		return x % m

def choose(n, k):
	if n < k:
		assert false
	return mult(factorial(n), modinv(mult(factorial(k), factorial(n - k)))) % NUMBER
from collections import deque, defaultdict
import heapq
from types import GeneratorType

def bootstrap(f, stack=[]):

	def wrappedfunc(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		else:
			to = f(*args, **kwargs)
			while True:
				if type(to) is GeneratorType:
					stack.append(to)
					to = next(to)
				else:
					stack.pop()
					if not stack:
						break
					to = stack[-1].send(to)
			return to
	return wrappedfunc

def dfs(g, timeIn, timeOut, depths, parents):
	cnt = 0
	stack = [[1, 0, 0, 0]]
	while stack:
		(v, neig_i, parent, depth) = stack[-1]
		parents[v] = parent
		depths[v] = depth
		if neig_i == 0:
			timeIn[v] = cnt
			cnt += 1
		while neig_i < len(g[v]):
			u = g[v][neig_i]
			if u == parent:
				neig_i += 1
				continue
			stack[-1][1] = neig_i + 1
			stack.append([u, 0, v, depth + 1])
			break
		if neig_i == len(g[v]):
			stack.pop()
			timeOut[v] = cnt
			cnt += 1
cnt = 0

@bootstrap
def dfs(v, adj, timeIn, timeOut, depths, parents, parent=0, depth=0):
	global cnt
	parents[v] = parent
	depths[v] = depth
	timeIn[v] = cnt
	cnt += 1
	for u in adj[v]:
		if u == parent:
			continue
		yield dfs(u, adj, timeIn, timeOut, depths, parents, v, depth + 1)
	timeOut[v] = cnt
	cnt += 1
	yield

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def lcm(a, b):
	return a * b / gcd(a, b)

def solution(s):
	return 'DA' if min(s.count('1'), s.count('0')) % 2 == 1 else 'NET'

def main():
	T = ri()
	for i in range(T):
		s = rs()
		x = solution(s)
		if 'xrange' not in dir(__builtins__):
			print(x)
		else:
			(print >> output, str(x))
	if 'xrange' in dir(__builtins__):
		print(output.getvalue())
		output.close()
if 'xrange' in dir(__builtins__):
	import cStringIO
	output = cStringIO.StringIO()
main()


from sys import stdin, stdout
import sys
from math import *
for __ in range(int(input())):
	s = input()
	ans = 0
	a = []
	for i in range(len(s)):
		if len(a) == 0:
			a.append(s[i])
		elif s[i] != a[-1]:
			ans += 1
			a.pop()
		else:
			a.append(s[i])
	if ans % 2 == 0:
		print('NET')
	else:
		print('DA')


def sol(s):
	n = len(s)
	one = s.count('1')
	zero = s.count('0')
	z = min(one, zero)
	if z & 1:
		print('DA')
	else:
		print('NET')
	return
t = int(input())
while t:
	t -= 1
	s = input()
	sol(s)


def modinv(n, p):
	return pow(n, p - 2, p)

def main():
	for case in range(int(input())):
		s = input()
		a = s.count('1')
		b = s.count('0')
		n = min(a, b)
		if n % 2 == 0:
			print('NET')
		else:
			print('DA')
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


def alice_win(L):
	if len(L) == 0 or len(L) == 1:
		return False
	count = 0
	a = L[0]
	for item in L:
		if item == a:
			count = count + 1
	if count == len(L):
		return False
	else:
		for i in range(len(L) - 1):
			if len(L) >= 1 and L[i] != L[i + 1]:
				L.remove(L[i])
				L.remove(L[i])
				break
		if len(L) == 0 or len(L) == 1:
			return True
		else:
			count1 = 0
			b = L[0]
			for item in L:
				if item == b:
					count1 = count1 + 1
			if count1 == len(L):
				return True
			else:
				for j in range(len(L) - 1):
					if len(L) >= 1 and L[j] != L[j + 1]:
						L.remove(L[j])
						L.remove(L[j])
						break
				return alice_win(L)
t = int(input())
for case in range(t):
	s = input()
	l = [int(item) for item in s]
	if alice_win(l) == True:
		print('DA')
	else:
		print('NET')


import sys
input = sys.stdin.readline
Q = int(input())
Query = [input().rstrip() for _ in range(Q)]
for S in Query:
	L = len(S)
	a = S.count('1')
	p = min(a, L - a)
	print('DA' if p % 2 == 1 else 'NET')


t = int(input())
for _ in range(t):
	l = list(input())
	z = l.count('0')
	o = l.count('1')
	a = min(z, o)
	if a & 1:
		print('DA')
	else:
		print('NET')


answ = ['NET', 'DA']
t = int(input())
for q in range(t):
	s = input()
	i = 1
	a = [1]
	turn = 0
	while i < len(s):
		if s[i] == s[i - 1]:
			a[len(a) - 1] += 1
		else:
			a.append(1)
		i += 1
	i = 0
	while i < len(a) - 1:
		if a[i] < a[i + 1]:
			a[i + 1] -= a[i]
			turn = abs(a[i] % 2 - turn)
			a.__delitem__(i)
		elif a[i] > a[i + 1]:
			turn = abs(a[i + 1] % 2 - turn)
			if i + 2 < len(a):
				a[i + 2] += a[i] - a[i + 1]
				a.__delitem__(i)
				a.__delitem__(i)
			else:
				a[i] -= a[i + 1]
				a.__delitem__(i + 1)
		elif a[i] == a[i + 1]:
			turn = abs(a[i] % 2 - turn)
			a.__delitem__(i)
			a.__delitem__(i)
	print(answ[turn])


def allone(s):
	n = len(s)
	count = 0
	for i in range(n):
		if s[i] == '1':
			count += 1
	if n == count:
		return True
	return False
t = int(input())
for _ in range(t):
	s = input()
	count = 0
	fset = set(['0', '1'])
	n = len(s)
	i = 0
	while s and i + 1 < n and (not allone(s)):
		if set([s[i], s[i + 1]]) == fset:
			s = s[:i] + s[i + 2:]
			count += 1
			n -= 2
			i = 0
		else:
			i += 1
	if count & 1:
		print('DA')
	else:
		print('NET')


from collections import Counter as C

def solve():
	s = input()
	c = C(s)
	print('DA' if min(c['0'], c['1']) % 2 else 'NET')

def main():
	t = 1
	t = int(input())
	for _ in range(t):
		solve()
main()


import sys
input = lambda : sys.stdin.readline().strip()
for _ in range(int(input())):
	s = input()
	print('DA' if min(s.count('0'), s.count('1')) % 2 == 1 else 'NET')


from collections import Counter

def ans(s):
	c = Counter(s)
	if min(c['0'], c['1']) % 2 == 0:
		return 'NET'
	else:
		return 'DA'
n = int(input())
L = []
for i in range(n):
	s = input()
	L.append(ans(s))
for l in L:
	print(l)


t = int(input())
for _ in range(t):
	s = input()
	count_1 = 0
	count_0 = 0
	for c in s:
		if c == '1':
			count_1 += 1
		elif c == '0':
			count_0 += 1
	if count_0 > count_1:
		pair = count_1
	else:
		pair = count_0
	if pair % 2 == 0:
		print('NET')
	else:
		print('DA')


query = int(input())
for _ in range(query):
	num = input()
	ones = zeros = 0
	for i in range(len(num)):
		if num[i] == '1':
			ones += 1
		else:
			zeros += 1
	m = min(ones, zeros)
	if m:
		if m % 2:
			print('DA')
		else:
			print('NET')
	else:
		print('NET')


t = int(input())
for _ in range(t):
	s = input()
	ones_cnt = 0
	zeros_cnt = 0
	for el in s:
		if el == '1':
			ones_cnt += 1
		else:
			zeros_cnt += 1
	if ones_cnt + zeros_cnt == 1:
		print('NET')
	elif min(ones_cnt, zeros_cnt) % 2 == 1:
		print('DA')
	else:
		print('NET')


_ = int(input())
while _ > 0:
	_ -= 1
	a = input()
	count = 0
	for x in a:
		if x == '1':
			count += 1
	z = len(a) - count
	ans = min(z, count) % 2
	if ans == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
ans = ''
for j in range(t):
	s = input()
	zeros = 0
	ones = 0
	for i in range(len(s)):
		if s[i] == '0':
			zeros += 1
		else:
			ones += 1
	if min(ones, zeros) % 2 == 0:
		ans += 'Net \n'
	else:
		ans += 'Da \n'
print(ans)


t = int(input())
for i in range(t):
	arr = input()
	ones = 0
	zeros = 0
	moves = 0
	for i in arr:
		if i == '1':
			ones += 1
		else:
			zeros += 1
	if ones <= zeros:
		moves = ones
	else:
		moves = zeros
	if moves % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	str1 = input()
	list1 = list(str1)
	aliceTurn = True
	bobTurn = False
	while True:
		length = len(list1)
		if length < 2 or list1.count('1') == 0 or list1.count('0') == 0:
			break
		for i in range(length - 1):
			if list1[i] != list1[i + 1]:
				list1.pop(i)
				list1.pop(i)
				break
		aliceTurn = not aliceTurn
		bobTurn = not bobTurn
	if aliceTurn:
		print('NET')
	else:
		print('DA')


try:
	import math
	t = int(input())
	for i in range(0, t):
		s = input()
		po = s
		s = list(s)
		p = s.count('1')
		q = s.count('0')
		if min(p, q) % 2 == 1:
			print('DA')
		else:
			print('NET')
except:
	pass


t = int(input())
res = []
for z in range(t):
	s = input()
	zer = 0
	ones = 0
	for i in range(len(s)):
		if s[i] == '0':
			zer += 1
		else:
			ones += 1
	if min(zer, ones) % 2 == 0:
		res.append('NET')
	else:
		res.append('DA')
for i in range(t):
	print(res[i])


from __future__ import division, print_function
import itertools
import sys
import os
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	input = raw_input
	range = xrange
	filter = itertools.ifilter
	map = itertools.imap
	zip = itertools.izip

def is_it_local():
	script_dir = str(os.getcwd()).split('/')
	username = 'dipta007'
	return username in script_dir

def READ(fileName):
	if is_it_local():
		sys.stdin = open(f'./{fileName}', 'r')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
if not is_it_local():
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
	input = lambda : sys.stdin.readline().rstrip('\r\n')

def input1(type=int):
	return type(input())

def input2(type=int):
	[a, b] = list(map(type, input().split()))
	return (a, b)

def input3(type=int):
	[a, b, c] = list(map(type, input().split()))
	return (a, b, c)

def input_array(type=int):
	return list(map(type, input().split()))

def input_string():
	s = input()
	return list(s)
if is_it_local():

	def debug(*args):
		st = ''
		for arg in args:
			st += f'{arg} '
		print(st)
else:

	def debug(*args):
		pass

def main():
	t = input1()
	for ci in range(t):
		st = input()
		s = []
		cnt = 0
		for v in st:
			if len(s) > 0 and s[-1] != v:
				cnt += 1
				s.pop()
			else:
				s.append(v)
		print('DA' if cnt % 2 else 'NET')
	pass
main()


for _ in range(int(input())):
	s = input()
	i = s.count('1')
	j = len(s) - i
	if min(i, j) & 1 == 0:
		print('NET')
	else:
		print('DA')


def substrDeletion(string, length):
	count0 = 0
	count1 = 0
	for i in range(length):
		if string[i] == '0':
			count0 += 1
		else:
			count1 += 1
	return min(count0, count1)
t = int(input())
for _ in range(t):
	string = input()
	length = len(string)
	if substrDeletion(string, length) % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
while t > 0:
	s = input()
	l = list(s)
	czero = l.count('0')
	cone = l.count('1')
	if czero > cone or czero == cone:
		if cone % 2 == 0:
			print('NET')
		else:
			print('DA')
	elif czero % 2 == 0:
		print('NET')
	else:
		print('DA')
	t = t - 1


t = int(input())
string_list = []
for i in range(t):
	s = input()
	string_list.append(s)
for string in string_list:
	track = 0
	string_copy = string
	SAL = list(string)
	while track <= len(string_copy):
		if '0' in SAL:
			if '1' in SAL:
				SAL.remove('0')
				SAL.remove('1')
				track += 1
			else:
				break
		else:
			break
	if track % 2 == 0:
		print('NET')
	else:
		print('DA')


import math
t = int(input())
for _ in range(t):
	s = input()
	arr = []
	var = s[0]
	temp = 0
	a = 0
	b = 0
	for i in s:
		if i == '0':
			a += 1
		else:
			b += 1
	arr.append(temp)
	ans = min(a, b)
	if ans % 2 == 0:
		print('NET')
	else:
		print('DA')


def solve(s):
	zeroes = ones = 0
	for c in s:
		if c == '0':
			zeroes += 1
		else:
			ones += 1
	min_count = min(zeroes, ones)
	if min_count % 2 == 0:
		return 'NET'
	else:
		return 'DA'
t = int(input())
results = list()
for _ in range(0, t):
	s = input()
	results.append(solve(s))
for result in results:
	print(result)


def check(s):
	(ind1, ind2) = (False, False)
	for i in s:
		if i == '0' and (not ind1):
			ind1 = True
		if i == '1' and (not ind2):
			ind2 = True
		if ind1 and ind2:
			break
	return ind1 and ind2
for _ in range(int(input())):
	s = input()
	turn = True
	while check(s):
		turn = not turn
		i = 0
		while i < len(s) - 1:
			if s[i] == '0' and s[i + 1] == '1':
				break
			if s[i] == '1' and s[i + 1] == '0':
				break
			i += 1
		s = s[:i] + s[i + 2:]
	if not turn:
		print('DA')
	else:
		print('NET')


import sys

def rs():
	return sys.stdin.readline().rstrip()

def ri():
	return int(sys.stdin.readline())

def ria():
	return list(map(int, sys.stdin.readline().split()))

def ws(s):
	sys.stdout.write(s + '\n')

def wi(n):
	sys.stdout.write(str(n) + '\n')

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')

def solve(s):
	n = len(s)
	turn = 1
	while True:
		if n <= 1:
			return turn == -1
		i = 0
		while i < n - 1:
			if s[i] == '0' and s[i + 1] == '1' or (s[i] == '1' and s[i + 1] == '0'):
				break
			i += 1
		if i == n - 1:
			return turn == -1
		s = s[:i] + s[i + 2:]
		n = len(s)
		turn = -turn

def main():
	for _ in range(ri()):
		s = rs()
		wi('DA' if solve(s) else 'NET')
main()


from collections import Counter
import math
import sys
from bisect import bisect, bisect_left, bisect_right

def input():
	return sys.stdin.readline().strip()

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def mod():
	return 10 ** 9 + 7
for i in range(INT()):
	s = input()
	x = s.count('1')
	y = s.count('0')
	z = min(x, y)
	if z % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	ss = input()
	a = ss.count('0')
	b = ss.count('1')
	mn = min(a, b)
	if mn % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	s = input()
	c = [0, 0]
	for n in s:
		c[int(n)] += 1
	print('DA' if min(c) % 2 else 'NET')


from sys import stdin, stdout
from math import gcd, ceil, sqrt
ii1 = lambda : int(stdin.readline().strip())
is1 = lambda : stdin.readline().strip()
iia = lambda : list(map(int, stdin.readline().strip().split()))
isa = lambda : stdin.readline().strip().split()
mod = 1000000007
tc = ii1()
for _ in range(tc):
	s = is1()
	flip = False
	while True:
		for i in range(len(s) - 1):
			if s[i] != s[i + 1]:
				s = s[:i] + s[i + 2:]
				flip = False if flip else True
				break
		else:
			break
	if flip:
		print('DA')
	else:
		print('NET')


t = int(input())
for i in range(t):
	string = input()
	s = 0
	f = 1
	while f == 1:
		if '01' in string:
			k1 = string.find('01')
			string = string[0:k1] + string[k1 + 2:]
			s += 1
		elif '10' in string:
			k2 = string.find('10')
			string = string[0:k2] + string[k2 + 2:]
			s += 1
		else:
			f = 0
	if s % 2 == 0:
		print('NET')
	else:
		print('DA')


def func(s):
	n = len(s)
	(o, z) = (0, 0)
	for i in s:
		if i == '0':
			z += 1
		else:
			o += 1
	pairs = min(z, o)
	if pairs % 2 == 0:
		return 'NET'
	return 'DA'
t = int(input())
for i in range(t):
	s = input()
	print(func(s))


import re
t = int(input())
for i in range(t):
	s = input()
	k = 0
	c = 0
	r = s
	while k == c:
		if re.search('01', r):
			r = r.replace('01', '', 1)
			c = c + 1
		elif re.search('10', r):
			r = r.replace('10', '', 1)
			c = c + 1
		k = k + 1
	if c % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for _ in range(t):
	g = input()
	a = g.count('1')
	b = g.count('0')
	c = min(a, b)
	if c % 2 == 1:
		print('DA')
	else:
		print('NET')


t = int(input())
for _ in range(t):
	s = input()
	one = 0
	z = 0
	k = 0
	for i in range(len(s)):
		if s[i] == '1':
			one = one + 1
		else:
			z = z + 1
	k = min(one, z)
	if k % 2 == 0:
		print('NET')
	else:
		print('DA')


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def msi():
	return map(str, input().strip().split(' '))

def li():
	return list(mi())

def dmain():
	sys.setrecursionlimit(1000000)
	threading.stack_size(1024000)
	thread = threading.Thread(target=main)
	thread.start()
import sys
input = sys.stdin.readline
scan_int = lambda : int(input())
scan_string = lambda : input().rstrip()
read_list = lambda : list(read())
read = lambda : map(int, input().split())
read_float = lambda : map(float, input().split())

def ceil(x):
	if x != int(x):
		x = int(x) + 1
	return x

def factorial(x, m):
	val = 1
	while x > 0:
		val = val * x % m
		x -= 1
	return val

def fact(x):
	val = 1
	while x > 0:
		val *= x
		x -= 1
	return val

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def lcm(a, b):
	return a * b // math.gcd(a, b)

def is_integer(n):
	return math.ceil(n) == math.floor(n)

def nCr(n, k):
	if k > n:
		return 0
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	(prime[0], prime[1]) = (False, False)
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime

def phi(n):
	result = n
	p = 2
	while p * p <= n:
		if n % p == 0:
			while n % p == 0:
				n = n // p
			result = result * (1.0 - 1.0 / float(p))
		p = p + 1
	if n > 1:
		result = result * (1.0 - 1.0 / float(n))
	return int(result)

def is_prime(n):
	if n == 0:
		return False
	if n == 1:
		return True
	for i in range(2, int(n ** (1 / 2)) + 1):
		if not n % i:
			return False
	return True

def next_prime(n, primes):
	while primes[n] != True:
		n += 1
	return n
MAXN = int(100000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i
spf = [0 for i in range(MAXN)]

def factoriazation(x):
	res = []
	for i in range(2, int(x ** 0.5) + 1):
		while x % i == 0:
			res.append(i)
			x //= i
	if x != 1:
		res.append(x)
	return res

def factors(n):
	res = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			res.append(i)
			res.append(n // i)
	return list(set(res))

def int_array():
	return list(map(int, input().strip().split()))

def float_array():
	return list(map(float, input().strip().split()))

def str_array():
	return input().strip().split()

def binary_search(low, high, w, h, n):
	while low < high:
		mid = low + (high - low) // 2
		if check(mid, w, h, n):
			low = mid + 1
		else:
			high = mid
	return low

def check(beauty, s, n, count):
	pass
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
from itertools import permutations
import math
import bisect as bis
import random
import sys
import collections as collect

def solve():
	s = scan_string()
	val = min(s.count('0'), s.count('1'))
	if val % 2 == 1:
		print('DA')
	else:
		print('NET')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
for i in range(scan_int()):
	solve()


for _ in range(int(input())):
	s = input()
	mins = 1000000000
	(z, o) = (0, 0)
	for i in range(len(s)):
		if s[i] == '0':
			z += 1
		else:
			o += 1
	if z > o:
		mins = o
	else:
		mins = z
	if mins % 2 == 0:
		print('NET')
	else:
		print('DA')


import math

def main():
	s1 = str(input())
	cnt1 = 0
	cnt0 = 0
	for i in range(len(s1)):
		if s1[i] == '1':
			cnt1 += 1
		else:
			cnt0 += 1
	if min(cnt1, cnt0) % 2 == 0:
		print('NET')
	else:
		print('DA')
	return

def test():
	t = int(input())
	while t:
		main()
		t -= 1
test()


for _ in range(int(input())):
	X = input()
	(Z, O) = (X.count('0'), X.count('1'))
	print('DA' if min(Z, O) % 2 == 1 else 'NET')


import math
for _ in range(int(input())):
	s = input()
	a = min(s.count('1'), s.count('0'))
	if a % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	a = input()
	l = len(a)
	i = 0
	coun = 0
	stack = []
	for i in range(l):
		if len(stack) == 0:
			stack.append(a[i])
		elif a[i] == '1':
			if stack[len(stack) - 1] == '0':
				coun += 1
				stack.pop()
			else:
				stack.append(a[i])
		elif stack[len(stack) - 1] == '1':
			coun += 1
			stack.pop()
		else:
			stack.append(a[i])
	if coun % 2 == 1:
		print('DA')
	else:
		print('NET')


t = int(input())
for _ in range(t):
	s = input()
	(count_0, count_1) = (0, 0)
	for char in s:
		if char == '0':
			count_0 += 1
		else:
			count_1 += 1
	if count_0 == 0 or count_1 == 0:
		print('NET')
	elif min(count_0, count_1) % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
l = []
for _ in range(t):
	l.append(str(input()))
for each in l:
	i = 0
	value = 0
	while True:
		if value >= len(each) - 1:
			break
		if each[value] != each[value + 1]:
			each = each[:value] + each[value + 2:]
			value = 0
			i += 1
		else:
			value += 1
	if i % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for i in range(t):
	s = str(input())
	c1 = s.count('1')
	c2 = s.count('0')
	if c1 == 0 or c2 == 0:
		print('NET')
	elif min(c1, c2) % 2 != 0:
		print('DA')
	else:
		print('NET')


import sys
T = int(input())
gamecase_in = sys.stdin.read().rstrip()
gamecase = tuple(gamecase_in.split('\n'))
for case in gamecase:
	strlist = list(case)
	counter = 0
	loop = True
	while loop:
		for i in range(len(strlist) - 1):
			if strlist[i] + strlist[i + 1] == '01':
				del strlist[i], strlist[i]
				counter += 1
				break
			elif strlist[i] + strlist[i + 1] == '10':
				del strlist[i], strlist[i]
				counter += 1
				break
		else:
			loop = False
	if counter % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for i in range(t):
	string = input()
	coun = 0
	l = len(string)
	state = list()
	for i in range(l):
		state.append(string[i])
		if len(state) > 1 and state[-1] != state[-2]:
			coun += 1
			state.pop(-1)
			state.pop(-1)
	print('DA' if coun & 1 else 'NET')


for z in range(int(input())):
	s = list(input())
	l = len(s)
	if s.count('0') == l or s.count('1') == l:
		print('NET')
	else:
		c = 0
		i = 0
		while l != 0:
			if l > 1:
				if s[i] == '1' and s[i + 1] == '0':
					del s[i:i + 2]
					c += 1
					i = 0
				elif s[i] == '0' and s[i + 1] == '1':
					del s[i:i + 2]
					c += 1
					i = 0
				else:
					i += 1
			if i == l - 1:
				l = 0
			else:
				l = len(s)
		if c % 2 == 0:
			print('NET')
		else:
			print('DA')


for nt in range(int(input())):
	s = input()
	n = len(s)
	if '0' not in s or '1' not in s:
		print('NET')
		continue
	stack = [s[0]]
	ans = 0
	for i in range(1, n):
		if len(stack) == 0:
			stack.append(s[i])
		elif s[i] != stack[-1]:
			stack.pop()
			ans = 1 - ans
		else:
			stack.append(s[i])
	if ans:
		print('DA')
	else:
		print('NET')


t = int(input())

def test(b):
	z = 0
	o = 0
	for i in b:
		if i == '0':
			z += 1
		else:
			o += 1
	if z == 0 or o == 0:
		return 0
	elif z == o and z % 2 == 0:
		return 0
	elif z == o and z % 2 == 1:
		return 1
	elif o < z:
		p = o % 2
		return p
	else:
		q = z % 2
		return q
for i in range(t):
	b = input()
	c = test(b)
	if c == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for _ in range(t):
	s = input()
	cnt0 = s.count('0')
	cnt1 = s.count('1')
	p = min(cnt0, cnt1)
	if p % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	b = input()
	o_cnt = 0
	z_cnt = 0
	for char in b:
		if char == '1':
			o_cnt += 1
		else:
			z_cnt += 1
	count = min(o_cnt, z_cnt)
	if count % 2 == 1:
		print('DA')
	else:
		print('NET')


count = int(input())
for _ in range(count):
	a = input()
	count_0 = a.count('0')
	count_1 = a.count('1')
	list_1 = [count_0, count_1]
	mi = min(list_1)
	if mi % 2 == 0:
		print('NET')
	else:
		print('DA')


n = int(input())
op = []
while n:
	l = []
	c1 = 0
	c2 = 0
	s = input()
	for i in s:
		l.append(int(i))
	for i in l:
		if i == 0:
			c1 = c1 + 1
		elif i != 0:
			c2 = c2 + 1
	if c1 >= c2:
		min = c2
	else:
		min = c1
	if min % 2 == 0:
		op.append('NET')
	else:
		op.append('DA')
	n = n - 1
for k in op:
	print(k)


s = []

def play():
	global s
	for i in range(len(s) - 1):
		if s[i] != s[i + 1]:
			del s[i + 1]
			del s[i]
			return True
	return False

def solve():
	global s
	s = list(input())
	turn = 0
	while play():
		turn ^= 1
	print(['NET', 'DA'][turn])
t = int(input())
for _ in range(t):
	solve()


for __ in range(int(input())):
	s = input()
	n = len(s)
	l = []
	for i in s:
		l.append(i)
	c = 0
	i = 0
	f = 0
	while i < n - 1:
		if l[i] == l[i + 1]:
			i += 1
		else:
			l.pop(i)
			l.pop(i)
			if c % 2 == 0:
				f = 1
			else:
				f = 0
			c += 1
			i = 0
			n = len(l)
	if f == 1:
		print('DA')
	else:
		print('NET')


def main():
	t = int(input())
	for case in range(t):
		string = list(input())
		count = 0
		i = 0
		while i < len(string) - 1:
			if string[i] != string[i + 1]:
				string.pop(i)
				string.pop(i)
				i = 0
				count += 1
			else:
				i += 1
		if count % 2 == 1:
			print('DA')
		else:
			print('NET')
main()


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from math import sqrt, floor, factorial, gcd, log
from collections import deque, Counter, defaultdict
from itertools import permutations, combinations
from math import gcd
from bisect import bisect
input = lambda : sys.stdin.readline().rstrip('\r\n')
read = lambda : list(map(int, input().strip().split(' ')))

def func(x):
	t = 0
	for i in arr:
		if i <= x:
			t += i
	return t

def solve():
	for _ in range(int(input())):
		s = input()
		que = deque()
		ans = 0
		dic = {'0': '1', '1': '0'}
		for i in s:
			if que and dic[que[-1]] == i:
				que.pop()
				ans += 1
			else:
				que.append(i)
		if ans % 2:
			print('DA')
		else:
			print('NET')
solve()


import io
import os
from collections import Counter, defaultdict, deque
player = ['DA', 'NET']

def solve(S):
	freq = Counter(S)
	turns = min(freq['0'], freq['1'])
	return (turns + 1) % 2
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
T = int(input())
for t in range(T):
	S = input().decode().rstrip()
	ans = solve(S)
	print(player[ans])


import sys
input = sys.stdin.readline

def int_array():
	return list(map(int, input().strip().split()))

def str_array():
	return input().strip().split()

def lower_letters():
	lowercase = [chr(i) for i in range(97, 97 + 26)]
	return lowercase

def upper_letters():
	uppercase = [chr(i) for i in range(65, 65 + 26)]
	return uppercase
for _ in range(int(input())):
	s = input().strip()
	(a, b) = (0, 0)
	for i in range(len(s)):
		if s[i] == '1':
			a += 1
		else:
			b += 1
	ans = min(a, b)
	if ans % 2 == 0:
		print('NET')
	else:
		print('DA')


ans = []
for _ in range(int(input())):
	u = list(map(int, list(input())))
	a1 = sum(u)
	a0 = len(u) - a1
	d = min(a0, a1)
	if d % 2 == 1:
		ans.append('DA')
	else:
		ans.append('NET')
print('\n'.join(ans))


import sys
from collections import defaultdict as dd
from collections import deque
from fractions import Fraction as f
from copy import *
from bisect import *
from heapq import *
from math import *
from itertools import permutations

def eprint(*args):
	print(*args, file=sys.stderr)
zz = 1
if zz:
	input = sys.stdin.readline
else:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('all.txt', 'w')

def li():
	return [int(x) for x in input().split()]

def fi():
	return int(input())

def si():
	return list(input().rstrip())

def mi():
	return map(int, input().split())

def gh():
	sys.stdout.flush()

def graph(n, m):
	for i in range(m):
		(x, y) = mi()
		a[x].append(y)
		a[y].append(x)

def bo(i):
	return ord(i) - ord('a')
t = fi()
while t > 0:
	t -= 1
	s = si()
	ans = ['DA', 'NET']
	st = []
	c = 0
	n = len(s)
	for i in range(n):
		if len(st):
			if st[-1] != s[i]:
				c += 1
				st.pop()
			else:
				st.append(s[i])
		else:
			st.append(s[i])
	print(ans[c % 2 ^ 1])


for _ in range(int(input())):
	a = list(input())
	o = 0
	z = 0
	for ele in a:
		if ele == '1':
			o += 1
		else:
			z += 1
	pp = min(o, z)
	if pp % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for i in range(t):
	s = input()
	ones = s.count('1')
	zeros = s.count('0')
	mini = min(ones, zeros)
	if mini % 2 != 0:
		print('DA')
	else:
		print('NET')


t = int(input())
for _ in range(t):
	x = str(input())
	a = []
	z = 0
	o = 0
	for i in x:
		if i == '0':
			z += 1
		else:
			o += 1
	if min(z, o) % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for _ in range(t):
	s = list(input())
	count = 0
	A = []
	for i in range(len(s)):
		if len(A) == 0 or A[-1] == s[i]:
			A.append(s[i])
		else:
			A.pop(-1)
			count += 1
	if count % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	s = input()
	n_one = sum(map(int, s))
	if min(n_one, len(s) - n_one) % 2 == 1:
		print('DA')
	else:
		print('NET')


def game(s):
	one = s.count('1')
	zero = s.count('0')
	if min(zero, one) % 2 == 0:
		print('NET')
	else:
		print('DA')
for _ in range(int(input())):
	s = input()
	game(s)


for i in range(int(input())):
	s = input()
	k = []
	count = 0
	for i in range(len(s)):
		if len(k) == 0 or s[i] == k[-1]:
			k.append(s[i])
		else:
			k.pop()
			count += 1
	if count % 2 != 0:
		print('DA')
	else:
		print('NET')


def find_nonconsecutive_idx(arr):
	for i in range(len(arr) - 1):
		if arr[i] != arr[i + 1]:
			return i
	return -1
n = int(input())
in_stream = [input().strip() for i in range(n)]
o = []
for s in in_stream:
	slen = len(s)
	s_arr = list(s)
	num_moves = 0
	while len(s_arr) > 1:
		first_ch_idx = find_nonconsecutive_idx(s_arr)
		if first_ch_idx == -1:
			break
		del s_arr[first_ch_idx + 1]
		del s_arr[first_ch_idx]
		num_moves += 1
	if num_moves % 2 == 0:
		print('NET')
	else:
		print('DA')
for l in o:
	print(l)


from sys import stdin, setrecursionlimit, stdout
from collections import deque
from math import sqrt, floor, ceil, log, log2, log10, pi, gcd, sin, cos, asin
from heapq import heapify, heappop, heappush, heappushpop, heapreplace

def ii():
	return int(stdin.readline())

def fi():
	return float(stdin.readline())

def mi():
	return map(int, stdin.readline().split())

def fmi():
	return map(float, stdin.readline().split())

def li():
	return list(mi())

def si():
	return stdin.readline().rstrip()

def lsi():
	return list(si())
res = ['NET', 'DA']
test_case = ii()
while test_case:
	test_case -= 1
	a = lsi()
	o = z = 0
	for i in a:
		if i == '1':
			o += 1
		else:
			z += 1
	print(res[min(o, z) % 2])


for test in range(int(input())):
	s = input()
	oo = 0
	e_1 = 0
	for i in s:
		if i == '0':
			oo += 1
		else:
			e_1 += 1
	n = min(oo, e_1)
	if n % 2 == 0:
		print('NET')
	else:
		print('DA')


import sys
import math
mod = 10 ** 9 + 7

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_string():
	return sys.stdin.readline().strip()
testcase = int(input())
for _ in range(testcase):
	s = get_string()
	a = s.count('0')
	b = s.count('1')
	x = min(a, b)
	if x % 2 == 0:
		print('NET')
	else:
		print('DA')


from sys import stdin, stdout
from collections import Counter
for _ in range(int(stdin.readline())):
	a = stdin.readline().strip()
	if a.count(a[0]) == len(a):
		print('NET')
	else:
		a1 = Counter(a)
		if a1['0'] == a1['1']:
			if a1['0'] % 2 == 0:
				print('NET')
			else:
				print('DA')
		elif min(a1.values()) % 2 == 0:
			print('NET')
		else:
			print('DA')


t = int(input())
for i in range(t):
	s = list(input())
	x = s.count('0')
	y = len(s) - x
	ans = min(x, y)
	if ans % 2 == 0:
		print('NET')
	else:
		print('DA')


tc = int(input())
for _ in range(tc):
	s = input()
	ns = ''
	c = 0
	while len(s) > 0:
		if '01' in s:
			x = s.index('01')
			if x == 0 and len(s) == 2:
				c += 1
				break
			ns = s[:x] + s[x + 2:]
			s = ns
			c += 1
		elif '10' in s:
			x = s.index('10')
			if x == 0 and len(s) == 2:
				c += 1
				break
			ns = s[:x] + s[x + 2:]
			s = ns
			c += 1
		else:
			break
	if c % 2 == 1:
		print('DA')
	else:
		print('NET')


import sys
input = lambda : sys.stdin.readline().rstrip()
for _ in range(int(input())):
	s = list(input())
	i = 0
	n = len(s)
	b = []
	moves = 0
	while i < n:
		j = i
		ct = 0
		while j < n and s[j] == s[i]:
			j += 1
			ct += 1
		b.append([s[i], ct])
		i = j
	fl = True
	while b and fl:
		fl = False
		i = 0
		c = []
		while i < len(b):
			if i + 1 < len(b) and b[i][0] != b[i + 1][0]:
				mn = min(b[i][1], b[i + 1][1])
				moves += mn
				b[i][1] -= mn
				b[i + 1][1] -= mn
				if b[i][1]:
					c.append(b[i])
				if b[i + 1][1]:
					c.append(b[i + 1])
				i += 2
				fl = True
			else:
				c.append(b[i])
				i += 1
		b = c
	if moves % 2:
		print('DA')
	else:
		print('NET')


sets = int(input())
i = 0
while i < sets:
	data = input()
	answer = min(data.count('1'), data.count('0'))
	if answer % 2 == 0:
		print('NET')
	else:
		print('DA')
	i += 1


t = int(input())
p = []
for i in range(t):
	y = list(map(int, input()))
	p.append(y)

def na(n, arr):
	flag = 0
	for i in range(n - 1):
		if arr[i] != arr[i + 1]:
			flag = 1
			break
	if arr == []:
		return 0
	elif flag == 0:
		return 0
	else:
		for i in range(n - 1):
			if arr[i] != arr[i + 1]:
				t = i
				g = i + 1
		del arr[t]
		del arr[g - 1]
		return 1 + na(n - 2, arr)
for i in range(t):
	u = na(len(p[i]), p[i])
	if u % 2 == 0:
		print('NET')
	else:
		print('DA')


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from math import gcd, ceil

def pre(s):
	n = len(s)
	pi = [0] * n
	for i in range(1, n):
		j = pi[i - 1]
		while j and s[i] != s[j]:
			j = pi[j - 1]
		if s[i] == s[j]:
			j += 1
		pi[i] = j
	return pi

def prod(a):
	ans = 1
	for each in a:
		ans = ans * each
	return ans

def lcm(a, b):
	return a * b // gcd(a, b)

def binary(x, length=16):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y
for _ in range(int(input()) if True else 1):
	s = input()
	c1 = s.count('0')
	c2 = s.count('1')
	m = min(c1, c2)
	print('DA' if m % 2 else 'NET')


t = int(input())
while t > 0:
	s = input()
	l = len(s)
	cnt0 = s.count('0')
	cnt1 = l - cnt0
	cnt1 = abs(cnt1)
	ans = min(cnt0, cnt1)
	if ans % 2 != 0:
		print('DA')
	else:
		print('NET')
	t -= 1


import sys
from math import *
from collections import *
inp = lambda : map(int, input().split())
n = int(input())
for _ in range(n):
	s = input()
	win = 0
	tmp1 = s.find('10')
	tmp2 = s.find('01')
	while tmp1 != -1 or tmp2 != -1:
		if tmp1 != -1:
			s = s.replace('10', '', 1)
		else:
			s = s.replace('01', '', 1)
		win = not win
		tmp1 = s.find('10')
		tmp2 = s.find('01')
	if win:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	string = input()
	rs = 0
	check = 0
	for i in string:
		if i == '0':
			rs += 1
			if rs <= 0:
				check += 1
		else:
			rs -= 1
			if rs >= 0:
				check += 1
	if check % 2 == 0:
		print('NET')
	else:
		print('DA')


tc = int(input())
for _ in range(tc):
	s = list(map(int, input()))
	c0 = 0
	c1 = 0
	for i in s:
		if i == 0:
			c0 += 1
		else:
			c1 += 1
	if c0 == 0 or c1 == 0:
		print('NET')
	elif min(c0, c1) % 2 == 1:
		print('DA')
	else:
		print('NET')


def one():
	s = input()
	z = s.count('0')
	o = s.count('1')
	if z < o:
		if z % 2 == 0:
			print('NET')
		else:
			print('DA')
	elif o % 2 == 0:
		print('NET')
	else:
		print('DA')
t = int(input())
for i in range(t):
	one()


for _ in range(int(input())):
	s = input()
	s = list(s)
	_0 = s.count('0')
	_1 = s.count('1')
	m = min(_0, _1)
	if m % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	s = input()
	ans = 0
	stack = []
	for i in s:
		if not stack:
			stack.append(i)
		elif stack[len(stack) - 1] != i:
			stack.pop()
			ans += 1
		else:
			stack.append(i)
	print('DA' if ans % 2 == 1 else 'NET')


t = int(input())
for i in range(t):
	s = input()
	for j in s:
		if j != s[0]:
			temp = 0
			break
		else:
			temp = 1
	if temp == 1:
		print('NET')
	else:
		zero = 0
		one = 0
		for k in s:
			if k == '0':
				zero += 1
			else:
				one += 1
		if zero == one and zero % 2 == 0:
			print('NET')
		else:
			ans = 0
			if zero > one:
				ans = one
			elif zero < one:
				ans = zero
			if zero == one:
				print('DA')
			elif ans % 2 == 0:
				print('NET')
			else:
				print('DA')


def solve():
	s = input()
	z = 0
	o = 0
	for i in s:
		if i == '1':
			o += 1
		else:
			z += 1
	c = min(o, z)
	if c % 2 == 0:
		print('NET')
	else:
		print('DA')
for i in range(int(input())):
	solve()


t = int(input())
i = 0
while i < t:
	s = input()
	count0 = 0
	count1 = 0
	for x in s:
		if x == '1':
			count1 = count1 + 1
		else:
			count0 = count0 + 1
	p = min(count0, count1)
	if p % 2 == 0:
		print('NET')
	else:
		print('DA')
	i = i + 1


t = int(input())
for i in range(t):
	s = input()
	cnt0 = 0
	cnt1 = 0
	for i in s:
		if i == '0':
			cnt0 += 1
		else:
			cnt1 += 1
	mn = min(cnt0, cnt1)
	if mn % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
while t > 0:
	s = input()
	s0 = s.count('0')
	s1 = s.count('1')
	mini = min(s0, s1)
	if mini % 2 == 0:
		print('NET')
	else:
		print('DA')
	t -= 1


def calc():
	ans1 = 0
	ans2 = 0
	ans = 0
	s = str(input())
	for i in range(0, len(s)):
		if s[i] == '0':
			ans1 += 1
		else:
			ans2 += 1
	ans = min(ans1, ans2)
	if ans % 2 == 1:
		print('DA')
	else:
		print('NET')
t = int(input())
for i in range(1, t + 1):
	calc()


cases = int(input())
for t in range(cases):
	n = input()
	zeros = 0
	ones = 0
	for i in n:
		if i == '0':
			zeros += 1
		else:
			ones += 1
	v = min(ones, zeros)
	if v % 2 == 0:
		print('NET')
	else:
		print('DA')


import queue
import math
t = int(input())
while t:
	s = input()
	(z, o) = (0, 0)
	for c in s:
		z += c == '0'
		o += c == '1'
	if min(z, o) % 2 == 0:
		print('NET')
	else:
		print('DA')
	t -= 1


t = int(input(''))
while t != 0:
	binary = list(input(''))
	move = 'A'
	i = 1
	while i < len(binary):
		if binary[i - 1] != binary[i]:
			i -= 1
			binary.pop(i)
			binary.pop(i)
			if move == 'A':
				move = 'B'
			else:
				move = 'A'
			i = 1
		elif i == len(binary) - 1:
			break
		else:
			i += 1
	if move == 'A':
		print('NET')
	else:
		print('DA')
	t -= 1


import math
import heapq, bisect
import sys
from collections import deque, defaultdict
from fractions import Fraction
mod = 10 ** 9 + 7
mod1 = 998244353
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

class TreeNode:

	def __init__(self, k, v):
		self.key = k
		self.value = v
		self.left = None
		self.right = None
		self.parent = None
		self.height = 1
		self.num_left = 1
		self.num_total = 1

class AvlTree:

	def __init__(self):
		self._tree = None

	def add(self, k, v):
		if not self._tree:
			self._tree = TreeNode(k, v)
			return
		node = self._add(k, v)
		if node:
			self._rebalance(node)

	def _add(self, k, v):
		node = self._tree
		while node:
			if k < node.key:
				if node.left:
					node = node.left
				else:
					node.left = TreeNode(k, v)
					node.left.parent = node
					return node.left
			elif node.key < k:
				if node.right:
					node = node.right
				else:
					node.right = TreeNode(k, v)
					node.right.parent = node
					return node.right
			else:
				node.value = v
				return

	@staticmethod
	def get_height(x):
		return x.height if x else 0

	@staticmethod
	def get_num_total(x):
		return x.num_total if x else 0

	def _rebalance(self, node):
		n = node
		while n:
			lh = self.get_height(n.left)
			rh = self.get_height(n.right)
			n.height = max(lh, rh) + 1
			balance_factor = lh - rh
			n.num_total = 1 + self.get_num_total(n.left) + self.get_num_total(n.right)
			n.num_left = 1 + self.get_num_total(n.left)
			if balance_factor > 1:
				if self.get_height(n.left.left) < self.get_height(n.left.right):
					self._rotate_left(n.left)
				self._rotate_right(n)
			elif balance_factor < -1:
				if self.get_height(n.right.right) < self.get_height(n.right.left):
					self._rotate_right(n.right)
				self._rotate_left(n)
			else:
				n = n.parent

	def _remove_one(self, node):
		replacement = node.left or node.right
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = replacement
			else:
				node.parent.right = replacement
			replacement.parent = node.parent
			node.parent = None
		else:
			self._tree = replacement
			replacement.parent = None
		node.left = None
		node.right = None
		node.parent = None
		self._rebalance(replacement)

	def _remove_leaf(self, node):
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = None
			else:
				node.parent.right = None
			self._rebalance(node.parent)
		else:
			self._tree = None
		node.parent = None
		node.left = None
		node.right = None

	def remove(self, k):
		node = self._get_node(k)
		if not node:
			return
		if AvlTree._is_leaf(node):
			self._remove_leaf(node)
			return
		if node.left and node.right:
			nxt = AvlTree._get_next(node)
			node.key = nxt.key
			node.value = nxt.value
			if self._is_leaf(nxt):
				self._remove_leaf(nxt)
			else:
				self._remove_one(nxt)
			self._rebalance(node)
		else:
			self._remove_one(node)

	def get(self, k):
		node = self._get_node(k)
		return node.value if node else -1

	def _get_node(self, k):
		if not self._tree:
			return None
		node = self._tree
		while node:
			if k < node.key:
				node = node.left
			elif node.key < k:
				node = node.right
			else:
				return node
		return None

	def get_at(self, pos):
		x = pos + 1
		node = self._tree
		while node:
			if x < node.num_left:
				node = node.left
			elif node.num_left < x:
				x -= node.num_left
				node = node.right
			else:
				return (node.key, node.value)
		raise IndexError('Out of ranges')

	@staticmethod
	def _is_left(node):
		return node.parent.left and node.parent.left == node

	@staticmethod
	def _is_leaf(node):
		return node.left is None and node.right is None

	def _rotate_right(self, node):
		if not node.parent:
			self._tree = node.left
			node.left.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.left
			node.left.parent = node.parent
		else:
			node.parent.right = node.left
			node.left.parent = node.parent
		bk = node.left.right
		node.left.right = node
		node.parent = node.left
		node.left = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	def _rotate_left(self, node):
		if not node.parent:
			self._tree = node.right
			node.right.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.right
			node.right.parent = node.parent
		else:
			node.parent.right = node.right
			node.right.parent = node.parent
		bk = node.right.left
		node.right.left = node
		node.parent = node.right
		node.right = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	@staticmethod
	def _get_next(node):
		if not node.right:
			return node.parent
		n = node.right
		while n.left:
			n = n.left
		return n
avl = AvlTree()

class SegmentTree1:

	def __init__(self, data, default='z', func=lambda a, b: min(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class SegmentTree:

	def __init__(self, data, default=0, func=lambda a, b: a + b):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD

def powm(a, n, m):
	if a == 1 or n == 0:
		return 1
	if n % 2 == 0:
		s = powm(a, n // 2, m)
		return s * s % m
	else:
		return a * powm(a, n - 1, m) % m

def sort_list(list1, list2):
	zipped_pairs = zip(list2, list1)
	z = [x for (_, x) in sorted(zipped_pairs)]
	return z

def product(l):
	por = 1
	for i in range(len(l)):
		por *= l[i]
	return por

def binarySearchCount(arr, n, key):
	left = 0
	right = n - 1
	count = 0
	while left <= right:
		mid = int((right + left) / 2)
		if arr[mid] <= key:
			count = mid + 1
			left = mid + 1
		else:
			right = mid - 1
	return count

def countdig(n):
	c = 0
	while n > 0:
		n //= 10
		c += 1
	return c

def countGreater(arr, n, k):
	l = 0
	r = n - 1
	leftGreater = n
	while l <= r:
		m = int(l + (r - l) / 2)
		if arr[m] >= k:
			leftGreater = m
			r = m - 1
		else:
			l = m + 1
	return n - leftGreater
for i in range(int(input())):
	s = input()
	sq = s.count('0')
	sa = s.count('1')
	if min(sq, sa) % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for s in range(t):
	lst = list(map(int, input()))
	count = 0
	check = True
	while check:
		for i in range(len(lst) - 1):
			if lst[i] == 0 and lst[i + 1] == 1 or (lst[i] == 1 and lst[i + 1] == 0):
				count += 1
				del lst[i + 1]
				del lst[i]
				break
		else:
			check = False
		if len(lst) == 0:
			check = False
	if count % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for testcase in range(t):
	s = input()
	n = len(s)
	zero = 0
	one = 0
	for i in range(len(s)):
		if s[i] == '1':
			one += 1
		else:
			zero += 1
	if one == n or zero == n:
		print('NET\n')
		continue
	else:
		one = min(zero, one)
		if one % 2 == 1:
			print('DA\n')
		else:
			print('NET\n')


import sys
from collections import deque
pprint = lambda s: print(' '.join(map(str, s)))
input = lambda : sys.stdin.readline().strip()
ipnut = input
for i in range(int(input())):
	m = 0
	s = list(map(int, input()))
	d = []
	ans = ['NET', 'DA']
	for i in s:
		if d:
			if i != d[-1]:
				d.pop()
				m += 1
			else:
				d.append(i)
		else:
			d.append(i)
	print(ans[m % 2])


h = int(input())
for p in range(h):
	st = input()
	if min(st.count('0'), st.count('1')) % 2 == 1:
		print('DA')
	else:
		print('NET')


t = int(input())
for i in range(t):
	s = input()
	(zero_cnt, one_cnt) = (0, 0)
	for j in range(len(s)):
		if s[j] == '0':
			zero_cnt += 1
		else:
			one_cnt += 1
	if min(zero_cnt, one_cnt) % 2 == 0:
		print('NET')
	else:
		print('DA')


import sys, collections
i = 0
for line in sys.stdin:
	line = line[:-1]
	if not line:
		break
	if i:
		cnt = collections.Counter(line)
		print('DA' if min(cnt['0'], cnt['1']) % 2 else 'NET')
	i += 1


n = int(input())
lst = []
for i in range(n):
	s = str(input())
	n0 = s.count('0')
	n1 = s.count('1')
	if min(n0, n1) % 2 == 1:
		lst.append('DA')
	else:
		lst.append('NET')
for i in range(n):
	print(lst[i])


try:
	for _ in range(int(input())):
		s = input()
		l = [s[0]]
		c = 0
		for i in range(1, len(s)):
			if l and l[-1] != s[i]:
				l.pop()
				c += 1
			else:
				l.append(s[i])
		if c % 2 != 0:
			print('DA')
		else:
			print('NET')
except EOFError:
	pass


for _ in range(int(input())):
	s = input()
	l = s.count('0')
	m = s.count('1')
	if l == 0 or m == 0:
		print('NET')
	elif min(l, m) % 2 != 0:
		print('DA')
	else:
		print('NET')


for tt in range(int(input())):
	s = input()
	c = 0
	while 1:
		if '10' in s:
			c += 1
			s = s.replace('10', '', 1)
		elif '01' in s:
			c += 1
			s = s.replace('01', '', 1)
		else:
			break
	if c % 2 == 0:
		print('NET')
	else:
		print('DA')


n = int(input())
ans = []
for i in range(n):
	l = list(map(int, input()))
	even = list(filter(lambda x: x % 2 == 0, l))
	odd = list(filter(lambda x: x % 2 != 0, l))
	m = min(len(even), len(odd))
	if m % 2 == 0:
		ans.append(str('NET'))
	else:
		ans.append(str('DA'))
print('\n'.join(ans))


import sys
input = sys.stdin.readline

def solve(S):
	turn = 0
	while len(set(S)) == 2:
		idx = -1
		prev = S[0]
		for i in range(1, len(S)):
			if S[i] != prev:
				idx = i
				break
		turn ^= 1
		tmp = ''
		for (i, s) in enumerate(S):
			if i != idx - 1 and i != idx:
				tmp += s
		S = tmp
	if turn == 0:
		return 'NET'
	return 'DA'

def main():
	t = int(input())
	for _ in range(t):
		S = input().strip()
		ans = solve(S)
		sys.stdout.write(ans + '\n')
main()


def minimum(a, b):
	if a <= b:
		return a
	return b
t = int(input())
l = []
for i in range(t):
	str = input()
	zero = 0
	one = 0
	for c in str:
		if c == '0':
			zero = zero + 1
		else:
			one = one + 1
	n = minimum(zero, one)
	if n % 2 == 0:
		l.append(0)
	else:
		l.append(1)
for x in l:
	if x == 1:
		print('DA')
	else:
		print('NET')


import sys
import math
import collections
from sys import stdin, stdout, setrecursionlimit
import bisect as bs
setrecursionlimit(2 ** 20)
M = 10 ** 9 + 7
T = int(stdin.readline())
for _ in range(T):
	s = stdin.readline().strip('\n')
	n = len(s)
	(o, z) = [0, 0]
	for i in range(n):
		if s[i] == '1':
			o += 1
		else:
			z += 1
	m = min(o, z)
	if m % 2 == 0:
		print('NET')
	else:
		print('DA')


from sys import stdin

def iinput():
	return int(stdin.readline())

def sinput():
	return input()

def minput():
	return map(int, stdin.readline().split())

def linput():
	return list(map(int, stdin.readline().split()))
t = iinput()
while t:
	t -= 1
	s = sinput()
	print('DA' if min(s.count('0'), s.count('1')) & 1 else 'NET')


t = int(input())
for i in range(t):
	s = input()
	ans = 1
	while '01' in s or '10' in s:
		if '01' in s:
			ans += 1
			t = s.find('01')
			s = s[0:t] + s[t + 2:]
		if '10' in s:
			ans += 1
			t = s.find('10')
			s = s[0:t] + s[t + 2:]
	if ans % 2 == 1:
		print('NET')
	else:
		print('DA')


import sys
input = sys.stdin.readline
import heapq
import copy
import math
import decimal

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def insr2():
	s = input()
	return s[:len(s) - 1]

def invr():
	return map(int, input().split())

def pr_list(a):
	print(*a, sep=' ')

def main():
	tests = inp()
	limit = 10 ** 18
	ans = 0
	for test in range(tests):
		s = insr()
		n_moves = 0
		stack = []
		for i in range(len(s)):
			if stack == []:
				stack.append(s[i])
				continue
			elif stack[-1] != s[i]:
				stack.pop()
				n_moves = n_moves + 1
			else:
				stack.append(s[i])
		if n_moves % 2 == 0:
			print('NET')
		else:
			print('DA')
main()


t = int(input())
for _ in range(t):
	s = input()
	oneCounts = s.count('1')
	zeroCounts = s.count('0')
	nMoves = min(oneCounts, zeroCounts)
	if nMoves % 2 == 1:
		print('DA')
	else:
		print('NET')


tests = int(input())
ans = [''] * tests
for i in range(tests):
	txt = input()
	x = txt.count('0')
	y = txt.count('1')
	if min(x, y) % 2 == 0:
		ans[i] = 'NET'
	else:
		ans[i] = 'DA'
for sol in ans:
	print(sol)


from sys import stdin, stdout
from math import gcd, sqrt
from collections import deque
input = stdin.readline
R = lambda : map(int, input().split())
I = lambda : int(input())
S = lambda : input().rstrip('\n')
L = lambda : list(R())
P = lambda x: stdout.write(x)
hg = lambda x, y: (y + x - 1) // x * x
pw = lambda x: 1 if x == 1 else 1 + pw(x // 2)
chk = lambda x: chk(x // 2) if not x % 2 else True if x == 1 else False
dgnl = lambda x: sqrt(2 * x ** 2)
for _ in range(I()):
	s = S()
	print(['NET', 'DA'][min(s.count('1'), s.count('0')) % 2])


for _ in range(int(input())):
	l = input()
	(c, c1) = (l.count('0'), l.count('1'))
	x = min(c, c1)
	if x & 1:
		print('DA')
	else:
		print('NET')


for i in range(int(input())):
	something = list(input())
	answer = min(something.count('1'), len(something) - something.count('1'))
	if answer % 2 == 1:
		print('DA')
	else:
		print('NET')


t = int(input())
for rdj in range(t):
	s = input()
	c1 = 0
	c2 = 0
	for i in s:
		if i == '0':
			c1 += 1
		else:
			c2 += 1
	ans = min(c1, c2)
	if ans % 2 != 0:
		print('DA')
	else:
		print('NET')


t = int(input())
for i in range(t):
	s = input()
	x = s.count('0')
	y = s.count('1')
	if x < y:
		res = x
	else:
		res = y
	if res % 2 == 0:
		print('NET')
	else:
		print('DA')


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
mod2 = 998244353
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def main():
	t = I()
	rr = []
	for _ in range(t):
		s = S()
		c = collections.Counter(s)
		m = min(c['1'], c['0'])
		if m % 2 == 0:
			rr.append('NET')
		else:
			rr.append('DA')
	return JA(rr, '\n')
print(main())


for _ in range(int(input())):
	s = input()
	turn = 0
	i = 0
	while 1:
		if len(s) > 1:
			if s[i] != s[i + 1]:
				s = s[:i] + s[i + 2:]
				turn += 1
				i = 0
			else:
				i += 1
				if i == len(s) - 1:
					break
				else:
					continue
		else:
			break
	if turn % 2 == 1:
		print('DA')
	else:
		print('NET')


def get_winner(s):
	n = len(s)
	if s == '0' * n:
		return 'NET'
	if s == '1' * n:
		return 'NET'
	x = s.count('1')
	y = s.count('0')
	m = min(x, y)
	if m % 2 == 0:
		return 'NET'
	else:
		return 'DA'
t = int(input())
for testcase in range(t):
	s = input()
	print(get_winner(s))


t = int(input())
ans = []
for i in range(t):
	string = input()
	zcount = 0
	ocount = 0
	for j in string:
		if j == '0':
			zcount += 1
		else:
			ocount += 1
	m = min(zcount, ocount)
	if m == 0:
		ans.append('NET')
	elif m % 2 == 1:
		ans.append('DA')
	else:
		ans.append('NET')
for i in ans:
	print(i)


for _ in range(int(input())):
	s = input()
	cnt = (len(s) - abs(s.count('1') - s.count('0'))) // 2
	if cnt % 2 == 1:
		print('DA')
	else:
		print('NET')


from collections import Counter
t = int(input())
for x in range(t):
	s = input()
	x = Counter(s)
	ans = min(x['1'], x['0'])
	if ans % 2 == 1:
		print('DA')
	else:
		print('NET')


from sys import stdin, stdout
for _ in range(int(stdin.readline())):
	s = list(input())
	o = 0
	while s:
		f = 1
		for i in range(1, len(s)):
			if s[i] != s[i - 1]:
				o += 1
				s.pop(i)
				s.pop(i - 1)
				f = 0
				break
		if f:
			break
	print('DA' if o & 1 else 'NET')


t = int(input())
for i in range(t):
	s = input()
	l = len(s)
	ct1 = 0
	ct2 = 0
	for i in range(len(s)):
		if s[i] == '1':
			ct2 += 1
		else:
			ct1 += 1
	ans = min(ct1, ct2)
	if ans % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for T in range(t):
	s = input()
	n = len(s)
	l = list(s)
	count = 0
	(c0, c1) = (0, 0)
	for i in range(n):
		if s[i] == '0':
			c0 += 1
		else:
			c1 += 1
	count = min(c1, c0)
	if count % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
ans = []
for i in range(t):
	s1 = input()
	s = list(s1)
	zeros = s.count('0')
	ones = s.count('1')
	dec = min(zeros, ones)
	if dec % 2 == 0:
		ans.append('NET')
	else:
		ans.append('DA')
for an in ans:
	print(an)


inp = int(input())

def find_valid_moves(s):
	length = len(s)
	idx = [x for x in range(length)]
	res = []
	for (i, x) in enumerate(s):
		if i == length - 1:
			continue
		if s[i] != s[i + 1]:
			tmp = [i, i + 1]
			res.append(tmp)
	return res

def switch_player(name):
	if name == 'a':
		name = 'b'
	else:
		name = 'a'
	return name
while inp != 0:
	s = input()
	s = [x for x in s]
	n_moves = 0
	not_ended = True
	name = 'a'
	while not_ended:
		moves = find_valid_moves(s)
		if len(moves) >= 1:
			for i in sorted(moves[0], reverse=True):
				del s[i]
			name = switch_player(name)
		if (len(moves) == 0) & (n_moves != 0):
			if name == 'b':
				print('DA')
			else:
				print('NET')
			not_ended = False
			continue
		if (len(moves) == 0) & (n_moves == 0):
			print('NET')
			not_ended = False
			continue
		n_moves += 1
	inp -= 1


t = int(input())
for i in range(t):
	s = input()
	ans = 'DA'
	count = 0
	while '01' in s or '10' in s:
		count += 1
		ind = s.find('01')
		if ind > -1:
			s = s[:ind] + s[ind + 2:]
			continue
		ind = s.find('10')
		if ind > -1:
			s = s[:ind] + s[ind + 2:]
	if count % 2 == 0:
		ans = 'NET'
	print(ans)


n = int(input())
for x in range(n):
	t = str(input())
	ones = 0
	zeros = 0
	for x in range(len(t)):
		if t[x] == '1':
			ones += 1
		else:
			zeros += 1
	if min(zeros, ones) % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	s = list(input())
	s += ' '
	c = 0
	i = 0
	l = len(s)
	for i in range(len(s) - 1):
		k = 0
		while k + 1 < len(s):
			if s[k] != s[k + 1] and s[k + 1] != ' ':
				if s[k + 2]:
					s = s[:k] + s[k + 2:]
					k = 0
					c += 1
				else:
					k += 1
			else:
				k += 1
	if c % 2 == 0:
		print('NET')
	else:
		print('DA')


T = int(input())
for _ in range(T):
	S = input()
	z = S.count('0')
	o = len(S) - z
	p = min(z, o)
	print('DA' if p % 2 else 'NET')


t = int(input())
for i in range(t):
	binstr = list(input())
	zeros = binstr.count('0')
	ones = binstr.count('1')
	if zeros >= ones:
		if ones % 2 == 0:
			print('NET')
		else:
			print('DA')
	elif zeros % 2 == 0:
		print('NET')
	else:
		print('DA')


import re
test = re.compile('01|10')
for _ in range(int(input())):
	s = str(input())
	i = 0
	while s != '' and test.search(s):
		l = test.search(s).start()
		s = list(s)
		del s[l]
		del s[l]
		s = ''.join(s)
		i += 1
	if i % 2 == 0:
		print('NET')
	else:
		print('DA')


for x in range(int(input())):
	s = input()
	f = 1
	while True:
		n = len(s)
		if s.count('1') == n or s.count('0') == n:
			break
		for x in range(1, n):
			if s[x] != s[x - 1]:
				s = s[0:x - 1] + s[x + 1:]
				f = (f + 1) % 2
				break
	if f == 0:
		print('DA')
	else:
		print('NET')


from collections import defaultdict as dd
import sys
input = sys.stdin.readline
t = int(input())
while t:
	s = input().split()[0]
	n = len(s)
	zero = s.count('0')
	one = n - zero
	m = min(zero, one)
	if m % 2:
		print('DA')
	else:
		print('NET')
	t -= 1


ST = int(input())
while ST:
	ST -= 1
	s = input()
	(cnt0, cnt1) = (0, 0)
	for i in s:
		if i == '0':
			cnt0 += 1
		else:
			cnt1 += 1
	if cnt0 != len(s) and cnt1 != len(s) and min(cnt0, cnt1) % 2:
		print('DA')
		continue
	print('NET')


import math
t = int(input(''))
while t > 0:
	s = input('')
	ones_count = 0
	zeroes_count = 0
	for i in s:
		if i == '0':
			zeroes_count += 1
	ones_count = len(s) - zeroes_count
	moves = min(zeroes_count, ones_count)
	if moves % 2 == 0:
		print('NET')
	else:
		print('DA')
	t -= 1


for _ in range(int(input())):
	s = list(str(input()))
	c1 = s.count('1')
	c0 = s.count('0')
	d = min(c0, c1)
	if d % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for _ in range(t):
	s = input()
	ones = 0
	for s_i in s:
		if s_i == '1':
			ones += 1
	zeroes = len(s) - ones
	turns = min(ones, zeroes)
	if turns % 2 == 1:
		print('DA')
	else:
		print('NET')


import sys
readline = sys.stdin.readline

def solve():
	S = readline().rstrip()
	c0 = S.count('0')
	c1 = S.count('1')
	m = min(c0, c1)
	print('DA' if m % 2 == 1 else 'NET')
T = int(readline())
for i in range(T):
	solve()


t = int(input())
for _ in range(t):
	s = input()
	count = 0
	a = 0
	b = 0
	while a != -1 or b != -1:
		a = s.find('01')
		b = s.find('10')
		if a > b and b != -1:
			s = s.replace('10', '', 1)
			count += 1
		elif a > b and b == -1:
			s = s.replace('01', '', 1)
			count += 1
		elif b > a and a != -1:
			s = s.replace('01', '', 1)
			count += 1
		elif b > a and a == -1:
			s = s.replace('10', '', 1)
			count += 1
	if count % 2 == 0:
		print('NET')
	else:
		print('DA')


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def fi():
	return float(input())

def si():
	return input()

def msi():
	return map(str, input().split())

def mi():
	return map(int, input().split())

def li():
	return list(mi())

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
mod = 1000000007
from math import log, log2, sqrt, factorial, cos, tan, sin, radians, ceil, floor
import bisect
from decimal import *
abc = 'abcdefghijklmnopqrstuvwxyz'
pi = 3.141592653589793

def main():
	for _ in range(ii()):
		s = si()
		c = 0
		o = s.count('1')
		z = len(s) - o
		x = min(o, z)
		if x % 2:
			print('DA')
		else:
			print('NET')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


from collections import Counter
t = int(input())
for i in range(t):
	s = input()
	a = Counter(s)
	b = min(a['0'], a['1'])
	if b % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	s = input()
	if s.count('10') == 0 and s.count('01') == 0:
		print('NET')
	else:
		c = 0
		while s.count('10') > 0 or s.count('01') > 0:
			if s.count('10') > 0:
				s = s.replace('10', '', 1)
				c += 1
			if s.count('01') > 0:
				s = s.replace('01', '', 1)
				c += 1
		print('DA' if c % 2 == 1 else 'NET')


from os import path
import sys
from functools import cmp_to_key as ctk
from collections import deque, defaultdict as dd
from bisect import bisect, bisect_left, bisect_right, insort, insort_left, insort_right
from itertools import permutations
from datetime import datetime
from math import ceil, sqrt, log, gcd

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().split())

def li():
	return list(mi())
abc = 'abcdefghijklmnopqrstuvwxyz'
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def bo(i):
	return ord(i) - ord('a')

def solve():
	for _ in range(ii()):
		s = si()
		f = 1
		f1 = 1
		n = len(s) - 1
		a = []
		for i in range(n):
			if len(a) == 0:
				a.append(s[i])
			elif a[len(a) - 1] != s[i]:
				a.pop()
				f ^= 1
			else:
				a.append(s[i])
		if f == 0:
			print('DA')
		else:
			print('NET')
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
else:
	input = sys.stdin.readline
solve()


for t in range(int(input())):
	s = input()
	n = len(s)
	ones = s.count('1')
	z = n - ones
	if z > ones:
		comb = ones
	else:
		comb = z
	if comb % 2 != 0:
		print('DA')
	else:
		print('NET')


def ques2(s):
	x = s.count('0')
	y = s.count('1')
	if x == 0 or y == 0:
		print('NET')
		return
	if x == y:
		if x % 2 != 0 or y % 2 != 0:
			print('DA')
		else:
			print('NET')
		return
	if x > y:
		if y % 2 != 0:
			print('DA')
		else:
			print('NET')
		return
	if x < y:
		if x % 2 != 0:
			print('DA')
		else:
			print('NET')
		return
t = int(input())
for i in range(t):
	s = input()
	ans = ques2(s)


t = int(input())
for tc in range(t):
	line = input()
	(c1, c2) = (0, 0)
	for i in line:
		if i == '1':
			c1 += 1
		if i == '0':
			c2 += 1
	if min(c1, c2) % 2 == 0:
		print('NET')
	else:
		print('DA')


try:
	t = int(input())
	for _ in range(t):
		s = input()
		li = list(s)
		c = li.count('1')
		z = len(li) - c
		l = len(s)
		m = min(c, z)
		if c % 2 == 0 and z % 2 == 0 or l == c or l == z:
			print('NET')
		elif m % 2 == 0:
			print('NET')
		else:
			print('DA')
except:
	pass


import math
from collections import deque
import sys
sys.setrecursionlimit(10 ** 4)

def Divisors(n):
	l = []
	i = 2
	while i <= math.sqrt(n):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
		i = i + 1
	return l

def SieveOfEratosthenes(n):
	l = []
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	for p in range(2, n + 1):
		if prime[p]:
			l.append(p)
	return l

def primeFactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(i)
			n = n / i
	if n > 2:
		l.append(n)
	return l

def Factors(n):
	result = []
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			if i == n / i:
				result.append(i)
			else:
				result.append(i)
				result.append(n // i)
	result.append(1)
	result.append(n)
	return result

def maxSubArraySum(a):
	max_so_far = 0
	max_ending_here = 0
	size = len(a)
	for i in range(0, size):
		max_ending_here = max_ending_here + a[i]
		if max_so_far < abs(max_ending_here):
			max_so_far = max_ending_here
	return max_so_far

def longestsubarray(arr, n, k):
	current_count = 0
	max_count = 0
	for i in range(0, n, 1):
		if arr[i] % k != 0:
			current_count += 1
		else:
			current_count = 0
		max_count = max(current_count, max_count)
	return max_count

def main():
	s = input()
	c1 = 0
	c2 = 0
	for j in s:
		if j == '1':
			c1 += 1
		else:
			c2 += 1
	if min(c1, c2) % 2 == 0:
		print('NET')
	else:
		print('DA')
t = int(input())
for i in range(0, t):
	main()


t = int(input())
d = []
for i in range(t):
	d.append(input())
for i in range(t):
	m = min(d[i].count('1'), d[i].count('0'))
	if m % 2 == 1:
		print('DA')
	else:
		print('NET')


t = int(input())
for j in range(0, t):
	st = input()
	if min(st.count('0'), st.count('1')) % 2 == 1:
		print('DA')
	else:
		print('NET')


test = int(input())
for _ in range(test):
	s = input()
	zero = 0
	for i in range(len(s)):
		if s[i] == '0':
			zero += 1
	diff = min(zero, len(s) - zero)
	print('NET') if diff % 2 == 0 else print('DA')


for _ in range(int(input())):
	s = input()
	a = '01'
	b = '10'
	f = False
	no = 0
	for i in range(0, len(s) - 1):
		k = s[i] + s[i + 1]
		if (k == a or k == b) and f == False:
			no += 1
			f = True
			break
	dict = {}
	dict['0'] = 0
	dict['1'] = 0
	if no > 0:
		for e in s:
			dict[e] += 1
		n = min(dict['1'], dict['0'])
		if n % 2 == 0:
			print('NET')
		else:
			print('DA')
	else:
		print('NET')


import math, sys
from sys import stdin, stdout
from collections import Counter, defaultdict, deque
input = stdin.readline
I = lambda : int(input())
li = lambda : list(map(int, input().split()))

def solve():
	s = input().strip()
	c = 0
	ans = []
	for i in range(len(s)):
		if len(ans) == 0:
			ans.append(s[i])
		elif ans[-1] == s[i]:
			ans.append(s[i])
		else:
			c += 1
			ans.pop()
	if c % 2:
		print('DA')
	else:
		print('NET')
for _ in range(I()):
	solve()


import sys
from collections import deque

def get_ints():
	return map(int, I().split())

def get_list():
	return list(map(int, I().split()))

def I():
	return sys.stdin.readline().strip()
for _ in range(int(I())):
	a = I()
	L = deque()
	win = min(a.count('0'), a.count('1'))
	print('DA' if win % 2 else 'NET')


t = int(input())
for i in range(t):
	s = list(input())
	a1 = s.count('0')
	a2 = s.count('1')
	if min(a1, a2) % 2 == 0:
		print('NET')
	else:
		print('DA')


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
t = int(input())
for _ in range(t):
	s = input()
	l = []
	m = 0
	for i in s:
		if l and i != l[-1]:
			l.pop()
			m += 1
		else:
			l.append(i)
	if m & 1:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	l = list(input())
	f = 1
	z = l.count('0')
	o = l.count('1')
	while z > 0 and o > 0:
		z -= 1
		o -= 1
		f = 0 if f == 1 else 1
	print('DA') if f == 0 else print('NET')


for _ in range(int(input())):
	s = input()
	count = 0
	while True:
		if '01' in s:
			j = s.index('01')
			s = s[:j] + s[j + 2:]
			count += 1
		elif '10' in s:
			j = s.index('10')
			s = s[:j] + s[j + 2:]
			count += 1
		else:
			break
	if count % 2 != 0:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	s = input()
	cnt0 = s.count('0')
	cnt1 = len(s) - cnt0
	cnt = min(cnt0, cnt1)
	if cnt & 1:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	s = input()
	one = s.count('1')
	zero = s.count('0')
	if one % 2 == 1 and zero % 2 == 1:
		print('DA')
	elif one % 2 == 0 and zero % 2 == 0:
		print('NET')
	elif one % 2 == 1:
		if zero > one:
			print('DA')
		else:
			print('NET')
	elif one > zero:
		print('DA')
	else:
		print('NET')


from sys import stdin, stdout
from sys import maxsize
input = stdin.readline

def solve():
	pass
test = 1
test = int(input().strip())
for t in range(0, test):
	s = list(input().strip())
	(zeros, ones) = (0, 0)
	for ele in s:
		if ele == '0':
			zeros += 1
		else:
			ones += 1
	ans = min(zeros, ones)
	if ans % 2 == 0:
		print('NET')
	else:
		print('DA')
	ans = solve()


n = int(input(' '))
for i in range(n):
	a = 0
	b = 0
	x = input('')
	for w in range(len(x)):
		if x[w] == '0':
			a = a + 1
		else:
			b = b + 1
	if a <= b:
		if a % 2 != 0:
			print('DA\n')
		else:
			print('NET\n')
	elif b < a:
		if b % 2 != 0:
			print('DA\n')
		else:
			print('NET\n')


def io():
	s = input()
	return s

def solve():
	s = io()
	move = 0
	while True:
		if '01' in s:
			move += 1
			s = s.replace('01', '', 1)
		elif '10' in s:
			move += 1
			s = s.replace('10', '', 1)
		else:
			break
	if move % 2 == 0:
		print('NET')
	else:
		print('DA')
T = int(input())
for _ in range(T):
	solve()


t = int(input())
while t > 0:
	s = input()
	cnt1 = 0
	cnt0 = 0
	for i in range(0, len(s)):
		if s[i] == '1':
			cnt1 += 1
		else:
			cnt0 += 1
	count = min(cnt1, cnt0)
	if count % 2 == 1:
		print('DA')
	else:
		print('NET')
	t -= 1


import math, itertools, fractions, heapq, collections, bisect, sys, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def LS():
	return sys.stdin.readline().split()

def S():
	return input()

def main():
	n = I()
	ans = []
	for _ in range(n):
		s = S()
		x = s.count('1')
		y = len(s) - x
		mn = min(x, y)
		if mn % 2 == 1:
			ans.append('DA')
		else:
			ans.append('NET')
	for x in ans:
		print(x)
main()


from collections import Counter

def main():
	t = int(input())
	for i in range(t):
		s = input()
		c = Counter(s)
		m = min(c['0'], c['1'])
		if m % 2 == 1:
			print('DA')
		else:
			print('NET')
main()


for _ in range(int(input())):
	s = list(input())
	d = []
	val = 0
	for i in s:
		if len(d) == 0:
			d.append(i)
		elif i != d[-1]:
			if val == 0:
				val = 1
			else:
				val = 0
			d.pop()
		else:
			d.append(i)
	if val == 0:
		print('NET')
	else:
		print('DA')


def isadjdiff(l, ind):
	if ind < len(l) - 1:
		if l[ind] == 0 and l[ind + 1] == 1:
			return True
		if l[ind] == 1 and l[ind + 1] == 0:
			return True
	else:
		return False

def makedigitlist(N):
	temp = [int(x) for x in str(N)]
	return str(temp)
T = int(input())
for i in range(T):
	num = str(input())
	arr = [int(x) for x in num]
	i = 0
	count = 0
	while len(arr) > 0:
		if isadjdiff(arr, i) == True:
			arr.pop(i)
			arr.pop(i)
			i = 0
			count += 1
		else:
			i += 1
		if i == len(arr):
			break
	if count % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for i in range(t):
	n1 = 0
	n0 = 0
	tot = 0
	s = str(input())
	for j in range(len(s)):
		if s[j] == '1':
			n1 += 1
		else:
			n0 += 1
	if n1 >= n0:
		if n0 % 2 == 0:
			print('NET')
		else:
			print('DA')
	elif n1 % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	s = input()
	l = len(s)
	p = q = r = 0
	for i in range(l):
		if s[i] == '0':
			if p > 0:
				r += 1
				p -= 1
			else:
				q += 1
		elif q > 0:
			r += 1
			q -= 1
		else:
			p += 1
	if r % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	s = input()
	n = len(s)
	c = 0
	i = 1
	p = [0]
	while i < n:
		if len(p) > 0 and s[p[-1]] != s[i]:
			p.pop()
			c += 1
		else:
			p.append(i)
		i += 1
	print('DA' if c & 1 else 'NET')


t = int(input())
ans = []
for l in range(t):
	s = input()
	n = len(s)
	count1 = 0
	count2 = 0
	for i in range(n):
		if s[i] == '0':
			count1 += 1
	count2 = n - count1
	if min(count1, count2) % 2 != 0:
		ans.append('DA')
	else:
		ans.append('NET')
for i in range(t):
	print(ans[i])


T = int(input())
for t in range(T):
	s = input()
	one = s.count('1')
	zero = s.count('0')
	m = min(one, zero)
	if m == 0:
		print('NET')
	elif m % 2 == 0:
		print('NET')
	else:
		print('DA')


def ans(a):
	i = 0
	j = len(a)
	count = 0
	while i < j - 1:
		if a[i] == '0' and a[i + 1] == '1' or (a[i] == '1' and a[i + 1] == '0'):
			del a[i]
			del a[i]
			if i > 0:
				i -= 1
			j -= 2
			count += 1
		else:
			i += 1
	if count % 2 == 0:
		return 'NET'
	else:
		return 'DA'
m = int(input())
for i in range(m):
	s = input()
	lis = []
	for i in s:
		lis.append(i)
	print(ans(lis))


for _ in range(int(input())):
	n = input()
	l = list(n)
	i = len(n) - 1
	t = 0
	while i >= 1:
		if len(l) - i >= 1:
			a = int(l[i]) - int(l[i - 1])
			if a == 1 or a == -1:
				l.pop(i)
				l.pop(i - 1)
				t += 1
			else:
				i -= 1
		else:
			i -= 1
	if t % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
testcases = list()
for i in range(t):
	testcases.append(input())
for testcase in testcases:
	l = list(testcase)
	l.sort()
	if '1' not in l:
		print('NET')
		continue
	if '0' not in l:
		print('NET')
		continue
	one_start = l.index('1')
	n = min(one_start, len(l) - one_start)
	if n == 0:
		print('NET')
	elif n == 1:
		print('DA')
	elif n % 2 == 0:
		print('NET')
	else:
		print('DA')


T = int(input())
for i in range(T):
	S = input()
	l = len(S)
	k = l // 2
	l_ones = 0
	r_ones = 0
	l_zer = 0
	r_zer = 0
	for j in range(l):
		if j < k:
			if S[j] == '0':
				l_zer += 1
			else:
				l_ones += 1
		elif S[j] == '0':
			r_zer += 1
		else:
			r_ones += 1
	ans = min(l_ones, r_zer) + min(l_zer, r_ones)
	if ans & 1 == 0:
		print('NET')
	else:
		print('DA')


import sys
for t in range(int(input())):
	a = input()
	print('NET' if min(a.count('0'), a.count('1')) % 2 == 0 else 'DA')


from sys import stdin
input = lambda : stdin.readline().strip()
from math import ceil, sqrt, factorial, gcd
from collections import deque
for _ in range(int(input())):
	s = list(input())
	i = 1
	if len(s) == 1:
		print('NET')
	else:
		count = 0
		stack = [s[0]]
		for i in range(1, len(s)):
			if len(stack) > 0:
				x = stack.pop()
				if s[i] == '1':
					if x == '0':
						count += 1
					else:
						stack.append(x)
						stack.append('1')
				elif s[i] == '0':
					if x == '1':
						count += 1
					else:
						stack.append(x)
						stack.append('0')
			else:
				stack.append(s[i])
		if count % 2 == 0:
			print('NET')
		else:
			print('DA')


from __future__ import division, print_function
from sys import stdin, stdout
import bisect
import math
import heapq
i_m = 9223372036854775807

def inin():
	return int(input())

def stin():
	return input()

def spin():
	return map(int, stin().split())

def lin():
	return list(map(int, stin().split()))

def matrix(n):
	return [list(map(int, input().split())) for i in range(n)]

def count2Dmatrix(i, list):
	return sum((c.count(i) for c in list))

def modinv(n, p):
	return pow(n, p - 2, p)

def GCD(x, y):
	x = abs(x)
	y = abs(y)
	if min(x, y) == 0:
		return max(x, y)
	while y:
		(x, y) = (y, x % y)
	return x

def Divisors(n):
	l = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
	return l
prime = []

def SieveOfEratosthenes(n):
	global prime
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	f = []
	for p in range(2, n):
		if prime[p]:
			f.append(p)
	return f
q = []

def dfs(n, d, v, c):
	global q
	v[n] = 1
	x = d[n]
	q.append(n)
	j = c
	for i in x:
		if i not in v:
			f = dfs(i, d, v, c + 1)
			j = max(j, f)
	return j
for _ in range(inin()):
	s = list(stin())
	i = 0
	c = 0
	while len(s) >= 1:
		if ('01' in ''.join(s)) == False and ('10' in ''.join(s)) == False:
			break
		if len(s) >= 2 and i + 1 < len(s):
			if s[i] == '1' and s[i + 1] == '0' or (s[i] == '0' and s[i + 1] == '1'):
				c += 1
				del s[i]
				del s[i]
				i = 0
			else:
				i += 1
		else:
			break
	if c % 2 == 1:
		print('DA')
	else:
		print('NET')


tt = int(input())
for loop in range(tt):
	z = 0
	o = 0
	s = input()
	for i in s:
		if i == '0':
			z += 1
		else:
			o += 1
	if min(z, o) % 2 == 0:
		print('NET')
	else:
		print('DA')


import sys
from collections import defaultdict as dd
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	arr = list(map(int, input().strip()))
	co = 0
	cz = 0
	for i in arr:
		if i == 1:
			co += 1
		else:
			cz += 1
	mini = min(co, cz)
	if mini % 2 == 1:
		print('DA')
	else:
		print('NET')


n = int(input())
for i in range(n):
	number = ''.join(sorted(list(input())))
	Count = 0
	while '01' in number:
		Count += 1
		number = number.replace('01', '')
	if Count % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for i in range(t):
	S = list(input())
	a = S.count('0')
	b = S.count('1')
	c = min(a, b)
	if c % 2 == 1:
		ans = 'DA'
	else:
		ans = 'NET'
	print(ans)


for _ in range(int(input())):
	s = input()
	o = 0
	l = 0
	for i in range(len(s)):
		if s[i] == '0':
			o += 1
		else:
			l += 1
	x = min(o, l)
	if x % 2 != 0:
		print('DA')
	else:
		print('NET')


def solve(s):
	l = 0
	r = 0
	count = 0
	i = 0
	while i < len(s) - 1:
		for j in range(i + 1, len(s)):
			a = s[i:j + 1].count('1')
			if a == s[i:j + 1].count('0'):
				count += a
				i = j
				break
		i += 1
	if count % 2 != 0:
		return True
	else:
		return False
t = int(input())
for we in range(t):
	s = input()
	if solve(s):
		print('DA')
	else:
		print('NET')


for t in range(int(input())):
	s1 = input()
	m0 = s1.count('0')
	m1 = s1.count('1')
	if min(m0, m1) % 2 == 0:
		print('NET')
	else:
		print('DA')


import sys
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep='\n')

def II():
	return int(sys.stdin.readline())

def MI():
	return map(int, sys.stdin.readline().split())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def SI():
	return sys.stdin.readline()[:-1]

def main():
	for _ in range(II()):
		s = SI()
		c1 = s.count('1')
		c0 = len(s) - c1
		c = min(c0, c1)
		if c & 1:
			print('DA')
		else:
			print('NET')
main()


f = int(input())
for q in range(f):
	s = input()
	a = []
	for i in range(len(s)):
		a.append(s[i])
	if min(a.count('1'), a.count('0')) % 2 == 1:
		print('DA')
	else:
		print('NET')


t = int(input())
for k in range(t):
	n = input()
	x = n.count('1')
	y = n.count('0')
	z = min(x, y)
	if z & 1:
		print('DA')
	else:
		print('NET')


import os
import gc
import sys
from io import BytesIO, IOBase
from collections import Counter
from collections import deque
import heapq
import math
import statistics

def sin():
	return input()

def ain():
	return list(map(int, sin().split()))

def sain():
	return input().split()

def iin():
	return int(sin())
MAX = float('inf')
MIN = float('-inf')
MOD = 1000000007

def readTree(n, m):
	adj = [deque([]) for _ in range(n + 1)]
	for _ in range(m):
		(u, v) = ain()
		adj[u].append(v)
		adj[v].append(u)
	return adj

def solve(n, d):
	pass

def main():
	for _ in range(iin()):
		s = sin()
		if '0' not in s:
			print('NET')
		elif '1' not in s:
			print('NET')
		else:
			cz = s.count('0')
			co = s.count('1')
			ans = min(cz, co)
			if ans % 2 == 1:
				print('DA')
			else:
				print('NET')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


test = int(input())
for i in range(test):
	s = input()
	ones = 0
	zero = 0
	for i in s:
		if i == '1':
			ones += 1
		else:
			zero += 1
	if zero == 0 or ones == 0:
		print('NET')
	elif len(s) % 2 == 0:
		if ones % 2:
			print('DA')
		else:
			print('NET')
	else:
		t = min(zero, ones)
		if t % 2:
			print('DA')
		else:
			print('NET')


n = int(input())
lst = []
for _ in range(n):
	BINARY = input()
	stack = []
	for each in BINARY:
		if not stack or each is stack[-1]:
			stack.append(each)
		else:
			stack.pop()
	turns = (len(BINARY) - len(stack)) // 2
	if turns % 2 == 0:
		lst.append('NET')
	else:
		lst.append('DA')
print('\n'.join(lst))


def read_int():
	n = int(input())
	return n

def read_ints():
	ints = [int(x) for x in input().split(' ')]
	return ints

def solve(s):
	moves = 0
	ms1 = s.split('10')
	ms2 = s.split('01')
	while len(ms1) > 1 or len(ms2) > 1:
		if len(ms1) > len(ms2):
			moves += len(ms1) - 1
			s = ''.join(ms1)
		else:
			moves += len(ms2) - 1
			s = ''.join(ms2)
		ms1 = s.split('10')
		ms2 = s.split('01')
	if moves % 2 == 1:
		return 'DA'
	else:
		return 'NET'
t = read_int()
for case in range(t):
	s = input()
	sol = solve(s)
	print(sol)


import sys
import math
read = sys.stdin.buffer.read
readlines = sys.stdin.buffer.readlines
t = int(input())
for case in range(t):
	s = input()
	zero_num = s.count('0')
	if min(len(s) - zero_num, zero_num) == 0:
		print('NET')
	elif min(len(s) - zero_num, zero_num) % 2:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	s = input()
	cnt = 0
	while 1:
		if '01' in s:
			cnt += 1
			s = s.replace('01', '', 1)
		elif '10' in s:
			cnt += 1
			s = s.replace('10', '', 1)
		else:
			break
	if cnt % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
ausgabe = []
for i in range(t):
	s = input()
	splited = list(s)
	count_one = splited.count('1')
	count_zero = splited.count('0')
	if count_one == 0 or count_zero == 0:
		ausgabe.append('NET')
	elif count_one < count_zero:
		if count_one % 2 == 0:
			ausgabe.append('NET')
		else:
			ausgabe.append('DA')
	elif count_one > count_zero:
		if count_zero % 2 == 0:
			ausgabe.append('NET')
		else:
			ausgabe.append('DA')
	elif count_one % 2 == 0:
		ausgabe.append('NET')
	else:
		ausgabe.append('DA')
for ergebnisse in range(t):
	print(ausgabe[ergebnisse])


t = int(input())
while t > 0:
	s = input()
	c = c1 = c2 = 0
	for i in s:
		if i == '1':
			c1 += 1
		else:
			c2 += 1
		if c1 > 0 and c2 > 0:
			c1 -= 1
			c2 -= 1
			c += 1
	if c % 2 == 0:
		print('NET')
	else:
		print('DA')
	t -= 1


t = int(input())
for i in range(t):
	string = input()
	length = len(string)
	prevLen = len(string)
	while True:
		string = string.split('01')
		string = ''.join(string)
		string = string.split('10')
		string = ''.join(string)
		if prevLen == len(string):
			break
		prevLen = len(string)
	moves = (length - len(string)) / 2
	if moves % 2 == 1:
		print('DA')
	else:
		print('NET')


n = int(input())
for _ in range(n):
	s = str(input())
	c1 = s.count('0')
	c2 = len(s) - c1
	c = min(c1, c2)
	if c & 1:
		print('DA')
	else:
		print('NET')


for t in range(int(input())):
	s = input()
	index = 0
	check = False
	while '01' in s or '10' in s:
		while index < len(s) - 1:
			if s[index] == '1' and s[index + 1] == '0' or (s[index] == '0' and s[index + 1] == '1'):
				s = s[:index] + s[index + 2:]
				check = not check
				index = -1
			index += 1
	if check:
		print('DA')
	else:
		print('NET')


import math
t = int(input())
while t != 0:
	t -= 1
	s = input()
	on = s.count('1')
	zer = s.count('0')
	mini = min(on, zer)
	if mini % 2 != 0:
		print('DA')
	else:
		print('NET')


t = int(input())
for i in range(t):
	q = input()
	l = []
	for j in q:
		l.append(int(j))
	x = l.count(1)
	y = l.count(0)
	if min(x, y) % 2 != 0:
		print('DA')
	else:
		print('NET')


t = int(input())
for i in range(t):
	s = list(input())
	(z, o) = (s.count('0'), s.count('1'))
	m = min(z, o)
	if m % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
while t > 0:
	t -= 1
	s = input()
	nz = 0
	no = 0
	for i in s:
		if i == '0':
			nz += 1
		else:
			no += 1
	if nz > 0 and no > 0:
		if nz > no:
			if no % 2 == 0:
				print('NET')
			else:
				print('DA')
		elif nz % 2 == 0:
			print('NET')
		else:
			print('DA')
	else:
		print('NET')


t = int(input())
for i in range(t):
	s = input()
	(m, n) = (0, 0)
	for j in range(len(s)):
		if s[j] == '0':
			m += 1
		else:
			n += 1
	ans = min(m, n)
	if ans % 2 == 1:
		print('DA')
	else:
		print('NET')


def is_sequential(a, b):
	return a == '1' and b == '0' or (a == '0' and b == '1')
n_tests = int(input())
for i in range(n_tests):
	line = input()
	numbers = list(line)
	count = 1
	n_moves = 0
	while count < len(numbers):
		if is_sequential(numbers[count - 1], numbers[count]):
			n_moves += 1
			del numbers[count - 1:count + 1]
			count = 0
		count += 1
	if n_moves % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
while t > 0:
	inp_str = str(input())
	lenth = len(inp_str)
	ones = 0
	one_pos = []
	zero_pos = []
	for i in range(lenth):
		if inp_str[i] == '1':
			ones += 1
			one_pos.append(i)
		else:
			zero_pos.append(i)
	zers = lenth - ones
	if min(zers, ones) % 2 == 0:
		print('NET')
	else:
		print('DA')
	t -= 1


from sys import stdin
for _ in range(int(input())):
	s = list(input())
	st = []
	c = 0
	for i in range(len(s)):
		if len(st) == 0:
			st.append(s[i])
			continue
		if s[i] == st[-1]:
			st.append(s[i])
		else:
			st.pop()
			c += 1
	if c % 2 == 0:
		print('NET')
	else:
		print('DA')


def whoWins(bitstring):
	oneCount = zeroCount = 0
	for i in bitstring:
		if i == '1':
			oneCount += 1
		else:
			zeroCount += 1
	turns = min(oneCount, zeroCount)
	if turns % 2 == 0:
		return 'NET'
	else:
		return 'DA'
t = int(input())
while t:
	bitstring = input()
	print(whoWins(bitstring))
	t = t - 1


def string(s):
	zeros = 0
	ones = 0
	for i in s:
		if i == '0':
			zeros += 1
		else:
			ones += 1
	res = min(zeros, ones)
	if res % 2 == 0:
		print('NET')
	else:
		print('DA')
test = int(input())
matrix = []
for _ in range(test):
	lst = input()
	matrix.append(lst)
for s in matrix:
	string(s)


import sys
import math
import heapq
from collections import defaultdict, deque
input = sys.stdin.readline

def r():
	return int(input())

def rm():
	return map(int, input().split())

def rl():
	return list(map(int, input().split()))
for _ in range(r()):
	a = list(input())
	zeros = 0
	ones = 0
	for i in range(len(a) - 1):
		if a[i] == '0':
			zeros += 1
		else:
			ones += 1
	print('DA' if min(zeros, ones) & 1 else 'NET')


for _ in range(int(input())):
	s = input()
	x = s.count('0')
	y = s.count('1')
	if x == 0 or y == 0:
		print('NET')
		continue
	if min(x, y) % 2 == 0:
		print('NET')
		continue
	print('DA')


for _ in range(int(input())):
	s = input()
	n0 = s.count('0')
	n1 = len(s) - n0
	print(('NET', 'DA')[min(n0, n1) % 2])


try:
	t = int(input())
	while t:
		s1 = input()
		s = list(s1)
		n = len(s)
		if s.count(1) == n or s.count(0) == n:
			print('NET')
		else:
			c1 = 0
			c2 = 0
			for i in range(n):
				if s[i] == '0':
					c1 = c1 + 1
				elif s[i] == '1':
					c2 = c2 + 1
			m = c1
			if c2 < c1:
				m = c2
			if m % 2 == 0:
				print('NET')
			elif m % 2 != 0:
				print('DA')
except:
	pass


from sys import stdin, stdout
from os import path
if path.exists('input.txt'):
	stdin = open('input.txt', 'r')
	stdout = open('output.txt', 'w')

	def I():
		return int(input())

	def In():
		return map(int, input().split())
else:

	def I():
		return int(stdin.readline())

	def In():
		return map(int, stdin.readline().split())

	def S():
		return stdin.readline().rstrip()

	def Sn():
		return stdin.readline().split(' ')

def func(s):
	n = len(s)
	zero = s.count('0')
	one = n - zero
	moves = min(zero, one)
	if moves & 1 == 0:
		return 'NET'
	return 'DA'
st = ''
for _ in range(I()):
	s = input()
	st = '\n'.join((st, func(s)))
stdout.write(st.lstrip())


t = int(input())
for i in range(t):
	a = input()
	n = len(a)
	c = 0
	for j in a:
		if j == '1':
			c += 1
	m = min(c, n - c)
	if m % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
while t != 0:
	t -= 1
	s = input()
	(c0, c1) = (0, 0)
	for element in s:
		if element is '0':
			c0 += 1
		else:
			c1 += 1
	if min(c0, c1) % 2 == 0:
		print('NET')
	else:
		print('DA')


from sys import stdin, stdout
import math
t = int(stdin.readline())
for _ in range(t):
	s = stdin.readline().strip()
	cnt = 0
	while True:
		(tmp, tcnt) = ('', 0)
		i = 0
		while i < len(s):
			if i == len(s) - 1:
				tmp += s[i]
				break
			if s[i] == s[i + 1]:
				tmp += s[i]
				i += 1
			else:
				tcnt += 1
				i += 2
		if tcnt == 0:
			break
		cnt += tcnt
		s = tmp
	if cnt % 2 == 0:
		print('NET')
	else:
		print('DA')


for q in range(int(input())):
	ent = input()
	ent = list(ent)
	t = len(ent)
	if t < 2:
		print('NET')
	else:
		flag = False
		k = 0
		while True:
			if k == t:
				break
			elif k < t - 1 and ent[k] != ent[k + 1]:
				del ent[k]
				del ent[k]
				t -= 2
				if k > 0:
					k -= 1
				if flag == False:
					flag = True
				else:
					flag = False
			else:
				k += 1
		if flag:
			print('DA')
		else:
			print('NET')


for _ in range(int(input())):
	s = input()
	t = 0
	n = len(s)
	i = 0
	while i < len(s) - 1:
		if s[i] != s[i + 1]:
			t += 1
			s = s.replace(s[i:i + 2], '', 1)
			if len(s) != 0:
				i = 0
			else:
				break
		else:
			i += 1
		if (s.count('0') == len(s) or s.count('1') == len(s)) or len(s) == 0:
			break
	if t % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	stri = list(input())
	count = 0
	while True:
		for i in range(1, len(stri)):
			if stri[i] != stri[i - 1]:
				stri.pop(i)
				stri.pop(i - 1)
				count += 1
				break
		flag = True
		for i in range(1, len(stri)):
			if stri[i] != stri[i - 1]:
				flag = False
		if flag:
			break
	if count % 2 != 0:
		print('DA')
	else:
		print('NET')


for case in range(int(input())):
	s = input().strip()
	zeros = s.count('0')
	ones = s.count('1')
	if min(zeros, ones) % 2 == 1:
		print('DA')
	else:
		print('NET')


def main():
	n = int(input())
	abc = []
	for _ in range(n):
		abc.append(input())
	for j in range(n):
		even_count = abc[j].count('1')
		if min(len(abc[j]) - even_count, even_count) % 2 == 0:
			print('NET')
		else:
			print('DA')
main()


t = int(input())
for _ in range(t):
	s = input()
	if not '0' in s or not '1' in s:
		print('NET')
		continue
	if len(s) == 1:
		print('NET')
		continue
	s = list(s)
	count = 0
	n1 = s.count('1')
	n0 = s.count('0')
	if n0 <= n1:
		if n0 % 2 == 1:
			print('DA')
		else:
			print('NET')
	elif n1 < n0:
		if n1 % 2 == 1:
			print('DA')
		else:
			print('NET')


for _ in range(int(input())):
	a = input()
	s = []
	cnt = 0
	for i in a:
		if len(s) == 0:
			s.append(i)
		elif i != s[-1]:
			s.pop()
			cnt += 1
		else:
			s.append(i)
	if cnt % 2 != 0:
		print('DA')
	else:
		print('NET')


t = int(input())
for x in range(t):
	a = input()
	cnt = 0
	while 1:
		z = 0
		for i in range(len(a) - 1):
			if a[i] == '0':
				if a[i + 1] == '1':
					cnt += 1
					z = 1
					a = a[:i] + a[i + 2:]
					break
			if a[i] == '1':
				if a[i + 1] == '0':
					cnt += 1
					z = 1
					a = a[:i] + a[i + 2:]
					break
		if z == 0:
			if cnt % 2 != 0:
				print('DA')
			else:
				print('NET')
			break


from sys import stdin, stdout
import heapq
import cProfile
from collections import Counter, defaultdict, deque
from functools import reduce
import math
from bisect import bisect, bisect_right, bisect_left

def get_int():
	return int(stdin.readline().strip())

def get_tuple():
	return map(int, stdin.readline().split())

def get_list():
	return list(map(int, stdin.readline().split()))

def solve():
	st = input()
	c0 = st.count('0')
	c1 = st.count('1')
	x = min(c0, c1) % 2
	if x:
		print('DA')
	else:
		print('NET')

def main():
	solve()
TestCases = True
if TestCases:
	for i in range(get_int()):
		main()
else:
	main()


def multiplier(times):
	b = 1
	if times != 1:
		for i in range(0, times - 1):
			b *= 10
		return b
	return 1
t = int(input())
for i in range(0, t):
	a = input()
	binary = int(a)
	number = len(a)
	arrays = []
	for j in range(0, number):
		c = multiplier(number - j)
		arrays.append(int(binary / c))
		binary = binary % c
	change = counts = element = 0
	j = 0
	while j < number - 1:
		change = 0
		if arrays[j] != 5:
			element = arrays[j]
			k = j + 1
			while arrays[k] == 5:
				k += 1
				if k == number:
					k = 100000000
					break
			if k != 100000000 and element != arrays[k]:
				arrays[j] = 5
				arrays[k] = 5
				counts += 1
				change = 1
		if change == 1:
			j = -1
		j += 1
	if counts % 2 == 1:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	s = input()
	c = 0
	st = []
	for i in s:
		if st:
			if st[-1] == i:
				st.append(i)
			else:
				st.pop()
				c += 1
		else:
			st.append(i)
	if c % 2 == 1:
		print('DA')
	else:
		print('NET')


import math

def main():
	A = 'DA'
	B = 'NET'
	t = Iint()
	for _ in range(t):
		s = I()
		n = 0
		(last0s, last1s) = (0, 0)
		for (i, si) in en(s):
			if si == '0':
				if last1s == 0:
					last0s += 1
					continue
				else:
					last1s -= 1
					n += 1
			elif si == '1':
				if last0s == 0:
					last1s += 1
					continue
				else:
					last0s -= 1
					n += 1
		print([B, A][n % 2])
FIO = True

def I():
	return input()

def Iint():
	return int(input())

def Ilist():
	return list(map(int, input().split()))

def Imap():
	return map(int, input().split())

def Plist(li, s=' '):
	print(s.join(map(str, li)))
if FIO:
	from io import BytesIO, IOBase
	import sys
	import os
en = enumerate
if not FIO:
	if __name__ == '__main__':
		main()
		exit()
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')
main()


sol = []
t = int(input())
while t:
	t -= 1
	s = input()
	k = 0
	d = {}
	d['1'] = 0
	d['0'] = 0
	ver = {}
	i = 0
	n = len(s)
	for i in range(n):
		ver[i] = False
	while i < n - 1:
		if s[i] != s[i + 1]:
			k += 1
			i += 1
			ver[i] = True
			ver[i + 1] = True
		else:
			d[s[i]] += 1
			ver[i] = True
		i += 1
	for i in range(n):
		if not ver[i]:
			d[s[i]] += 1
	k += min(d['0'], d['1'])
	if k % 2 == 0:
		sol.append('NET')
	else:
		sol.append('DA')
for i in sol:
	print(i)


t = int(input())
for _ in range(t):
	s = input()
	zeros = 0
	for var in s:
		if var == '0':
			zeros += 1
	moves = min(zeros, len(s) - zeros)
	if moves % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	ar = list(input())
	(x, y) = (ar.count('0'), ar.count('1'))
	if min(x, y) % 2 == 1:
		print('DA')
	else:
		print('NET')


for u in range(int(input())):
	s = input()
	ans = 0
	l = []
	for i in s:
		if len(l) == 0:
			l.append(i)
		elif l[-1] == '0':
			if i == '0':
				l.append(i)
			else:
				l.pop()
				ans += 1
		elif l[-1] == '1':
			if i == '1':
				l.append(i)
			else:
				l.pop()
				ans += 1
	if ans % 2 == 0:
		print('NET')
	else:
		print('DA')


def mii():
	return map(int, input().split())
for _ in range(int(input())):
	a = list(map(int, list(input())))
	n = len(a)
	i = 0
	moves = 0
	(o, z) = (0, 0)
	while i < n:
		if a[i] == 0:
			o += 1
			i += 1
		else:
			z += 1
			i += 1
	winner = 0
	if o > 0 and z > 0:
		if min(o, z) % 2:
			winner = 1
		else:
			winner = 0
	else:
		winner = 0
	if winner:
		print('DA')
	else:
		print('NET')


t = int(input())
for i in range(t):
	s = input()
	s1 = list(s)
	a = 0
	while 1:
		f = 0
		for j in range(len(s1) - 1):
			if s1[j] != s1[j + 1]:
				s1.remove(s1[j])
				s1.remove(s1[j])
				a += 1
				f = 1
				break
		if f == 0:
			break
	if a % 2 != 0:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	s = input()
	if '0' not in s or '1' not in s:
		print('NET')
		continue
	chance = 1
	while '01' in s or '10' in s:
		if '01' in s:
			i = s.index('01')
			s = s[:i] + s[i + 2:]
			chance = 0 if chance == 1 else 1
		else:
			i = s.index('10')
			s = s[:i] + s[i + 2:]
			chance = 0 if chance == 1 else 1
	if chance == 0:
		print('DA')
	else:
		print('NET')


for test_case in range(int(input())):
	string = list(input())
	ans = 0
	x = 0
	y = len(string) - 1
	while x < y:
		if string[x] != string[x + 1]:
			ans += 1
			string.pop(x)
			string.pop(x)
			x = -1
		x += 1
		y = len(string) - 1
	if ans % 2 == 0:
		print('NET')
	else:
		print('DA')


from collections import deque
import sys

def inp():
	return sys.stdin.readline().strip()
for _ in range(int(inp())):
	turn = True
	s = inp()
	while len(s) > 1:
		f = False
		for i in range(1, len(s)):
			if s[i] != s[i - 1]:
				f = True
				s = s[:i - 1] + s[i + 1:]
				break
		if not f:
			break
		else:
			turn = not turn
	if not turn:
		print('DA')
	else:
		print('NET')


t = int(input())
for i in range(t):
	s = input()
	c = 0
	k = 0
	if len(set(s)) == 1:
		print('NET')
	else:
		ones = s.count('1')
		zeros = s.count('0')
		lent = len(s)
		l = ['0'] * lent
		if ones > zeros:
			loop = zeros
		else:
			loop = ones
		if loop == 1:
			print('DA')
		elif loop == 2:
			print('NET')
		else:
			for i in range(1, loop * 2, 2):
				l[i] = '1'
			for i in range(0, loop + 1, 2):
				l[i] = '0'
			s1 = ''.join(l)
			check = s1.count('01')
			if check % 2 != 0:
				print('DA')
			else:
				print('NET')


for _ in range(int(input())):
	a = input()
	t = a[0]
	count = 1
	turn = 1
	for i in range(1, len(a)):
		if count == 0:
			t = a[i]
			count = 1
			continue
		if a[i] == t:
			count += 1
		else:
			count -= 1
			turn = -turn
	if turn < 0:
		print('DA')
	else:
		print('NET')


import sys
input = sys.stdin.readline

def solve(s):
	count_0 = 0
	count_1 = 0
	for c in s:
		if c == '0':
			count_0 += 1
		else:
			count_1 += 1
	pairs = min(count_0, count_1)
	if pairs % 2 == 0:
		return 'NET'
	else:
		return 'DA'
t = int(input())
for _ in range(t):
	s = input().strip()
	print(solve(s))


t = int(input())
cnt = 0
for i in range(t):
	s = input()
	cero = s.count('0')
	uno = s.count('1')
	if cero > uno:
		if uno % 2 != 0:
			print('DA')
		else:
			print('NET')
	elif cero % 2 != 0:
		print('DA')
	else:
		print('NET')


import math
for t in range(int(input())):
	string = input()
	flag = False
	j = 0
	while '01' in string or '10' in string:
		while j < len(string) - 1:
			if string[j] == '1' and string[j + 1] == '0' or (string[j] == '0' and string[j + 1] == '1'):
				string = string[:j] + string[j + 2:]
				j = -1
				flag = not flag
			j += 1
	if flag:
		print('DA')
	else:
		print('NET')


t = int(input())
for i in range(t):
	s = [int(i) for i in input()]
	(one, zero) = (s.count(1), s.count(0))
	mina = min(one, zero)
	if mina & 1:
		print('DA')
	else:
		print('NET')


import sys

def i():
	return sys.stdin.readline()[:-1]
cases = int(i())
for x in range(cases):
	case = i()
	l = len(case)
	zero = sum((x == '0' for x in case))
	turns = min(zero, l - zero)
	print('NET' if turns % 2 == 0 else 'DA')


for I in range(int(input())):
	s = input()
	l = len(s)
	ll = len(s)
	while 1:
		s = s.replace('01', '')
		s = s.replace('10', '')
		if len(s) == ll:
			break
		else:
			ll = len(s)
	diff = (l - ll) // 2
	if diff % 2 == 1:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	a = input()
	c = 0
	d = 0
	k = 0
	for i in range(len(a)):
		if a[i] == '1':
			c += 1
		else:
			d += 1
	if c == len(a) or d == len(a):
		print('NET')
		k = 1
	if k == 0:
		if c >= d:
			if d % 2 == 0:
				print('NET')
			else:
				print('DA')
		elif c % 2 == 0:
			print('NET')
		else:
			print('DA')


for _ in range(int(input())):
	l = input()
	n = len(l)
	if n == l.count('0') or n == l.count('1'):
		print('NET')
		continue
	x = l.count('1')
	y = l.count('0')
	z = min(x, y)
	if z % 2 == 0:
		print('NET')
	else:
		print('DA')


for i in range(int(input())):
	s = input()
	z = 0
	o = 0
	for k in range(len(s)):
		if s[k] == '1':
			o += 1
		else:
			z += 1
	m = min(o, z)
	if m % 2 == 0:
		print('NET')
	else:
		print('DA')


import os
import sys
from math import *
from collections import *
from fractions import *
from bisect import *
from heapq import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
yes = 'DA'
no = 'NET'
for _ in range(Int()):
	s = input()
	n = len(s)
	d = Counter(s)
	select = min(d['1'], d['0'])
	if select % 2:
		print(yes)
	else:
		print(no)


import sys

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 19
MOD = 10 ** 9 + 7
for _ in range(INT()):
	S = input()
	N = len(S)
	cnt0 = S.count('0')
	cnt1 = S.count('1')
	if not cnt0 or not cnt1:
		print('NET')
		continue
	cnt = min(cnt0, cnt1)
	if cnt % 2 == 0:
		print('NET')
	else:
		print('DA')


T = int(input())
for _ in range(T):
	s = input()
	(zero, one) = (0, 0)
	for c in s:
		if c == '0':
			zero += 1
		else:
			one += 1
	cnt = min(zero, one)
	ans = 'DA' if cnt % 2 == 1 else 'NET'
	print(ans)


from sys import stdin
ip = stdin.readline
for _ in range(int(ip())):
	s = ip().strip()
	n = len(s)
	cnt = 0
	i = 1
	stk = [s[0]]
	while i < n:
		if stk and (not s[i] == stk[-1]):
			cnt += 1
			stk.pop()
		else:
			stk.append(s[i])
		i += 1
	print('NET' if cnt % 2 == 0 else 'DA')


for i in range(int(input())):
	s = input()
	(count1, count0) = (0, 0)
	for i in range(len(s)):
		if s[i] == '1':
			count1 += 1
		else:
			count0 += 1
	minc = min(count1, count0)
	if minc % 2 == 1:
		print('DA')
	else:
		print('NET')


import sys
input = sys.stdin.readline
for test in range(int(input())):
	s = input()
	print('DA' if min(s.count('0'), s.count('1')) % 2 else 'NET')


import sys
input = sys.stdin.readline
for f in range(int(input())):
	s = input()
	ones = -1
	zeros = 0
	for i in range(len(s)):
		if s[i] == '0':
			zeros += 1
		else:
			ones += 1
	mv = min(ones, zeros)
	if mv % 2 == 0:
		print('NET')
	else:
		print('DA')


def tran(s):
	tog = 0
	S = []
	n = 0
	for i in s:
		S.append(i)
	while len(S) > 1 and n < len(S) - 1:
		if S[n] != S[n + 1]:
			S.pop(n)
			S.pop(n)
			tog = tog + 1
			n = 0
		else:
			n = n + 1
	if tog % 2 == 1:
		return 'DA'
	else:
		return 'NET'
t = int(input())
ans = []
for i in range(t):
	s = input()
	r = tran(s)
	ans.append(r)
for i in ans:
	print(i)


for i in range(int(input())):
	s = str(input())
	x = 0
	y = 0
	for i in s:
		if i == '0':
			y += 1
		else:
			x += 1
	k = x + y
	k = k / 2
	j = min(x, y)
	if x == 0 or y == 0:
		print('NET')
	elif x == y and k % 2 != 0:
		print('DA')
	elif x == y and k % 2 == 0:
		print('NET')
	elif j % 2 == 0:
		print('NET')
	elif j % 2 != 0:
		print('DA')


cases = int(input())
for i in range(cases):
	a = input()
	zero = 0
	one = 0
	for i in a:
		if i == '0':
			zero += 1
		elif i == '1':
			one += 1
	t = min(zero, one)
	if t == 0 or t % 2 == 0:
		print('NET')
	else:
		print('DA')


T = int(input())
for i in range(T):
	c = 0
	s = input()
	c2 = 0
	for i in range(len(s)):
		if s[i] == '0':
			c += 1
		else:
			c2 += 1
	x = min(c, c2)
	if x % 2 == 0:
		print('NET')
	else:
		print('DA')


for tt in range(int(input())):
	s = input()
	if len(s) == 2 and len(set(s)) == 2:
		print('DA')
	elif len(set(s)) == 1:
		print('NET')
	else:
		k1 = s.count('0')
		k2 = s.count('1')
		k3 = min(k1, k2)
		if k3 % 2 == 0:
			print('NET')
		else:
			print('DA')


for lo in range(int(input())):
	st = input()
	l = len(st)
	c = 0
	for i in range(l):
		if st[i] == '1':
			c += 1
	c1 = l - c
	mn = min(c, c1)
	if mn % 2 == 0:
		print('NET')
	else:
		print('DA')


def rmv_char(str, m):
	return str[:m] + str[m + 2:]

def player(n):
	x = len(n) - 1
	i = 0
	while i < x:
		if n[i] == '0' and n[i + 1] == '1' or (n[i] == '1' and n[i + 1] == '0'):
			n = rmv_char(n, i)
			x = x - 2
			i = -1
			return n
		i = i + 1
r = int(input())
for l in range(r):
	n = input()
	while True:
		n = player(n)
		if n is None:
			print('NET')
			break
		n = player(n)
		if n is None:
			print('DA')
			break


t = int(input())
for _ in range(t):
	st = input()
	count0 = 0
	count1 = 0
	for letter in st:
		if letter == '0':
			count0 += 1
		else:
			count1 += 1
	moves = min(count0, count1)
	if moves % 2 == 0:
		print('NET')
	else:
		print('DA')


from collections import defaultdict
Q = int(input())
for _ in range(Q):
	s = input()
	mode = 1
	ans = 0
	while True:
		if s.count('01') >= 1:
			ans += s.count('01')
			s = s.replace('01', '')
		elif s.count('10') >= 1:
			ans += s.count('10')
			s = s.replace('10', '')
		else:
			break
	print(['NET', 'DA'][ans % 2])


test_case = int(input())
l = []
for i in range(0, test_case):
	l.append(str(input()))
for i in range(0, len(l)):
	counter = 0
	while '10' in l[i] or '01' in l[i]:
		if '10' in l[i]:
			l[i] = l[i].replace('10', '', 1)
			counter += 1
		elif '01' in l[i]:
			l[i] = l[i].replace('01', '', 1)
			counter += 1
	if counter % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	s = input()
	count = 0
	while True:
		new = s.replace('10', '', 1)
		if new == s:
			new = s.replace('01', '', 1)
			if new == s:
				break
			else:
				count = count + 1
				s = new
				continue
		count = count + 1
		s = new
	if count % 2 == 0:
		print('NET')
	else:
		print('DA')


def func(s):
	length = len(s)
	ones = s.count('1')
	zeros = length - ones
	small = None
	if ones >= zeros:
		small = zeros
	else:
		small = ones
	if small % 2 == 0:
		print('NET')
	else:
		print('DA')
t = int(input())
for _ in range(t):
	s = input()
	func(s)


for _ in range(int(input())):
	str1 = input()
	zeros = str1.count('0')
	ones = str1.count('1')
	if ones == 0 or zeros == 0:
		print('NET')
	elif ones != zeros:
		if min(ones, zeros) % 2 != 0:
			print('DA')
		else:
			print('NET')
	elif ones % 2 != 0:
		print('DA')
	else:
		print('NET')


t = int(input())
for test in range(t):
	s = input()
	edin = 0
	nol = 0
	for i in range(len(s)):
		if s[i] == '1':
			edin += 1
		else:
			nol += 1
	if min(edin, nol) % 2 == 0:
		print('NET')
	else:
		print('DA')


import sys
input = sys.stdin.readline

def getInt():
	return int(input())

def getVars():
	return map(int, input().split())

def getList():
	return list(map(int, input().split()))

def getStr():
	return input().strip()
t = getInt()
for _ in range(t):
	s = getStr()
	k0 = 0
	k1 = 0
	res = False
	for i in range(len(s)):
		if s[i] == '0':
			if k1 > 0:
				k1 -= 1
				res = not res
			else:
				k0 += 1
		elif k0 > 0:
			k0 -= 1
			res = not res
		else:
			k1 += 1
	if res:
		print('DA')
	else:
		print('NET')


t = int(input())
while t:
	t += -1
	s = list(input())
	turn = 0
	while 1:
		check = 0
		for i in range(len(s) - 1):
			if s[i] != s[i + 1]:
				s.pop(i)
				s.pop(i)
				check = 1
				turn ^= 1
				break
		if check == 0:
			break
	if turn:
		print('DA')
	else:
		print('NET')


for ii in range(int(input())):
	s = input()
	i = 0
	c = 0
	d = 0
	for i in range(len(s)):
		if s[i] == '1':
			c += 1
		else:
			d += 1
	x = min(c, d)
	if x % 2 == 0:
		print('NET')
	else:
		print('DA')


T = int(input())
for t in range(T):
	s = list(map(int, list(input().strip())))
	win = 0
	while len(s) != 0:
		i = 0
		need_break = 0
		while i < len(s):
			if i == len(s) - 1:
				need_break = 1
				break
			if s[i] != s[i + 1]:
				win += 1
				s.pop(i)
				s.pop(i)
				break
			i += 1
		if need_break == 1:
			break
	if win % 2 != 0:
		print('DA')
	else:
		print('NET')


t = int(input())
for _ in range(t):
	s = input()
	l = list(s)
	n = len(s)
	c = 0
	i = 0
	while i < n - 1:
		if l[i] != l[i + 1]:
			l.pop(i)
			l.pop(i)
			i = 0
			n = len(l)
			c = c + 1
		else:
			i = i + 1
	if c % 2 == 0:
		print('NET')
	else:
		print('DA')


T = int(input())
while T > 0:
	s = input()
	a = s.count('1')
	b = s.count('0')
	if int(min(a, b)) % 2 == 1:
		print('DA')
	else:
		print('NET')
	T -= 1


__MULTITEST = True

def solve():
	s = str(input())
	i = 0
	n = len(s)
	turns = 0
	while n > 1:
		flag = False
		for i in range(1, n):
			if s[i - 1] != s[i]:
				s = s[0:i - 1] + s[i + 1:]
				n -= 2
				turns += 1
				flag = True
				break
		if not flag:
			break
	print('DA' if turns % 2 == 1 else 'NET')
t = int(input()) if __MULTITEST else 1
for tt in range(t):
	solve()


t = int(input())
c = []
for i in range(t):
	s = input()
	x = min(s.count('0'), s.count('1'))
	if x % 2 == 0:
		c.append('NET')
	else:
		c.append('DA')
for k in c:
	print(k)


t = int(input())
for case in range(t):
	s = input()
	zeroes = s.count('0')
	ones = s.count('1')
	print('DA' if min(zeroes, ones) % 2 == 1 else 'NET')


for _ in range(int(input())):
	s = input()
	c = 0
	while len(set(s)) > 1:
		if '10' in s:
			s = s.replace('10', '', 1)
			c += 1
		elif '01' in s:
			s = s.replace('01', '', 1)
			c += 1
	if c % 2 == 0:
		print('NET')
	else:
		print('DA')


INT_MAX = 10 ** 30 + 7
MOD = 10 ** 9 + 7

def INPUT():
	return list((int(i) for i in input().split()))

def LIST_1D_ARRAY(n):
	return [0 for _ in range(n)]

def LIST_2D_ARRAY(m, n):
	return [[0 for _ in range(n)] for _ in range(m)]
for i in range(int(input())):
	s = input()
	z = 0
	u = 0
	for i in range(len(s)):
		if s[i] == '0':
			z += 1
		else:
			u += 1
	if z == 0:
		print('NET')
	elif u % 2 != 0:
		if z >= u:
			print('DA')
		elif z % 2 == 1:
			print('DA')
		else:
			print('NET')
	elif z >= u:
		print('NET')
	elif z % 2 == 0:
		print('NET')
	else:
		print('DA')


def main():
	t = int(input())
	for _ in range(t):
		s = input()
		cnt = f(s)
		if cnt % 2 == 1:
			print('DA')
		else:
			print('NET')

def f(s):
	ones = 0
	zeros = 0
	for c in s:
		if c == '0':
			zeros += 1
		else:
			ones += 1
	return min(ones, zeros)
main()


from sys import stdin, stdout
for test in range(int(stdin.readline())):
	s = stdin.readline()
	s = s[:-1]
	ind0 = 0
	ind1 = 0
	for i in s:
		if i == '1':
			ind1 += 1
		else:
			ind0 += 1
	if ind0 == 0 or ind1 == 0:
		stdout.write('NET\n')
	elif min(ind0, ind1) % 2 == 1:
		stdout.write('DA\n')
	else:
		stdout.write('NET\n')


t = int(input())
answer = []
for a in range(t):
	line = list(input())
	zero = 0
	one = 0
	for b in line:
		if b == '0':
			zero += 1
		else:
			one += 1
	cnt = min(zero, one)
	if cnt % 2 == 1:
		answer.append('DA')
	else:
		answer.append('NET')
for b in answer:
	print(b)


nb_cases = int(input())
for case in range(nb_cases):
	s = input()
	nb0 = s.count('0')
	nb1 = s.count('1')
	if min(nb0, nb1) % 2 == 1:
		print('DA')
	else:
		print('NET')


def string_connect(s, ind):
	lis = list(s)
	del lis[ind]
	s = ''.join(lis)
	return s
t = int(input())
while t > 0:
	t -= 1
	s = input()
	i = 0
	cnt = 0
	while i < len(s) and len(s) > 0:
		if i + 1 < len(s) and (s[i] == '0' and s[i + 1] == '1' or (s[i] == '1' and s[i + 1] == '0')):
			s = string_connect(s, i)
			s = string_connect(s, i)
			i = 0
			cnt += 1
		else:
			i += 1
	if cnt % 2:
		print('DA')
	else:
		print('NET')


def ans(a, c):
	if '10' not in a and '01' not in a:
		return c
	else:
		d = a.count('10')
		b = a.replace('10', '')
		e = b.count('01')
		h = b.replace('01', '')
		return ans(h, c + d + e)
n = int(input())
l1 = []
for i in range(n):
	l1.append(input())
for i in l1:
	if ans(i, 0) % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for i in range(t):
	s = input()
	l = len(s)
	null = s.count('0')
	odin = s.count('1')
	if min(null, odin) % 2 == 1:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	s = input()
	s = list(s)
	s.sort()
	o = s.count('1')
	z = s.count('0')
	if o == z:
		if o % 2 == 0:
			print('NET')
		else:
			print('DA')
	else:
		x = min(o, z)
		if x % 2 == 0:
			print('NET')
		else:
			print('DA')


import sys
import math
from sys import stdin, stdout

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_string():
	return sys.stdin.readline().strip()

def main():
	for t in range(int(input())):
		l = input()
		n = len(l)
		i = 0
		c = 0
		s = list(l)
		while i + 1 < n:
			if s[i] != s[i + 1]:
				if c == 0:
					c = 1
				else:
					c = 0
				del [s[i]]
				del [s[i]]
				if i == 0:
					pass
				else:
					i -= 1
				n = n - 2
			else:
				i += 1
		if c == 0:
			print('NET')
		else:
			print('DA')
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


t = int(input())
while t > 0:
	count = 0
	s = input()
	while s.count('01') > 0 or s.count('10') > 0:
		s = s.replace('01', '', 1) if s.count('01') > 0 else s.replace('10', '', 1)
		count += 1
	print('DA' if count % 2 else 'NET')
	t -= 1


def who_wins(play_str):
	lose = 0
	counter = 1
	while counter > 0:
		if lose == 1 or len(play_str) == 0:
			break
		for i in range(len(play_str)):
			if i == len(play_str) - 1:
				lose = 1
				counter += 1
				continue
			if play_str[i] != play_str[i + 1]:
				play_str = play_str[:i] + play_str[i + 2:]
				break
		counter += 1
	if counter % 2 == 0:
		return 'DA'
	else:
		return 'NET'
inputs_list = []
inputs_num = int(input())
while inputs_num > 0:
	input_data = input()
	inputs_list.append(input_data)
	inputs_num -= 1
for i in inputs_list:
	print(who_wins(i))


t = int(input())
for _ in range(t):
	s = input()
	c = 0
	ok = True
	while ok:
		c = (c + 1) % 2
		a = s.count('01')
		b = s.count('10')
		if a == 0 and b == 0:
			ok = False
		elif a != 0:
			s = s.replace('01', '', 1)
		else:
			s = s.replace('10', '', 1)
	if c == 1:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	st = list(input())
	ar = list(map(int, st))
	zer = 0
	on = 0
	for i in range(len(ar)):
		if ar[i] == 0:
			zer += 1
		else:
			on += 1
	v = min(zer, on)
	if v % 2 == 0:
		print('NET')
	else:
		print('DA')


sets = int(input())
i = 0
while i < sets:
	data = input()
	j = 0
	while ('01' in data or '10' in data) and len(data) > 0:
		if '01' in data:
			data = data.replace('01', '', 1)
		elif '10' in data:
			data = data.replace('10', '', 1)
		j += 1
	if j == 0 or j % 2 == 0:
		print('NET')
	else:
		print('DA')
	i += 1


from sys import stdin
import math
import sys

def readline():
	return stdin.readline()
tests = int(readline())

def solve(s):
	i1 = 0
	i0 = 0
	for i in range(0, len(s)):
		if s[i] == '1':
			i1 += 1
		else:
			i0 += 1
	if min(i0, i1) % 2 != 0:
		return 'DA'
	return 'NET'
for t in range(0, tests):
	s = readline().rstrip('\n')
	print(solve(s))


production = True
import sys, math, collections

def input(input_format=0, multi=0):
	if multi > 0:
		return [input(input_format) for i in range(multi)]
	else:
		next_line = sys.stdin.readline()[:-1]
		if input_format >= 10:
			use_list = False
			input_format = int(str(input_format)[-1])
		else:
			use_list = True
		if input_format == 0:
			formatted_input = [next_line]
		elif input_format == 1:
			formatted_input = list(map(int, next_line.split()))
		elif input_format == 2:
			formatted_input = list(map(float, next_line.split()))
		elif input_format == 3:
			formatted_input = list(next_line)
		elif input_format == 4:
			formatted_input = (lambda x: [x[0], list(map(int, x[1:]))])(next_line.split())
		elif input_format == 5:
			formatted_input = (lambda x: [x[0], list(map(float, x[1:]))])(next_line.split())
		elif input_format == 6:
			formatted_input = next_line.split()
		else:
			formatted_input = [next_line]
		return formatted_input if use_list else formatted_input[0]

def out(output_line, output_format=0, newline=True):
	formatted_output = ''
	if output_format == 0:
		formatted_output = str(output_line)
	elif output_format == 1:
		formatted_output = ' '.join(map(str, output_line))
	elif output_format == 2:
		formatted_output = '\n'.join(map(str, output_line))
	print(formatted_output, end='\n' if newline else '')

def log(*args):
	if not production:
		print('$$$', end='')
		print(*args)
enum = enumerate

def solve():
	s = input(3)
	r = True
	c = 0
	while r:
		c += 1
		for i in range(len(s) - 1):
			log(s[i], s[i + 1])
			if s[i] != s[i + 1]:
				s = s[:i] + s[i + 2:]
				log(s)
				break
		else:
			r = False
	log(c)
	out('DA' if not c % 2 else 'NET')
	return
for i in range(input(11)):
	solve()


for _ in range(int(input())):
	s = str(input())
	mi = s.count('1')
	mi = min(len(s) - mi, mi)
	if mi % 2:
		print('DA')
	else:
		print('NET')


import sys

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def rinput():
	return map(int, sys.stdin.readline().strip().split())

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))
mod = int(1000000000.0) + 7
for _ in range(iinput()):
	s = input()
	flag = 1
	while '01' in s or '10' in s:
		if '01' in s:
			ind = s.index('01')
		else:
			ind = s.index('10')
		s = s[:ind] + s[ind + 2:]
		flag += 1
	if flag % 2 == 1:
		print('NET')
	else:
		print('DA')


from collections import deque
from sys import stdin, stdout
import math
input = stdin.readline
for _ in range(int(input())):
	x = input()
	first = x.count('1')
	second = x.count('0')
	print('DA' if min(first, second) % 2 else 'NET')


for _ in range(int(input())):
	a = input()
	zero = 0
	um = 0
	for c in a:
		zero += 1 - int(c)
		um += int(c)
	if zero < um:
		count = zero
	else:
		count = um
	if count % 2 == 1:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	s = input()
	count = 0
	f = 1
	while f == 1 and len(s) != 0:
		n = len(s)
		f = 0
		t = ''
		i = 0
		while i < n - 1:
			x = i
			y = i + 1
			if s[x] != s[y]:
				count += 1
				f = 1
				t += s[y + 1:]
				break
			else:
				t += s[x]
			i += 1
		s = t
	if count % 2 == 0:
		print('NET')
	else:
		print('DA')


def main():
	t = eval(input())
	for i in range(t):
		a = input()
		count0 = 0
		count1 = 0
		for item in a:
			if item == '0':
				count0 = count0 + 1
			else:
				count1 = count1 + 1
		if min(count0, count1) % 2 == 1:
			print('DA')
		else:
			print('NET')
main()


for _ in range(int(input())):
	ls = input().strip()
	o_cnt = ls.count('0')
	on_cnt = ls.count('1')
	k = min(o_cnt, on_cnt)
	if k % 2 == 0:
		print('NET')
	else:
		print('DA')


import math
t = int(input())
while t:
	t = t - 1
	s = input()
	(one, zero) = (0, 0)
	for w in s:
		if w == '0':
			zero += 1
		else:
			one += 1
	if zero == 0 or one == 0:
		print('NET')
	else:
		(minn, maxx) = (min(zero, one), max(zero, one))
		if minn % 2 == 0:
			print('NET')
		else:
			print('DA')


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7
from types import GeneratorType

def bootstrap(func, stack=[]):

	def wrapped_function(*args, **kwargs):
		if stack:
			return func(*args, **kwargs)
		else:
			call = func(*args, **kwargs)
			while True:
				if type(call) is GeneratorType:
					stack.append(call)
					call = next(call)
				else:
					stack.pop()
					if not stack:
						break
					call = stack[-1].send(call)
			return call
	return wrapped_function
Ri = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()
for _ in range(int(ri())):
	s = ri()
	(n1, n0) = (0, 0)
	for i in s:
		if i == '1':
			n1 += 1
		else:
			n0 += 1
	minn = min(n0, n1)
	if minn % 2 == 1:
		print('DA')
	else:
		print('NET')


N = int(input())
for i in range(N):
	s = input()
	test = [s[0]]
	count = 0
	for j in range(len(s) - 1):
		test.append(s[j + 1])
		if len(test) > 1:
			if test[-1] == '0' and test[-2] == '1' or (test[-1] == '1' and test[-2] == '0'):
				count += 1
				test = test[:len(test) - 2]
	if count % 2 == 0:
		print('NET')
	else:
		print('DA')


n = int(input())
for _ in range(n):
	a = input()
	l1 = a.count('0')
	l2 = a.count('1')
	m = min(l1, l2)
	if m & 1:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	s = input()
	removals = 0
	status = True
	while status:
		status = False
		for i in range(len(s) - 1):
			if s[i] == '0' and s[i + 1] == '1' or (s[i] == '1' and s[i + 1] == '0'):
				s = s[:i] + s[i + 2:]
				removals += 1
				status = True
				break
	if removals % 2 == 1:
		print('DA')
	else:
		print('NET')


t = int(input())
for i in range(t):
	l = []
	s = input()
	for i in range(len(s)):
		l.append(s[i])
	x = sorted(l)
	o = l.count('0')
	z = l.count('1')
	c = 0
	if o == z:
		c = o
	elif o > z:
		c = z
	elif o < z:
		c = o
	elif o == 0 or z == 0:
		c = 0
	if c == 0:
		print('NET')
	elif c % 2 == 0:
		print('NET')
	else:
		print('DA')


import os
import sys
from math import *
from collections import *
from fractions import *
from bisect import *
from heapq import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
t = int(input())
while t:
	t -= 1
	s = input()
	if len(''.join(set(s))) == 1:
		print('NET')
	else:
		c1 = s.count('1')
		c0 = s.count('0')
		mn = min(c1, c0)
		if mn % 2 == 1:
			print('DA')
		else:
			print('NET')


t = int(input())
for _ in range(t):
	a = input()
	c1 = 0
	c0 = 0
	for i in a:
		if i == '1':
			c1 += 1
		else:
			c0 += 1
	moves = min(c0, c1)
	if moves % 2 != 0:
		print('DA')
	else:
		print('NET')


nTests = int(input())

def canWin(bits):
	win = False
	for i in range(len(bits) - 1):
		if bits[i] != bits[i + 1]:
			if not canWin(bits[0:i] + bits[i + 2:len(bits)]):
				win = True
				break
	return win
for _ in range(nTests):
	bits = input()
	zero = 0
	one = 0
	for i in bits:
		if i == '0':
			zero += 1
		else:
			one += 1
	if min(zero, one) % 2 == 1:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	s = input()
	movesMade = 0
	while True:
		movePossible = False
		for i in range(len(s) - 1):
			if s[i] != s[i + 1]:
				s = s[:i] + s[i + 2:]
				movePossible = True
				break
		if movePossible:
			movesMade += 1
		else:
			break
	if movesMade % 2 == 0:
		print('NET')
	else:
		print('DA')


def switch(t):
	if t == 'A':
		return 'B'
	return 'A'
for tt in range(int(input())):
	s = list(input())
	turn = 'A'
	last = ''
	while len(s) > 1:
		for i in range(len(s) - 1):
			if s[i] != s[i + 1]:
				turn = switch(turn)
				k = s.pop(i)
				s.pop(i)
				break
		if s == last:
			break
		last = s.copy()
	print('DA' if turn == 'B' else 'NET')


t = int(input())
for _ in range(t):
	s = str(input())
	n = len(s)
	a = 0
	b = 0
	for i in range(n):
		if s[i] == '0':
			a += 1
		else:
			b += 1
	c = min(a, b)
	if c % 2 == 1:
		print('DA')
	else:
		print('NET')


n = int(input())
while n > 0:
	win = False
	s = input()
	while True:
		tmp = s.replace('01', '', 1)
		if len(tmp) == len(s):
			tmp = s.replace('10', '', 1)
		if len(tmp) == len(s):
			break
		s = tmp
		win = not win
	if win:
		print('DA')
	else:
		print('NET')
	n -= 1


import sys
import math
from collections import defaultdict

def solve(test):
	s = list(map(int, list(input())))
	n = len(s)
	count = 0
	i = 0
	(zeros, ones) = (0, 0)
	for i in range(n):
		if s[i] == 1:
			ones += 1
			if zeros:
				ones -= 1
				zeros -= 1
				count += 1
		else:
			zeros += 1
			if ones:
				ones -= 1
				zeros -= 1
				count += 1
	print('DA' if count & 1 else 'NET')
test_cases = int(input())
for t in range(1, test_cases + 1):
	solve(t)


n = int(input())
for i in range(0, n):
	x = input()
	ar = []
	for j in x:
		ar.append(j)
	d = ar.count('0')
	f = ar.count('1')
	g = min(d, f)
	if g % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	s = input()
	ans = 0
	st = []
	for n in s:
		n = int(n)
		if st:
			if n != st[-1]:
				ans += 1
				st.pop()
			else:
				st.append(n)
		else:
			st.append(n)
	if ans % 2:
		print('DA')
	else:
		print('NET')


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import *
from copy import *
from collections import deque
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def solve():
	s = inp()
	c0 = s.count('0')
	n = len(s)
	c1 = n - c0
	k = min(c0, c1)
	if k % 2 == 0:
		print('NET')
	else:
		print('DA')
testcase(int(inp()))


for i in range(int(input())):
	s = input()
	i = 0
	c = 0
	s1 = s.count('1')
	s2 = s.count('0')
	if min(s1, s2) == 0:
		print('NET')
	elif min(s1, s2) % 2 == 0:
		print('NET')
	else:
		print('DA')


n = int(input())
for i in range(n):
	a = input()
	c = 0
	d = 0
	for i in a:
		if i == '0':
			c = c + 1
		else:
			d = d + 1
	m = min(c, d)
	if m % 2 == 0:
		print('NET')
	else:
		print('DA')


from sys import stdin, stdout
cin = stdin.readline
cout = stdout.write
mp = lambda : list(map(int, cin().split()))
pl = ['net', 'da']
(t,) = mp()
for _ in range(t):
	s = cin()[:-1]
	x = min(s.count('0'), s.count('1')) % 2
	cout(str(pl[x]) + '\n')


t = int(input())
while t:
	str = input()
	a = '01'
	b = '10'
	count = 0
	while a in str or b in str:
		if a in str:
			str = str.replace('01', '', 1)
			count += 1
			continue
		elif b in str:
			str = str.replace('10', '', 1)
			count += 1
			continue
	if count % 2 == 0:
		print('NET')
	else:
		print('DA')
	t -= 1


t = int(input())
res = []
for i in range(t):
	a = input()
	s = min(a.count('0'), a.count('1'))
	if s % 2 == 0:
		res.append('NET')
	else:
		res.append('DA')
for i in res:
	print(i)


import os
os_input = os.read(0, int(10000000.0)).split()
os_input_pos = -1
answer_list = []

def read_s():
	global os_input_pos
	os_input_pos += 1
	return os_input[os_input_pos].decode()

def read_i():
	return int(read_s())

def write_s(v):
	answer_list.append(v)

def write_i(v):
	write_s(str(v))

def print_ans():
	os.write(1, '\n'.join(answer_list).encode())
	os.write(1, '\n'.encode())
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
			else:
				stack.pop()
				if not stack:
					break
				to = stack[-1].send(to)
		return to
	return wrapped_func
T = read_i()
while T:
	T -= 1
	s = read_s()
	write_s('DA' if min(s.count('0'), s.count('1')) % 2 else 'NET')
print_ans()


t = int(input())
for i in range(t):
	s = input()
	c_0 = 0
	c_1 = 0
	for k in range(len(s)):
		if s[k] == '0':
			c_0 += 1
		else:
			c_1 += 1
	comp = min(c_0, c_1)
	if comp % 2 == 1:
		print('DA')
	else:
		print('NET')


inp = lambda : int(input())
inpm = lambda : map(int, input().split())
inpl = lambda : list(inpm())
l2mn = lambda _n, _m: [[0 for __ in range(_m)] for _ in range(_n)]
l2n = lambda _n: l2mn(_n, _n)
INF = int(1e+18)
MOD = int(1000000000.0) + 7
N = 2000009

def solve():
	s = input()
	k0 = s.count('0')
	k1 = s.count('1')
	m = min(k0, k1)
	if m % 2 == 1:
		print('da')
	else:
		print('net')

def main():
	t = inp()
	for i in range(t):
		solve()
main()


for _ in range(int(input())):
	l = list(input())
	one = l.count('1')
	zero = l.count('0')
	ans = min(one, zero)
	if ans & 1:
		print('DA')
	else:
		print('NET')


t = int(input())
output = []
for _ in range(t):
	temp = []
	a = list(map(int, input()))
	count = 0
	val = True
	while val == True:
		initLen = len(a)
		for i in range(0, len(a) - 1, 1):
			if a[i] != a[i + 1]:
				count += 1
				a.pop(i)
				a.pop(i)
				if len(a) == 0:
					val = False
				break
		finLen = len(a)
		if initLen == finLen:
			val = False
	if count % 2 == 0:
		output.append('NET')
	else:
		output.append('DA')
for x in output:
	print(x)


import math
from decimal import *
getcontext().prec = 30
t = int(input())

def fn(s, c):
	if len(s) == 0:
		return c
	pos = s.rfind('01')
	pos1 = s.rfind('10')
	if pos != -1:
		L = s[:pos]
		R = s[pos + 2:]
		c += 1
		return fn(L + R, c)
	elif pos1 != -1:
		L = s[:pos1]
		R = s[pos1 + 2:]
		c += 1
		return fn(L + R, c)
	else:
		return c
while t:
	t -= 1
	s = input()
	x = fn(s, 0)
	if x % 2:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	a = list(input())
	k = True
	b = False
	while a.count('0') != 0 and a.count('1') != 0:
		f = 0
		if k == True:
			for i in range(len(a) - 1):
				if a[i] == '1' and a[i + 1] == '0' or (a[i] == '0' and a[i + 1] == '1'):
					del a[i]
					del a[i]
					f = 1
					break
			if f == 1:
				k = False
				b = True
			else:
				break
			if len(a) == 0:
				break
		else:
			for i in range(len(a) - 1):
				if a[i] == '1' and a[i + 1] == '0' or (a[i] == '0' and a[i + 1] == '1'):
					del a[i]
					del a[i]
					f = 1
					break
			if f == 1:
				b = False
				k = True
			else:
				break
			if len(a) == 0:
				break
	if k == True:
		print('NET')
	else:
		print('DA')


n = int(input())
l = []
for i in range(n):
	l.append(input())
for i in l:
	a = i.count('1')
	a = min(a, len(i) - a)
	print('DA' if a % 2 else 'NET')


from sys import stdin, stdout
input = stdin.readline
print = stdout.write
for _ in range(int(input())):
	s = input().rstrip()
	if min(s.count('0'), s.count('1')) % 2:
		print('DA' + '\n')
	else:
		print('NET' + '\n')


import math
num_cases = int(input())
for _ in range(num_cases):
	arr = input().strip()
	count = 0
	excess = 0
	excess_elem = 0
	for elem in arr:
		if excess == 0:
			excess = 1
			excess_elem = elem
		elif elem == excess_elem:
			excess += 1
		else:
			count += 1
			excess -= 1
	if count % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	a = input()
	(v, r) = ([], 0)
	for i in a:
		if len(v) == 0 or i == v[-1]:
			v.append(i)
		else:
			r += 1
			v.pop()
	if r % 2 != 0:
		print('DA')
	else:
		print('NET')


for j in range(int(input())):
	s = input()
	para = s.count('0')
	para2 = s.count('1')
	if min((para, para2)) % 2 != 0:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	s = input()
	ch0 = 0
	ch1 = 0
	for i in s:
		if i == '1':
			ch1 += 1
		else:
			ch0 += 1
	ans = min(ch0, ch1)
	if ans % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for i in range(t):
	s = input()
	kol1 = 0
	kol0 = 0
	for l in range(len(s)):
		if s[l] == '0':
			kol0 += 1
		else:
			kol1 += 1
	m = min(kol1, kol0)
	if m % 2 == 1:
		print('DA')
	else:
		print('NET')


import sys
t = int(input())
while t:
	t -= 1
	s = input()
	k = min(s.count('1'), s.count('0'))
	if k % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for i in range(t):
	s = input()
	n = s.count('1')
	m = s.count('0')
	a = min(n, m)
	if a == 0 or a % 2 == 0:
		print('NET')
	else:
		print('DA')


num = int(input())
for i in range(num):
	st = input()
	print('DA' if min(st.count('0'), st.count('1')) % 2 == 1 else 'NET')


for _ in range(int(input())):
	s = input()
	c = 0
	k = 0
	while len(s) > 1:
		n = len(s)
		t = 0
		for i in range(n - 1):
			if int(s[i]) + int(s[i + 1]) == 1:
				s = s[:i] + s[i + 2:]
				c += 1
				t = 1
				break
		if t == 0:
			if c % 2 == 0:
				print('NET')
			else:
				print('DA')
			k = 1
			break
	if k == 0:
		if c % 2 == 0:
			print('NET')
		else:
			print('DA')


t = int(input())
for _ in range(t):
	L = list(input())
	count = 0
	i = 0
	while i < len(L) - 1:
		if L[i] == '0' and L[i + 1] == '1':
			del L[i]
			del L[i]
			count += 1
			i = 0
		elif L[i] == '1' and L[i + 1] == '0':
			del L[i]
			del L[i]
			count += 1
			i = 0
		else:
			i += 1
	if count % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for tt in range(t):
	s = input()
	zero = one = 0
	for i in s:
		if i == '0':
			zero += 1
		else:
			one += 1
	foo = min(one, zero)
	if foo & 1:
		print('DA')
	else:
		print('NET')


t = int(input())
for i in range(t):
	n = list(input())
	c = 0
	while True:
		f = 0
		for i in range(len(n) - 1):
			if n[i] == '1' and n[i + 1] == '0' or (n[i] == '0' and n[i + 1] == '1'):
				c += 1
				f = 1
				n.remove(n[i + 1])
				n.remove(n[i])
				break
		if f == 0:
			break
	x = c % 2
	if x == 0:
		print('NET')
	else:
		print('DA')


q = int(input())
for _ in range(q):
	astring = input()
	ones = astring.count('1')
	print('NET' if min(ones, len(astring) - ones) % 2 == 0 else 'DA')


from itertools import groupby
for _ in range(int(input())):
	s = list(input())
	t = s.count('1')
	m = min(t, len(s) - t)
	if m % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	s = list(input())
	(c_0, c_1) = (0, 0)
	for i in s:
		if i == '0':
			c_0 += 1
		else:
			c_1 += 1
	if min(c_0, c_1) % 2 == 0:
		print('NET')
	else:
		print('DA')


from sys import *
input = stdin.readline
for _ in range(int(input())):
	s = input()
	cn0 = 0
	cn1 = 0
	for i in s:
		if i == '0':
			cn0 += 1
		elif i == '1':
			cn1 += 1
	mn = min(cn0, cn1)
	if mn % 2 == 0:
		stdout.write('NET\n')
	else:
		stdout.write('DA\n')


t = int(input())
for _ in range(t):
	s = input()
	n = len(s)
	one = s.count('1')
	zero = n - one
	print('DA' if min(one, zero) & 1 else 'NET')


test = int(input())
for t in range(test):
	s = input()
	count1 = 0
	count2 = 0
	for x in range(len(s)):
		if s[x] == '1':
			count1 = count1 + 1
		else:
			count2 = count2 + 1
	minimum = min(count2, count1)
	if minimum % 2 == 0:
		print('NET')
	else:
		print('DA')


o = int(input())
for _ in range(o):
	s = input()
	count = 0
	cont = True
	while cont != False:
		cont = False
		for i in range(len(s) - 1):
			if s[i] != s[i + 1]:
				temp = s[:i] + s[i + 2:]
				s = temp
				cont = True
				count += 1
				break
	if count % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	s = input()
	SUM = 0
	for x in s:
		if x == '1':
			SUM += 1
	MIN = min(SUM, len(s) - SUM)
	if MIN % 2 == 0:
		print('NET')
	else:
		print('DA')


import os
from collections import Counter
is_dev = 'vscode' in os.environ and False
if is_dev:
	inF = open('cfEdu90/in.txt', 'r')
	outF = open('cfEdu90/out.txt', 'w')

def ins(r):
	return list(map(int, r.split(' ')))

def inputT():
	if is_dev:
		return inF.readline()
	else:
		return input()

def printT(data):
	if is_dev:
		return outF.write(data + '\n')
	else:
		return print(data)
for _ in range(int(inputT())):
	s = inputT()
	alice_can_win = True
	s_c = Counter(s)
	min_c = '1' if s_c['0'] > s_c['1'] else '0'
	alice_can_win = s_c[min_c] % 2 == 1
	printT(f"{('DA' if alice_can_win else 'NET')}")
if is_dev:
	print(open('cfEdu90/out.txt', 'r').read() == open('cfEdu90/outactual.txt', 'r').read())


for _ in range(int(input())):
	s = list(input())
	t = []
	for i in s:
		t.append(int(i))
	(u, count) = (0, 0)
	while u == 0:
		counter = 0
		for j in range(len(t) - 1):
			if t[j] == 0 and t[j + 1] == 1 or (t[j] == 1 and t[j + 1] == 0):
				t.remove(t[j])
				t.remove(t[j])
				count += 1
				counter = 1
				break
		if counter == 1:
			continue
		else:
			break
	if count % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for i in range(t):
	z = 0
	s = input()
	for c in s:
		if c == '0':
			z += 1
	w = min(z, len(s) - z)
	print('NET' if w % 2 == 0 else 'DA')


t = int(input())
while t:
	s = input()
	c1 = s.count('0')
	c2 = s.count('1')
	c = min(c1, c2)
	if c == 0:
		print('NET')
	elif c % 2 == 0:
		print('NET')
	else:
		print('DA')
	t = t - 1


t = int(input())
for _ in range(t):
	st = list(input().rstrip('\n'))
	count0 = 0
	count1 = 0
	total = 0
	for each in st:
		if each == '0':
			if count1 >= 1:
				count1 -= 1
				total += 1
			else:
				count0 += 1
		if each == '1':
			if count0 >= 1:
				count0 -= 1
				total += 1
			else:
				count1 += 1
	if total % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	st = input()
	on = 0
	ze = 0
	for i in st:
		if i == '0':
			ze += 1
		else:
			on += 1
	chance = min(on, ze)
	if chance % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	s = input()
	a = 0
	b = []
	for x in s:
		if b and b[-1] != x:
			b.pop()
			a += 1
		else:
			b += (x,)
	print('DA' if a % 2 else 'NET')


def game(s):
	o = s.count('1')
	z = s.count('0')
	i = 0
	b = 0
	if min(o, z) % 2 != 0:
		print('DA')
	else:
		print('NET')
t = int(input())
l = []
for i in range(t):
	s = input()
	l.append(s)
for i in range(len(l)):
	game(l[i])


t = int(input())

def find_Solution(string):
	stack = [string[0]]
	count = 0
	for i in range(1, len(string)):
		if len(stack) == 0:
			stack.append(string[i])
		elif string[i] == stack[-1]:
			stack.append(string[i])
		else:
			stack.pop()
			count += 1
	if count != 0 and count % 2 != 0:
		return 'DA'
	else:
		return 'NET'
for _ in range(t):
	string = input()
	print(find_Solution(string))


for _ in range(int(input())):
	s = str(input())
	f1 = 1
	f2 = 1
	c = 0
	while True:
		if s.count('01'):
			s = s.replace('01', '', 1)
			c += 1
			f1 = 1
		else:
			f1 = 0
		if s.count('10'):
			s = s.replace('10', '', 1)
			c += 1
			f2 = 1
		else:
			f2 = 0
		if f1 | f2 == 0:
			break
	if c % 2 == 1:
		print('DA')
	else:
		print('NET')


n = int(input())
for i in range(n):
	s = list(input())
	a = 1
	turn = 1
	while a == 1:
		for x in range(len(s)):
			end = 1
			try:
				if s[x] != s[x + 1]:
					del s[x + 1]
					del s[x]
					turn = turn * -1
					x = 0
					end = 0
					break
			except IndexError:
				z = 0
		if s == [] or end == 1:
			a = 0
	if turn == -1:
		print('DA')
	else:
		print('NET')


t = int(input())
for j in range(t):
	s = input()
	count = 0
	while True:
		i = 0
		if '0' not in s or '1' not in s or len(s) == 0:
			break
		s1 = ''
		while i < len(s):
			if i + 1 < len(s) and s[i] != s[i + 1]:
				count += 1
				i = i + 2
			else:
				s1 = s1 + s[i]
				i = i + 1
		s = s1
	if count % 2 == 1:
		print('DA')
	else:
		print('NET')


def game(s):
	if len(s) < 2:
		result = 'Net'
	elif len(s) == 2:
		if s[0] == s[1]:
			result = 'Net'
		else:
			result = 'Da'
	elif s.count('0') == s.count('1'):
		if len(s) / 2 % 2 == 0:
			result = 'Net'
		else:
			result = 'Da'
	elif s.count('0') < s.count('1'):
		if s.count('0') % 2 == 0:
			result = 'Net'
		else:
			result = 'Da'
	elif s.count('1') % 2 == 0:
		result = 'Net'
	else:
		result = 'Da'
	print(result)
t = int(input())
l = []
for i in range(t):
	l.append(input())
for i in range(t):
	game(l[i])


t = int(input())
for i in range(t):
	s = input()
	count1 = s.count('1')
	count0 = s.count('0')
	if count1 == 0 or count0 == 0:
		print('NET')
	else:
		x = min(count0, count1)
		if x % 2:
			print('DA')
		else:
			print('NET')


T = int(input())
for test in range(T):
	s = input()
	count0 = s.count('0')
	count1 = len(s) - count0
	if count0 < count1:
		if count0 % 2 == 1:
			print('DA')
		else:
			print('NET')
	elif count1 % 2 == 1:
		print('DA')
	else:
		print('NET')


cases = int(input())
for case in range(cases):
	binary = input()
	counter = 0
	while '01' in binary or '10' in binary:
		for i in range(len(binary) - 1):
			if binary[i:i + 2] == '01' or binary[i:i + 2] == '10':
				binary = binary[:i] + binary[i + 2:]
				counter += 1
				break
	if counter % 2 != 0:
		print('DA')
	else:
		print('NET')


def removal(s):
	if len(s) == 1 or 0:
		return s
	else:
		for i in range(1, len(s)):
			if s[i - 1] != s[i]:
				return removal(s[:i - 1] + s[i + 1:])
		return s
n = int(input())
for i in range(0, n):
	s = str(input())
	x = len(s)
	y = len(removal(s))
	n = (x - y) // 2
	if n % 2 == 0:
		print('NET')
	else:
		print('DA')


from sys import stdin, stdout
import math
input = stdin.readline

def print(x='', y='', end='\n'):
	if y == '':
		stdout.write(str(x) + end)
	else:
		stdout.write(str(x) + ' ' + str(y) + end)

def solve():
	s = input()
	n = len(s)
	z = s.count('0')
	o = s.count('1')
	minn = min(z, o)
	if minn == 0:
		print('NET')
		return
	if minn % 2:
		print('DA')
	else:
		print('NET')
tt = 1
tt = int(input())
for __ in range(tt):
	solve()


t = int(input())
for tc in range(t):
	s = input()
	zero = s.count('0')
	one = s.count('1')
	mn = min(zero, one)
	if mn % 2:
		print('DA')
	else:
		print('NET')


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
import bisect
from heapq import *
from math import *
from collections import deque
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def graph(vertex):
	return [[] for i in range(0, vertex + 1)]

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def lcm(a, b):
	return a * b // gcd(a, b)

def power(a, b):
	ans = 1
	while b > 0:
		if b % 2 == 1:
			ans *= a
		a *= a
		b //= 2
	return ans

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def bs(a, l, h, x):
	while l < h:
		mid = (l + h) // 2
		if a[mid] == x:
			return mid
		if a[mid] < x:
			l = mid + 1
		else:
			h = mid
	return l

def sieve(a):
	for i in range(3, 10 ** 6 + 1, 2):
		a[i] = 1
	for i in range(3, 10 ** 6 + 1, 2):
		for j in range(i * i, 10 ** 6 + 1, i):
			a[j] = 0
	a[2] = 1
	return a

def bfs(g, st):
	visited = [0] * len(g)
	visited[st] = 1
	queue = []
	queue.append(st)
	new = []
	while len(queue) != 0:
		s = queue.pop()
		new.append(s)
		for i in g[s]:
			if visited[i] == 0:
				visited[i] = 1
				queue.append(i)
	return new

def solve():
	s = inp()
	n = len(s)
	f = True
	cnt = 0
	while f:
		if '01' in s:
			cnt += 1
			ind = -1
			for i in range(0, n - 1):
				if s[i] == '0' and s[i + 1] == '1':
					ind = i
					break
			s = s[:ind] + s[ind + 2:]
			continue
		elif '10' in s:
			cnt += 1
			ind = -1
			for i in range(0, n - 1):
				if s[i] == '1' and s[i + 1] == '0':
					ind = i
					break
			s = s[:ind] + s[ind + 2:]
			continue
		else:
			f = False
	if cnt % 2 == 1:
		print('DA')
	else:
		print('NET')
testcase(int(inp()))


import sys
import math
data = sys.stdin.readlines()
for i in range(int(data[0])):
	suma1 = sum(list(map(int, list(data[i + 1][:len(data[i + 1]) - 1]))))
	suma2 = len(data[i + 1]) - suma1 - 1
	minimo = min(suma1, suma2)
	if minimo % 2 == 1:
		print('DA')
	else:
		print('NET')


import sys
import math
import collections
import operator as op
from collections import deque
from math import gcd, inf, sqrt
from bisect import bisect_right, bisect_left
from functools import reduce
from sys import stdin, stdout, setrecursionlimit
setrecursionlimit(2 ** 20)

def factorial(n):
	if n == 0:
		return 1
	return n * factorial(n - 1)

def ncr(n, r):
	r = min(r, n - r)
	numer = reduce(op.mul, range(n, n - r, -1), 1)
	denom = reduce(op.mul, range(1, r + 1), 1)
	return numer // denom

def prime_factors(n):
	i = 2
	factors = []
	while i * i <= n:
		if n % i:
			i += 1
		else:
			n //= i
			factors.append(i)
	if n > 1:
		factors.append(n)
	return len(set(factors))

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def factors(n):
	return list(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))
MOD = 10 ** 9 + 7
T = 1
T = int(stdin.readline())
for _ in range(T):
	s = str(stdin.readline().strip('\n'))
	n = len(s)
	o = s.count('0')
	z = s.count('1')
	if o == 0 or z == 0:
		print('NET')
		continue
	if min(o, z) % 2 == 1:
		print('DA')
	else:
		print('NET')


n = int(input())
for i in range(n):
	s = str(input())
	c = []
	j = 0
	f = 1
	while j < len(s):
		if len(c) == 0:
			c.append(s[j])
			j = j + 1
		elif s[j] == '0' and c[len(c) - 1] == '1':
			c.pop()
			if f == 1:
				f = 2
			else:
				f = 1
			j = j + 1
		elif s[j] == '1' and c[len(c) - 1] == '0':
			c.pop()
			if f == 1:
				f = 2
			else:
				f = 1
			j = j + 1
		else:
			c.append(s[j])
			j = j + 1
	if f == 1:
		print('NET')
	else:
		print('DA')


t = int(input())
while t > 0:
	str = input()
	(z, o) = (0, 0)
	for i in str:
		if i == '0':
			z += 1
		else:
			o += 1
	if z <= o:
		if z % 2 == 0:
			print('NET')
		else:
			print('DA')
	elif o % 2 == 0:
		print('NET')
	else:
		print('DA')
	t -= 1


t = int(input())
for x in range(t):
	score = 0
	str01 = input()
	while '0' in str01 and '1' in str01:
		if '01' in str01:
			str01 = str01.replace('01', '', 1)
			score += 1
		elif '10' in str01:
			str01 = str01.replace('10', '', 1)
			score += 1
	if score % 2:
		print('DA')
	else:
		print('NET')


def check(s, n):
	for i in range(n - 1):
		if s[i] != s[i + 1]:
			return True
	return False

def solve(s, alice):
	n = len(s)
	if not check(s, n):
		return not alice
	for i in range(n - 1):
		if s[i] != s[i + 1]:
			return solve(s[:i] + s[i + 2:], not alice)
for _ in range(int(input())):
	s = input()
	n = len(s)
	if solve(s, True):
		print('DA')
	else:
		print('NET')


def verificaVencedor(listaJogo):
	moves = 0
	aux = 0
	while aux + 1 < len(listGame):
		if listGame[aux] != listGame[aux + 1]:
			listGame.pop(aux + 1)
			listGame.pop(aux)
			if aux != 0:
				aux = aux - 1
			else:
				aux = 0
			moves += 1
		else:
			aux = aux + 1
	if moves % 2 != 0:
		print('DA')
	else:
		print('NET')
numberTest = int(input())
for i in range(0, numberTest):
	stringGame = input()
	listGame = list(stringGame)
	verificaVencedor(listGame)


t = int(input())
for _ in range(t):
	a = input()
	l = list(a)
	c1 = l.count('1')
	c0 = l.count('0')
	if c0 == len(l) or c1 == len(l):
		print('NET')
	else:
		mn = min(c0, c1)
		if mn % 2 == 0:
			print('NET')
		else:
			print('DA')


from sys import stdin, stdout
from collections import Counter
t = int(stdin.readline().strip())
for _ in range(t):
	s = stdin.readline().strip()
	dctr = {'0': 0, '1': 0}
	for i in s:
		dctr[i] += 1
	t1 = min(dctr['0'], dctr['1'])
	if t1 % 2 == 0:
		stdout.write('NET\n')
	else:
		stdout.write('DA\n')


t = int(input())
for i in range(0, t):
	s = input()
	s = s + '2'
	cc = 0
	while '01' in s or '10' in s:
		if '01' in s:
			a = s.index('01')
			s = s[:a] + s[a + 2:]
			cc = cc + 1
		else:
			a = s.index('10')
			s = s[:a] + s[a + 2:]
			cc = cc + 1
	if cc % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	b = input()
	c0 = b.count('0')
	c1 = len(b) - c0
	if min(c0, c1) % 2:
		print('DA')
	else:
		print('NET')


t = int(input())
for coasdjf in range(t):
	s = input()
	c1 = 0
	c2 = 0
	for x in s:
		if x == '0':
			c1 += 1
	c2 = len(s) - c1
	ans = min(c1, c2) % 2
	if ans == 1:
		print('DA')
	else:
		print('NET')


def fun(s):
	stack = []
	cnt = 0
	stack.append(s[0])
	for i in range(1, len(s)):
		if stack:
			if stack[-1] == '0' and s[i] == '1':
				stack.pop()
				cnt = cnt + 1
			elif stack[-1] == '1' and s[i] == '0':
				stack.pop()
				cnt = cnt + 1
			else:
				stack.append(s[i])
		else:
			stack.append(s[i])
	if cnt % 2 != 0:
		return 'DA'
	else:
		return 'NET'
for i in range(0, int(input())):
	s = input()
	print(fun(s))


for i in range(int(input())):
	s = input()
	p = s.count('0')
	q = s.count('1')
	if p == 0 or q == 0:
		print('NET')
	elif min(p, q) % 2 == 1:
		print('DA')
	else:
		print('NET')


n = int(input())
l = []
for _ in range(0, n):
	s = input()
	l.append(s)
for s in l:
	(c, d) = (0, 0)
	for x in s:
		if x == '1':
			c = c + 1
		if x == '0':
			d = d + 1
	m = min(c, d)
	if m % 2 == 0:
		print('NET')
	else:
		print('DA')


def testcase():
	import sys
	input = sys.stdin.readline
	s = input().strip()
	a = min(s.count('1'), s.count('0'))
	if a % 2:
		print('DA')
	else:
		print('NET')

def main():
	import sys
	input = sys.stdin.readline
	t = int(input())
	for _ in range(t):
		testcase()
main()


t = int(input())
for T in range(t):
	s = list(input())
	c = 0
	n = len(s)
	for i in range(n):
		for j in range(len(s) - 1):
			if s[j] != s[j + 1]:
				s.pop(j)
				s.pop(j)
				c += 1
				break
		if len(s) < 2:
			break
	if c % 2 != 0:
		print('DA')
	else:
		print('NET')


for T in range(int(input())):
	s = input()
	zerocount = 0
	onecount = 0
	count = 0
	for i in range(len(s)):
		if s[i] == '0':
			if onecount > 0:
				count += 1
				onecount -= 1
			else:
				zerocount += 1
		if s[i] == '1':
			if zerocount > 0:
				count += 1
				zerocount -= 1
			else:
				onecount += 1
	if count % 2 != 0:
		print('DA')
	else:
		print('NET')


from sys import stdin
input = lambda : stdin.readline().rstrip('\r\n')
from collections import defaultdict as vector
from collections import deque as que
inin = lambda : int(input())
inar = lambda : list(map(int, input().split()))
Testcase = inin()
for _ in range(Testcase):
	s = input()
	a = min(s.count('0'), s.count('1'))
	if a == 0:
		print('NET')
	elif a % 2:
		print('DA')
	else:
		print('NET')


def main():
	t = int(input())
	for _ in range(t):
		s = input()
		cnt = 0
		if len(s) == 1:
			print('NET')
		else:
			while len(s) > 1:
				i = 0
				flag = 1
				while i < len(s) - 1:
					if s[i] != s[i + 1]:
						cnt += 1
						flag = 0
						s = s[:i] + s[i + 2:]
						break
					i += 1
				if flag:
					break
			print('DA' if cnt % 2 == 1 else 'NET')
main()


def solve(s):
	one = 0
	zero = 0
	n = len(s)
	for i in range(n):
		if s[i] == '0':
			zero += 1
		else:
			one += 1
	if zero == n or one == n:
		print('NET')
		return
	cnt = min(one, zero)
	if cnt % 2 != 0:
		print('DA')
	else:
		print('NET')
t = int(input())
for _ in range(t):
	s = input()
	solve(s)


test = int(input())
for i in range(test):
	s = list(input())
	zeros = s.count('0')
	ones = s.count('1')
	if ones == len(s) or zeros == len(s):
		print('NET')
	else:
		done = []
		flag = 1
		while True:
			if zeros > 0 and ones > 0:
				zeros -= 1
				ones -= 1
				if flag == 1:
					done.append('alice')
					flag = 0
				else:
					done.append('bob')
					flag = 1
			else:
				break
		if done == [] or done[-1] == 'bob':
			print('NET')
		else:
			print('DA')


import sys

def I():
	return list(map(int, input().split()))

def sieve(n):
	a = [1] * n
	for i in range(2, n):
		if a[i]:
			for j in range(i * i, n, i):
				a[j] = 0
	return a
for __ in range(int(input())):
	s = input()
	if min(s.count('0'), s.count('1')) % 2 == 0:
		print('NET')
	else:
		print('DA')


for i in range(int(input())):
	s = str(input())
	if '0' not in s or '1' not in s:
		print('NET')
	else:
		k = 0
		while '10' in s:
			k = k + s.count('10')
			s = s.replace('10', '')
		while '01' in s:
			k = k + s.count('01')
			s = s.replace('01', '')
		if k % 2 == 0:
			print('NET')
		else:
			print('DA')


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	s = list(input().rstrip())
	turn = False
	i = 0
	while True:
		if not s:
			break
		if '1' not in s:
			break
		if '0' not in s:
			break
		if s[i] != s[i + 1]:
			del s[i:i + 2]
			i = 0
			turn = not turn
		else:
			i += 1
	if turn:
		print('DA')
	else:
		print('NET')


for t in range(int(input())):
	s = input()
	l = list(s)
	co0 = 0
	co1 = 0
	for i in l:
		if i == '0':
			co0 += 1
		else:
			co1 += 1
	length = min(co0, co1)
	if length % 2 == 1:
		print('DA')
	else:
		print('NET')


from collections import Counter
t = int(input())
buf = []
for _ in range(t):
	s = input()
	cnt = Counter(s)
	if len(cnt) == 1:
		c = 0
	else:
		c = min(cnt.values())
	buf.append('DA' if c % 2 == 1 else 'NET')
print('\n'.join(buf))


t = int(input())
for _ in range(t):
	s = list(input())
	i = 0
	count = 0
	try:
		while True:
			if s[i] != s[i + 1]:
				s.pop(i)
				s.pop(i)
				i = 0
				count += 1
			else:
				i += 1
	except IndexError:
		if count % 2 == 0:
			print('NET')
		else:
			print('DA')


numCases = int(input())
while numCases > 0:
	numCases -= 1
	numberOne = 0
	numberZero = 0
	count = 0
	strGame = input()
	while count != len(strGame):
		if strGame[count] == '0':
			numberZero += 1
		else:
			numberOne += 1
		count += 1
	maxJogadas = min(numberZero, numberOne)
	if maxJogadas % 2 == 0:
		print('NET')
	else:
		print('DA')


import bisect
import decimal
from decimal import Decimal
import os
from collections import Counter
import bisect
from collections import defaultdict
import math
import random
import heapq
from math import sqrt
import sys
from functools import reduce, cmp_to_key
from collections import deque
import threading
from itertools import combinations
from io import BytesIO, IOBase
from itertools import accumulate
decimal.getcontext().prec = 46

def primeFactors(n):
	prime = set()
	while n % 2 == 0:
		prime.add(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			prime.add(i)
			n = n // i
	if n > 2:
		prime.add(n)
	return list(prime)

def getFactors(n):
	factors = []
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n // i == i:
				factors.append(i)
			else:
				factors.append(i)
				factors.append(n // i)
		i = i + 1
	return factors

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	num = []
	for p in range(2, n + 1):
		if prime[p]:
			num.append(p)
	return num

def lcm(a, b):
	return a * b // math.gcd(a, b)

def sort_dict(key_value):
	return sorted(key_value.items(), key=lambda kv: (kv[1], kv[0]))

def list_input():
	return list(map(int, input().split()))

def num_input():
	return map(int, input().split())

def string_list():
	return list(input())

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def binaryToDecimal(n):
	return int(n, 2)

def DFS(n, s, adj):
	visited = [False for i in range(n + 1)]
	stack = []
	stack.append(s)
	while len(stack):
		s = stack[-1]
		stack.pop()
		if not visited[s]:
			visited[s] = True
		for node in adj[s]:
			if not visited[node]:
				stack.append(node)

def solve():
	s = list(input())
	stack = ['*']
	turn = 0
	for i in s:
		if stack[-1] == '0' and i == '1' or (stack[-1] == '1' and i == '0'):
			stack.pop()
			turn += 1
		else:
			stack.append(i)
	if turn % 2 == 0:
		print('NET')
		return
	print('DA')
t = 1
t = int(input())
for _ in range(t):
	solve()


t = int(input())
for _ in range(t):
	x = input()
	res = ''
	c = 0
	n = len(x)
	l = []
	l.append(-1)
	for i in range(n):
		if l[-1] == -1:
			l.append(x[i])
		elif l[-1] != -1 and l[-1] != x[i]:
			l.pop()
			c += 1
		else:
			l.append(x[i])
	if c & 1 == 1:
		print('DA')
	else:
		print('NET')


t = int(input())
for q in range(t):
	l = list(input())
	c = 0
	while len(l) > 0 and l != ['0'] * len(l) and (l != ['1'] * len(l)):
		for i in range(len(l) - 1):
			if l[i] != l[i + 1]:
				l.pop(i)
				l.pop(i)
				c += 1
				break
	if c % 2 == 1:
		print('DA')
	else:
		print('NET')


import sys
import random
from math import *

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def finput():
	return float(input())

def tinput():
	return input().split()

def linput():
	return list(input())

def rinput():
	return map(int, tinput())

def fiinput():
	return map(float, tinput())

def rlinput():
	return list(map(int, input().split()))

def trinput():
	return tuple(rinput())

def srlinput():
	return sorted(list(map(int, input().split())))

def NOYES(fl):
	if fl:
		print('NO')
	else:
		print('YES')

def YESNO(fl):
	if fl:
		print('YES')
	else:
		print('NO')

def main():
	(q, res) = ([], 1)
	for i in linput():
		if q:
			if i != q[-1]:
				res += 1
				q.pop()
			else:
				q.append(i)
		else:
			q.append(i)
	print(['DA', 'NET'][res % 2])
for inytd in range(iinput()):
	main()


t = int(input())
for _ in range(t):
	string = input()
	c0 = string.count('0')
	c1 = string.count('1')
	m = min(c0, c1)
	if m % 2 == 0:
		print('NET')
	else:
		print('DA')


from sys import stdin
from math import ceil
inp = lambda : stdin.readline().strip()
t = int(inp())
for _ in range(t):
	s = inp()
	ones = s.count('1')
	zeroes = s.count('0')
	if min(ones, zeroes) % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(0, int(input())):
	l = input()
	flag = 0
	turn = 'Alice'
	index = -1
	while True:
		flag = 0
		index = -1
		for i in range(0, len(l) - 1):
			if l[i] == '0' and l[i + 1] == '1' or (l[i] == '1' and l[i + 1] == '0'):
				index = i
				flag = 1
				break
		if index == -1:
			l = l
		else:
			l = l[:index] + l[index + 2:]
		if turn == 'Alice':
			turn = 'Bob'
		else:
			turn = 'Alice'
		if flag == 0:
			if turn == 'Alice':
				print('DA')
			else:
				print('NET')
			break


for t in range(int(input())):
	t = input()
	(c0, c1) = (0, 0)
	for i in t:
		if i == '0':
			c0 += 1
		else:
			c1 += 1
	turns = min(c0, c1)
	if turns % 2 == 1:
		print('DA')
	else:
		print('NET')


for t in range(int(input())):
	l = list(input())
	ones = l.count('1')
	zeros = l.count('0')
	if ones == zeros:
		print('DA' if ones % 2 == 1 else 'NET')
	else:
		k = min(ones, zeros)
		print('DA' if k % 2 == 1 else 'NET')


import sys
input = sys.stdin.readline
import collections

def main():
	t = int(input())
	for _ in range(t):
		S = input().strip()
		alice = 0
		while len(S) >= 2:
			x = S.find('01')
			if x != -1:
				alice ^= 1
				S = S[0:x] + S[x + 2:]
				continue
			x = S.find('10')
			if x != -1:
				alice ^= 1
				S = S[0:x] + S[x + 2:]
				continue
			break
		if alice == 0:
			print('NET')
		else:
			print('DA')
main()


t = int(input())
i = 0
while i < t:
	s = input('')
	n1 = s.count('1')
	n0 = s.count('0')
	if min(n0, n1) % 2 == 1:
		print('DA')
	else:
		print('NET')
	i += 1


for i in range(int(input(''))):
	a = input('')
	b = a
	while '01' in a or '10' in a:
		a = a.replace('01', '').replace('10', '')
	x = len(b) - len(a)
	if x % 4 == 0:
		print('NET')
	else:
		print('DA')


import sys
import math

def scan(input_type='int'):
	if input_type == 'int':
		return list(map(int, sys.stdin.readline().strip().split()))
	else:
		return list(map(str, sys.stdin.readline().strip()))

def solution():
	for _ in range(int(input())):
		s = input()
		o = s.count('1')
		z = s.count('0')
		if min(o, z) % 2 == 1:
			print('DA')
		else:
			print('NET')
solution()


from collections import Counter
for i in range(int(input())):
	s = input()
	cnt = Counter(s)
	ans = min(cnt.get('0', 0), cnt.get('1', 0))
	if ans % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for _ in range(t):
	s = input()
	li = list(s)
	x = li.count('0')
	y = li.count('1')
	if x <= y:
		z = x
	else:
		z = y
	if z % 2 != 0 and z != 0:
		print('DA')
	else:
		print('NET')


t = int(input())
l = []
for _ in range(t):
	l.append(input())
for s in l:
	c = 0
	while '10' in s or '01' in s:
		if '10' in s:
			s = s.replace('10', '', 1)
			c = c + 1
		if '01' in s:
			s = s.replace('01', '', 1)
			c = c + 1
	if c % 2 == 0:
		print('NET')
	else:
		print('DA')


from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import heappush, heappop
import math
from collections import *
from functools import reduce, cmp_to_key
import sys
input = sys.stdin.readline
M = mod = 998244353

def factors(n):
	return sorted(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def inv_mod(n):
	return pow(n, mod - 2, mod)

def li():
	return [int(i) for i in input().rstrip('\n').split()]

def st():
	return input().rstrip('\n')

def val():
	return int(input().rstrip('\n'))

def li2():
	return [i for i in input().rstrip('\n')]

def li3():
	return [int(i) for i in input().rstrip('\n')]
for _ in range(val()):
	s = li3()
	i = ans = 0
	ans = min(s.count(1), s.count(0))
	print('DA' if ans & 1 else 'NET')


import math
from collections import defaultdict, Counter, deque
INF = float('inf')

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a

def isPrime(n):
	if n <= 1:
		return False
	i = 2
	while i ** 2 <= n:
		if n % i == 0:
			return False
		i += 1
	return True

def primeFactor(n):
	if n % 2 == 0:
		return 2
	i = 3
	while i ** 2 <= n:
		if n % i == 0:
			return i
		i += 1
	return n

def vars():
	return map(int, input().split())

def array():
	return list(map(int, input().split()))

def main():
	s = input()
	n = len(s)
	s = list(s)
	if s[0] == '0':
		for i in range(n):
			if s[i] == '1':
				s[i] = '0'
			else:
				s[i] = '1'
	o = 0
	z = 0
	i = 0
	ans = 0
	while i < n:
		while i < n and s[i] == '1':
			i += 1
			o += 1
		if o:
			ans += min(z, o)
			sub = min(z, o)
			z -= sub
			o -= sub
		while i < n and s[i] == '0':
			i += 1
			z += 1
		ans += min(z, o)
		sub = min(z, o)
		z -= sub
		o -= sub
	if ans % 2 == 1:
		print('DA')
	else:
		print('NET')
t = int(input())
for _ in range(t):
	main()


for _ in range(int(input())):
	s = list(input())
	nd = 0
	n = len(s)
	i = 0
	while i < n - 1:
		if s[i] == '0' and s[i + 1] == '1':
			s.pop(i)
			s.pop(i)
			i = 0
			nd += 1
			n = len(s)
		elif s[i] == '1' and s[i + 1] == '0':
			s.pop(i)
			s.pop(i)
			i = 0
			nd += 1
			n = len(s)
		else:
			i += 1
	if nd % 2 == 0:
		print('NET')
	else:
		print('DA')


test = int(input())
while test > 0:
	s = input()
	freq = {}
	for i in range(len(s)):
		if s[i] in freq:
			freq[s[i]] += 1
		else:
			freq[s[i]] = 1
	if len(freq) == 1:
		print('NET')
	elif min(freq['0'], freq['1']) % 2 == 0:
		print('NET')
	else:
		print('DA')
	test -= 1


def func(str):
	if str.count('1') == 0:
		return 'NET'
	elif str.count('0') == 0:
		return 'NET'
	else:
		count0 = str.count('0')
		count1 = str.count('1')
	i = min(count0, count1)
	if (i + 1) % 2 == 0:
		return 'DA'
	elif (i + 1) % 2 != 0:
		return 'NET'
for _ in range(int(input())):
	str = input()
	print(func(str))


T = int(input())
from collections import Counter
for _ in range(T):
	s = input()
	b = Counter(s)
	sa = min(b['0'], b['1'])
	if sa % 2 == 1:
		print('DA')
	else:
		print('NET')


import collections
import os
import sys
from io import BytesIO, IOBase
import math
ins = lambda : [int(x) for x in input()]
inp = lambda : int(input())
inps = lambda : [int(x) for x in input().split()]

def main():
	t = int(input())
	for _ in range(t):
		s = input()
		cnt = 0
		s = list(s)
		while True:
			if len(s) < 2:
				break
			i = 0
			pr = 0
			while i < len(s) - 1:
				if s[i] != s[i + 1]:
					cnt += 1
					pr += 1
					s.pop(i)
					s.pop(i)
					i -= 1
				i += 1
			if not pr:
				break
		if cnt & 1:
			print('DA')
		else:
			print('NET')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


for _ in range(int(input())):
	data = input()
	alice = True
	while len(data) != 0 or len(data) != 1:
		found = False
		for i in range(len(data) - 1):
			if data[i] != data[i + 1]:
				data = data[:i] + data[i + 2:]
				found = True
				break
		if not found:
			break
		if alice:
			alice = False
		else:
			alice = True
	if alice:
		print('NET')
	else:
		print('DA')


import sys
import math
from copy import copy, deepcopy
from copy import deepcopy as dcp
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right
from collections import deque
from collections import Counter
from itertools import accumulate, combinations, permutations
from heapq import heapify, heappop, heappush
from functools import lru_cache

def input():
	return sys.stdin.readline()[:-1]

def printl(li):
	_ = print(*li, sep='\n') if li else None

def argsort(s, return_sorted=False):
	inds = sorted(range(len(s)), key=lambda k: s[k])
	if return_sorted:
		return (inds, [s[i] for i in inds])
	return inds

def alp2num(c, cap=False):
	return ord(c) - 97 if not cap else ord(c) - 65

def num2alp(i, cap=False):
	return chr(i + 97) if not cap else chr(i + 65)

def matmat(A, B):
	(K, N, M) = (len(B), len(A), len(B[0]))
	return [[sum([A[i][k] * B[k][j] for k in range(K)]) for j in range(M)] for i in range(N)]

def matvec(M, v):
	(N, size) = (len(v), len(M))
	return [sum([M[i][j] * v[j] for j in range(N)]) for i in range(size)]

def T(M):
	(n, m) = (len(M), len(M[0]))
	return [[M[j][i] for j in range(n)] for i in range(m)]

def main():
	mod = 1000000007
	s = input()
	l = len(s)
	count = 0
	for si in s:
		if si == '0':
			count += 1
	c1 = l - count
	ans = min(c1, count)
	if ans % 2 == 0:
		print('NET')
	else:
		print('DA')
q = int(input())
for _ in range(q):
	main()


from sys import stdin
from collections import deque
mod = 10 ** 9 + 7
import sys
import random
from queue import PriorityQueue
from collections import Counter as cc
from bisect import bisect_right
from bisect import bisect_left
from collections import defaultdict
from math import sqrt, factorial, gcd, log2, inf, ceil
import heapq
input = lambda : sys.stdin.readline().rstrip()
from sys import stdin, stdout
from heapq import heapify, heappush, heappop
from itertools import permutations
from math import factorial as f

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p
import sys
t = int(input())
for _ in range(t):
	s = input()
	i = 0
	cnt1 = s.count('0')
	cnt2 = s.count('1')
	z = min(cnt1, cnt2)
	if z % 2 != 0:
		print('DA')
	else:
		print('NET')


import sys
input = lambda : sys.stdin.readline().rstrip('\r\n')
from collections import Counter
t = int(input())
for _ in range(t):
	s = input()
	c = Counter(s)
	cnt = min(c['0'], c['1'])
	if cnt % 2:
		print('DA')
	else:
		print('NET')


import math
for _ in range(int(input())):
	a = list(input())
	c1 = a.count('0')
	c2 = a.count('1')
	if min(c1, c2) % 2 == 1:
		print('DA')
	else:
		print('NET')


t = int(input())
for _ in range(t):
	s = input()
	flag = True
	q = []
	count = 0
	for x in s:
		if q and q[0] != x:
			q.pop()
			count += 1
		else:
			q.append(x)
	if count % 2:
		print('DA')
	else:
		print('NET')


t = int(input())
for i in range(t):
	ones = 0
	length = 0
	for char in input():
		if int(char) == 1:
			ones += 1
		length += 1
	if length % 2 != 0 and ones > length / 2:
		alica = ones % 2 == 0
	else:
		alica = ones % 2 != 0
	if alica:
		print('DA')
	else:
		print('NET')


def fun(s):
	l = list(s)
	for i in range(len(s) - 1):
		if s[i] != s[i + 1]:
			del l[i:i + 2]
			s = ''.join(l)
			return s
	return 'NO'
inputs = int(input())
outputs = []
for i in range(inputs):
	binary = input()
	total = 0
	while len(binary) >= 2:
		if len(binary) == 2 and binary[-1] == binary[-2]:
			break
		else:
			binary = fun(binary)
			if binary != 'NO':
				total += 1
			else:
				break
	if total % 2 == 0:
		outputs.append('NET')
	else:
		outputs.append('DA')
for output in outputs:
	print(output)


test_cases = int(input())

def deletion(binary, pair):
	pos = binary.index(pair)
	binary = list(binary)
	(binary[pos], binary[pos + 1]) = ('', '')
	return ''.join(binary)

def distinct_pairs(binary):
	distinct_pairs = 0
	while '01' in binary or '10' in binary:
		if '01' in binary:
			binary = deletion(binary, '01')
		else:
			binary = deletion(binary, '10')
		distinct_pairs += 1
	return distinct_pairs
for i in range(test_cases):
	binary = input()
	no_of_distinct_pairs = distinct_pairs(binary)
	if no_of_distinct_pairs % 2 != 0:
		print('DA')
	else:
		print('NET')


testCases = int(input())
for t in range(testCases):
	string = input()
	ones = 0
	zeroes = 0
	for char in string:
		if char == '0':
			zeroes += 1
		else:
			ones += 1
	reductions = 0
	if ones <= zeroes:
		reductions = ones
	else:
		reductions = zeroes
	if reductions % 2 == 1:
		print('DA')
	else:
		print('NET')


import sys
from bisect import *
from math import floor, sqrt, ceil, factorial as F, gcd, pi
from itertools import chain, combinations, permutations, accumulate
from collections import Counter, defaultdict, OrderedDict, deque
from array import array
INT_MAX = sys.maxsize
INT_MIN = -sys.maxsize - 1
mod = 1000000007
ch = 'abcdefghijklmnopqrstuvwxyz'
lcm = lambda a, b: a * b // gcd(a, b)
setbit = lambda x: bin(x)[2:].count('1')
input = lambda : sys.stdin.readline()

def solve():
	for _ in range(int(sys.stdin.readline())):
		s = sys.stdin.readline().replace('\n', '')
		d = Counter(s)
		if min(d['0'], d['1']) & 1:
			print('DA')
		else:
			print('NET')
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	pass
solve()


t = int(input())
for i in range(t):
	s = input()
	one = s.count('1')
	if min(one, len(s) - one) % 2 == 1:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	string = input()
	n = len(string)
	a = string.count('1')
	if a == n or a == 0:
		print('NET')
	else:
		b = n - a
		if a < b:
			if a % 2 == 0:
				print('NET')
			else:
				print('DA')
		elif a >= b:
			if b % 2 == 0:
				print('NET')
			else:
				print('DA')


t = int(input())
for _ in range(t):
	s = input()
	cnt0 = 0
	cnt1 = 0
	for c in s:
		if c == '1':
			cnt1 += 1
		else:
			cnt0 += 1
	pairs = min(cnt0, cnt1)
	if pairs % 2 == 1:
		print('DA')
	else:
		print('NET')


def solve():
	s = list(input())
	a = int(0)
	z = len(s)
	for j in range(0, int(z / 2) + 1):
		i = 0
		while i < z - 1:
			if int(s[i]) != int(s[i + 1]):
				s.pop(i)
				s.pop(i)
				a = a + 1
				z = len(s)
				i = i + 1
				break
			if i == z - 2:
				if a % 2 != 0:
					print('DA')
				else:
					print('NET')
				return
			i = i + 1
	if a % 2 != 0:
		print('DA')
		return
	else:
		print('NET')
		return
tc = int(input())
while tc > 0:
	solve()
	tc = tc - 1


def find_turn(turn):
	if '0' not in turn or '1' not in turn:
		return 'NET'
	elif min(turn.count('1'), turn.count('0')) % 2 == 0:
		return 'NET'
	else:
		return 'DA'
for _ in range(int(input())):
	x = input()
	print(find_turn(x))


a = int(input())
li = []
for i in range(0, a):
	s = input()
	p = s.count('0')
	q = s.count('1')
	y = 0
	while p > 0 and q > 0:
		p = p - 1
		q = q - 1
		y = y + 1
	if y % 2 == 0:
		li.append('NET')
	else:
		li.append('DA')
for i in range(a):
	print(li[i])


for _ in range(int(input())):
	a = input()
	k = a.count('1')
	l = a.count('0')
	if min(l, k) % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for _ in range(t):
	s = [i for i in input()]
	n = len(s)
	count = 0
	while len(s) > 1:
		flag = 0
		i = 0
		while i < len(s) - 1:
			if s[i] != s[i + 1]:
				s.pop(i)
				s.pop(i)
				count += 1
				flag = 1
				break
			i += 1
		if flag == 0:
			break
	if count == 0:
		print('NET')
	elif count % 2 == 0:
		print('NET')
	else:
		print('DA')


from __future__ import division, print_function
import os
import sys, math
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def main():
	Test = int(input())
	while Test:
		Test -= 1
		s = input()
		(cnt, n) = (0, len(s))
		st = []
		for i in range(n):
			if len(st) == 0:
				st.append(ord(s[i]) - ord('0'))
			elif st[-1] != ord(s[i]) - ord('0'):
				st.pop()
				cnt += 1
			else:
				st.append(ord(s[i]) - ord('0'))
		print('DA' if cnt & 1 else 'NET')
	return None
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


for _ in range(int(input())):
	s = input()
	bl = wt = 0
	for i in s:
		if i == '1':
			bl += 1
		else:
			wt += 1
	if min(bl, wt) % 2 == 0:
		print('NET')
	else:
		print('DA')


from math import *
t = int(input())
while t > 0:
	s = input()
	one = 0
	zero = 0
	for i in s:
		if i == '0':
			zero += 1
		else:
			one += 1
	val = min(one, zero)
	if val % 2 == 1:
		print('DA')
	else:
		print('NET')
	t -= 1


t = int(input())
for i in range(t):
	a = input()
	z = a.count('0')
	x = a.count('1')
	b = min(z, x)
	if b % 2 == 0:
		print('NET')
	else:
		print('DA')


from collections import Counter, defaultdict
BS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'

def to_base(s, b):
	res = ''
	while s:
		res += BS[s % b]
		s //= b
	return res[::-1] or '0'
alpha = 'abcdefghijklmnopqrstuvwxyz'
from math import floor, ceil, pi
primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919]

def primef(n, plst=[]):
	if n == 1:
		return plst
	else:
		for m in primes:
			if n % m == 0:
				return primef(n // m, plst + [m])
		return primef(1, plst + [n])
t = int(input())
for i in range(t):
	s = list(input())
	c = Counter(s)
	if c['0'] == 0 or c['1'] == 0:
		print('NET')
	elif len(s) > 1:
		got = min(c['0'], c['1'])
		if got % 2 == 1:
			print('DA')
		else:
			print('NET')
	else:
		print('NET')


from sys import stdin, stdout, setrecursionlimit
from math import ceil
for i in range(int(input())):
	s = input()
	ans = 0
	while '0' in s and '1' in s:
		for i in range(len(s) - 1):
			if s[i] == '0' and s[i + 1] == '1' or (s[i] == '1' and s[i + 1] == '0'):
				s = s[:i] + s[i + 2:]
				break
		ans = 1 - ans
	if ans == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	s = input()
	one = 0
	for x in s:
		one += x == '1'
	print('NDEAT'[min(one, len(s) - one) & 1::2])


t = int(input())
for z in range(t):
	s = input()
	zeroes = s.count('0')
	ones = s.count('1')
	if ones < zeroes:
		if zeroes == 0 or ones == 0:
			print('NET')
		elif ones % 2 == 0:
			print('NET')
		else:
			print('DA')
	elif zeroes == 0 or ones == 0:
		print('NET')
	elif zeroes % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	i = input()
	j = i.count('1')
	k = i.count('0')
	print('DA') if min(j, k) % 2 != 0 else print('NET')


def play(ss):
	n = len(ss)
	i = 0
	ns = []
	while i < n - 1:
		if ss[i] != ss[i + 1]:
			i += 2
			while i < n:
				ns.append(ss[i])
				i += 1
			return ns
		else:
			ns.append(ss[i])
		i += 1
	return False
for _ in range(int(input())):
	ss = list(map(int, list(input().strip())))
	n = len(ss)
	(i, j) = (0, 1)
	if n == 1:
		print('NET')
		continue
	cnt = 0
	stck = [ss[0]]
	i = 1
	while True:
		ns = play(ss)
		if ns != False:
			cnt += 1
		else:
			break
		ss = ns
	if cnt % 2 == 0:
		print('NET')
	else:
		print('DA')


from sys import stdin, stdout
int_in = lambda : int(stdin.readline())
arr_in = lambda : [int(x) for x in stdin.readline().split()]
mat_in = lambda rows: [arr_in() for _ in range(rows)]
str_in = lambda : stdin.readline().strip()
out = lambda o: stdout.write('{}\n'.format(o))
arr_out = lambda o: out(' '.join(map(str, o)))
bool_out = lambda o: out('YES' if o else 'NO')
tests = lambda : range(1, int_in() + 1)
case_out = lambda i, o: out('Case #{}: {}'.format(i, o))

def solve(s):
	moves = 0
	while '01' in s or '10' in s:
		if '01' in s:
			loc = s.index('01')
		elif '10' in s:
			loc = s.index('10')
		s = s[:loc] + s[loc + 2:]
		moves += 1
	return moves % 2 == 1
for i in tests():
	s = str_in()
	out('DA' if solve(s) else 'NET')


for _ in range(int(input())):
	list1 = input()
	x1 = list1.count('1')
	x2 = list1.count('0')
	x = min(x1, x2)
	if x % 2 == 0:
		print('NET')
	else:
		print('DA')


import time, math, bisect, sys
from sys import stdin, stdout
from collections import deque
from fractions import Fraction
from collections import Counter
from collections import OrderedDict
from itertools import count
pi = 3.141592653589793

def II():
	return int(stdin.readline())

def IO():
	return stdin.readline()

def IP():
	return map(int, stdin.readline().split())

def L():
	return list(map(int, stdin.readline().split()))

def P(x):
	return stdout.write(str(x))

def PI(x, y):
	return stdout.write(str(x) + ' ' + str(y) + '\n')

def lcm(a, b):
	return a * b // gcd(a, b)

def gcd(a, b):
	if a == 0:
		return b
	elif b == 0:
		return a
	if a > b:
		return gcd(a % b, b)
	else:
		return gcd(a, b % a)

def readTree():
	v = int(input())
	adj = [set() for i in range(v + 1)]
	for i in range(v - 1):
		(u1, u2) = In()
		adj[u1].add(u2)
		adj[u2].add(u1)
	return (adj, v)

def bfs(adj, v):
	visited = [False] * (v + 1)
	q = deque()
	while q:
		pass

def sieve():
	li = [True] * 1000001
	(li[0], li[1]) = (False, False)
	for i in range(2, len(li), 1):
		if li[i] == True:
			for j in range(i * i, len(li), i):
				li[j] = False
	prime = []
	for i in range(1000001):
		if li[i] == True:
			prime.append(i)
	return prime

def setBit(n):
	count = 0
	while n != 0:
		n = n & n - 1
		count += 1
	return count

def solve():
	s = input()
	n = len(s)
	win = 'NET'
	while s and True:
		for i in range(n - 1):
			if s[i] != s[i + 1]:
				if win == 'NET':
					win = 'DA'
				else:
					win = 'NET'
				s = s[:i] + s[i + 2:]
				n = n - 2
				break
		else:
			break
	print(win)
t = II()
for i in range(t):
	solve()


def ans(s):
	zero = 0
	one = 0
	for i in s:
		if i == '1':
			one += 1
		else:
			zero += 1
	minimum = min(zero, one)
	if minimum % 2 == 0:
		return 'NET'
	else:
		return 'DA'
t = int(input())
for i in range(t):
	s = str(input())
	print(ans(s))


t = int(input())
for _ in range(t):
	s = list(input())
	n = len(s)
	ans = 0
	k = s.count('0')
	m = s.count('1')
	c = min(m, k)
	ans = c % 2
	if ans == 1:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	s = input()
	count = 0
	l = list(s)
	while len(l) >= 2:
		for i in range(len(l) - 1):
			if l[i] != l[i + 1]:
				count += 1
				del l[i:i + 2]
				break
		else:
			break
		continue
	if count % 2 != 0:
		print('DA')
	else:
		print('NET')


t = int(input())
while t:
	s = input()
	lis = list(s)
	one = lis.count('1')
	zero = lis.count('0')
	ans = min(one, zero)
	if ans % 2 == 0:
		print('NET')
	else:
		print('DA')
	t -= 1


n = int(input())
for i in range(n):
	s = input()
	cnt = 0
	if s.count('0') == 0 or s.count('1') == 0:
		print('NET')
		continue
	a = s.count('0')
	b = s.count('1')
	if min(a, b) % 2 == 1:
		print('DA')
	else:
		print('NET')


class Stack:

	def __init__(self):
		self.data = []

	def push(self, data):
		self.data.append(data)

	def pop(self):
		self.data.pop()

	def __str__(self):
		return self.data

def Reversefunc(a):
	if a == '0':
		return '1'
	else:
		return '0'
n = int(input())
theInp = []
for i in range(n):
	a = input()
	theInp.append(a)
for i in range(n):
	counter = 0
	temp = theInp[i]
	tempList = temp.split()
	for j in tempList:
		obj = Stack()
		for k in j:
			if obj.data == []:
				obj.push(k)
			elif Reversefunc(k) == obj.data[-1]:
				obj.pop()
				counter += 1
			else:
				obj.push(k)
	if counter == 0:
		print('NET')
	elif counter % 2 == 0:
		print('NET')
	else:
		print('DA')


number = int(input(''))
for i in range(number):
	nums = input('')
	loop1 = True
	list1 = []
	while loop1:
		count10 = nums.count('10')
		if count10 > 0:
			list1.append(count10)
			nums = nums.replace('10', '')
		count01 = nums.count('01')
		if count01 > 0:
			list1.append(count01)
			nums = nums.replace('01', '')
		count10 = nums.count('10')
		count01 = nums.count('01')
		if count10 == 0 and count01 == 0:
			loop1 = False
	total = 0
	for i in range(0, len(list1)):
		total = total + list1[i]
	if total % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for _ in range(t):
	s = input()
	n = len(s)
	l0 = l1 = 0
	for j in range(n):
		if s[j] == '0':
			l0 += 1
		else:
			l1 += 1
	if min(l0, l1) % 2 != 0:
		print('DA')
	else:
		print('NET')


import os
t = int(input())
while t:
	t -= 1
	s = input()
	count0 = 0
	count1 = 0
	for x in s:
		if x == '1':
			count1 += 1
		else:
			count0 += 1
	if min(count0, count1) % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
while t != 0:
	t = t - 1
	s = input()
	count0 = 0
	count1 = 0
	l = len(s)
	for i in range(0, l):
		if s[i] == '0':
			count0 = count0 + 1
		if s[i] == '1':
			count1 = count1 + 1
	ans = min(count1, count0)
	if ans % 2 != 0:
		print('DA')
	else:
		print('NET')


t = int(input())
for k in range(t):
	s = input()
	n = len(s)
	c1 = 0
	c2 = 0
	i = 0
	while i < n:
		if s[i] == '0':
			c1 += 1
		elif s[i] == '1':
			c2 += 1
		i += 1
	x = min(c1, c2)
	if x % 2 == 0:
		print('NET')
	else:
		print('DA')


for t in range(int(input())):
	v = input()
	x = 0
	c = 1
	while c != 0:
		c = 0
		for i in range(len(v) - 1):
			h = v[i]
			if v[i + 1] != h:
				v = v[0:i] + v[i + 2:]
				c = 1
				x += 1
				break
	if x % 2 == 0:
		print('NET')
	else:
		print('DA')


import math

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def lcm(a, b):
	return a * b / gcd(a, b)

def bs(arr, l, r, x):
	while l <= r:
		mid = l + (r - l) // 2
		if arr[mid] == x:
			return arr[mid]
		elif arr[mid] < x:
			l = mid + 1
		else:
			r = mid - 1
	return -1

def swap(list, pos1, pos2):
	(list[pos1], list[pos2]) = (list[pos2], list[pos1])
	return list
t = int(input())
for _ in range(t):
	s = input()
	c0 = s.count('0')
	c1 = s.count('1')
	x = min(c0, c1)
	if x % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for i in range(t):
	s = input().strip()
	p = s.count('1')
	v = min(len(s) - p, p)
	if v % 2 == 0:
		print('NET')
	else:
		print('DA')


for i in range(int(input())):
	s = input()
	lis = [int(x) for x in s]
	flag = 0
	while True:
		if lis == []:
			break
		elif 0 not in lis or 1 not in lis:
			break
		else:
			for j in range(len(lis) - 1):
				if lis[j] == 0 and lis[j + 1] == 1 or (lis[j] == 1 and lis[j + 1] == 0):
					lis.pop(j)
					lis.pop(j)
					if flag == 0:
						flag = 1
					else:
						flag = 0
					break
	if flag == 0:
		print('NET')
	else:
		print('DA')


import sys
import math
_INPUT_LINES = sys.stdin.read().splitlines()
input = iter(_INPUT_LINES).__next__
i = int(input())
for t in range(i):
	s = input()
	(zero, one) = (s.count('0'), s.count('1'))
	if min(zero, one) % 2 == 1:
		print('DA')
	else:
		print('NET')


t = int(input())
while t > 0:
	t -= 1
	s = input()
	n = len(s)
	c = 0
	while n > 0:
		n1 = len(s)
		s = s.replace('01', '')
		n2 = len(s)
		c += (n1 - n2) // 2
		s = s.replace('10', '')
		n3 = len(s)
		c += (n3 - n2) // 2
		if n1 == n2 and n2 == n3:
			break
	if c % 2 != 0:
		print('DA')
	else:
		print('NET')


n = int(input())
for i in range(n):
	s = input()
	x = 0
	y = 0
	for j in range(len(s)):
		if s[j] == '0':
			x += 1
		else:
			y += 1
	if min(x, y) % 2 == 1:
		print('DA')
	else:
		print('NET')


def solve(s, ans):
	moves = 0
	while True:
		found = False
		for i in range(len(s) - 1):
			if s[i] != s[i + 1]:
				found = True
				s.pop(i)
				s.pop(i)
				break
		if found:
			moves += 1
		else:
			break
	if moves % 2 == 0:
		ans.append('NET')
	else:
		ans.append('DA')

def main():
	t = int(input())
	ans = []
	for i in range(t):
		s = list(input())
		solve(s, ans)
	for i in ans:
		print(i)
main()


import sys
sys.setrecursionlimit(10000)
t = int(input())
for _ in range(t):
	s = input()
	count = min(s.count('1'), s.count('0'))
	if count % 2 == 0:
		print('NET')
	else:
		print('DA')


case = int(input())
for _ in range(case):
	s = input()
	zero = s.count('0')
	one = s.count('1')
	a = min(zero, one)
	if a % 2 == 0:
		print('NET')
	else:
		print('DA')


from math import ceil
from math import radians
from heapq import heapify, heappush, heappop
import bisect
from math import pi
from collections import deque
from math import factorial
from math import log, ceil
from collections import defaultdict
from math import *
from sys import stdin, stdout
import itertools
import os
import sys
import threading
from collections import deque, Counter, OrderedDict, defaultdict
from heapq import *
from fractions import Fraction
mod = int(pow(10, 9) + 7)

def ii():
	return int(input())

def si():
	return str(input())

def mi():
	return map(int, input().split())

def li1():
	return list(mi())

def fii():
	return int(stdin.readline())

def fsi():
	return str(stdin.readline())

def fmi():
	return map(int, stdin.readline().split())

def fli():
	return list(fmi())
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}

def getKey(item):
	return item[0]

def sort2(l):
	return sorted(l, key=getKey)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res
graph = defaultdict(list)
visited = [0] * 1000000
col = [-1] * 1000000

def bfs(d, v):
	q = []
	q.append(v)
	visited[v] = 1
	while len(q) != 0:
		x = q[0]
		q.pop(0)
		for i in d[x]:
			if visited[i] != 1:
				visited[i] = 1
				q.append(i)
		print(x)

def make_graph(e):
	d = {}
	for i in range(e):
		(x, y) = mi()
		if x not in d:
			d[x] = [y]
		else:
			d[x].append(y)
		if y not in d:
			d[y] = [x]
		else:
			d[y].append(x)
	return d

def gr2(n):
	d = defaultdict(list)
	for i in range(n):
		(x, y) = mi()
		d[x].append(y)
	return d

def connected_components(graph):
	seen = set()

	def dfs(v):
		vs = set([v])
		component = []
		while vs:
			v = vs.pop()
			seen.add(v)
			vs |= set(graph[v]) - seen
			component.append(v)
		return component
	ans = []
	for v in graph:
		if v not in seen:
			d = dfs(v)
			ans.append(d)
	return ans

def primeFactors(n):
	s = set()
	while n % 2 == 0:
		n = n // 2
	for i in range(3, int(sqrt(n)) + 1, 2):
		while n % i == 0 and i % 2 == 1:
			s.add(i)
			n = n // i
	if n > 2 and n % 2 == 1:
		s.add(n)
	return s

def find_all(a_str, sub):
	start = 0
	while True:
		start = a_str.find(sub, start)
		if start == -1:
			return
		yield start
		start += len(sub)

def SieveOfEratosthenes(n, isPrime):
	isPrime[0] = isPrime[1] = False
	for i in range(2, n):
		isPrime[i] = True
	p = 2
	while p * p <= n:
		if isPrime[p] == True:
			i = p * p
			while i <= n:
				isPrime[i] = False
				i += p
		p += 1
	return isPrime

def dijkstra(edges, f, t):
	g = defaultdict(list)
	for (l, r, c) in edges:
		g[l].append((c, r))
	(q, seen, mins) = ([(0, f, ())], set(), {f: 0})
	while q:
		(cost, v1, path) = heappop(q)
		if v1 not in seen:
			seen.add(v1)
			path = (v1, path)
			if v1 == t:
				return (cost, path)
			for (c, v2) in g.get(v1, ()):
				if v2 in seen:
					continue
				prev = mins.get(v2, None)
				next = cost + c
				if prev is None or next < prev:
					mins[v2] = next
					heappush(q, (next, v2, path))
	return float('inf')

def binsearch(a, l, r, x):
	while l <= r:
		mid = l + (r - 1) // 2
		if a[mid]:
			return mid
		elif a[mid] > x:
			l = mid - 1
		else:
			r = mid + 1
	return -1

def readTree(n):
	adj = [set() for _ in range(n)]
	for _ in range(n - 1):
		(u, v) = map(int, input().split())
		adj[u - 1].add(v - 1)
		adj[v - 1].add(u - 1)
	return adj

def treeOrderByDepth(n, adj, root=0):
	parent = [-2] + [-1] * (n - 1)
	ordered = []
	q = deque()
	q.append(root)
	depth = [0] * n
	while q:
		c = q.popleft()
		ordered.append(c)
		for a in adj[c]:
			if parent[a] == -1:
				parent[a] = c
				depth[a] = depth[c] + 1
				q.append(a)
	return (ordered, parent, depth)

def isSubSequence(str1, str2):
	m = len(str1)
	n = len(str2)
	j = 0
	i = 0
	while j < m and i < n:
		if str1[j] == str2[i]:
			j = j + 1
		i = i + 1
	return j == m

def nextPowerOf2(n):
	count = 0
	if n and (not n & n - 1):
		return n
	while n != 0:
		n >>= 1
		count += 1
	return 1 << count

def cou(n):
	c = 0
	while n > 1:
		c += 1
		n //= 2
	return c

def dfsques(d, x, visited, a, b, m):
	visited[x] = 1
	q = [x]
	c = 1
	cost = m
	pro = [x]
	while q:
		y = q.pop(0)
		for i in d[y]:
			if visited[i] == 0 and (cost * c + a[i - 1]) / (c + b[i - 1]) >= cost:
				q.append(i)
				cost = (cost * c + a[i - 1]) / (c + 1)
				visited[i] = 1
				pro.append(i)
	return (cost, pro)
for _ in range(ii()):
	c = 0
	s = si()
	st = []
	for i in s:
		if i == '0':
			if len(st) > 0 and st[-1] == 1:
				st.pop()
				c += 1
			else:
				st.append(0)
		elif len(st) > 0 and st[-1] == 0:
			st.pop()
			c += 1
		else:
			st.append(1)
	if c % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	S = input()
	n = len(S)
	s = []
	for i in range(n):
		s.append(S[i])
	cnt = min(s.count('0'), s.count('1'))
	if cnt % 2 == 0:
		print('NET')
	else:
		print('DA')


cases = input()
l = []
for i in range(int(cases)):
	l.append(input())
for binstr in l:
	ones = 0
	zero = 0
	for a in binstr:
		if a == '1':
			ones += 1
		if a == '0':
			zero += 1
	if zero >= ones:
		if ones % 2 == 0:
			print('NET')
		else:
			print('DA')
	if ones > zero:
		if zero % 2 == 0:
			print('NET')
		else:
			print('DA')


for _ in range(int(input())):
	s = input()
	fr = 0
	t = ''
	while s != t:
		t = s
		fr += s.count('10')
		s = s.replace('10', '')
		fr += s.count('01')
		s = s.replace('01', '')
	s = fr * 2
	k = s // 2
	if s % 2 == 0 and s % 4 != 0 or (k % 2 != 0 and s % 4 != 0):
		print('DA')
	else:
		print('NET')


import os
import sys
from io import BytesIO, IOBase

def solution(s):
	winner = False
	while True:
		z1 = s.count('01')
		z2 = s.count('10')
		if z1:
			cnt = z1 % 2
			winner = not winner if cnt else winner
			s = s.replace('01', '')
			continue
		if z2:
			cnt = z2 % 2
			winner = not winner if cnt else winner
			s = s.replace('10', '')
			continue
		break
	write('DA' if winner else 'NET')

def main():
	for _ in range(r_int()):
		s = input()
		solution(s)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')

def write(*args, end='\n'):
	for x in args[:-1]:
		sys.stdout.write(str(x) + ' ')
	sys.stdout.write(str(args[-1]))
	sys.stdout.write(end)

def r_array():
	return [int(x) for x in input().split()]

def r_int():
	return int(input())
main()


from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	s = input()
	print(['NET', 'DA'][min(s.count('1'), s.count('0')) & 1])


t = int(input())
while t:
	a = input()
	r = a.count('0')
	k = a.count('1')
	r = min(r, k)
	if r % 2:
		print('DA')
	else:
		print('NET')
	t -= 1


def game():
	string = input()
	list_of_digits = []
	for digit in string:
		list_of_digits.append(digit)
	count_0 = list_of_digits.count('0')
	count_1 = list_of_digits.count('1')
	if count_0 <= count_1:
		if count_0 % 2 != 0:
			print('DA')
		else:
			print('NET')
	elif count_1 % 2 != 0:
		print('DA')
	else:
		print('NET')

def main():
	for cases in range(int(input())):
		game()
main()


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return s[:len(s) - 1]

def invr():
	return map(int, input().split())
T = inp()
tests = []
for _ in range(T):
	tests.append(insr())
for t in tests:
	ones = t.count('1')
	zeros = t.count('0')
	if min(ones, zeros) % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for _ in range(t):
	s = input()
	i = 0
	counts = {'1': 0, '0': 0}
	for i in range(len(s)):
		counts[s[i]] += 1
	pairs = min(counts['0'], counts['1'])
	if pairs % 2 == 0:
		print('NET')
	else:
		print('DA')


from collections import *
import sys
from bisect import *
input = sys.stdin.readline
from math import *
t = int(input())
while t:
	t -= 1
	a = input().rstrip('\n')
	x = min(a.count('0'), a.count('1'))
	if x % 2:
		print('DA')
	else:
		print('NET')


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	s = list(input().rstrip())
	(x, y) = (s.count('0'), s.count('1'))
	if min(x, y) % 2 == 1:
		print('DA')
	else:
		print('NET')


t = int(input())

def alice(st):
	j = 1
	while True:
		if '10' in st:
			a = st.index('10')
			st = st[:a] + st[a + 2:]
			j += 1
		elif '01' in st:
			a = st.index('01')
			st = st[:a] + st[a + 2:]
			j += 1
		else:
			break
	if j % 2 == 0:
		return 'DA'
	else:
		return 'NET'
li = []
for i in range(t):
	li = li + [input()]
for i in li:
	print(alice(i))


T = int(input())
for _ in range(T):
	s = input()
	s = list(s)
	c = 0
	while len(s) != 0:
		flag = 0
		check = 0
		for i in range(0, len(s) - 1):
			if s[i] == '0' and s[i + 1] == '1' or (s[i] == '1' and s[i + 1] == '0'):
				del s[i:i + 2]
				c += 1
				check += 1
				break
			else:
				flag += 1
		if flag + 1 == len(s) and check == 0:
			break
	if c % 2 != 0:
		print('DA')
	else:
		print('NET')


for _tc in range(int(input())):
	s = input()
	s = list(s)
	count0 = s.count('0')
	count1 = s.count('1')
	print('DA' if min(count0, count1) % 2 == 1 else 'NET')


def F(r, p):
	for h in range(0, len(p) - 1):
		if p[h] != p[h + 1]:
			r += 1
	return r
t = int(input())
a = [''] * t
e = [''] * t
for i in range(0, t):
	a[i] = str(input())
for y in range(0, t):
	x = str(a[y])
	q = 0
	while x != '' and F(0, x) > 0:
		for i in range(0, len(x) - 1):
			if x[i] != x[i + 1]:
				if i != len(x) - 1:
					x = x[:i] + x[i + 2:]
				else:
					x = x[:i] + x[i:]
				q += 1
				break
	if q % 2 == 1:
		e[y] = 'DA'
	else:
		e[y] = 'NET'
for i in range(0, t):
	print(e[i])


for _ in range(int(input())):
	s = input()
	count = 0
	i = 0
	while i < len(s) - 1:
		if s[i] == '0' and s[i + 1] == '1' or (s[i] == '1' and s[i + 1] == '0'):
			s = s[0:i] + s[i + 2:]
			count += 1
			i = -1
		if i == len(s) - 1:
			break
		i += 1
	print('DA' if count % 2 == 1 else 'NET')


t = int(input())
for i in range(t):
	s = input()
	ze = 0
	on = 0
	for j in s:
		if j == '0':
			ze += 1
		else:
			on += 1
	times = min(ze, on)
	if times % 2:
		print('DA')
	else:
		print('NET')


from sys import stdin, stdout
t = int(stdin.readline())
for _ in range(t):
	s = input()
	arr = []
	flg = 0
	for i in s:
		if len(arr) == 0:
			arr.append(i)
		elif arr[-1] == i:
			arr.append(i)
		else:
			arr.pop()
			flg = not flg
	if flg == 0:
		print('NET')
	else:
		print('DA')


import sys
from collections import defaultdict as dd
from collections import Counter as cc
from queue import Queue
import math
import itertools
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	pass
for i in range(int(input())):
	q = list(map(int, input()))
	w = min(sum(q), len(q) - sum(q))
	if w % 2 == 1:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	s1 = input()
	ones = 0
	zeros = 0
	for c in s1:
		if c == '1':
			ones += 1
		else:
			zeros += 1
	if min(ones, zeros) % 2 == 1:
		print('DA')
	else:
		print('NET')


import sys
buff_readline = sys.stdin.readline
readline = sys.stdin.readline
INF = 2 ** 62 - 1

def read_int():
	return int(buff_readline())

def read_int_n():
	return list(map(int, buff_readline().split()))

def read_float():
	return float(buff_readline())

def read_float_n():
	return list(map(float, buff_readline().split()))

def read_str():
	return readline().strip()

def read_str_n():
	return readline().strip().split()

def error_print(*args):
	print(*args, file=sys.stderr)

def mt(f):
	import time

	def wrap(*args, **kwargs):
		s = time.time()
		ret = f(*args, **kwargs)
		e = time.time()
		error_print(e - s, 'sec')
		return ret
	return wrap

def slv(S):
	n = min(S.count('1'), S.count('0'))
	return 'DA' if n % 2 == 1 else 'NET'

def main():
	for _ in range(read_int()):
		S = read_str()
		print(slv(S))
main()


t = int(input())
for _ in range(t):
	s = input()
	n = len(s)
	a = s.count('1')
	b = s.count('0')
	if a > b:
		(b, a) = (a, b)
	left = (n - (b - a)) // 2
	if left % 2:
		print('DA')
	else:
		print('NET')


t = int(input())
for _ in range(t):
	a = input()
	zero = 0
	one = 0
	for i in a:
		if i == '0':
			zero += 1
		else:
			one += 1
	pairs = min(one, zero)
	if pairs % 2 == 1:
		print('DA')
	else:
		print('NET')


t = int(input())
if 1 <= t <= 1000:
	for i in range(t):
		string = input()
		if 1 <= len(string) <= 100:
			count = 0
			while True:
				if string.find('10') != -1:
					string = string.replace('10', '', 1)
					count += 1
				elif string.find('01') != -1:
					string = string.replace('01', '', 1)
					count += 1
				else:
					break
		if count % 2 == 0:
			print('NET')
		else:
			print('DA')


t = int(input())
for i in range(t):
	s = input()
	zero = 0
	one = 0
	for ch in s:
		if ch == '0':
			zero += 1
		else:
			one += 1
	result = min(zero, one)
	if result % 2 == 0:
		print('NET')
	else:
		print('DA')


import math

def solve():
	s = input()
	a = s.count('1')
	b = s.count('0')
	x = min(a, b)
	if x % 2 == 0:
		print('NET')
	else:
		print('DA')
	return
t = 1
t = int(input())
while t > 0:
	t -= 1
	solve()


t = int(input())
for _ in range(t):
	s = [int(i) for i in input()]
	ct0 = 0
	ct1 = 0
	for i in s:
		if i == 1:
			ct1 += 1
		else:
			ct0 += 1
	ct = min(ct0, ct1)
	if ct % 2:
		print('DA')
	else:
		print('NET')


testcases = int(input())
for testcase in range(testcases):
	dicts = {}
	inputs = input()
	for i in inputs:
		if i not in dicts:
			dicts[i] = 1
		else:
			dicts[i] += 1
	if len(dicts) == 1:
		print('NET')
		continue
	getmin = min(dicts['0'], dicts['1'])
	if getmin & 1 == 1:
		print('DA')
	else:
		print('NET')


t = int(input())
for _ in range(t):
	S = input()
	z = S.count('0')
	print('DA') if min(z, len(S) - z) % 2 == 1 else print('NET')


for _ in range(int(input())):
	s = input()
	ans = 0
	n = len(s)
	while n > 0:
		if s.count('10') > 0:
			ans += s.count('10')
			n -= 2 * s.count('10')
			s = s.replace('10', '')
		elif s.count('01') > 0:
			ans += s.count('01')
			n -= 2 * s.count('01')
			s = s.replace('01', '')
		else:
			break
	if ans % 2 == 0:
		print('NET')
	else:
		print('DA')


from sys import stdin
t = int(stdin.readline().strip())
for i in range(t):
	s = stdin.readline().strip()
	num0 = 0
	for c in s:
		num0 += int(c == '0')
	num1 = len(s) - num0
	if min(num0, num1) % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
while t > 0:
	s = list(input())
	c = 0
	flag = 1
	while flag:
		flag = 0
		for i in range(len(s) - 1):
			if int(s[i]) ^ int(s[i + 1]) == 1:
				del s[i + 1]
				del s[i]
				flag = 1
				c += 1
				break
	if c % 2 == 0:
		print('NET')
	else:
		print('DA')
	t -= 1


t = int(input())
for q in range(0, t):
	a = input()
	m1 = a.find('10')
	m2 = a.find('01')
	count = 0
	while m1 != -1 or m2 != -1:
		if m1 != -1:
			a = a[:m1] + a[m1 + 2:]
		elif m2 != -1:
			a = a[:m2] + a[m2 + 2:]
		count += 1
		m1 = a.find('10')
		m2 = a.find('01')
	if count % 2 == 0:
		print('NET')
	else:
		print('DA')


def f(s):
	s0 = s.count('0')
	s1 = s.count('1')
	ans = min(s0, s1)
	if ans % 2 != 0:
		return 'DA'
	else:
		return 'NET'
t = int(input())
a = []
for i in range(t):
	s = input()
	a.append(f(s))
for elem in a:
	print(elem)


n = int(input())
for i in range(n):
	s = input()
	if '1' in s or '0' in s:
		c0 = s.count('0')
		c1 = s.count('1')
		if min(c0, c1) % 2 == 1:
			print('DA')
		else:
			print('NET')
	else:
		print('NET')


for _ in range(int(input())):
	s = list(input())
	turn = 0
	i = 0
	while i < len(s) - 1:
		if s[i] != s[i + 1]:
			turn += 1
			del s[i:i + 2]
			i = -1
		i += 1
		s = s.copy()
	print('DA' if turn % 2 != 0 else 'NET')


t = int(input())
import math
for i in range(t):
	s = list(input())
	a = s.count('0')
	b = s.count('1')
	if min(a, b) % 2 == 1:
		print('DA')
	else:
		print('NET')


import sys
input = sys.stdin.readline
from math import ceil
ans = []
for i in range(int(input())):
	s = input()
	zero = 0
	one = 0
	for i in s:
		if i == '1':
			one += 1
		elif i == '0':
			zero += 1
	if min(one, zero) == 0:
		ans.append('NET')
	elif min(one, zero) % 2 == 0:
		ans.append('NET')
	else:
		ans.append('DA')
print(*ans, sep='\n')


import math
num = int(input())
inp = []
result = []
for i in range(num):
	inp.append(input())
	x = (inp[i].count('0'), inp[i].count('1'))
	if math.fmod(min(x), 2) == 0:
		result.append('NET')
	else:
		result.append('DA')
for i in range(num):
	print(result[i])


t = int(input())
for z in range(t):
	s = [int(x) for x in input()]
	count = 0
	ones = 0
	zeroes = 0
	for i in s:
		if i == 1:
			ones += 1
		else:
			zeroes += 1
	ans = min(zeroes, ones)
	if ans % 2 == 1:
		print('DA')
	else:
		print('NET')


import math
a = input()
t = int(a)
for zz in range(0, t, 1):
	a = input()
	n1 = 0
	n0 = 0
	for i in range(0, len(a), 1):
		if a[i] == '0':
			n0 = n0 + 1
		else:
			n1 = n1 + 1
	aa = min(n0, n1)
	if aa % 2 == 0:
		print('NET')
	else:
		print('DA')


import os
import sys
from io import BytesIO, IOBase

def readvars():
	k = map(int, input().split())
	return k

def readlist():
	li = list(map(int, input().split()))
	return li

def anslist(li):
	ans = ' '.join([str(v) for v in li])
	return ans

def main():
	t = 1
	t = int(input())
	for xx in range(t):
		s = input()
		n = len(s)
		uno = 0
		dos = 0
		for dig in s:
			uno += dig == '1'
			dos += dig == '0'
		ans = min(uno, dos)
		if ans % 2 == 0:
			print('NET')
		else:
			print('DA')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


t = int(input())
from math import *
for ty in range(t):
	n = input()
	l = []
	count = 0
	l.append(n[0])
	for xy in range(1, len(n)):
		if len(l) > 0 and n[xy] != l[-1]:
			l.pop()
			count += 1
		else:
			l.append(n[xy])
	if count % 2 == 0:
		print('NET')
	else:
		print('DA')


def solve():
	s = input()
	(i, c) = (0, 0)
	while i < len(s) - 1:
		if s[i] == '1' and s[i + 1] == '0' or (s[i] == '0' and s[i + 1] == '1'):
			if i + 2 < len(s):
				s = s[:i] + s[i + 2:]
			else:
				s = s[:i]
			c += 1
			i = 0
		else:
			i += 1
	if c % 2:
		print('DA')
	else:
		print('NET')
for _ in range(int(input())):
	solve()


for i in range(int(input())):
	n = input()
	alice = min(n.count('1'), n.count('0'))
	if alice % 2 != 0:
		print('DA')
	else:
		print('NET')


rw = int(input())
for ewqr in range(rw):
	s = input()
	sc0 = s.count('0')
	sc1 = s.count('1')
	f = min(sc0, sc1)
	if f % 2 == 0:
		print('NET')
	else:
		print('DA')


from collections import defaultdict
con = 10 ** 9 + 7
INF = float('inf')

def getlist():
	return list(map(int, input().split()))

def main():
	T = int(input())
	for _ in range(T):
		s = input()
		cnt0 = 0
		cnt1 = 0
		for i in s:
			if i == '0':
				cnt0 += 1
			else:
				cnt1 += 1
		jud = min(cnt0, cnt1)
		if jud % 2 == 1:
			print('DA')
		else:
			print('NET')
main()


for _ in range(int(input())):
	s = input()
	o = s.count('1')
	z = s.count('0')
	ans = 0
	if o == 0 or z == 0:
		ans = 1
	elif min(o, z) % 2 == 0:
		ans = 1
	if ans:
		print('NET')
	else:
		print('DA')


import math
t = int(input())
for hello in range(t):
	s = list(input())
	if min(s.count('1'), s.count('0')) % 2 == 0:
		print('NET')
	else:
		print('DA')


T = int(input())
while T > 0:
	T -= 1
	S = input()
	c = 0
	while len(S) > 0:
		n1 = len(S)
		S = S.replace('01', '')
		n2 = len(S)
		c += (n1 - n2) // 2
		S = S.replace('10', '')
		n3 = len(S)
		c += (n3 - n2) // 2
		if n1 == n2 and n2 == n3:
			break
	if c % 2 != 0:
		print('DA')
	else:
		print('NET')


import sys
from sys import stdin, stdout
from math import ceil, floor, sqrt, log, log2, log10
from collections import Counter
int_max = float('inf')
int_min = -float('inf')
ANS = []
input = stdin.readline

def solve():
	pass
t = int(input())
for i in range(t):
	s = input().strip()
	n = len(s)
	c0 = s.count('0')
	c1 = s.count('1')
	total = min(c0, c1)
	if total % 2 == 1:
		ANS.append('DA')
	else:
		ANS.append('NET')
print('\n'.join(ANS))


import io
import os
from sys import stdout, stdin
input = stdin.readline
for t in range(int(input())):
	s = input().strip()
	count = 0
	while 1:
		flag = 0
		for i in range(1, len(s)):
			if s[i - 1] != s[i]:
				flag = 1
				count += 1
				if i + 1 <= len(s) - 1:
					s = s[:i - 1] + s[i + 1:]
				else:
					s = s[:i - 1]
				break
		if flag == 0:
			break
	if count % 2 == 1:
		print('DA')
	else:
		print('NET')


import sys
import math

def II():
	return int(sys.stdin.readline())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def MI():
	return map(int, sys.stdin.readline().split())

def SI():
	return sys.stdin.readline().strip()
t = II()
for q in range(t):
	s = SI()
	x = s.count('0')
	y = s.count('1')
	count = min(x, y)
	if count % 2 == 1:
		print('DA')
	else:
		print('NET')


for i in range(int(input())):
	data = list(map(int, list(input())))
	ones = data.count(1)
	nulls = len(data) - ones
	if ones and data:
		if min(ones, nulls) & 1:
			print('DA')
		else:
			print('NET')
	else:
		print('NET')


n = int(input())
for i in range(n):
	s = input()
	l = []
	for i in range(len(s)):
		l.append(int(s[i]))
	c = 0
	j = 1
	while j > 0:
		k = 0
		for i in range(len(l) - 1):
			if l[i] == 1 and l[i + 1] == 0 or (l[i] == 0 and l[i + 1] == 1):
				l.pop(i)
				l.pop(i)
				c = c + 1
				k = 1
				break
		if k == 0 or len(l) == 0:
			j = -1
		else:
			k = 0
	if c % 2 == 1:
		print('DA')
	else:
		print('NET')


T = int(input())

def process(x, cur_state):
	n = len(x)
	terminate_flag = True
	for i in range(1, n):
		if x[0] != x[i]:
			terminate_flag = False
			break
	if terminate_flag:
		return (x, cur_state)
	else:
		remove_set = set()
		pointer = 0
		while pointer < n - 1:
			if x[pointer] != x[pointer + 1]:
				remove_set.add(pointer)
				remove_set.add(pointer + 1)
				pointer += 2
				cur_state += 1
				cur_state %= 2
			else:
				pointer += 1
		y = ''
		for i in range(n):
			if i not in remove_set:
				y += x[i]
		return process(y, cur_state)
for t in range(T):
	s = input()
	(y, cur_state) = process(s, 0)
	if cur_state % 2:
		print('DA')
	else:
		print('NET')


t = int(input())
res = []
for i in range(t):
	string = input()
	l = list(string)
	a = l.count('0')
	b = l.count('1')
	if a <= b:
		if a % 2 == 0:
			res.append('NET')
		else:
			res.append('DA')
	elif b % 2 == 0:
		res.append('NET')
	else:
		res.append('DA')
for ch in res:
	print(ch)


t = int(input())
for i in range(t):
	s = input()
	(a, b) = (0, 0)
	for j in range(1, len(s)):
		if '01' in s:
			s = s.replace('01', '', 1)
			if j % 2 == 0:
				b += 1
			else:
				a += 1
		elif '10' in s:
			s = s.replace('10', '', 1)
			if j % 2 == 0:
				b += 1
			else:
				a += 1
	print('DA') if a > b else print('NET')


t = int(input())
for i in range(t):
	s = list(input())
	move = 0
	while True:
		indey = 0
		indfer = 0
		t = 0
		for k in range(len(s) - 1):
			if s[k] != s[k + 1]:
				t = 1
				if k == 0 or k == len(s) - 2:
					indfer = k
				elif s[k - 1] == s[k + 2]:
					indey = k
				elif s[k - 1] != s[k + 2]:
					indfer = k
		if t == 0:
			break
		elif indey != 0:
			del s[indey], s[indey]
		else:
			del s[indfer], s[indfer]
		move += 1
	if move % 2 != 0:
		print('DA')
	else:
		print('NET')


from __future__ import division, print_function
import os, sys
import math
import collections
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def msi():
	return map(str, input().strip().split(' '))

def li():
	return list(mi())

def dmain():
	sys.setrecursionlimit(100000000)
	threading.stack_size(40960000)
	thread = threading.Thread(target=main)
	thread.start()
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def getKey(item):
	return item[1]

def sort2(l):
	return sorted(l, key=getKey, reverse=True)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(n - r))

def binary_search(arr, low, high, x):
	if high >= low:
		mid = (high + low) // 2
		if arr[mid] == x:
			return mid
		elif arr[mid] > x:
			return binary_search(arr, low, mid - 1, x)
		else:
			return binary_search(arr, mid + 1, high, x)
	else:
		return -1

def ceil(x, y):
	if x % y == 0:
		return x // y
	else:
		return x // y + 1

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def padded_bin_with_complement(x):
	if x < 0:
		return bin(2 ** 16 - abs(x))[2:].zfill(16)
	else:
		return bin(x)[2:].zfill(16)

def binaryToDecimal(binary):
	binary1 = binary
	(decimal, i, n) = (0, 0, 0)
	while binary != 0:
		dec = binary % 10
		decimal = decimal + dec * pow(2, i)
		binary = binary // 10
		i += 1
	print(decimal)

def CountFrequency(arr):
	return collections.Counter(arr)

def pos(a):
	b = [0] * len(a)
	c = sorted(a)
	for i in range(len(a)):
		for j in range(len(a)):
			if c[j] == a[i]:
				b[i] = j
				break
	return b

def smallestDivisor(n):
	if n % 2 == 0:
		return 2
	i = 3
	while i * i <= n:
		if n % i == 0:
			return i
		i += 2
	return n

def commonn(a, b, n):
	c = []
	for i in range(n):
		if a[i] == b[i]:
			c.append('-1')
		else:
			c.append(b[i])
	return c

def primeFactors(n):
	j = []
	while n % 2 == 0:
		j.append(2)
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			j.append(int(n))
			n = n / i
	if n > 2:
		j.append(int(n))
	return j

def main():
	for _ in range(ii()):
		s = si()
		f = 0
		s = list(s)
		cou = 0
		b = []
		h1 = s.count('1')
		h2 = s.count('0')
		if min(h1, h2) % 2:
			print('DA')
		else:
			print('NET')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


s = ''
ans = 0
for i in range(int(input())):
	s = input()
	ans = max(s.count('0'), s.count('1')) - abs(s.count('0') - s.count('1'))
	if ans % 2 and s.count('0') != 0 and (s.count('1') != 0):
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	s = input()
	ones = s.count('1')
	zeros = s.count('0')
	mnm = ones if ones < zeros else zeros
	if mnm % 2 == 0:
		print('NET')
	else:
		print('DA')


for i in range(0, int(input())):
	s = list(input())
	count_0 = s.count('0')
	count_1 = s.count('1')
	if count_0 > count_1:
		if count_1 % 2 == 0:
			print('NET')
		else:
			print('DA')
	elif count_0 <= count_1:
		if count_0 % 2 == 0:
			print('NET')
		else:
			print('DA')


t = int(input())
while t:
	s = input()
	n = len(s)
	counts = 0
	for ele in s:
		if ele == '1':
			counts += 1
	mini = min(counts, n - counts)
	if mini % 2 == 0:
		print('NET')
	else:
		print('DA')
	t -= 1


t = int(input())
for cas in range(t):
	s = input()
	a = s.count('1')
	b = s.count('0')
	if min(a, b) % 2:
		print('DA')
	else:
		print('NET')


def comRes(x):
	i = 0
	n = 0
	while len(x) > 0:
		if i >= len(x) - 1:
			break
		if x[i] != x[i + 1]:
			temp = x[i] + x[i + 1]
			x = x.replace(temp, '', 1)
			i = 0
			n += 1
		else:
			i += 1
	if n == 0:
		return 'NET'
	if n % 2 != 0:
		return 'DA'
	else:
		return 'NET'
t = int(input())
for i in range(t):
	s = input()
	print(comRes(s))


import sys
import math as mt
t = int(input())
for _ in range(t):
	s = input()
	(x, y) = (0, 0)
	for i in range(len(s)):
		if s[i] == '0':
			x += 1
		else:
			y += 1
	x = min(x, y)
	if x % 2 != 0:
		print('DA')
	else:
		print('NET')


for k in range(int(input())):
	x = input()
	sym = 1
	ans = 0
	ind = min((x.count('0'), x.count('1'))) % 2
	print('DA' * ind + 'NET' * (not ind))


import sys
T = int(sys.stdin.readline())
for _ in range(T):
	s = sys.stdin.readline().strip()
	count = [0, 0]
	for l in s:
		count[int(l)] += 1
	if min(count) % 2:
		print('DA')
	else:
		print('NET')


import math
import datetime
import collections
import statistics
import itertools

def is_prime(num):
	for i in range(2, int(math.sqrt(num)) + 1):
		if num % i == 0:
			return False
	return True

def input_list():
	ll = list(map(int, input().split(' ')))
	return ll
tc = int(input())
for _ in range(tc):
	s = list(input())
	(o, e) = (0, 1)
	n = len(s)
	while e < n:
		if s == ['0', '1'] or s == ['1', '0']:
			o += 1
			break
		elif s[e] != s[e - 1]:
			del s[e - 1]
			del s[e - 1]
			e = 1
			n = len(s)
			o += 1
		else:
			e += 1
	if o % 2 == 1:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	val = input()
	v = min(val.count('0'), val.count('1')) % 2
	if v:
		print('DA')
	else:
		print('NET')


def solve():
	s = input()
	c1 = s.count('1')
	c0 = s.count('0')
	q = min(c0, c1)
	print('da' if q % 2 == 1 else 'net')
t = int(input())
for _ in range(t):
	solve()


def answer(s):
	num_steps = min(s.count('0'), s.count('1'))
	if num_steps % 2 == 1:
		return 'DA'
	else:
		return 'NET'

def main():
	t = int(input())
	s = ['0'] * t
	for j in range(t):
		s[j] = input()
	for j in range(t):
		print(answer(s[j]))
main()


def main():
	t = int(input())
	while t > 0:
		game()
		t -= 1

def game():
	s = input()
	zero = 0
	one = 0
	for i in range(0, len(s)):
		zero += s[i] == '0'
		one += s[i] == '1'
	if zero < one:
		x = zero
	else:
		x = one
	x %= 2
	if x:
		print('DA')
	else:
		print('NET')
main()


import sys
ii = lambda : sys.stdin.readline().strip()
idata = lambda : [int(x) for x in ii().split()]

def solve():
	s = ii()
	s1 = s.count('1')
	s2 = s.count('0')
	if min(s2, s1) % 2 == 0:
		print('NET')
	else:
		print('DA')
	return
for t in range(int(ii())):
	solve()


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	s = input().rstrip()
	n = len(s)
	M = [s[0]]
	count = 0
	for i in range(1, n):
		if M == []:
			M.append(s[i])
			continue
		if s[i] != M[-1]:
			count += 1
			M.pop(-1)
		else:
			M.append(s[i])
	if count % 2 != 0:
		print('DA')
	else:
		print('NET')


row = input()
row_code = []
output = []
for i in range(int(row)):
	row_code.append(input())
for code in row_code:
	(one, zero) = (code.count('1'), code.count('0'))
	result = 0
	while (zero and one) > 0:
		one = one - 1
		zero = zero - 1
		result = result + 1
	if result % 2 != 0:
		output.append('DA')
	else:
		output.append('Net')
for i in output:
	print(i)


from fractions import Fraction
import bisect
import os
import io
from collections import Counter
import bisect
from collections import defaultdict
import math
import random
import heapq as hq
from math import sqrt
import sys
from functools import reduce, cmp_to_key
from collections import deque
import threading
from itertools import combinations
from io import BytesIO, IOBase
from itertools import accumulate
from queue import Queue

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def tinput():
	return input().split()

def rinput():
	return map(int, tinput())

def rlinput():
	return list(rinput())
mod = int(1000000000.0) + 7

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))
t = 1
t = iinput()
for _ in range(t):
	s = input()
	move = 0
	while True:
		flg = False
		news = ''
		i = 0
		n = len(s)
		if n == 0 or n == 1:
			break
		while i < n - 1:
			if s[i] != s[i + 1]:
				s = s[:i] + s[i + 2:] if i != n - 2 else s[:i]
				flg = True
				move ^= 1
				break
			i += 1
		if not flg:
			break
	print(['DA', 'NET'][move ^ 1])


import math
import sys
from itertools import permutations
input = sys.stdin.readline
t = int(input())
for i in range(t):
	s = list(input())
	if s[-1] == '\n':
		s.pop()
	c0 = s.count('0')
	c1 = s.count('1')
	minn = min(c0, c1)
	if minn % 2 == 0:
		print('NET')
	else:
		print('DA')


def assign_str(cases):
	if cases not in range(1, 1001):
		exit('enter value in range [1, 1000]')
	i = 0
	while i < cases:
		ques_str = input()
		for char in ques_str:
			if char != '0' and char != '1':
				exit("enter only 1's and 0's")
		if len(ques_str) not in range(1, 101):
			exit('enter string of length in range [1, 100]')
		str_list.append(ques_str)
		i = i + 1

def trimmer(string):
	if len(string) < 2:
		return '-1'
	i = 0
	check = 0
	before_str = string
	list = []
	while i < len(string):
		if i < len(string) - 1 and string[i] != string[i + 1] and (check == 0):
			check = 1
			i = i + 2
		else:
			list.append(string[i])
			i = i + 1
	string = str(list)
	string = string.replace(',', '')
	string = string.replace(' ', '')
	string = string.replace("'", '')
	string = string.replace(']', '')
	string = string.replace('[', '')
	if before_str == string:
		return '-1'
	return string

def win():
	rank = 0
	while rank < cases:
		check = 1
		gstr = str_list[rank]
		winner = 1
		while check == 1:
			gstr = trimmer(gstr)
			if gstr == '-1':
				check = 0
				continue
			winner = winner + 1
		if winner % 2 == 0:
			print('DA')
		else:
			print('NET')
		rank = rank + 1
cases = int(input())
str_list = []
assign_str(cases)
win()


def solve(a):
	res = False
	while len(a):
		for i in range(0, len(a)):
			if i + 1 >= len(a):
				a = ''
				break
			if a[i] != a[i + 1]:
				res = not res
				if i + 2 <= len(a):
					a = a[:i] + a[i + 2:]
				break
	return res
t = int(input())
while t:
	s = input()
	if solve(s):
		print('DA')
	else:
		print('NET')
	t -= 1


def f(s):
	n = len(s)
	for i in range(n - 1):
		if s[i] != s[i + 1]:
			s = s[:i] + s[i + 2:]
			return 1 + f(s)
	return 0
for t in range(int(input())):
	s = str(input())
	m = f(s)
	if m % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
while t:
	s = input()
	cnt0 = 0
	cnt1 = 0
	for i in s:
		if i == '0':
			cnt0 = cnt0 + 1
		else:
			cnt1 = cnt1 + 1
	if cnt0 == 0 or cnt1 == 0:
		print('NET')
	else:
		f = min(cnt0, cnt1)
		if f % 2 != 0:
			print('DA')
		else:
			print('NET')
	t = t - 1


from sys import stdin

def inp():
	return stdin.buffer.readline().rstrip().decode('utf8')

def itg():
	return int(stdin.buffer.readline())

def mpint():
	return map(int, stdin.buffer.readline().split())
for case in range(itg()):
	s = inp()
	z = s.count('0')
	e = len(s) - z
	if min(z, e) & 1:
		print('DA')
	else:
		print('NET')


import sys
fast_reader = sys.stdin.readline
fast_writer = sys.stdout.write

def input():
	return fast_reader().strip()

def print(*argv):
	fast_writer(' '.join((str(i) for i in argv)))
	fast_writer('\n')
for _ in range(int(input())):
	s = input()
	t = min(s.count('1'), s.count('0'))
	if t % 2 == 1:
		print('DA')
	else:
		print('NET')


def Game(s):
	numero = min(s.count('1'), s.count('0'))
	if numero % 2 == 0 or numero == 0:
		return 'NET'
	else:
		return 'DA'
Lista = []
total = int(input())
for i in range(total):
	Lista.append(str(input()))
for j in Lista:
	print(Game(j))


import os
import sys
from io import BytesIO, IOBase
import math
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
for _ in range(int(input())):
	st = input()
	c1 = 0
	c2 = 0
	ss = list()
	ss.append(1)
	l = len(st)
	for i in range(l):
		if st[i] == '1':
			c1 += 1
		else:
			c2 += 1
	a = min(c1, c2)
	if a % 2 == 0:
		print('NET')
	else:
		print('DA')


T = int(input())
for _ in range(T):
	N = input()
	c1 = N.count('1')
	c2 = N.count('0')
	mini = min(c1, c2)
	if mini % 2 == 0:
		print('NET')
	else:
		print('DA')


for i in range(int(input())):
	string = list(input())
	ones = string.count('1')
	zeros = string.count('0')
	pairs = min(ones, zeros)
	if pairs % 2 == 1:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	s = input()
	zer = s.count('0')
	one = s.count('1')
	mov = min(zer, one)
	if mov % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for _ in range(t):
	s = input()
	for i in range(0, 10000000):
		if i % 2 == 0:
			if '01' in s:
				new = list(s)
				temp = s.find('01')
				new.pop(temp)
				new.pop(temp)
				s = ''.join(new)
			elif '10' in s:
				new = list(s)
				temp = s.find('10')
				new.pop(temp)
				new.pop(temp)
				s = ''.join(new)
			else:
				print('NET')
				break
		elif '10' in s:
			new = list(s)
			temp = s.find('10')
			new.pop(temp)
			new.pop(temp)
			s = ''.join(new)
		elif '01' in s:
			new = list(s)
			temp = s.find('01')
			new.pop(temp)
			new.pop(temp)
			s = ''.join(new)
		else:
			print('DA')
			break


for _ in range(int(input())):
	s = list(input())
	c = d = 0
	while s != []:
		for i in range(len(s) - 1):
			if s[i] != s[i + 1]:
				s.pop(i + 1)
				s.pop(i)
				c += 1
				d = 1
				break
		if d != 1:
			break
		d = 0
	if c % 2 != 0:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	a = input()
	ones = []
	zeros = []
	for i in a:
		if i == '0':
			zeros.append(i)
		else:
			ones.append(i)
	move = min(len(ones), len(zeros))
	if move % 2 == 1:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	s = input().rstrip()
	c0 = s.count('0')
	c1 = s.count('1')
	c = min(c0, c1)
	if c % 2 == 0:
		print('NET')
	else:
		print('DA')


from sys import stdin
input = lambda : stdin.readline().strip()
char = [chr(i) for i in range(97, 123)]
CHAR = [chr(i) for i in range(65, 91)]
mp = lambda : list(map(int, input().split()))
INT = lambda : int(input())
rn = lambda : range(INT())
from math import ceil, sqrt, factorial, gcd
for _ in rn():
	ans = 0
	k = input()
	n = len(k)
	a = k.count('0')
	b = n - a
	ans = min(a, b)
	if ans % 2 == 1:
		print('DA')
	else:
		print('NET')


t = int(input())
for _ in range(t):
	s = input()
	n01 = 1
	n10 = 1
	n = 0
	while n01 + n10 != 0:
		n01 = s.count('01')
		s = s.replace('01', '')
		n10 = s.count('10')
		s = s.replace('10', '')
		n += n01 + n10
	if n % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for i in range(0, t):
	s = input()
	z = 0
	o = 0
	for e in s:
		if e == '1':
			o += 1
		else:
			z += 1
	if min(z, o) % 2 == 1:
		print('DA')
	else:
		print('NET')


t = int(input())
for _ in range(t):
	s = str(input())
	n = len(s)
	c = 0
	for x in s:
		if x == '0':
			c += 1
	if c == 0 or c == n:
		print('NET')
	else:
		n = min(n - c, c)
		if n % 2 == 1:
			print('DA')
		else:
			print('NET')


n = int(input())
for i in range(n):
	a = input()
	b = a.count('1') - a.count('0')
	if b < 0:
		b *= -1
	b = (len(a) - b) // 2
	if b % 2:
		print('DA')
	else:
		print('NET')


from collections import Counter
n = int(input())
lst_res = []
for _ in range(n):
	num = input()
	if min([Counter(num)['1'], Counter(num)['0']]) % 2 != 0:
		lst_res.append('DA')
	else:
		lst_res.append('NET')
for _ in lst_res:
	print(_)


for x in range(int(input())):
	s = input()
	s = list(s)
	k = 0
	while len(s) > 0:
		z = len(s)
		for i in range(len(s) - 1):
			if s[i] == '1' and s[i + 1] == '0' or (s[i] == '0' and s[i + 1] == '1'):
				s.pop(i)
				s.pop(i)
				k += 1
				break
		if len(s) == z:
			break
	if k % 2:
		print('DA')
	else:
		print('NET')


t = int(input())
for i in range(0, t):
	count = 0
	s = str(input())
	while '10' in s or '01' in s:
		x = s.find('01')
		y = s.find('10')
		if x in range(0, 101):
			s = s[:x] + s[x + 2:]
			count += 1
		elif y in range(0, 101):
			s = s[:y] + s[y + 2:]
			count += 1
	if count % 2 == 1:
		print('DA')
	else:
		print('NET')


t = int(input())
for test in range(t):
	a = input()
	ones = 0
	zeros = 0
	for c in a:
		if c == '1':
			ones += 1
		else:
			zeros += 1
	total = min(ones, zeros)
	ans = 'DA'
	if total % 2 == 0:
		ans = 'NET'
	else:
		ans = 'DA'
	print(ans)


t = int(input())
while t:
	t = t - 1
	s = input()
	a1 = len(s)
	o = s.count('1')
	z = s.count('0')
	if z == 0 or o == 0:
		print('NET')
	else:
		a = min(z, o)
		if a % 2 == 1:
			print('DA')
		else:
			print('NET')


import sys, os
from io import BytesIO, IOBase
import collections, itertools, bisect, heapq, math, string
from decimal import *
BUFSIZE = 8192
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def main():
	t = int(input())
	for i in range(t):
		s = str(input())
		stack = [s[0]]
		cnt = 0
		for j in range(1, len(s)):
			if len(stack) != 0 and s[j] != stack[-1]:
				cnt += 1
				stack.pop()
			else:
				stack.append(s[j])
		if cnt % 2 == 0:
			print('NET')
		else:
			print('DA')
main()


w = int(input())
for _ in range(w):
	li = input()
	count = 0
	q = 0
	while q < len(li):
		if li[q] == '0':
			count += 1
		q += 1
	counter = min(count, len(li) - count)
	if counter % 2 != 0:
		print('DA')
	else:
		print('NET')


def f(s):
	if len(s) < 2:
		return 0
	for i in range(len(s) - 1):
		if s[i] != s[i + 1]:
			return 1 + f(s[:i] + s[i + 2:])
	return 0
for tc in range(int(input())):
	s = input()
	if f(s) % 2 == 0:
		print('NET')
	else:
		print('DA')


a = int(input())
for x in range(a):
	b = input()
	q = b.count('0')
	w = b.count('1')
	if q == 0 or w == 0:
		print('NET')
	elif q > w and w % 2 != 0:
		print('DA')
	elif w > q and q % 2 != 0:
		print('DA')
	elif w == q and w % 2 != 0 and (q % 2 != 0):
		print('DA')
	else:
		print('NET')


for i in range(int(input())):
	string = input()
	(r, t) = (0, 1)
	while r != t:
		t = r
		r += string.count('10')
		string = string.replace('10', '')
		r += string.count('01')
		string = string.replace('01', '')
	string = r * 2
	k = string // 2
	if string % 2 == 0 and string % 4 != 0 or (k % 2 != 0 and string % 4 != 0):
		print('DA')
	else:
		print('NET')


for __ in range(int(input())):
	S = input()
	freq = {}
	for c in S:
		freq[c] = freq.get(c, 0) + 1
	possible_moves = min(freq.get('0', 0), freq.get('1', 0))
	print(['NET', 'DA'][possible_moves & 1])


import math as mt
import sys, string
input = sys.stdin.readline
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split())
M = lambda : map(int, input().split())
I = lambda : int(input())
from collections import defaultdict
t = I()
for _ in range(t):
	s = input().strip()
	p = s[0]
	l = [p]
	c = 0
	for i in range(1, len(s)):
		if len(l) != 0 and s[i] != l[0]:
			c += 1
			l.pop()
		else:
			l.append(s[i])
	if c % 2 == 0:
		print('NET')
	else:
		print('DA')


import sys
cont = sys.stdin.readlines()
cont = [i.strip('\n') for i in cont]
numTests = int(cont.pop(0)[0])
for i in cont:
	if i.count('10') > 0 or i.count('01') > 0:
		count = 0
		while i.count('10') > 0:
			i = i.replace('10', '', 1)
			count += 1
		while i.count('01') > 0:
			i = i.replace('01', '', 1)
			count += 1
		if count % 2 == 1:
			print('DA')
		else:
			print('NET')
	else:
		print('NET')


t = int(input())
for _ in range(t):
	s = input()
	a = 0
	while len(s) > 0:
		if '01' in s:
			a += s.count('01')
			s = s.replace('01', '')
			continue
		if '10' in s:
			a += s.count('10')
			s = s.replace('10', '')
			continue
		else:
			break
	if a % 2 != 0:
		print('DA')
	else:
		print('NET')


t = int(input())
for i in range(t):
	s = input()
	ze = 0
	on = 0
	for i in range(len(s)):
		if s[i] == '0':
			ze = ze + 1
		else:
			on = on + 1
	if ze == len(s) or on == len(s):
		print('NET')
	elif on == ze:
		if on & 1:
			print('DA')
		else:
			print('NET')
	elif min(ze, on) % 2 == 1:
		print('DA')
	else:
		print('NET')


import sys
from os import path
if path.exists('C:/Users/prana/Desktop/sublime/input.txt'):
	sys.stdin = open('C:/Users/prana/Desktop/sublime/input.txt', 'r')
	sys.stdout = open('C:/Users/prana/Desktop/sublime/output.txt', 'w')

def solve():
	s = list(input())
	one = 0
	zero = 0
	for i in s:
		if i == '1':
			one += 1
		else:
			zero += 1
	n = len(s)
	if one == n or zero == n:
		print('NET')
	elif n == 1:
		print('NET')
	elif n == 2:
		print('DA')
	else:
		i = 0
		count = 0
		t = min(one, zero)
		if t % 2 == 0:
			print('NET')
		else:
			print('DA')
T = 1
T = int(input())
for _ in range(1, T + 1):
	print('Case #', _, file=sys.stderr)
	solve()


t = int(input())
for _ in range(t):
	s = input()
	st = []
	ans = 1
	for i in range(len(s)):
		if len(st) and st[-1] != s[i]:
			st.pop()
			ans = 1 - ans
		else:
			st.append(s[i])
	if not ans:
		print('DA')
	else:
		print('NET')


for z in range(int(input())):
	s = input()
	(p, q) = (0, 0)
	for i in s:
		if i == '1':
			p += 1
		else:
			q += 1
	p = min(p, q)
	if p % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	s = input()
	turn = 1
	while '10' in s or '01' in s:
		if '01' in s:
			s = s.replace('01', '', 1)
		else:
			s = s.replace('10', '', 1)
		turn = 1 - turn
	if turn:
		print('NET')
	else:
		print('DA')


import sys
infile = sys.stdin
next(infile)
for line in infile:
	l = line
	l = l.replace(l[-1], '')
	n = len(l)
	i = 0
	step = 0
	while i < len(l) - 1:
		if int(l[i]) != int(l[i + 1]):
			l = l.replace(l[i], '', 1)
			l = l.replace(l[i], '', 1)
			i = 0
			step += 1
		else:
			i += 1
	if step % 2 == 0:
		print('NET')
	else:
		print('DA')


testcases = int(input())
for i in range(testcases):
	s = list(input())
	k = 0
	j = 0
	while j < len(s):
		if ''.join(s[j:j + 2]) == '01' or ''.join(s[j:j + 2]) == '10':
			s.pop(j)
			s.pop(j)
			k += 1
			j -= 1
		else:
			j += 1
	if k % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	s = input()
	change = True
	k = 0
	while change:
		change = False
		for i in range(0, len(s) - 1):
			if s[i] != s[i + 1]:
				change = True
				s = s[:i] + s[i + 2:]
				break
		k += 1
	if k == 0 or k % 2 == 0:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	n = input()
	c0 = n.count('0')
	c1 = n.count('1')
	if c0 == 1 and c1 == 1:
		print('DA')
	elif c1 == 0 or c0 == 0:
		print('NET')
	elif min(c0, c1) % 2 == 1:
		print('DA')
	else:
		print('NET')


import sys
input = sys.stdin.readline
from collections import deque
t = int(input())
for tests in range(t):
	S = deque(input().strip())
	ANS = 0
	X = deque()
	while S:
		while S and X and (S[0] != X[-1]):
			S.popleft()
			X.pop()
			ANS += 1
		if S:
			x = S.popleft()
			X.append(x)
	if ANS % 2 == 1:
		print('DA')
	else:
		print('NET')


n = int(input())
for i in range(n):
	series = list(map(int, input()))
	if min(series.count(1), series.count(0)) % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	c = 0
	st = input()
	s1 = set()
	s0 = set()
	for i in range(len(st)):
		if st[i] == '1':
			s1.add(i)
		else:
			s0.add(i)
	i = 0
	while i < len(st):
		if i in s0:
			if i + 1 in s1:
				c += 1
				s1.remove(i + 1)
				s0.remove(i)
				i += 2
			else:
				i += 1
		elif i in s1:
			if i + 1 in s0:
				c += 1
				s0.remove(i + 1)
				s1.remove(i)
				i += 2
			else:
				i += 1
	if len(s0) != 0 and len(s1) != 0:
		x = min(len(s0), len(s1))
		c += x
	if c % 2 != 0:
		print('DA')
	else:
		print('NET')


t = int(input())
while t > 0:
	t -= 1
	s = input()
	c0 = s.count('0')
	c1 = s.count('1')
	c = min(c0, c1)
	if c & 1:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	s = input()
	i = s.find('10')
	if i == -1:
		i = s.find('01')
	w = False
	while i != -1:
		w = not w
		s = s[:i] + s[i + 2:]
		i = s.find('10')
		if i == -1:
			i = s.find('01')
	print('DA' if w else 'NET')


import math
import os
import random
import re
import sys
import collections

def solve():
	for _ in range(int(input())):
		s = input()
		n = len(s)
		if s.count('0') == n or s.count('1') == n:
			print('NET')
		else:
			s0 = s.count('0')
			s1 = s.count('1')
			if min(s1, s0) % 2 == 0:
				print('NET')
			else:
				print('DA')
solve()


def result(s):
	l = []
	for i in range(0, len(s)):
		if i + 1 == len(s):
			break
		if s[i] != s[i + 1]:
			l.append(s[i:i + 2])
	return l

def gameResult(s):
	(l, i, count) = ([], 0, 0)
	while True:
		if i + 1 == len(s):
			break
		if len(s) < 2:
			break
		if s[i] != s[i + 1]:
			s = s[0:i] + s[i + 2:]
			i = 0
			count = count + 1
		else:
			i = i + 1
	return count
int_inp = int(input())
l = []
for i in range(0, int_inp):
	l.append(input())
for i in l:
	if gameResult(i) % 2 != 0:
		print('DA')
	else:
		print('NET')


z = int(input())
for h in range(z):
	a = list(map(int, input()))
	cnt = 0
	while True:
		flag = 0
		for i in range(len(a) - 1):
			if len(a) > 1:
				if a[i] == 0 and a[i + 1] or (a[i] == 1 and a[i + 1] == 0):
					cnt += 1
					flag = 1
					a.pop(i)
					a.pop(i)
					break
		if flag == 0:
			break
		if len(a) == 0:
			break
	if cnt % 2 == 0 and cnt != 1:
		print('NET')
	else:
		print('DA')


def game(s):
	temp = s
	count = 0
	cond = True
	while cond:
		new = temp
		for i in range(len(temp) - 1):
			if temp[i] != temp[i + 1]:
				new = temp[:i] + temp[i + 2:]
				break
		if len(temp) == len(new):
			cond = False
			break
		temp = new
		count = count + 1
	if count == 0 or count % 2 == 0:
		return False
	return True
for _ in range(int(input())):
	s = input()
	ans = game(s)
	if ans:
		print('DA')
	else:
		print('NET')


t = int(input())
for _ in range(t):
	ls = list(input())
	turn = 1
	if len(ls) == 1:
		print('NET')
	elif len(ls) == 2:
		if ls[0] != ls[1]:
			print('DA')
		else:
			print('NET')
	else:
		turn = 1
		while len(ls) > 1:
			for i in range(len(ls) - 1):
				if ls[i] != ls[i + 1]:
					ls.remove(ls[i])
					ls.remove(ls[i])
					if turn == 1:
						turn = 2
					else:
						turn = 1
					break
			else:
				if turn == 1:
					print('NET')
				else:
					print('DA')
				break
		else:
			if turn == 1:
				print('NET')
			else:
				print('DA')


import sys
import math
from collections import defaultdict
for _ in range(int(input())):
	s = list(input())
	jj = 0
	while len(s) > 1:
		for i in range(len(s) - 1):
			f = 0
			if s[i] != s[i + 1]:
				s.pop(i + 1)
				s.pop(i)
				f = 1
				break
		if f == 0:
			break
		else:
			jj += 1
	if jj % 2 != 0:
		print('DA')
	else:
		print('NET')


import math
import bisect
import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return s

def invr():
	return map(int, input().split())
T = inp()
for t in range(T):
	s = insr()
	s = s[:len(s) - 1]
	fl = True
	c = 0
	while fl:
		fl = False
		for i in range(len(s) - 1):
			if s[i] != s[i + 1]:
				s = s[:i] + s[i + 2:]
				fl = True
				c += 1
				break
	if c % 2 == 0:
		print('NET')
	else:
		print('DA')


for _ in range(int(input())):
	s = input()
	countlist = []
	count = 1
	alice = 'DA'
	Bob = 'NET'
	for i in range(1, len(s)):
		if s[i] != s[i - 1]:
			countlist.append(count)
			count = 1
		else:
			count += 1
	countlist.append(count)
	countodd = 0
	counteven = 0
	for i in range(len(countlist)):
		if i & 1:
			countodd += countlist[i]
		else:
			counteven += countlist[i]
	r = min(counteven, countodd)
	if r % 2 == 1:
		print(alice)
	else:
		print(Bob)


for t in range(int(input())):
	s = input()
	c1 = s.count('1')
	c0 = s.count('0')
	if c1 >= c0:
		num = c0
	else:
		num = c1
	if num % 2 == 0:
		print('NET')
	else:
		print('DA')


for t in range(int(input())):
	inp = input()
	c0 = inp.count('0')
	c1 = len(inp) - c0
	if min((c0, c1)) & 1:
		print('DA')
	else:
		print('NET')


t = int(input())
for you in range(t):
	s = input()
	n = 0
	for i in s:
		if i == '1':
			n += 1
	z = min(n, len(s) - n)
	if z % 2:
		print('DA')
	else:
		print('NET')


a = int(input())
for i in range(0, a):
	s = input()
	arr = []
	ones = 0
	zero = 0
	for i in s:
		if i == '1':
			arr.append(1)
			ones = ones + 1
		else:
			arr.append(0)
			zero = zero + 1
	i = 0
	count = 0
	ans = min(zero, ones)
	if ans % 2 == 0:
		print('NET')
	else:
		print('DA')


x = int(input())
for i in range(x):
	myline = input()
	zero = myline.count('0')
	one = myline.count('1')
	if one > zero:
		less = zero
	else:
		less = one
	if less % 2 == 0:
		print('NET')
	else:
		print('DA')


for j in range(int(input())):
	n = input()
	x = n.count('0')
	y = n.count('1')
	if x == 0 or y == 0:
		print('NET')
	elif min(x, y) % 2 != 0:
		print('DA')
	else:
		print('NET')


import sys
I = sys.stdin.readline
pr = sys.stdout.write

def main():
	for _ in range(int(I())):
		s = [x == '1' for x in I().strip()]
		t = 1
		c = 0
		while len(set(s)) > 1:
			for (i, x) in enumerate(s[:-1]):
				if x ^ s[i + 1]:
					s = s[:max(0, i)] + s[i + 2:]
					c += 1
					break
		pr(f"{'NDEAT'[c & 1::2]}\n")
main()


from math import ceil

def solve():
	S = input()
	cnt0 = 0
	cnt1 = 0
	for s in S:
		if s == '0':
			cnt0 += 1
		else:
			cnt1 += 1
	cnt = min(cnt1, cnt0)
	if cnt % 2 == 0:
		print('NET')
	else:
		print('DA')
for cnt in range(int(input())):
	solve()


for _ in range(int(input())):
	ss = input()
	x = 0
	y = 0
	for i in ss:
		if i == '1':
			x += 1
		else:
			y += 1
	if min(x, y) % 2 == 1:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	s = input()
	c = 0
	while True:
		if '10' in s:
			c += s.count('10')
			s = s.replace('10', '')
		elif '01' in s:
			c += s.count('01')
			s = s.replace('01', '')
		else:
			break
	if c % 2 != 0:
		print('DA')
	else:
		print('NET')


t = int(input())
for i in range(t):
	s = input()
	alice = True
	if len(s) < 2:
		print('NET')
	elif '01' not in s and '10' not in s:
		print('NET')
	else:
		while len(s) >= 2:
			if '01' in s:
				s = s.replace('01', '', 1)
				alice = not alice
			elif '10' in s:
				s = s.replace('10', '', 1)
				alice = not alice
			else:
				break
		if alice:
			print('NET')
		else:
			print('DA')


for _ in range(int(input())):
	l = input()
	print('NDEAT'[min(l.count('0'), l.count('1')) % 2 == 1::2])


t = int(input())
for j in range(1, t + 1):
	s = input()
	count = 0
	i = 0
	while i < len(s):
		if s[i] is '0':
			count += 1
		i += 1
	if min(count, len(s) - count) % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for i in range(t):
	s = list(input())
	q = 0
	c = 2
	c1 = 0
	while c1 < len(s) - 1:
		for j in range(0, len(s) - 1):
			if s[j] == '1' and s[j + 1] == '0' or (s[j] == '0' and s[j + 1] == '1'):
				c += 1
				s.pop(j + 1)
				s.pop(j)
				c1 = 0
				break
			else:
				c1 += 1
	if c % 2 != 0:
		print('DA')
	else:
		print('NET')


iterations = int(input())
for i in range(iterations):
	n = 0
	my_list = list(input())
	while '1' in my_list and '0' in my_list:
		my_list.remove('1')
		my_list.remove('0')
		n += 1
	if n % 2 == 0:
		print('NET')
	else:
		print('DA')


def solve():
	s = input()
	(z, o) = (0, 0)
	for i in s:
		if i == '1':
			o += 1
		else:
			z += 1
	if min(z, o) & 1:
		print('DA')
	else:
		print('NET')
t = int(input())
for _ in range(t):
	solve()


for _ in range(int(input())):
	s = [x for x in input()]
	a = 1
	poss = True
	while poss:
		poss = 0
		for i in range(len(s) - 1):
			if s[i] == '1' and s[i + 1] == '0' or (s[i] == '0' and s[i + 1] == '1'):
				if a:
					a = 0
				else:
					a = 1
				poss = 1
				s.pop(i)
				s.pop(i)
				break
	if a == 0:
		print('DA')
	else:
		print('NET')


def next_string(string):
	global result
	for i in range(len(string) - 1):
		if string[i] != string[i + 1]:
			result += 1
			tmp = string[:i] + string[i + 2:]
			return next_string(tmp)
for tc in range(int(input())):
	s = input()
	result = 0
	next_string(s)
	if result % 2:
		print('DA')
	else:
		print('NET')


import re
t = int(input())
c = 0
for i in range(t):
	s = input()
	while True:
		s2 = re.sub('01|10', '', s, 1)
		if s2 == s:
			break
		else:
			s = s2
			c = c + 1
	if c % 2 != 0:
		print('DA')
	else:
		print('NET')
	c = 0


for _ in range(int(input())):
	s = input()
	l = list(s)
	i = 0
	c = 0
	while i < len(l) - 1:
		a = i
		if l[i] != l[i + 1]:
			l.remove(l[i])
			l.remove(l[i])
			c += 1
			if i == 0:
				i = a
				continue
			else:
				i -= 2
		i += 1
	if c % 2 == 0:
		print('NET')
	else:
		print('DA')


def winner(s):
	if len(set(s)) == 1:
		return 'NET'
	else:
		moves = 0
		i = 0
		while len(set(s)) != 1 and len(s) > 1:
			if s[i] != s[i + 1]:
				del s[i:i + 2]
				moves += 1
				if i > 0:
					i -= 1
			else:
				i += 1
	if moves % 2 == 0:
		return 'NET'
	else:
		return 'DA'
t = int(input())
for _ in range(t):
	s = list(input())
	print(winner(s))


import sys, io, os, time
from collections import defaultdict
from collections import OrderedDict
from collections import deque
from itertools import combinations
from itertools import permutations
import bisect, math, heapq
alphabet = 'abcdefghijklmnopqrstuvwxyz'
input = sys.stdin.readline

def check(s):
	for i in range(len(s) - 1):
		if s[i] == '1' and s[i + 1] == '0':
			return i
		elif s[i] == '0' and s[i + 1] == '1':
			return i
	return -1
for ii in range(int(input())):
	s = input()
	f = 0
	while True:
		curr = check(s)
		if curr == -1:
			break
		elif curr == len(s) - 2:
			f = not f
			break
		s = s[:curr] + s[curr + 2:]
		f = not f
	if not f:
		print('NET')
	else:
		print('DA')


from sys import stdin, stdout
import math, sys
from itertools import permutations, combinations
from collections import defaultdict, deque, OrderedDict
from os import path
import bisect as bi
import heapq

def yes():
	print('YES')

def no():
	print('NO')
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

	def I():
		return int(input())

	def In():
		return map(int, input().split())
else:

	def I():
		return int(stdin.readline())

	def In():
		return map(int, stdin.readline().split())

def main():
	try:
		l = input()
		mi = min(l.count('1'), l.count('0'))
		if mi == 0 or mi % 2 == 0:
			print('NET')
		else:
			print('DA')
	except:
		pass
M = 998244353
P = 1000000007
for _ in range(I()):
	main()


t = int(input())
for test in range(t):
	s = input()
	zc = 0
	oc = 0
	for i in s:
		if i == '1':
			oc += 1
		else:
			zc += 1
	if min(zc, oc) % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
for _ in range(t):
	s = input()
	o = 0
	z = 0
	cnt = 0
	i = 0
	while i < len(s):
		while i < len(s) and s[i] == '1':
			o += 1
			i += 1
		while i < len(s) and s[i] == '0':
			z += 1
			i += 1
		k = min(z, o)
		z -= k
		o -= k
		cnt += k
	if cnt % 2 == 0:
		print('NET')
	else:
		print('DA')


t = int(input())
while t > 0:
	s = input()
	a = s.count('1')
	b = s.count('0')
	if a > b:
		if b % 2 == 0:
			print('NET')
		else:
			print('DA')
	elif a % 2 == 0:
		print('NET')
	else:
		print('DA')
	t = t - 1


t = int(input())
for i in range(t):
	s = str(input())
	one = s.count('1')
	zero = s.count('0')
	mi = min(zero, one)
	if mi % 2 == 1:
		print('DA')
	else:
		print('NET')


def sol():
	s = input()
	on = 0
	zr = 0
	tot = 0
	for n in s:
		if n == '1':
			if zr == 0:
				on += 1
			else:
				zr -= 1
				tot += 1
		elif on == 0:
			zr += 1
		else:
			on -= 1
			tot += 1
	if tot % 2:
		print('DA')
	else:
		print('NET')
for n in range(int(input())):
	sol()


t = int(input())
for case in range(t):
	string = list(map(int, input()))
	num_1 = sum(string)
	num_0 = len(string) - num_1
	if min(num_0, num_1) % 2 == 1:
		print('DA')
	else:
		print('NET')


for _ in range(int(input())):
	s = input()
	count = 0
	while '01' in s or '10' in s:
		if '01' in s:
			count += s.count('01')
			s = s.replace('01', '')
		elif '10' in s:
			count += s.count('10')
			s = s.replace('10', '')
	if count % 2 == 0:
		print('NET')
	else:
		print('DA')


from collections import Counter
t = int(input())
for i in range(t):
	s = input()
	c = Counter(s)
	c = list(c.values())
	if '1' in s and '0' in s:
		a = min(c[0], c[1])
		if a % 2 == 0:
			print('NET')
		else:
			print('DA')
	else:
		print('NET')


t = int(input())
for i in range(t):
	s = input()
	s = list(s)
	sum = 0
	j = 0
	z = 0
	while j < len(s) - 1 and len(s) > 1:
		if s[j] != s[j + 1]:
			sum = sum + 1
			s = s[:j] + s[j + 2:]
			j = 0
		else:
			j = j + 1
	if sum == 0:
		print('NET')
	elif sum % 2 == 0:
		print('NET')
	else:
		print('DA')