#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long int t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    vector<long long int> v1;
    long long int turns = 0;
    for (long long int i = 0; i < s.length(); i++) {
      if (v1.size() == 0) {
        v1.push_back(s[i]);
      } else {
        if (v1[v1.size() - 1] != s[i]) {
          turns++;
          v1.pop_back();
        } else {
          v1.push_back(s[i]);
        }
      }
    }
    if (turns % 2 == 0)
      cout << "NET\n";
    else
      cout << "DA\n";
  }
}
