#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, m, k, l;
  cin >> t;
  string s;
  for (int i = 0; i < t; i++) {
    k = 0, l = 0;
    cin >> s;
    m = s.length();
    for (int j = 0; j < m; j++) {
      if (s[j] == '0') {
        k++;
      } else {
        l++;
      }
    }
    if (l <= k) {
      if (l % 2 == 0) {
        cout << "NET" << endl;
      } else {
        cout << "DA" << endl;
      }
    } else {
      if (k % 2 == 0) {
        cout << "NET" << endl;
      } else {
        cout << "DA" << endl;
      }
    }
  }
  return 0;
}
