#include <bits/stdc++.h>
using namespace std;
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  string s;
  cin >> t;
  for (int i = 0; i < t; i++) {
    int count_zero = 0, count_one = 0;
    cin >> s;
    for (unsigned j = 0; j < s.size(); j++) {
      if (s[j] == '0')
        count_zero++;
      else
        count_one++;
    }
    if (min(count_one, count_zero) % 2 != 0)
      cout << "DA\n";
    else
      cout << "NET\n";
    count_zero = 0;
    count_one = 0;
  }
  return EXIT_SUCCESS;
}
