#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    long long int cnt = 0;
    bool ok;
    while (s.size() > 1) {
      ok = true;
      for (long long int i = 0; i < s.size() - 1; i++) {
        if (s[i] != s[i + 1]) {
          cnt++;
          s.erase(i, 1);
          s.erase(i, 1);
          ok = false;
          break;
        }
      }
      if (ok) break;
    }
    if (cnt & 1)
      cout << "DA\n";
    else
      cout << "NET\n";
  }
}
