#include <bits/stdc++.h>
void fre() {
  freopen("A.txt", "r", stdin);
  freopen("Ans.txt", "w", stdout);
}
void Fre() { freopen("A.txt", "r", stdin); }
using namespace std;
const int mxn = 2e5 + 10;
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    string s;
    cin >> s;
    int c1 = 0, c2 = 0;
    for (auto x : s)
      if (x == '0')
        c1++;
      else
        c2++;
    if (min(c1, c2) % 2)
      printf("DA\n");
    else
      printf("NET\n");
  }
  return 0;
}
