#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    int f = 0, i = 0, j = 1;
    for (i = 0; i < s.length() - 1; i++) {
      if (s[i] != s[i + 1]) {
        f = 1;
        break;
      }
    }
    if (f == 0) {
      cout << "NET"
           << "\n";
      continue;
    }
    while (1) {
      j++;
      f = 0;
      if (s.length() < 2) {
        break;
      }
      if (s.length() == 2 && s[0] == s[1]) break;
      for (i = 0; i < s.length() - 1; i++) {
        if (s[i] != s[i + 1]) {
          f = 1;
          s.erase(i, 2);
          break;
        }
      }
      if (f == 0) {
        break;
      }
    }
    if (j % 2 != 0) {
      cout << "DA"
           << "\n";
    } else
      cout << "NET"
           << "\n";
  }
  return 0;
}
