#include <bits/stdc++.h>
using namespace std;
const long long mxn = 1e18;
void solve() {
  string s;
  cin >> s;
  bool ko = true;
  bool flag = true;
  while (flag) {
    flag = false;
    for (long long i = 0; i < (long long)s.length() - 1; i++) {
      if (s[i] != s[i + 1]) {
        s.erase(i, 2);
        ko = !ko;
        flag = true;
        break;
      }
    }
  }
  if (ko)
    cout << "NET"
         << "\n";
  else
    cout << "DA"
         << "\n";
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  while (t--) solve();
  return 0;
}
