#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const double eps = 1e-8;
const int INF = 0x3f3f3f3f;
const long long LNF = 0x3f3f3f3f3f3f;
inline int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
inline long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
inline int lcm(int a, int b) { return a * b / gcd(a, b); }
const int MAXN = 200;
char s[MAXN];
void solve() {
  scanf("%s", s);
  int len = strlen(s);
  int cnt1 = 0, cnt0 = 0;
  for (int i = 0; i < len; ++i) {
    if (s[i] == '0') {
      cnt0++;
    } else {
      cnt1++;
    }
  }
  int t = min(cnt0, cnt1);
  if (t & 1) {
    puts("DA");
  } else {
    puts("NET");
  }
}
int main() {
  int t;
  scanf("%d", &t);
  for (int i = 0; i < t; ++i) {
    solve();
  }
  return 0;
}
