#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  int tt;
  cin >> tt;
  while (tt--) {
    string s;
    cin >> s;
    int count = 0;
    for (int i = 0; i < s.size(); i++) {
      if (s[i] == '1') {
        count++;
      }
    }
    int n = s.size();
    if (min(count, n - count) % 2 == 1) {
      cout << "DA";
    } else {
      cout << "NET";
    }
    cout << '\n';
  }
  return 0;
}
