#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long n;
  cin >> n;
  while (n--) {
    string s;
    long long x = 0, y = 0;
    cin >> s;
    for (long long j = 0; j < s.size(); j++) {
      if (s[j] == '0')
        x++;
      else
        y++;
    }
    long long mn = min(x, y);
    if (mn % 2) {
      cout << "DA" << endl;
    } else {
      cout << "NET" << endl;
    }
  }
  return 0;
}
