#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, i, cnt1, cnt0, j, k, l;
  scanf("%d", &t);
  while (t--) {
    cnt1 = 0;
    cnt0 = 0;
    string s;
    cin >> s;
    l = s.length();
    for (i = 0; i < l; i++) {
      if (s[i] == '1')
        cnt1++;
      else
        cnt0++;
    }
    j = min(cnt1, cnt0);
    if (j % 2 != 0) {
      printf("DA\n");
    } else {
      printf("NET\n");
    }
  }
  return 0;
}
