#include <bits/stdc++.h>
using namespace std;
const char NO[3] = "NO", YES[4] = "YES";
const int INF = 0x3f3f3f3f;
const int MAXN = 2e6 + 10;
double PI = 3.1415926535898;
struct number_x {
  int a, b;
  friend bool operator<(const number_x &x, const number_x &y) {
    return x.a < y.a;
  }
};
template <typename _tp>
inline _tp read(_tp &x) {
  char ch = getchar(), sgn = 0;
  x = 0;
  while (ch ^ '-' && !isdigit(ch)) ch = getchar();
  if (ch == '-') ch = getchar(), sgn = 1;
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  if (sgn) x = -x;
  return x;
}
char s[MAXN];
stack<char> ss;
int main() {
  int t;
  cin >> t;
  while (t--) {
    cin >> s;
    int k = 0;
    char c;
    int len = strlen(s);
    for (int i = 0; i < len; i++) {
      if (ss.empty())
        ss.push(s[i]);
      else if (ss.top() != s[i]) {
        ss.pop();
        k++;
      } else {
        ss.push(s[i]);
      }
    }
    while (!ss.empty()) ss.pop();
    if (k % 2)
      cout << "DA" << endl;
    else
      cout << "NET" << endl;
  }
  return 0;
}
