#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
long long t, n, a, b, c;
int main() {
  string s;
  cin >> t;
  while (t--) {
    cin >> s;
    n = s.size();
    a = b = 0;
    for (int i = 0; i < n; i++) {
      if (s[i] == '0')
        a++;
      else
        b++;
    }
    a = min(a, b);
    if (a % 2)
      cout << "DA" << endl;
    else
      cout << "NET" << endl;
  }
  return 0;
}
