# B. 01 Game
importsysinput=sys.stdin.readlinet=int(input())for_inrange(t):s=list(input().rstrip())turn=False# F for Alice, T for Bob
i=0whileTrue:# if s empty
ifnots:break# all 0
if'1'notins:break# all 1
if'0'notins:breakifs[i]!=s[i+1]:dels[i:i+2]i=0turn=notturnelse:i+=1# print(turn)
ifturn:print('DA')else:print('NET')