#include <bits/stdc++.h>
using namespace std;
inline int dcmp(double a, double b) {
  return fabs(a - b) < (1e-9) ? 0 : a < b ? -1 : +1;
}
const int N = 100 + 9;
char c[N];
int main() {
  int tc;
  scanf("%d", &tc);
  while (tc--) {
    scanf("%s", c);
    int n = strlen(c);
    puts((min(count(c, c + n, '0'), count(c, c + n, '1')) & 1) ? "DA" : "NET");
  }
  return 0;
}
