#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    int count0 = 0, count1 = 0;
    for (int i = 0; i < s.size(); i++) {
      if (s[i] == '0')
        count0++;
      else
        count1++;
    }
    int min1 = min(count1, count0);
    if (min1 % 2 == 1)
      cout << "DA" << endl;
    else
      cout << "NET" << endl;
  }
  return 0;
}
