#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, zero, one, c, i;
  cin >> t;
  while (t--) {
    char s[101];
    cin >> s;
    zero = one = c = i = 0;
    while (s[i] != '\0') {
      if (s[i] == '0')
        zero++;
      else
        one++;
      i++;
    }
    if (zero <= one)
      c = zero;
    else
      c = one;
    if (c % 2 == 0)
      cout << "NET" << endl;
    else
      cout << "DA" << endl;
  }
  return 0;
}
