#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t = 1;
  cin >> t;
  while (t--) {
    vector<char> vec;
    string s, ss;
    long long cont = 0;
    cin >> ss;
    int n = ss.size();
    bool flag = true;
    while (flag == true) {
      vec.clear();
      s = ss;
      flag = false;
      for (int i = 0; i < n; i++) {
        if (i == n - 1) vec.push_back(s[i]);
        if (i == n - 1) break;
        if (s[i] != s[i + 1]) {
          i++;
          cont++;
          flag = true;
        } else
          vec.push_back(s[i]);
      }
      n = vec.size();
      for (int i = 0; i < n; i++) {
        ss[i] = vec[i];
      }
    }
    if (cont % 2 == 1) {
      cout << "DA" << endl;
    } else
      cout << "NET" << endl;
  }
}
