#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  while (T--) {
    string s, ans = "";
    cin >> s;
    int count0 = 0, count1 = 0, count = 0;
    for (int i = 0; i < s.length(); i++) {
      if (s[i] == '0') count0++;
      if (s[i] == '1') count1++;
    }
    count = min(count0, count1);
    if (count % 2 != 0)
      ans = "DA";
    else
      ans = "NET";
    cout << ans << "\n";
  }
}
