#include <bits/stdc++.h>
using namespace std;
int t;
string s;
int main() {
  cin >> t;
  while (t--) {
    cin >> s;
    int steps = 0, length = 0;
    for (char c : s) {
      length++;
      if (c == '0') {
        steps++;
      }
    }
    steps = min(steps, length - steps);
    cout << (steps % 2 > 0 ? "DA" : "NET") << endl;
  }
  return 0;
}
