#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
long long t, n, m, k, q, a, b, x, y, ans, arr[N];
bool vis[N], valid;
long long mod = 1000000007;
string s;
string play(string &s) {
  string ret = "";
  int n = s.size();
  for (int i = 0; i < n; ++i) {
    if (i == n - 1) {
      ret += s[i];
    } else {
      if (s[i] != s[i + 1])
        ++ans, ++i;
      else
        ret += s[i];
    }
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  ;
  t = 1;
  cin >> t;
  while (t--) {
    cin >> s;
    ans = 0;
    while (true) {
      string t = play(s);
      if (s.size() == t.size()) break;
      s = t;
    }
    if (ans % 2 == 1)
      cout << "DA" << endl;
    else
      cout << "NET" << endl;
  }
  return 0;
}
