#include <bits/stdc++.h>
using namespace std;
template <class T>
void read(T& x) {
  T res = 0, f = 1;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    res = (res << 3) + (res << 1) + c - '0';
    c = getchar();
  }
  x = res * f;
}
const long long N = 200000 + 10;
long long t, num[3];
char s[N];
int main() {
  read(t);
  while (t--) {
    scanf("%s", s + 1);
    int n = strlen(s + 1);
    num[0] = num[1] = 0;
    for (int i = 1; i <= n; i++) {
      num[s[i] - '0']++;
    }
    int ans = min(num[0], num[1]);
    if (ans & 1)
      printf("DA\n");
    else
      printf("NET\n");
  }
  return 0;
}
