#include <bits/stdc++.h>
using namespace std;
int main() {
  int zero, one;
  string str;
  int n;
  cin >> n;
  while (n--) {
    cin >> str;
    zero = 0, one = 0;
    int l = str.length();
    for (int i = 0; i < l; i++) {
      if (str[i] == '0')
        zero++;
      else
        one++;
    }
    int min;
    zero <= one ? min = zero : min = one;
    if (min % 2 == 0) {
      cout << "NET" << endl;
    } else {
      cout << "DA" << endl;
    }
  }
  return 0;
}
