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